Core/DBLayer: Proper core-side handling of MySQL errno 1213 to prevent a snowballeffect (until innodb_lock_wait_timeout)

This commit is contained in:
Machiavelli
2011-05-23 16:33:33 +02:00
parent f7ce41c4af
commit 402198c5ff
5 changed files with 34 additions and 21 deletions
@@ -256,12 +256,8 @@ void WorldSession::HandleSendMail(WorldPacket & recv_data)
pl->MoveItemFromInventory(items[i]->GetBagSlot(), item->GetSlot(), true);
item->DeleteFromInventoryDB(trans); // deletes item from character's inventory
item->SetOwnerGUID(rc);
item->SaveToDB(trans); // recursive and not have transaction guard into self, item not in inventory and can be save standalone
// owner in data will set at mail receive and item extracting
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SET_ITEM_OWNER);
stmt->setUInt32(0, GUID_LOPART(rc));
stmt->setUInt32(1, item->GetGUIDLow());
trans->Append(stmt);
draft.AddItem(item);
}