diff options
author | Robin H. Johnson <robbat2@orbis-terrarum.net> | 2014-10-06 09:25:42 -0700 |
---|---|---|
committer | Robin H. Johnson <robbat2@orbis-terrarum.net> | 2014-10-06 09:25:42 -0700 |
commit | cfa43fe21c342c5a7517edf0eae02a94404d4909 (patch) | |
tree | 5879d063f22533c17aba89114bc1305e23cd2161 /Bugzilla/DB/Mysql.pm | |
parent | Ignore the master config. (diff) | |
parent | Merge tag 'bugzilla-4.4.6' into upstream (diff) | |
download | bugzilla-cfa43fe21c342c5a7517edf0eae02a94404d4909.tar.gz bugzilla-cfa43fe21c342c5a7517edf0eae02a94404d4909.tar.bz2 bugzilla-cfa43fe21c342c5a7517edf0eae02a94404d4909.zip |
Merge branch 'upstream', takes 4.4.6 fixesgentoo-4.4.6
Conflicts:
.gitignore
Bugzilla/Constants.pm
docs/bugzilla.ent.tmpl
template/en/default/pages/release-notes.html.tmpl
Diffstat (limited to 'Bugzilla/DB/Mysql.pm')
-rw-r--r-- | Bugzilla/DB/Mysql.pm | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/Bugzilla/DB/Mysql.pm b/Bugzilla/DB/Mysql.pm index c7ce1927a..dc93b7406 100644 --- a/Bugzilla/DB/Mysql.pm +++ b/Bugzilla/DB/Mysql.pm @@ -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) { |