[H-GEN] Mysql & bitwise xor

Clinton Roy croy at dstc.edu.au
Sun Nov 16 19:10:31 EST 2003


[ Humbug *General* list - semi-serious discussions about Humbug and     ]
[ Unix-related topics. Posts from non-subscribed addresses will vanish. ]

"Paul Clarke" <paul at sitedynamics.com.au> writes:


> Is it just me or does mysql not like a bitwise xor
>
> The query:
> update user set groups=groups ^ 2 where login="pmcleod"
> Returns ... You have an error in your SQL syntax near '^ 2 where
> login="pmcleod"' at line 1
>
> However both the following work fine:
> update user set groups=groups & 2 where login="pmcleod"  // and
> update user set groups=groups | 2 where login="pmcleod"  // or
>
> Any ideas, is there something really simple that I am missing?
>
> I am running MySQL 3.23.49

The doc at:

http://www.mysql.com/documentation/mysql/bychapter/manual_Reference.html#Bit_functions

indicates that bitwise xor was added in 4.0.2.

hth,
-- 
Clinton Roy
Elvin Software Engineer - elvin.dstc.edu.au

--
* This is list (humbug) general handled by majordomo at lists.humbug.org.au .
* Postings to this list are only accepted from subscribed addresses of
* lists 'general' or 'general-post'.  See http://www.humbug.org.au/



More information about the General mailing list