FredyH / MySQLOO

MySQLOO
GNU Lesser General Public License v2.1
140 stars 55 forks source link

Can't read BIGINT(8) from database #19

Closed FreddieDev closed 6 years ago

FreddieDev commented 6 years ago

When reading a big int from the database, numbers are shortened down like so: 7.6561198020163e+16

They do however, write perfectly, leading me to believe this is a shortcoming for mysqloo.

bigdogmat commented 6 years ago

Lua only has one type of number, double, and it can't store 64 bit integers. As it says on the forum thread you'll need to cast to a char.

Bigint fields now return as numbers. This might be problematic if you want to use a bigint as the primary key and select it from the server (such as steamid64). In these cases make sure to cast the bigint to a string in your SQL query like this: SELECT (CAST steamid64 as 'CHAR') as steamid64 FROM ...

FreddieDev commented 6 years ago

Super fast and very helpful! Thank you very much bigdogmat!