]> git.ipfire.org Git - thirdparty/bugzilla.git/commitdiff
Bug 252555: Remove the ANSI mode when running MySQL
authorVishant Gautam <gautamvishant@gmail.com>
Mon, 15 Sep 2014 16:06:23 +0000 (18:06 +0200)
committerFrédéric Buclin <LpSolit@gmail.com>
Mon, 15 Sep 2014 16:06:23 +0000 (18:06 +0200)
r=LpSolit a=sgreen

Bugzilla/DB/Mysql.pm

index c7ce1927a15637a1cf8b5073a2b091e4b71275ee..dc93b740615a497ca8a040bb2cb95a6f8efbc6d7 100644 (file)
@@ -70,17 +70,18 @@ sub new {
     $self->{private_bz_dsn} = $dsn;
 
     bless ($self, $class);
-    
-    # Bug 321645 - disable MySQL strict mode, if set
+
+    # Check for MySQL modes.
     my ($var, $sql_mode) = $self->selectrow_array(
         "SHOW VARIABLES LIKE 'sql\\_mode'");
 
+    # Disable ANSI and strict modes, else Bugzilla will crash.
     if ($sql_mode) {
         # STRICT_TRANS_TABLE or STRICT_ALL_TABLES enable MySQL strict mode,
         # causing bug 321645. TRADITIONAL sets these modes (among others) as
         # well, so it has to be stipped as well
         my $new_sql_mode =
-            join(",", grep {$_ !~ /^STRICT_(?:TRANS|ALL)_TABLES|TRADITIONAL$/}
+            join(",", grep {$_ !~ /^(?:ANSI|STRICT_(?:TRANS|ALL)_TABLES|TRADITIONAL)$/}
                             split(/,/, $sql_mode));
 
         if ($sql_mode ne $new_sql_mode) {