[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:
Ambal 2011-03-25 21:52:59 +02:00
parent d9374d936f
commit 40ef9cbf2f
24 changed files with 1823 additions and 488 deletions

View file

@ -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);