I am making an account confirmation system. Unfortunately, for some odd
reason, the email's authcode differs from mysql's auth code. The email's
auth code is 84560046651013854756231785743141, yet mysql's auth code is
always 2147483647 for every account I create....
2137483647 -> 2^31-1 (the highest possible number in a signed 32 bit integer). Your authcode is a 128 bit number (for a 64 bit it would have to be <=9223372036854775807); so mysql can't fit your number into the field.
Apparently, in this case, either mysql (or - a bit more likely - the ruby driver just sets the variable to the maximum allowable value, if the value passed in is too large).
i don't get it! The email's auth code is taken from the same variable, and returns what it is supposed to. What's wrong? Just to give some background on the app: In the accounts tbl, there is an int index named 'auth'. The auth code is around 32 digits to insure uniqueness.
Well, you could either use a field type that can hold a 128 bit integer (16 bytes); or - if your app would be able to handle it, just use the lowest 32 bits from that number and store that:
myauthcode=myauthcode & 0xFFFFFFFF
ALLIANCE, n. In international politics, the union of two thieves who
have their hands so deeply inserted in each other's pockets that
they cannot separately plunder a third.
(Ambrose Bierce, The Devil's Dictionary)