Skip to content

Commit

Permalink
Merge pull request #15197 from strapi/fix/deadlock-mysql-inverse-order
Browse files Browse the repository at this point in the history
Avoid deadlocks for mysql and mariadb when creating a Nth locale
  • Loading branch information
petersg83 committed Dec 16, 2022
2 parents bd6c0fc + 0413f27 commit a8064a0
Showing 1 changed file with 2 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -328,7 +328,7 @@ const cleanOrderColumnsForInnoDB = async ({
await db.connection
.raw(
`
CREATE TEMPORARY TABLE ??
CREATE TABLE ??
SELECT
id,
(
Expand Down Expand Up @@ -361,9 +361,7 @@ const cleanOrderColumnsForInnoDB = async ({
)
.transacting(trx);
} finally {
await db.connection
.raw(`DROP TEMPORARY TABLE IF EXISTS ??`, [tempInvOrderTableName])
.transacting(trx);
await db.connection.raw(`DROP TABLE IF EXISTS ??`, [tempInvOrderTableName]).transacting(trx);
}
}
};
Expand Down

0 comments on commit a8064a0

Please sign in to comment.