From db71c627a42161b6fd04dedf709d450b4d081916 Mon Sep 17 00:00:00 2001 From: Petro Vashchuk Date: Tue, 27 Apr 2021 12:50:56 +0300 Subject: [PATCH] Bug 11175: (follow-up) make atomic update idempotent Content-Type: text/plain; charset=utf-8 Atomic update tries to insert line into system preferences even if it's already there. This patch fixes that by adding 'IGNORE' to the query, making it idempotent. Signed-off-by: Martin Renvoize Signed-off-by: Andrew Nugged Signed-off-by: Marcel de Rooy --- installer/data/mysql/atomicupdate/bug_11175.perl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/installer/data/mysql/atomicupdate/bug_11175.perl b/installer/data/mysql/atomicupdate/bug_11175.perl index 889a816331..3f56e7e2c4 100644 --- a/installer/data/mysql/atomicupdate/bug_11175.perl +++ b/installer/data/mysql/atomicupdate/bug_11175.perl @@ -1,6 +1,6 @@ $DBversion = 'XXX'; # will be replaced by the RM if( CheckVersion( $DBversion ) ) { - $dbh->do("INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, `type` ) VALUES ('ShowComponentRecords', 'nowhere', 'nowhere|staff|opac|both','In which record detail pages to show list of the component records, as linked via 773','Choice')"); + $dbh->do("INSERT IGNORE INTO systempreferences ( `variable`, `value`, `options`, `explanation`, `type` ) VALUES ('ShowComponentRecords', 'nowhere', 'nowhere|staff|opac|both','In which record detail pages to show list of the component records, as linked via 773','Choice')"); SetVersion( $DBversion ); print "Upgrade to $DBversion done (Bug 11175: Show component records in detail views)\n"; } -- 2.20.1