Re: [Mysql-cocoa-users] Bug with BigInt data types
Brought to you by:
sergecohen
|
From: Serge C. <ser...@us...> - 2003-08-19 11:26:55
|
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Hi=0D =0D If I understand properly the MySQL documentation, we have the following =0D= sizes for integer storage:=0D =0D - - SMALLINT : 16 bits (short int in C).=0D - - MEDIUMINT : 24 bits (inexistent in C).=0D - - INT or INTEGER : 32 bits (int in C).=0D - - BIGINT : 64 bits (long int in C).=0D =0D So I don't see why the atol function should not work properly for =0D integers in the range -9223372036854775808 to 9223372036854775807 =0D (though I guess it will not be happy if you use UNSIGNED BIGINT, which =0D= are corresponding to unsigned long int... which atol can not produce, =0D= you will get unexepected result with UNSIGNED BIGINT > =0D 9223372036854775807)...=0D =0D So from the documentation of both MySQL, atol (from stdlib) and =0D NSNumber, I don't understand why there should be a problem for integers =0D= in the 2147483647 to 9223372036854775807 range.=0D Maybe I'm also missing something here???=0D =0D =0D I'm sorry to be a bit untrusty... but can you confirm the problem (then =0D= I'll know for sure that I am missing something):=0D - - You have a BIGINT column type in you retrieved table.=0D - - It contains a number in the range 2147483647 to 9223372036854775807.=0D= - - When you look at it using ie. mysql it appears Ok.=0D - - BUT if you retrieve the exact same information using the SMySQL =0D framework you get a wrong number.=0D =0D If you can confirm that I properly (or not) understand your remark, =0D I'll try my best to fix the problem (and if I did not understand your =0D= bug report, can you try to explain it in a different way).=0D =0D Thanks for the feedback.=0D =0D Serge.=0D =0D PS: Can you also tell me which version of the framework you are using.=0D= =0D Le mardi, 19 ao=FB 2003, =E0 11:45 Europe/Amsterdam, Lorenz Textor a = =E9crit :=0D =0D > Hi everybody,=0D >=0D > It seems that in the SMySQL framework BigInt data types are limited to = =0D > a max value of 2147483647, while MySQL allows 64 (63) bit integer =0D > values. Does anybody know how to fix that? I think that the [NSNumber = =0D > numberWithLong:atol(theData)]; isn't appropriate for BigInt values, =0D= > but I'm not sure what would be right here...=0D >=0D > Thanks for your help=0D > Lorenz=0D >=0D >=0D > Mysql-cocoa-users mailing list=0D > Mys...@li...=0D > https://lists.sourceforge.net/lists/listinfo/mysql-cocoa-users=0D >=0D >=0D - ----------------------------------------------------=0D Serge Cohen=0D =0D GPG Key ID: 9CBB58FB=0D - ----------------------------------------------------=0D -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.1 (Darwin) iD8DBQE/QgmO5EPeG5y7WPsRAtmJAJwMZ0xRFJoSbe0OfyiQxjs6uvzanwCgjWIm OPsZh3HkJ6dU+58v+mQf7Ck=3D =3D4BO1 -----END PGP SIGNATURE----- |