Bugzilla – Attachment 56049 Details for
Bug 17324
branchcode is NULL in letter triggers red upgrade message
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 17324: Deal with branchcode NULL issue
Bug-17324-Deal-with-branchcode-NULL-issue.patch (text/plain), 2.09 KB, created by
Jonathan Druart
on 2016-10-05 07:21:57 UTC
(
hide
)
Description:
Bug 17324: Deal with branchcode NULL issue
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2016-10-05 07:21:57 UTC
Size:
2.09 KB
patch
obsolete
>From 8045368999bf92bc73bd967081e5cea1adfbee47 Mon Sep 17 00:00:00 2001 >From: Mark Tompsett <mtompset@hotmail.com> >Date: Tue, 20 Sep 2016 19:29:28 -0400 >Subject: [PATCH] Bug 17324: Deal with branchcode NULL issue > >In a database update we alter the letter table, making a column >(branchcode) not be able to contain NULL values. >However if it already does, this SQL fails. So before changing the >column we change the NULL values > >[Tue Sep 20 19:08:10 2016] updatedatabase.pl: DBD::mysql::db do failed: >Invalid use of NULL value [for Statement " >[Tue Sep 20 19:08:10 2016] updatedatabase.pl: ALTER TABLE letter MODIFY >COLUMN branchcode varchar(10) NOT NULL DEFAULT '' >[Tue Sep 20 19:08:10 2016] updatedatabase.pl: "] at >/home/mtompset/kohaclone/installer/data/mysql/updatedatabase.pl line >12638. > >Reproduce: >on an ubuntu 16.04 LTS machine with MySQL 5.7 install git koha >development environment. >... >git checkout -b my_3.18.x origin/3.18.x >drop database koha_library; >create database koha_library; >quit; >web install all sample data >(ignore some issues with sample data, and one with mandatory) > >git checkout -b bug_17234 origin/master >git bz apply 17292 >git bz apply 17320 >git bz apply 17260 >git bz apply 17234 >web install >Two warning messages are expected output from upgrade process, but >the above message is not. > >Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz> > >Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Did not follow the test plan, but the changes make sense >--- > installer/data/mysql/updatedatabase.pl | 3 +++ > 1 file changed, 3 insertions(+) > >diff --git a/installer/data/mysql/updatedatabase.pl b/installer/data/mysql/updatedatabase.pl >index 1536904..0062bf5 100755 >--- a/installer/data/mysql/updatedatabase.pl >+++ b/installer/data/mysql/updatedatabase.pl >@@ -12581,6 +12581,9 @@ SetVersion($DBversion); > $DBversion = "3.23.00.063"; > if ( CheckVersion($DBversion) ) { > $dbh->do(q{ >+ UPDATE letter SET branchcode='' WHERE branchcode IS NULL; >+ }); >+ $dbh->do(q{ > ALTER TABLE letter MODIFY COLUMN branchcode varchar(10) NOT NULL DEFAULT '' > }); > $dbh->do(q{ >-- >2.8.1
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 17324
:
55727
|
55728
|
56041
| 56049