Jump to content

DB Bug in SaveCreatureRespawnTime(...)


Guest Marik

Recommended Posts

Hi,

I've a small aesthetic thing. It's not so bad I hope.

Anyway, I get sometimes an Database Error:

SQL: DELETE FROM creature_respawn WHERE guid = '113185' AND instance = '0&

2010-10-27 01:43:28 SQL ERROR: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ''0&' at line 1

The only function in the code, which creates such a SQL Query is the follow:

void ObjectMgr::SaveCreatureRespawnTime(uint32 loguid, uint32 instance, time_t t)

{

mCreatureRespawnTimes[MAKE_PAIR64(loguid,instance)] = t;

CharacterDatabase.PExecute("DELETE FROM creature_respawn WHERE guid = '%u' AND instance = '%u'", loguid, instance);

if(t)

CharacterDatabase.PExecute("INSERT INTO creature_respawn VALUES

( '%u', '" UI64FMTD "', '%u' )", loguid, uint64(t), instance);

}

Does somebody have an idea how it comes, that the uint32 in combination with the %u flag can be "0&"?

Isn't that mysterious somehow?

Greeting Marik

Link to comment
Share on other sites

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. Privacy Policy Terms of Use