Bugzilla – Attachment 81529 Details for
Bug 21682
Stock Rotation: Update DB is failing with strict_sql_modes ON
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 21682: Follow up to use the default_exists check
Bug-21682-Follow-up-to-use-the-defaultexists-check.patch (text/plain), 1.40 KB, created by
Mark Tompsett
on 2018-10-29 17:15:04 UTC
(
hide
)
Description:
Bug 21682: Follow up to use the default_exists check
Filename:
MIME Type:
Creator:
Mark Tompsett
Created:
2018-10-29 17:15:04 UTC
Size:
1.40 KB
patch
obsolete
>From 9a6b6895a59d7bfc80910263b6c4cbb99a1d3741 Mon Sep 17 00:00:00 2001 >From: Mark Tompsett <mtompset@hotmail.com> >Date: Mon, 29 Oct 2018 17:10:01 +0000 >Subject: [PATCH] Bug 21682: Follow up to use the default_exists check > >This will make sure it is idempotent, and avoid issues if the DB has >already been corrected either through upgrade or manually before. >--- > installer/data/mysql/atomicupdate/bug_21682.perl | 6 +++++- > 1 file changed, 5 insertions(+), 1 deletion(-) > >diff --git a/installer/data/mysql/atomicupdate/bug_21682.perl b/installer/data/mysql/atomicupdate/bug_21682.perl >index 16eeb3d80b..69ce30587e 100644 >--- a/installer/data/mysql/atomicupdate/bug_21682.perl >+++ b/installer/data/mysql/atomicupdate/bug_21682.perl >@@ -1,6 +1,10 @@ > $DBversion = 'XXX'; # will be replaced by the RM > if( CheckVersion( $DBversion ) ) { >- $dbh->do( "ALTER TABLE `stockrotationrotas` ALTER COLUMN `description` DROP DEFAULT" ); >+ # people upgrading their MySQL/MariaDB will have already had the DB forcibly fixed, >+ # but for those who have not, and there is a sql strict mode issue, this will fix it. >+ if ( default_exists( 'stockrotationrotas', 'description' ) ) { >+ $dbh->do( "ALTER TABLE `stockrotationrotas` ALTER COLUMN `description` DROP DEFAULT" ); >+ } > > SetVersion( $DBversion ); > print "Upgrade to $DBversion done (Bug 21682 - Remove default on stockrotationrotas.description )\n"; >-- >2.11.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 21682
:
81280
|
81347
|
81348
|
81525
|
81526
|
81527
|
81528
|
81529
|
81769
|
81770
|
81787
|
81788
|
81815