diff options
author | Vishant Gautam <gautamvishant@gmail.com> | 2014-09-15 18:06:23 +0200 |
---|---|---|
committer | Frédéric Buclin <LpSolit@gmail.com> | 2014-09-15 18:06:23 +0200 |
commit | e9f5fda21dbf517408609bb2d1ded1a9b2bf190e (patch) | |
tree | df30927297f61d1c29ec63bafd662527482ec950 | |
parent | Bug 1036242: "TypeError: bug_status is undefined" when creating a bug (diff) | |
download | bugzilla-e9f5fda21dbf517408609bb2d1ded1a9b2bf190e.tar.gz bugzilla-e9f5fda21dbf517408609bb2d1ded1a9b2bf190e.tar.bz2 bugzilla-e9f5fda21dbf517408609bb2d1ded1a9b2bf190e.zip |
Bug 252555: Remove the ANSI mode when running MySQL
r=LpSolit a=sgreen
-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) { |