14-08-2007, 01:16 PM
That sounds like a rollover of a signed short integer to me.
A 16-bit signed int can hold a value range of -32768 to 32767. In C there is no implicit overflow checking, so 32767 + 1 yields -32768 ... ooops. The
same happens in "not so well designed" databases too when their developers oversaw this little quirk. A database has to error out and rollback the
transaction on data overflow, but the bad ones just go ahead and silently corrupt your data. So if it isn't in Dan's code, it could just be a badly
chosen data type (smallint) for the points attribute in the pilots table.
That of course is just an educated guess. Dan would have to confirm to be sure.
Jan
A 16-bit signed int can hold a value range of -32768 to 32767. In C there is no implicit overflow checking, so 32767 + 1 yields -32768 ... ooops. The
same happens in "not so well designed" databases too when their developers oversaw this little quirk. A database has to error out and rollback the
transaction on data overflow, but the bad ones just go ahead and silently corrupt your data. So if it isn't in Dan's code, it could just be a badly
chosen data type (smallint) for the points attribute in the pilots table.
That of course is just an educated guess. Dan would have to confirm to be sure.
Jan
--
Anyone who trades liberty for security deserves neither
liberty nor security. -- Benjamin Franklin
Anyone who trades liberty for security deserves neither
liberty nor security. -- Benjamin Franklin