Re: [Mysql-cocoa-users] Bug with BigInt data types
Brought to you by:
sergecohen
|
From: Lorenz T. <lo...@te...> - 2003-08-20 20:34:59
|
Hi Serge, Thank you for your quick answer! I'm using an old version, but I have checked the current version and it=20= seems to use the same method to get the numeric values. The field is of type BigInt and not unsigned, and the value is showed=20 correctly in other tools. If I open the table in my app, it shows=20 always 2147483647 for values greater than this. I've tested it also=20 with your MySQL Display app to be sure that it it is not an error of my=20= app - with the same result. Please tell me if I should test it with the newest version of the=20 framework too! It's not that important, so look at it only if you have=20= the time... I'll also look at it, but I don't understand enough of this=20= things (can it be a problem of the method numberWithLong: ?). Thanks very much for your work on the framework, it's really great! Cheers, Lorenz On Tuesday, Aug 19, 2003, at 13:27 Europe/Rome, Serge Cohen wrote: > -----BEGIN PGP SIGNED MESSAGE----- > Hash: SHA1 > > Hi > > If I understand properly the MySQL documentation, we have the=20 > following sizes for integer storage: > > - - SMALLINT : 16 bits (short int in C). > - - MEDIUMINT : 24 bits (inexistent in C). > - - INT or INTEGER : 32 bits (int in C). > - - BIGINT : 64 bits (long int in C). > > So I don't see why the atol function should not work properly for=20 > integers in the range -9223372036854775808 to 9223372036854775807=20 > (though I guess it will not be happy if you use UNSIGNED BIGINT, which=20= > are corresponding to unsigned long int... which atol can not produce,=20= > you will get unexepected result with UNSIGNED BIGINT >=20 > 9223372036854775807)... > > So from the documentation of both MySQL, atol (from stdlib) and=20 > NSNumber, I don't understand why there should be a problem for=20 > integers in the 2147483647 to 9223372036854775807 range. > Maybe I'm also missing something here??? > > > I'm sorry to be a bit untrusty... but can you confirm the problem=20 > (then I'll know for sure that I am missing something): > - - You have a BIGINT column type in you retrieved table. > - - It contains a number in the range 2147483647 to=20 > 9223372036854775807. > - - When you look at it using ie. mysql it appears Ok. > - - BUT if you retrieve the exact same information using the SMySQL=20 > framework you get a wrong number. > > If you can confirm that I properly (or not) understand your remark,=20 > I'll try my best to fix the problem (and if I did not understand your=20= > bug report, can you try to explain it in a different way). > > Thanks for the feedback. > > Serge. > > PS: Can you also tell me which version of the framework you are using. > > Le mardi, 19 ao=FB 2003, =E0 11:45 Europe/Amsterdam, Lorenz Textor a = =E9crit=20 > : > >> Hi everybody, >> >> It seems that in the SMySQL framework BigInt data types are limited=20= >> to a max value of 2147483647, while MySQL allows 64 (63) bit integer=20= >> values. Does anybody know how to fix that? I think that the=20 >> [NSNumber numberWithLong:atol(theData)]; isn't appropriate for BigInt=20= >> values, but I'm not sure what would be right here... >> >> Thanks for your help >> Lorenz >> >> >> Mysql-cocoa-users mailing list >> Mys...@li... >> https://lists.sourceforge.net/lists/listinfo/mysql-cocoa-users >> >> > - ---------------------------------------------------- > Serge Cohen > > GPG Key ID: 9CBB58FB > - ---------------------------------------------------- > -----BEGIN PGP SIGNATURE----- > Version: GnuPG v1.2.1 (Darwin) > > iD8DBQE/QgmO5EPeG5y7WPsRAtmJAJwMZ0xRFJoSbe0OfyiQxjs6uvzanwCgjWIm > OPsZh3HkJ6dU+58v+mQf7Ck=3D > =3D4BO1 > -----END PGP SIGNATURE----- > > --=20 lorenz textor ** sh ** eigerstrasse 21 8200 schaffhausen tf 052 - 624 27 91 ** ticino ** via delle scuole 41 6963 pregassona tf 091 - 940 20 57 ** mobile 076 - 531 71 74 email lo...@te... |