From 5cf04ce39fde137e84e57aec16a8fd8c69bbdbd9 Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Wed, 5 Jan 2022 16:45:34 +0100 Subject: [PATCH] Bug 29778: Remove DBMS error ERROR - {UNKNOWN}: DBI Exception: DBD::mysql::db do failed: Table 'additional_contents' is specified twice, both as a target for 'DELETE' and as a separate source for data at /kohadevbox/koha/C4/Installer.pm line 738 Happened on MariaDB 10.1 and 10.3, not 10.6 --- installer/data/mysql/atomicupdate/bug_29778.pl | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/installer/data/mysql/atomicupdate/bug_29778.pl b/installer/data/mysql/atomicupdate/bug_29778.pl index c8f25e7c902..48c97c746b0 100755 --- a/installer/data/mysql/atomicupdate/bug_29778.pl +++ b/installer/data/mysql/atomicupdate/bug_29778.pl @@ -9,9 +9,11 @@ return { $dbh->do(q{ DELETE FROM additional_contents WHERE code NOT IN ( - SELECT code - FROM additional_contents - WHERE lang = "default" + SELECT code FROM ( + SELECT code + FROM additional_contents + WHERE lang = "default" + ) as tmp ); }); }, -- 2.25.1