• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

TFS 1.X+ Message: Out of range value for column

darkmu

Active Member
Joined
Aug 26, 2007
Messages
249
Solutions
1
Reaction score
44
Location
Paraná,Brazil
After I created a system to add lucky points in the database instead of storage, I started to give some problems in my bank like:

TFS 1.3

Lua:
2020-12-25 21:22:02 -  [Error - mysql_real_query] Query: UPDATE `players` SET `level` = 1145,`group_id` = 1,`vocation` = 11,`health` = 10891,`healthmax` = 11555,`experience` = 24892088448,`lookbody` = 88,`lookfeet` = 0,`lookhead` = 0,`looklegs` = 114,`looktype` = 289,`lookaddons` = 3,`maglevel` = 46,`mana` = 166
2020-12-25 21:22:02 -  Message: Out of range value for column 'manaspent' at row 1
2020-12-25 21:22:02 -  [Error - mysql_real_query] Query: UPDATE `players` SET `level` = 1145,`group_id` = 1,`vocation` = 11,`health` = 10891,`healthmax` = 11555,`experience` = 24892088448,`lookbody` = 88,`lookfeet` = 0,`lookhead` = 0,`looklegs` = 114,`looktype` = 289,`lookaddons` = 3,`maglevel` = 46,`mana` = 166
2020-12-25 21:22:02 -  Message: Out of range value for column 'manaspent' at row 1
2020-12-25 21:22:02 -  [Error - mysql_real_query] Query: UPDATE `players` SET `level` = 1145,`group_id` = 1,`vocation` = 11,`health` = 10891,`healthmax` = 11555,`experience` = 24892088448,`lookbody` = 88,`lookfeet` = 0,`lookhead` = 0,`looklegs` = 114,`looktype` = 289,`lookaddons` = 3,`maglevel` = 46,`mana` = 166

1608942693947.png
 

Yalasari

Active Member
Joined
Jul 16, 2017
Messages
82
Solutions
8
Reaction score
45
Error message which you are getting indicates that query tries to update manaspent but given value is either too big or too small.
According to MySQL docs valid value for unsigned int type is between 0 and 4294967295, so you are trying to pass value which is outside of valid range.
Right now it is even hard to tell whether your changes caused it or maybe it is just pure coincidence. You'd have to give more details so we could see what's going on.
Assuming that there was changes in iologindata.cpp - posting code part where query to save player data into database is "construced" would be helpful (this big chunk of code around 694 line beggining with query.str(std::string()); ...)
 

fabian766

Veteran OT User
Joined
Apr 22, 2008
Messages
127
Solutions
21
Reaction score
331
Location
Poland
Manaspent variable is uint64_t in player structure so that means it should be unsigned bigint in database but what do you expect from TFS developers that can only complains about other codes even if there's nothing wrong with them but they can't themselves keep correct variables synchronization between server and database.
Here are simple mysql query to fix it:
Code:
ALTER TABLE `players` CHANGE `manaspent` `manaspent` bigint unsigned NOT NULL DEFAULT '0'
 
Top