Bugzilla – Attachment 55113 Details for
Bug 17234
ALTER IGNORE TABLE is invalid in mysql 5.7. This breaks updatedatabase.pl
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 17234 - updatedatabase.pl's ALTER IGNORE break with mysql 5.7.4+
Bug-17234---updatedatabasepls-ALTER-IGNORE-break-w.patch (text/plain), 4.39 KB, created by
Blou
on 2016-09-02 12:22:30 UTC
(
hide
)
Description:
Bug 17234 - updatedatabase.pl's ALTER IGNORE break with mysql 5.7.4+
Filename:
MIME Type:
Creator:
Blou
Created:
2016-09-02 12:22:30 UTC
Size:
4.39 KB
patch
obsolete
>From 1f53f261739a1a4afc56dde7a778c5956dc73c33 Mon Sep 17 00:00:00 2001 >From: Blou <philippe.blouin@inlibro.com> >Date: Fri, 2 Sep 2016 08:05:48 -0400 >Subject: [PATCH] Bug 17234 - updatedatabase.pl's ALTER IGNORE break with mysql > 5.7.4+ > >The doc says: "As of MySQL 5.7.4, the IGNORE clause for ALTER TABLE is removed and its use produces an error." >This fix replaces ALTER IGNORE with ALTER in updatedatabase.pl > >To TEST, try an upgrade from 3.18 to 3.22 after installing the latest mysql (at least 5.7.4, by the doc). >Some will fail with error > >DBD::mysql::db do failed: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'IGNORE TABLE aqbasket > ADD KEY authorisedby (authorisedby)' at line 1 [for Statement " > ALTER IGNORE TABLE aqbasket > ADD KEY authorisedby (authorisedby) > "] at ./installer/data/mysql/updatedatabase.pl line 10563. > >0) Find a database on 3.18, save it. >1) Set your code base to 3.22(or master) >2) run updatedatabase.pl >3) See the errors. >4) Apply the patch >5) Reload the 3.18 database >6) succeed with updatedatabase.pl >--- > installer/data/mysql/updatedatabase.pl | 22 +++++++++++----------- > 1 file changed, 11 insertions(+), 11 deletions(-) > >diff --git a/installer/data/mysql/updatedatabase.pl b/installer/data/mysql/updatedatabase.pl >index 6697919..05045cd 100755 >--- a/installer/data/mysql/updatedatabase.pl >+++ b/installer/data/mysql/updatedatabase.pl >@@ -10418,13 +10418,13 @@ if ( CheckVersion($DBversion) ) { > $DBversion = "3.19.00.041"; > if ( CheckVersion($DBversion) ) { > $dbh->do(q| >- ALTER IGNORE TABLE suggestions ADD KEY status (STATUS) >+ ALTER TABLE suggestions ADD KEY status (STATUS) > |); > $dbh->do(q| >- ALTER IGNORE TABLE suggestions ADD KEY biblionumber (biblionumber) >+ ALTER TABLE suggestions ADD KEY biblionumber (biblionumber) > |); > $dbh->do(q| >- ALTER IGNORE TABLE suggestions ADD KEY branchcode (branchcode) >+ ALTER TABLE suggestions ADD KEY branchcode (branchcode) > |); > print "Upgrade to $DBversion done (Bug 14132: suggestions table is missing indexes)\n"; > SetVersion ($DBversion); >@@ -10440,7 +10440,7 @@ if ( CheckVersion($DBversion) ) { > }); > > $dbh->do(q{ >- ALTER IGNORE TABLE auth_subfield_structure >+ ALTER TABLE auth_subfield_structure > ADD CONSTRAINT auth_subfield_structure_ibfk_1 > FOREIGN KEY (authtypecode) REFERENCES auth_types(authtypecode) > ON DELETE CASCADE ON UPDATE CASCADE >@@ -10561,15 +10561,15 @@ if ( CheckVersion($DBversion) ) { > $DBversion = "3.21.00.007"; > if ( CheckVersion($DBversion) ) { > $dbh->do(q| >- ALTER IGNORE TABLE aqbasket >+ ALTER TABLE aqbasket > ADD KEY authorisedby (authorisedby) > |); > $dbh->do(q| >- ALTER IGNORE TABLE aqbooksellers >+ ALTER TABLE aqbooksellers > ADD KEY name (name(255)) > |); > $dbh->do(q| >- ALTER IGNORE TABLE aqbudgets >+ ALTER TABLE aqbudgets > ADD KEY budget_parent_id (budget_parent_id), > ADD KEY budget_code (budget_code), > ADD KEY budget_branchcode (budget_branchcode), >@@ -10577,11 +10577,11 @@ if ( CheckVersion($DBversion) ) { > ADD KEY budget_owner_id (budget_owner_id) > |); > $dbh->do(q| >- ALTER IGNORE TABLE aqbudgets_planning >+ ALTER TABLE aqbudgets_planning > ADD KEY budget_period_id (budget_period_id) > |); > $dbh->do(q| >- ALTER IGNORE TABLE aqorders >+ ALTER TABLE aqorders > ADD KEY parent_ordernumber (parent_ordernumber), > ADD KEY orderstatus (orderstatus) > |); >@@ -10818,7 +10818,7 @@ if ( CheckVersion($DBversion) ) { > $dbh->{PrintError} = $print_error; > > $dbh->do(q{ >- ALTER IGNORE TABLE course_reserves >+ ALTER TABLE course_reserves > ADD CONSTRAINT course_reserves_ibfk_2 > FOREIGN KEY (ci_id) REFERENCES course_items (ci_id) > ON DELETE CASCADE ON UPDATE CASCADE >@@ -10931,7 +10931,7 @@ if ( CheckVersion($DBversion) ) { > $DBversion = "3.21.00.029"; > if ( CheckVersion($DBversion) ) { > $dbh->do(q{ >- ALTER IGNORE TABLE discharges >+ ALTER TABLE discharges > ADD COLUMN discharge_id int(11) NOT NULL AUTO_INCREMENT PRIMARY KEY FIRST > }); > print "Upgrade to $DBversion done (Bug 14368: Add discharges history)\n"; >-- >2.1.0
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 17234
:
55113
|
55144
|
55634
|
55635
|
55704
|
55722
|
55729
|
55833
|
56820
|
56821
|
56822
|
56823
|
56824
|
56825
|
58548
|
58551
|
58552
|
58865
|
59003