Bugzilla – Attachment 94895 Details for
Bug 23805
Add a dedicated credit_types table
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 23805: (RM follow-up) updatedatabase.pl mariadb support
Bug-23805-RM-follow-up-updatedatabasepl-mariadb-su.patch (text/plain), 1.68 KB, created by
Martin Renvoize (ashimema)
on 2019-10-31 08:43:31 UTC
(
hide
)
Description:
Bug 23805: (RM follow-up) updatedatabase.pl mariadb support
Filename:
MIME Type:
Creator:
Martin Renvoize (ashimema)
Created:
2019-10-31 08:43:31 UTC
Size:
1.68 KB
patch
obsolete
>From 3b022ff77cbc234cf4f541904e1e5347ae96191e Mon Sep 17 00:00:00 2001 >From: Martin Renvoize <martin.renvoize@ptfs-europe.com> >Date: Mon, 28 Oct 2019 17:13:09 +0000 >Subject: [PATCH] Bug 23805: (RM follow-up) updatedatabase.pl mariadb support > >MySQL and MariaDB have different syntax when it comes to dropping a >CHECK constraint. > >Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> >--- > installer/data/mysql/updatedatabase.pl | 35 ++++++++++++++++++++------ > 1 file changed, 27 insertions(+), 8 deletions(-) > >diff --git a/installer/data/mysql/updatedatabase.pl b/installer/data/mysql/updatedatabase.pl >index a0c00b43fb..18b4d78488 100755 >--- a/installer/data/mysql/updatedatabase.pl >+++ b/installer/data/mysql/updatedatabase.pl >@@ -20011,14 +20011,33 @@ if ( CheckVersion($DBversion) ) { > } > > # Dropping the check constraint in accountlines >- $dbh->do( >- qq{ >- ALTER TABLE >- accountlines >- DROP CHECK >- `accountlines_check_type` >- } >- ); >+ my ($raise_error) = $dbh->{RaiseError}; >+ $dbh->{AutoCommit} = 0; >+ $dbh->{RaiseError} = 1; >+ eval { >+ # MariaDB Specific Drop >+ $dbh->do( >+ qq{ >+ ALTER TABLE >+ accountlines >+ DROP CONSTRAINT >+ `accountlines_check_type` >+ } >+ ); >+ }; >+ if ($@) { >+ # MySQL Specific Drop >+ $dbh->do( >+ qq{ >+ ALTER TABLE >+ accountlines >+ DROP CHECK >+ `accountlines_check_type` >+ } >+ ); >+ } >+ $dbh->{AutoCommit} = 1; >+ $dbh->{RaiseError} = $raise_error; > > # Update accountype 'C' to 'CREDIT' > $dbh->do( >-- >2.20.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 23805
:
94153
|
94154
|
94155
|
94156
|
94157
|
94158
|
94159
|
94160
|
94161
|
94162
|
94163
|
94164
|
94166
|
94167
|
94168
|
94169
|
94170
|
94171
|
94172
|
94173
|
94174
|
94175
|
94176
|
94177
|
94178
|
94801
|
94815
|
94832
| 94895