Vikram Noel Ambrose wrote: > I can't seem to read back BIGINT UNSIGNED (8bytes) from a mysql database. > > For example: > A value of "10988581603938712255" = 0x987F48BFB028BABF > is returned as "9223372036854775807" = 0x7FFFFFFFFFFFFFFF > > Something somewhere is capping off my BIGINT UNSIGNED to the maximum > of a signed 8byte number. > > I'm using libdbi-0.8.3 on Ubuntu-9.10 X86_64. > > > Vikram. > > > I think I may have found the cause of the problem:
Line:726 in dbd_mysql.c data->d_longlong = (long long) atoll(raw); break; I was pretty shocked to see an atoll call in libdbi. But there is no point on going on about that. Just as a hack, I replaced it with, strtoull(raw,NULL,10); and it seems to be working. Obviously this is not going to work with actual signed and negative numbers. How do we fix this? Vikram. ------------------------------------------------------------------------------ This SF.Net email is sponsored by the Verizon Developer Community Take advantage of Verizon's best-in-class app development support A streamlined, 14 day to market process makes app distribution fast and easy Join now and get one step closer to millions of Verizon customers http://p.sf.net/sfu/verizon-dev2dev _______________________________________________ libdbi-users mailing list libdbi-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/libdbi-users