Bugzilla – Attachment 77313 Details for
Bug 21129
New ALTER IGNORE TABLE entries need correction in updatedatabase.pl
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 21129: New ALTER IGNORE TABLE entries need correction in updatedatabase.pl
Bug-21129-New-ALTER-IGNORE-TABLE-entries-need-corr.patch (text/plain), 3.30 KB, created by
Blou
on 2018-07-27 19:04:14 UTC
(
hide
)
Description:
Bug 21129: New ALTER IGNORE TABLE entries need correction in updatedatabase.pl
Filename:
MIME Type:
Creator:
Blou
Created:
2018-07-27 19:04:14 UTC
Size:
3.30 KB
patch
obsolete
>From 905d9dd4ffdd1b131667cf16de4edabd63afaed4 Mon Sep 17 00:00:00 2001 >From: Blou <philippe.blouin@inlibro.com> >Date: Fri, 27 Jul 2018 11:41:16 -0400 >Subject: [PATCH] Bug 21129: New ALTER IGNORE TABLE entries need correction in > updatedatabase.pl > >Bug 17234 made an effort to remove the ALTER IGNORE from updatedatabase.pl so that it could work with Mysql 5.7. But new entries have since been added to it: > >Bug 12395 - 18.06.00.005 >Bug 19524 - 18.06.00.006 >Bug 13560 - 18.06.00.008 > >This is corrected using column_exists to validate the existence of the new columns before ALTER >--- > installer/data/mysql/updatedatabase.pl | 16 +++++++++++----- > 1 file changed, 11 insertions(+), 5 deletions(-) > >diff --git a/installer/data/mysql/updatedatabase.pl b/installer/data/mysql/updatedatabase.pl >index 6e967b8..c4ca176 100755 >--- a/installer/data/mysql/updatedatabase.pl >+++ b/installer/data/mysql/updatedatabase.pl >@@ -16129,16 +16129,22 @@ if( CheckVersion( $DBversion ) ) { > > $DBversion = '18.06.00.005'; > if( CheckVersion( $DBversion ) ) { >- $dbh->do( "ALTER IGNORE TABLE aqorders ADD COLUMN created_by int(11) NULL DEFAULT NULL AFTER quantityreceived;" ); >- $dbh->do( "ALTER IGNORE TABLE aqorders ADD CONSTRAINT aqorders_created_by FOREIGN KEY (created_by) REFERENCES borrowers (borrowernumber) ON DELETE SET NULL ON UPDATE CASCADE;" ); >- $dbh->do( "UPDATE aqorders, aqbasket SET aqorders.created_by = aqbasket.authorisedby WHERE aqorders.basketno = aqbasket.basketno AND aqorders.created_by IS NULL;" ); >+ unless ( column_exists('aqorders', 'created') ) { >+ $dbh->do( "ALTER TABLE aqorders ADD COLUMN created_by int(11) NULL DEFAULT NULL AFTER quantityreceived;" ); >+ unless ( foreign_key_exists('aqorders', 'aqorders_created_by') ) { >+ $dbh->do( "ALTER TABLE aqorders ADD CONSTRAINT aqorders_created_by FOREIGN KEY (created_by) REFERENCES borrowers (borrowernumber) ON DELETE SET NULL ON UPDATE CASCADE;" ); >+ } >+ $dbh->do( "UPDATE aqorders, aqbasket SET aqorders.created_by = aqbasket.authorisedby WHERE aqorders.basketno = aqbasket.basketno AND aqorders.created_by IS NULL;" ); >+ } > SetVersion( $DBversion ); > print "Upgrade to $DBversion done (Bug 12395 - Save order line's creator)\n"; > } > > $DBversion = '18.06.00.006'; > if( CheckVersion( $DBversion ) ) { >- $dbh->do( "ALTER IGNORE TABLE patron_lists ADD COLUMN shared tinyint(1) default 0 AFTER owner;" ); >+ unless ( column_exists('patron_lists', 'shared') ) { >+ $dbh->do( "ALTER TABLE patron_lists ADD COLUMN shared tinyint(1) default 0 AFTER owner;" ); >+ } > SetVersion( $DBversion ); > print "Upgrade to $DBversion done (Bug 19524 - Share patron lists between staff)\n"; > } >@@ -16157,7 +16163,7 @@ if( CheckVersion( $DBversion ) ) { > > $DBversion = '18.06.00.008'; > if( CheckVersion( $DBversion ) ) { >- $dbh->do( "ALTER IGNORE TABLE marc_modification_template_actions CHANGE action action ENUM('delete_field','add_field','update_field','move_field','copy_field','copy_and_replace_field')" ); >+ $dbh->do( "ALTER TABLE marc_modification_template_actions CHANGE action action ENUM('delete_field','add_field','update_field','move_field','copy_field','copy_and_replace_field')" ); > SetVersion( $DBversion ); > print "Upgrade to $DBversion done (Bug 13560 - need an add option in marc modification templates)\n"; > } >-- >2.7.4
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 21129
:
77313
|
77330
|
77331
|
77360
|
77361