FUDforum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » FUDforum Development » Bug Reports » ERROR: Unable to identify a prefix operator '!' for type 'integer'
Show: Today's Messages :: Polls :: Message Navigator
Switch to threaded view of this topic Create a new topic Submit Reply
ERROR: Unable to identify a prefix operator '!' for type 'integer' [message #16484] Sun, 01 February 2004 19:53 Go to next message
Sebastian_T is currently offline  Sebastian_T   Poland
Messages: 33
Registered: January 2004
Location: Warsaw, Poland
Karma: 0
Member
FUD on postgreSQL v. 7.3, upgraded from 2.3.8. to 2.6.0

when trying to accept posts in premoderated forum, shows an error:

(/usr/local/apache/htdocs/forum.blizniaki.net/index.php:141
/usr/local/apache/htdocs/forum.blizniaki.net/index.php:232
/usr/local/apache/htdocs/forum.blizniaki.net/theme/default/modque.php:1948
/usr/local/apache/htdocs/forum.blizniaki.net/index.php:1185
) : ERROR: Unable to identify a prefix operator '!' for type 'integer' You may need to add parentheses or an explicit cast
Query: SELECT CASE WHEN !(9600246 & 1048576) THEN mm.id ELSE 1 END FROM fud23_msg m INNER JOIN fud23_thread t ON m.thread_id=t.id LEFT JOIN fud23_mod mm ON t.forum_id=mm.forum_id AND mm.user_id=4 WHERE m.id=11314
Server Version:
[Referring Page] http://forum.blizniaki.net/index.php?t=modque&SQ=e0ed5a526d4ddac085e7ac 991945a699



postgreq does not accept '!' as an integer in line:

f (!q_singleval('SELECT CASE WHEN !('.$usr->users_opt.' & 1048576) THEN mm.id ELSE 1 END FROM fud23_msg m INNER JOIN fud23_thread t ON m.t
hread_id=t.id LEFT JOIN fud23_mod mm ON t.forum_id=mm.forum_id AND mm.user_id='._uid.' WHERE m.id='.($appr ? $appr : $del))) {



as a newbe, no ideas... Wink

Sebastian


PS. And so to run something, we changed:

if (!q_singleval('SELECT CASE WHEN !('.$usr->users_opt.' & 1048576) THEN mm.id ELSE 1 END FROM fud23_msg m INNER JOIN fud23_thread t ON m.t
hread_id=t.id LEFT JOIN fud23_mod mm ON t.forum_id=mm.forum_id AND mm.user_id='._uid.' WHERE m.id='.($appr ? $appr : $del))) {

to:

if (!q_singleval('SELECT CASE WHEN (('.$usr->users_opt.' & 1048576) > 0) THEN mm.id ELSE 1 END FROM fud23_msg m INNER JOIN fud23_thread t ON m.t
hread_id=t.id LEFT JOIN fud23_mod mm ON t.forum_id=mm.forum_id AND mm.user_id='._uid.' WHERE m.id='.($appr ? $appr : $del))) {

now it does not show an error, but also does not accept posts Wink


Sebastian

[Updated on: Sun, 01 February 2004 20:26]

Report message to a moderator

Re: ERROR: Unable to identify a prefix operator '!' for type 'integer' [message #16496 is a reply to message #16484] Tue, 03 February 2004 00:13 Go to previous messageGo to next message
Ilia is currently offline  Ilia   Canada
Messages: 13241
Registered: January 2002
Karma: 0
Senior Member
Administrator
Core Developer
Wrong logic Razz

it should be:

(('.$usr->users_opt.' & 1048576) == 0)

I've applied the fix for the problem to the CVS.


FUDforum Core Developer
Odp: Re: ERROR: Unable to identify a prefix operator '!' for type 'integer' [message #16521 is a reply to message #16496] Tue, 03 February 2004 22:28 Go to previous messageGo to next message
Sebastian_T is currently offline  Sebastian_T   Poland
Messages: 33
Registered: January 2004
Location: Warsaw, Poland
Karma: 0
Member
THX, it works now Wink

Sebastian


Sebastian
Odp: Re: ERROR: Unable to identify a prefix operator '!' for type 'integer' [message #16624 is a reply to message #16496] Tue, 10 February 2004 12:09 Go to previous messageGo to next message
Sebastian_T is currently offline  Sebastian_T   Poland
Messages: 33
Registered: January 2004
Location: Warsaw, Poland
Karma: 0
Member
error in CVS (double =), causing the same:

(/usr/local/apache/htdocs/forum.blizniaki.net/index.php:141
/usr/local/apache/htdocs/forum.blizniaki.net/index.php:232
/usr/local/apache/htdocs/forum.blizniaki.net/theme/default/modque.php:1959
/usr/local/apache/htdocs/forum.blizniaki.net/index.php:1185
) : ERROR: Unable to identify an operator '==' for types 'integer' and 'integer' You will have to retype this query using an explicit cast
Query: SELECT CASE WHEN ((9600246 & 1048576) == 0) THEN mm.id ELSE 1 END FROM fud23_msg m INNER JOIN fud23_thread t ON m.thread_id=t.id LEFT JOIN fud23_mod mm ON t.forum_id=mm.forum_id AND mm.user_id=4 WHERE m.id=11744
Server Version:
[Referring Page] http://forum.blizniaki.net/index.php?t=modque&SQ=a8baee0cf737814f7c8143 c8b559e09a


just for info, as we patched it manually and is ok Wink


Sebastian
Re: Odp: Re: ERROR: Unable to identify a prefix operator '!' for type 'integer' [message #16627 is a reply to message #16624] Tue, 10 February 2004 14:04 Go to previous message
Ilia is currently offline  Ilia   Canada
Messages: 13241
Registered: January 2002
Karma: 0
Senior Member
Administrator
Core Developer
Fixed, thanks.

FUDforum Core Developer
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: ERROR: Relation "f2" does not exist
Next Topic: Error in maillist.php,v 1.38
Goto Forum:
  

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ]

Current Time: Tue Nov 26 04:17:07 GMT 2024

Total time taken to generate the page: 0.02136 seconds