It looks like when mysql coerces character strings into integers, it
turns them into signed int's. Obviously if the column is unsigned, this
is a problem. Don't use quotes you say. Problem is that the perl DBI API
seems to put quotes around everything. So when I grab a really really
large integer from the db using the perl api, and then try to get a
child record referencing the same large integer ID, the DB doesn't give
me anything because it's coercing a large chunk of text into a signed
integer and truncating it. 

Another not-really-a-bug but definitely a pitfall. And it sucks because
after not being able to use md5 hashes to index my records using
BINARY(16) because binary isn't really binary because it cuts off
spaces, I'm losing a digit of my next-best-thing thanks to unsigned
integers which are actually signed. 

Don't make me go spend my life savings on Oracle! 

Here's an example in case you're really bored. The problem below exists
because 9358082631434058695 > 2^63

##First with no quotes around the large integer:
mysql> select job_id from wordbarrel_9a where
job_id=9358082631434058695;
+---------------------+
| job_id              |
+---------------------+
| 9358082631434058695 |
+---------------------+
1 row in set (0.00 sec)

##Then with quotes:
mysql> select job_id from wordbarrel_9a where
job_id='9358082631434058695';
Empty set (0.00 sec)

mysql> desc wordbarrel_9a;
+----------+---------------------+------+-----+---------+-------+
| Field    | Type                | Null | Key | Default | Extra |
+----------+---------------------+------+-----+---------+-------+
| job_id   | bigint(20) unsigned |      | PRI | 0       |       |
+----------+---------------------+------+-----+---------+-------+





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

Reply via email to