Skip to content

Instantly share code, notes, and snippets.

@F3st
Created July 28, 2012 12:05
Show Gist options
  • Save F3st/3193045 to your computer and use it in GitHub Desktop.
Save F3st/3193045 to your computer and use it in GitHub Desktop.
SQLTransaction trans = CharacterDatabase.BeginTransaction();
trans->PAppend("DELETE FROM character_instance USING character_instance LEFT JOIN instance ON character_instance.instance = id WHERE map = '%u' and difficulty='%u'", mapid, difficulty);
trans->PAppend("DELETE FROM group_instance USING group_instance LEFT JOIN instance ON group_instance.instance = id WHERE map = '%u' and difficulty='%u'", mapid, difficulty);
trans->PAppend("DELETE FROM instance WHERE map = '%u' and difficulty='%u'", mapid, difficulty);
CharacterDatabase.CommitTransaction(trans);
SQL: DELETE FROM instance WHERE map = '757' and difficulty='1'
ERROR: [1213] Deadlock found when trying to get lock; try restarting transaction
[Warning] Transaction aborted. 3 queries not executed.
SQL: DELETE FROM instance WHERE map = '671' and difficulty='0'
ERROR: [1213] Deadlock found when trying to get lock; try restarting transaction
[Warning] Transaction aborted. 3 queries not executed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment