Bugzilla – Attachment 31526 Details for
Bug 7372
RoadTypes should be folded into Authorised Values
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 7372: (follow-up) does execute this DB entry twice
Bug-7372-follow-up-does-execute-this-DB-entry-twic.patch (text/plain), 2.84 KB, created by
Jonathan Druart
on 2014-09-11 13:24:50 UTC
(
hide
)
Description:
Bug 7372: (follow-up) does execute this DB entry twice
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2014-09-11 13:24:50 UTC
Size:
2.84 KB
patch
obsolete
>From 7509301696e0f4e9ed963c4bc5c3d5ed5741c0e6 Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@biblibre.com> >Date: Thu, 11 Sep 2014 15:22:44 +0200 >Subject: [PATCH] Bug 7372: (follow-up) does execute this DB entry twice > >Since this enh has been backported on 3.14, this patch should be applied >on 3.16 and master branch in order to update the updatedb entry. >It should not be executed twice otherwise the process is stuck on this >entry. > >http://irc.koha-community.org/koha/2014-09-11#i_1567078 >--- > installer/data/mysql/updatedatabase.pl | 43 +++++++++++++++++++--------------- > 1 file changed, 24 insertions(+), 19 deletions(-) > >diff --git a/installer/data/mysql/updatedatabase.pl b/installer/data/mysql/updatedatabase.pl >index bfe5f71..eff6e07 100755 >--- a/installer/data/mysql/updatedatabase.pl >+++ b/installer/data/mysql/updatedatabase.pl >@@ -7984,28 +7984,33 @@ if ( CheckVersion($DBversion) ) { > $dbh->{AutoCommit} = 0; > $dbh->{RaiseError} = 1; > >- my $av_added = $dbh->do(q| >- INSERT INTO authorised_values(category, authorised_value, lib, lib_opac) >- SELECT 'ROADTYPE', roadtypeid, road_type, road_type >- FROM roadtype; >- |); >- >- my $rt_deleted = $dbh->do(q| >- DELETE FROM roadtype >- |); >+ eval { >+ $dbh->selectcol_arrayref(q|SELECT COUNT(*) FROM roadtype|); >+ }; >+ unless ( $@ ) { >+ warn "pas erreur"; >+ my $av_added = $dbh->do(q| >+ INSERT INTO authorised_values(category, authorised_value, lib, lib_opac) >+ SELECT 'ROADTYPE', roadtypeid, road_type, road_type >+ FROM roadtype; >+ |); > >- if ( $av_added == $rt_deleted or $rt_deleted eq "0E0" ) { >- $dbh->do(q| >- DROP TABLE roadtype; >+ my $rt_deleted = $dbh->do(q| >+ DELETE FROM roadtype > |); >- $dbh->commit; >- print "Upgrade to $DBversion done (Bug 7372: Move road types from the roadtype table to the ROADTYPE authorised values)\n"; >- SetVersion($DBversion); >- } else { >- print "Upgrade to $DBversion failed (Bug 7372: Move road types from the roadtype table to the ROADTYPE authorised values.\nTransaction aborted because $@\n)"; >- $dbh->rollback; >- } > >+ if ( $av_added == $rt_deleted or $rt_deleted eq "0E0" ) { >+ $dbh->do(q| >+ DROP TABLE roadtype; >+ |); >+ $dbh->commit; >+ print "Upgrade to $DBversion done (Bug 7372: Move road types from the roadtype table to the ROADTYPE authorised values)\n"; >+ SetVersion($DBversion); >+ } else { >+ print "Upgrade to $DBversion failed (Bug 7372: Move road types from the roadtype table to the ROADTYPE authorised values.\nTransaction aborted because $@\n)"; >+ $dbh->rollback; >+ } >+ } > $dbh->{AutoCommit} = 1; > $dbh->{RaiseError} = 0; > } >-- >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 7372
:
22310
|
22542
|
25212
|
25540
| 31526 |
32083