mirror of
https://github.com/mangosfour/server.git
synced 2025-12-12 19:37:03 +00:00
[11284] Implement prepared statements for INSERT+DELETE+UPDATE SQL requests. Should improve player save performance + lower MySQL server CPU usage.
Note: PostgreSQL does not have prepared statements implemented using native APIs. Huge thanks to Undergarun, kero99 and Vinolentus. Signed-off-by: Ambal <pogrebniak@gala.net>
This commit is contained in:
parent
d9374d936f
commit
40ef9cbf2f
24 changed files with 1823 additions and 488 deletions
|
|
@ -262,7 +262,11 @@ void WorldSession::HandleOpenItemOpcode(WorldPacket& recvPacket)
|
|||
pUser->DestroyItem(pItem->GetBagSlot(), pItem->GetSlot(), true);
|
||||
return;
|
||||
}
|
||||
CharacterDatabase.PExecute("DELETE FROM character_gifts WHERE item_guid = '%u'", pItem->GetGUIDLow());
|
||||
|
||||
static SqlStatementID delGifts ;
|
||||
|
||||
SqlStatement stmt = CharacterDatabase.CreateStatement(delGifts, "DELETE FROM character_gifts WHERE item_guid = ?");
|
||||
stmt.PExecute(pItem->GetGUIDLow());
|
||||
}
|
||||
else
|
||||
pUser->SendLoot(pItem->GetObjectGuid(),LOOT_CORPSE);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue