From 0013f6fa45e755a285752a67af8729a47a2e79cd Mon Sep 17 00:00:00 2001 From: Jared Camins-Esakov Date: Fri, 23 Nov 2012 12:30:26 -0500 Subject: [PATCH] Bug 9135: updatedatabase.pl fails when DEBUG is set When the DEBUG environment variable is set to a true value, all DBI errors are treated as fatal. Unfortunately, duplicate keys are incredibly common in updatedatabase.pl, since sysprefs are often added in testing, then re-added once the patches have been pushed to master (or added when on a maintenance branch, and then re-added when the system is upgraded to either a newer maintenance branch or master). This patch disables fatal errors for the updatedatabase.pl script. Signed-off-by: Katrin Fischer All tests and perlcritic pass. To test, run from command line: export DEBUG=1 installer/data/mysql/updatedatabase.pl Signed-off-by: Jonathan Druart If a query causes an error, the script continues as expected. Signed-off-by: Jared Camins-Esakov Signed-off-by: Chris Cormack Signed-off-by: Liz Rea --- installer/data/mysql/updatedatabase.pl | 1 + 1 file changed, 1 insertion(+) diff --git a/installer/data/mysql/updatedatabase.pl b/installer/data/mysql/updatedatabase.pl index 96a70590a9..2a8305f638 100755 --- a/installer/data/mysql/updatedatabase.pl +++ b/installer/data/mysql/updatedatabase.pl @@ -64,6 +64,7 @@ GetOptions( my $dbh = C4::Context->dbh; $|=1; # flushes output +local $dbh->{RaiseError} = 0; # Record the version we are coming from -- 2.39.5