[H-GEN] Mysql & bitwise xor

Greg Black gjb at gbch.net
Sun Nov 16 18:42:54 EST 2003


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

On 2003-11-17, Paul Clarke wrote:
> 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

Looks like a bug in mysql to me.  The manual for my version
(3.23.55) shows the following examples; as you can see, the OR
operator works, while the XOR fails as you saw:

mysql> SELECT 1 | 1;
+-------+
| 1 | 1 |
+-------+
|     1 |
+-------+
1 row in set (0.00 sec)

mysql> SELECT 1 ^ 1;
ERROR 1064: You have an error in your SQL syntax near '^ 1' at line 1

I'd check with Humbug member Arjen Lentz <arjen at mysql.com> to
see if they have an explanation for this, or a fix.

Cheers, Greg

--
* 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