Bugzilla – Attachment 81388 Details for
Bug 21613
Turn strict SQL modes on for tests
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 21613: Turn strict SQL modes on for tests
Bug-21613-Turn-strict-SQL-modes-on-for-tests.patch (text/plain), 1.88 KB, created by
Katrin Fischer
on 2018-10-28 09:58:43 UTC
(
hide
)
Description:
Bug 21613: Turn strict SQL modes on for tests
Filename:
MIME Type:
Creator:
Katrin Fischer
Created:
2018-10-28 09:58:43 UTC
Size:
1.88 KB
patch
obsolete
>From d98f66d9bd6d83839bfe488dc259d83d6168abb5 Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Thu, 18 Oct 2018 20:06:07 -0300 >Subject: [PATCH] Bug 21613: Turn strict SQL modes on for tests > >This patch will turn the strict SQL modes on When tests are ran with prove. > >Test plan: >- Apply the first patch >- prove t/db_dependent/Koha/Database.t >=> Will pass if you have <strict_sql_modes>1</strict_sql_modes> in your >koha-conf.xml >=> Will fail otherwise >- Apply the second patch >- prove t/db_dependent/Koha/Database.t >=> Will pass whatever the value of strict_sql_modes in your >koha-conf.xml > >Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> > >Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> >--- > Koha/Database.pm | 6 +++--- > 1 file changed, 3 insertions(+), 3 deletions(-) > >diff --git a/Koha/Database.pm b/Koha/Database.pm >index 56ffc46488..1da498fee4 100644 >--- a/Koha/Database.pm >+++ b/Koha/Database.pm >@@ -76,10 +76,10 @@ sub _new_schema { > %encoding_attr = ( mysql_enable_utf8 => 1 ); > $encoding_query = "set NAMES 'utf8mb4'"; > $tz_query = qq(SET time_zone = "$tz") if $tz; >- unless ( C4::Context->config('strict_sql_modes') ) { >- $sql_mode_query = q{SET sql_mode = 'IGNORE_SPACE,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION'}; >- } else { >+ if ( $ENV{_} =~ m|prove| or C4::Context->config('strict_sql_modes') ) { > $sql_mode_query = q{SET sql_mode = 'ONLY_FULL_GROUP_BY,STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION'}; >+ } else { >+ $sql_mode_query = q{SET sql_mode = 'IGNORE_SPACE,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION'}; > } > } > elsif ( $db_driver eq 'Pg' ) { >-- >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 21613
:
80887
|
80888
|
80896
|
80897
|
80904
|
80936
|
80937
|
81387
| 81388 |
81389
|
81390