From c2e91f7248d12f367a738eea70bf6576e7c351d3 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 Signed-off-by: Lucas Gass Signed-off-by: Katrin Fischer Signed-off-by: Fridolin Somers --- 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 c8f25e7c90..48c97c746b 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.39.5