Bugzilla – Attachment 55706 Details for
Bug 17320
MySQL 5.7 doesn't work well with SQL using '0000-00-00'
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 17320: Make '0000-00-00' into 0
Bug-17320-Make-0000-00-00-into-0.patch (text/plain), 4.83 KB, created by
Mark Tompsett
on 2016-09-20 00:59:44 UTC
(
hide
)
Description:
Bug 17320: Make '0000-00-00' into 0
Filename:
MIME Type:
Creator:
Mark Tompsett
Created:
2016-09-20 00:59:44 UTC
Size:
4.83 KB
patch
obsolete
>From 4c407c29beafd6773c151e60ffb60f3a4802e774 Mon Sep 17 00:00:00 2001 >From: Mark Tompsett <mtompset@hotmail.com> >Date: Mon, 19 Sep 2016 20:41:26 -0400 >Subject: [PATCH] Bug 17320: Make '0000-00-00' into 0 > >See comment 0. >--- > 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 7be9ce2..c03049b 100755 >--- a/installer/data/mysql/updatedatabase.pl >+++ b/installer/data/mysql/updatedatabase.pl >@@ -157,7 +157,7 @@ if (C4::Context->preference("Version") < TransformToNum($DBversion)) { > > $DBversion = "3.00.00.006"; > if (C4::Context->preference("Version") < TransformToNum($DBversion)) { >- $dbh->do("UPDATE issues SET issuedate=timestamp WHERE issuedate='0000-00-00'"); >+ $dbh->do("UPDATE issues SET issuedate=timestamp WHERE issuedate=0"); > print "Upgrade to $DBversion done (filled issues.issuedate with timestamp)\n"; > SetVersion ($DBversion); > } >@@ -1955,7 +1955,7 @@ if (C4::Context->preference("Version") < TransformToNum($DBversion)) { > > print "Upgrade to $DBversion done (remove default '0000-00-00' in subscriptionhistory.enddate field)\n"; > $dbh->do("ALTER TABLE `subscriptionhistory` CHANGE `enddate` `enddate` DATE NULL DEFAULT NULL "); >- $dbh->do("UPDATE subscriptionhistory SET enddate=NULL WHERE enddate='0000-00-00'"); >+ $dbh->do("UPDATE subscriptionhistory SET enddate=NULL WHERE enddate=0"); > SetVersion ($DBversion); > } > >@@ -2909,7 +2909,7 @@ if (C4::Context->preference("Version") < TransformToNum($DBversion)) { > # match the new type of the corresponding field > $dbh->do('ALTER TABLE fundmapping modify column bookfundid varchar(30)'); > # System did not ensure budgetdate was valid historically >- $dbh->do(q|UPDATE fundmapping SET budgetdate = entrydate WHERE budgetdate = '0000-00-00' OR budgetdate IS NULL|); >+ $dbh->do(q|UPDATE fundmapping SET budgetdate = entrydate WHERE budgetdate = 0 OR budgetdate IS NULL|); > # We save the map in fundmapping in case you need later processing > $dbh->do(q|ALTER TABLE fundmapping add column aqbudgetid integer|); > # these can speed processing up >@@ -3632,7 +3632,7 @@ if (C4::Context->preference("Version") < TransformToNum($DBversion)) { > > $DBversion = "3.01.00.130"; > if (C4::Context->preference("Version") < TransformToNum($DBversion)) { >- $dbh->do("UPDATE reserves SET expirationdate = NULL WHERE expirationdate = '0000-00-00'"); >+ $dbh->do("UPDATE reserves SET expirationdate = NULL WHERE expirationdate = 0"); > print "Upgrade to $DBversion done (change reserves.expirationdate values of 0000-00-00 to NULL (bug 1532)\n"; > SetVersion ($DBversion); > } >@@ -4580,7 +4580,7 @@ if ( C4::Context->preference("Version") < TransformToNum($DBversion) ) { > > $DBversion = "3.07.00.002"; > if ( C4::Context->preference("Version") < TransformToNum($DBversion) ) { >- $dbh->do("UPDATE borrowers SET debarred=NULL WHERE debarred='0000-00-00';"); >+ $dbh->do("UPDATE borrowers SET debarred=NULL WHERE debarred=0;"); > print "Setting NULL to debarred where 0000-00-00 is stored (bug 7272)\n"; > SetVersion($DBversion); > } >@@ -7613,7 +7613,7 @@ if ( CheckVersion($DBversion) ) { > SELECT subscriptionid, startdate > FROM subscription > WHERE firstacquidate IS NULL >- OR firstacquidate = '0000-00-00' >+ OR firstacquidate = 0 > |); > $get_subscriptions_sth->execute; > while ( my ($subscriptionid, $startdate) = $get_subscriptions_sth->fetchrow ) { >@@ -10607,7 +10607,7 @@ if ( CheckVersion($DBversion) ) { > $dbh->do(q| > UPDATE aqorders SET orderstatus='cancelled' > WHERE (datecancellationprinted IS NOT NULL OR >- datecancellationprinted<>'0000-00-00'); >+ datecancellationprinted<>0); > |); > print "Upgrade to $DBversion done (Bug 13993: Correct orderstatus for transferred orders)\n"; > SetVersion($DBversion); >@@ -10833,16 +10833,16 @@ if ( CheckVersion($DBversion) ) { > $DBversion = "3.21.00.023"; > if ( CheckVersion($DBversion) ) { > $dbh->do(q{ >- UPDATE borrowers SET debarred=NULL WHERE debarred='0000-00-00' >+ UPDATE borrowers SET debarred=NULL WHERE debarred=0 > }); > $dbh->do(q{ >- UPDATE borrowers SET dateexpiry=NULL where dateexpiry='0000-00-00' >+ UPDATE borrowers SET dateexpiry=NULL where dateexpiry=0 > }); > $dbh->do(q{ >- UPDATE borrowers SET dateofbirth=NULL where dateofbirth='0000-00-00' >+ UPDATE borrowers SET dateofbirth=NULL where dateofbirth=0 > }); > $dbh->do(q{ >- UPDATE borrowers SET dateenrolled=NULL where dateenrolled='0000-00-00' >+ UPDATE borrowers SET dateenrolled=NULL where dateenrolled=0 > }); > print "Upgrade to $DBversion done (Bug 14717: Prevent 0000-00-00 dates in patron data)\n"; > SetVersion($DBversion); >-- >2.7.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 17320
: 55706 |
56819