Merge pull request #15197 from strapi/fix/deadlock-mysql-inverse-order

Avoid deadlocks for mysql and mariadb when creating a Nth locale
This commit is contained in:
Pierre Noël 2022-12-16 19:44:26 +01:00 committed by GitHub
commit a8064a03ca
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -328,7 +328,7 @@ const cleanOrderColumnsForInnoDB = async ({
await db.connection await db.connection
.raw( .raw(
` `
CREATE TEMPORARY TABLE ?? CREATE TABLE ??
SELECT SELECT
id, id,
( (
@ -361,9 +361,7 @@ const cleanOrderColumnsForInnoDB = async ({
) )
.transacting(trx); .transacting(trx);
} finally { } finally {
await db.connection await db.connection.raw(`DROP TABLE IF EXISTS ??`, [tempInvOrderTableName]).transacting(trx);
.raw(`DROP TEMPORARY TABLE IF EXISTS ??`, [tempInvOrderTableName])
.transacting(trx);
} }
} }
}; };