Bugzilla – Attachment 167562 Details for
Bug 36978
Upgrade fails at 23.06.00.007 [Bug 34029]
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 36978: [Bug 34029 follow-up] Make update idempotent
Bug-36978-Bug-34029-follow-up-Make-update-idempote.patch (text/plain), 2.26 KB, created by
Chris Cormack
on 2024-06-07 08:26:42 UTC
(
hide
)
Description:
Bug 36978: [Bug 34029 follow-up] Make update idempotent
Filename:
MIME Type:
Creator:
Chris Cormack
Created:
2024-06-07 08:26:42 UTC
Size:
2.26 KB
patch
obsolete
>From d258e460c9c3def50de1aa5abdf7f779b146f3e5 Mon Sep 17 00:00:00 2001 >From: Martin Renvoize <martin.renvoize@ptfs-europe.com> >Date: Tue, 4 Jun 2024 12:51:45 +0100 >Subject: [PATCH] Bug 36978: [Bug 34029 follow-up] Make update idempotent > >The update wasn't checking for index pre-existance and as such could >fail in certain cases. > >Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz> >--- > installer/data/mysql/db_revs/230600007.pl | 27 ++++++++--------------- > 1 file changed, 9 insertions(+), 18 deletions(-) > >diff --git a/installer/data/mysql/db_revs/230600007.pl b/installer/data/mysql/db_revs/230600007.pl >index 0a6abe77c2..362e6b0908 100755 >--- a/installer/data/mysql/db_revs/230600007.pl >+++ b/installer/data/mysql/db_revs/230600007.pl >@@ -21,13 +21,10 @@ return { > ); > say $out "Updated deletedbiblioitems.place to text"; > >- $dbh->do( >- q{ >- ALTER TABLE `biblioitems` >- DROP INDEX `publishercode` >+ if ( index_exists( 'biblioitems', 'publishercode' ) ) { >+ $dbh->do(q{ALTER TABLE `biblioitems` DROP INDEX `publishercode`}); >+ say $out "Remove index on biblioitems.publishercode"; > } >- ); >- say $out "Remove index on biblioitems.publishercode"; > $dbh->do( > q{ > ALTER TABLE `biblioitems` >@@ -35,20 +32,14 @@ return { > } > ); > say $out "Updated biblioitems.publishercode to text"; >- $dbh->do( >- q{ >- ALTER TABLE `biblioitems` >- ADD INDEX `publishercode` (`publishercode`(191)) >- } >- ); >+ >+ $dbh->do(q{ALTER TABLE `biblioitems` ADD INDEX `publishercode` (`publishercode`(191))}); > say $out "Create index on biblioitems.publishercode"; >- $dbh->do( >- q{ >- ALTER TABLE `deletedbiblioitems` >- DROP INDEX `publishercode` >+ >+ if ( index_exists( 'deletedbiblioitems', 'publishercode' ) ) { >+ $dbh->do(q{ALTER TABLE `deletedbiblioitems` DROP INDEX `publishercode`}); >+ say $out "Remove index on deletedbiblioitems.publishercode"; > } >- ); >- say $out "Remove index on deletedbiblioitems.publishercode"; > $dbh->do( > q{ > ALTER TABLE `deletedbiblioitems` >-- >2.39.2
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 36978
:
167379
|
167562
|
167570