Use DELETE + INSERT statement wrapped in a transaction in Item::SaveRefundDataToDB()
--HG-- branch : trunk
This commit is contained in:
+5
-9
@@ -1057,15 +1057,11 @@ void Item::BuildUpdate(UpdateDataMapType& data_map)
|
||||
|
||||
void Item::SaveRefundDataToDB()
|
||||
{
|
||||
std::ostringstream ss;
|
||||
ss << "INSERT INTO item_refund_instance VALUES(";
|
||||
ss << GetGUIDLow() << ",";
|
||||
ss << GetRefundRecipient() << ",";
|
||||
ss << GetPaidMoney() << ",";
|
||||
ss << GetPaidExtendedCost();
|
||||
ss << ")";
|
||||
|
||||
CharacterDatabase.Execute(ss.str().c_str());
|
||||
CharacterDatabase.BeginTransaction();
|
||||
CharacterDatabase.PExecute("DELETE FROM item_refund_instance WHERE item_guid = '%u'", GetGUIDLow());
|
||||
CharacterDatabase.PExecute("INSERT INTO item_refund_instance (`item_guid`,`player_guid`,`paidMoney`,`paidExtendedCost`)"
|
||||
" VALUES('%u','%u','%u','%u')", GetGUIDLow(), GetRefundRecipient(), GetPaidMoney(), GetPaidExtendedCost());
|
||||
CharacterDatabase.CommitTransaction();
|
||||
}
|
||||
|
||||
void Item::DeleteRefundDataFromDB()
|
||||
|
||||
Reference in New Issue
Block a user