From ccc6624c364d59dcdf9b8f3f83ffbaa6818e63ad 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 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 --- 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