Hi !

select 129 & 127;                             -- ok(1)
select '129' & 127;                           -- ok(1)
select (0+'129') & 127;                       -- ok(1)
select CAST('129' AS UNSIGNED INTEGER) & 127; -- ok(1)
select CONVERT('129', UNSIGNED INTEGER) & 127;-- ok(1)

Doing the same with 64 bit values gives strange results:

select 9223372036854775809 & 127;                             -- returns 1, correct
select '9223372036854775809' & 127;                           -- ERROR: returns 127
select (0+'9223372036854775809') & 127;                       -- ERROR: returns 0
select CAST('9223372036854775809' AS UNSIGNED INTEGER) & 127; -- ERROR: returns 127
select CONVERT('9223372036854775809', UNSIGNED INTEGER) & 127;-- ERROR: returns 127

So please tell me how to perform a bitwise 64bit-AND if
a value is quoted.

Never seen such a strange bug for a long time.

Well, I just found it because DBD::mysql quotes large integer
bind-variables even on perl int64...

So do I need to write an UDF-Function to get the correct behavior
or is there another work-arround to fix this?

-- 

  ciao - 
    Stefan

-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]

Reply via email to