SQL replace error

Old bugs stored here for reference.
Locked
User avatar
John Adams
Retired
Posts: 9684
Joined: Thu Jul 26, 2007 6:27 am
EQ2Emu Server: EQ2Emulator Test Center
Characters: John
Location: Arizona
Contact:

SQL replace error

Post by John Adams » Fri Feb 27, 2009 6:53 pm

Not sure what this is... checked the code, and the right value appears to be getting passed, but with my SQL in STRICT mode, I am getting an error in SaveItem()

Code: Select all

replace into character_items (id, type, char_id, slot, item_id, creator, condition_, attuned, bag_id, count, max_sell_value, account_id) values 
(1127340675, 'NOT-EQUIPPED', 750, 2579, 2528806324, '', 247, 0,1183875888, 132, 3600379438, 150);
See the "2579"? that is supposed to be a slot... but with tinyint(3), max is 255. So I am not sure where 2579 is coming from anyway. This is logging in the first time on an empty character_items table, pulling 3 items in - bag, food, water.

Code looks fine:

Code: Select all

	string update_item = string("replace into character_items (id, type, char_id, slot, item_id, creator, condition_, attuned, bag_id, count, max_sell_value, account_id) values(%lu, '%s', %lu, %i, %lu, '%s', %i, %i, %li, %i, %lu, %lu)");
	query.RunQuery2(Q_REPLACE, update_item.c_str(), item->details.unique_id, type, char_id, item->details.slot_id, item->details.item_id, 
		getSafeEscapeString(item->creator.data.c_str()).c_str(), item->generic_info.condition, item->CheckFlag(ATTUNED) ? 1 : 0, item->details.inv_slot_id, item->details.count, item->GetMaxSellValue(), account_id);
LE, let me save you a lot of time.

LethalEncounter says, "Works on my machine".

Any ideas?

User avatar
John Adams
Retired
Posts: 9684
Joined: Thu Jul 26, 2007 6:27 am
EQ2Emu Server: EQ2Emulator Test Center
Characters: John
Location: Arizona
Contact:

Re: SQL replace error

Post by John Adams » Fri Feb 27, 2009 7:02 pm

And of course, any attempt to reproduce what I just did fails, and everything works perfectly.

So chalk it up to anomalous and let's just move on. Sorry.

LethalEncounter
Team: Zombie
Posts: 2717
Joined: Wed Jul 25, 2007 10:10 pm

Re: SQL replace error

Post by LethalEncounter » Fri Feb 27, 2009 10:00 pm

Hmm, strange. Something to keep an eye on. let me know if you can figure out what is causing it, or it happens again.

Locked

Who is online

Users browsing this forum: No registered users and 0 guests