Bugzilla – Attachment 56316 Details for
Bug 8835
Two indexes on biblioitems.issn
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 8835: New db rev for issn_idx
Bug-8835-New-db-rev-for-issnidx.patch (text/plain), 2.04 KB, created by
Marcel de Rooy
on 2016-10-13 09:38:36 UTC
(
hide
)
Description:
Bug 8835: New db rev for issn_idx
Filename:
MIME Type:
Creator:
Marcel de Rooy
Created:
2016-10-13 09:38:36 UTC
Size:
2.04 KB
patch
obsolete
>From 4a24dd6fe2ddb5382e9ec9eb75cb1ec9aebf7582 Mon Sep 17 00:00:00 2001 >From: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> >Date: Thu, 13 Oct 2016 10:49:17 +0200 >Subject: [PATCH] Bug 8835: New db rev for issn_idx >Content-Type: text/plain; charset=utf-8 > >This db rev reapplies dbrev 3.15.00.049 in case that one failed due to >existence of issn_idx. > >Test plan: >If you do not have index issn_idx, recreate it: > ALTER TABLE biblioitems ADD INDEX issn_idx (issn (255)) >Run this db rev. You should see: Removed issn_idx. >Rerun the dbrev. You should see: Everything is fine. >--- > installer/data/mysql/atomicupdate/8835_dbrev.perl | 23 +++++++++++++++++++++ > 1 file changed, 23 insertions(+) > create mode 100644 installer/data/mysql/atomicupdate/8835_dbrev.perl > >diff --git a/installer/data/mysql/atomicupdate/8835_dbrev.perl b/installer/data/mysql/atomicupdate/8835_dbrev.perl >new file mode 100644 >index 0000000..eee4e75 >--- /dev/null >+++ b/installer/data/mysql/atomicupdate/8835_dbrev.perl >@@ -0,0 +1,23 @@ >+$DBversion = "16.06.00.XXX"; >+if ( CheckVersion($DBversion) ) { >+ >+ # If index issn_idx still exists, we assume that dbrev 3.15.00.049 failed, >+ # and we repeat it (partially). >+ # Note: the db rev only pertains to biblioitems and is not needed for >+ # deletedbiblioitems. >+ >+ my $temp = $dbh->selectall_arrayref( "SHOW INDEXES FROM biblioitems WHERE key_name = 'issn_idx'" ); >+ >+ if( @$temp > 0 ) { >+ $dbh->do( "ALTER TABLE biblioitems DROP INDEX isbn" ); >+ $dbh->do( "ALTER TABLE biblioitems DROP INDEX issn" ); >+ $dbh->do( "ALTER TABLE biblioitems DROP INDEX issn_idx" ); >+ $dbh->do( "ALTER TABLE biblioitems CHANGE isbn isbn MEDIUMTEXT NULL DEFAULT NULL, CHANGE issn issn MEDIUMTEXT NULL DEFAULT NULL" ); >+ $dbh->do( "ALTER TABLE biblioitems ADD INDEX isbn ( isbn ( 255 ) ), ADD INDEX issn ( issn ( 255 ) )" ); >+ print "Upgrade to $DBversion done (Bug 8835). Removed issn_idx.\n"; >+ } else { >+ print "Upgrade to $DBversion done (Bug 8835). Everything is fine.\n"; >+ } >+ >+ SetVersion($DBversion); >+} >-- >1.7.10.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 8835
:
56278
|
56316
|
56489
|
56490
|
57706
|
57707