summaryrefslogtreecommitdiffstats
path: root/Bugzilla
diff options
context:
space:
mode:
authorVishant Gautam <gautamvishant@gmail.com>2014-09-15 18:04:29 +0200
committerFrédéric Buclin <LpSolit@gmail.com>2014-09-15 18:04:29 +0200
commitcfb4ad901f1acc08d65f4972393b2308cf509d31 (patch)
treeb30efa9f72f34067eb5a7284995a40b50f2bd1c8 /Bugzilla
parent84ec7f6938e6c44e617bb3b2669281e21d5c198a (diff)
downloadbugzilla-cfb4ad901f1acc08d65f4972393b2308cf509d31.tar.gz
bugzilla-cfb4ad901f1acc08d65f4972393b2308cf509d31.tar.xz
Bug 252555: Remove the ANSI mode when running MySQL
r=LpSolit a=sgreen
Diffstat (limited to 'Bugzilla')
-rw-r--r--Bugzilla/DB/Mysql.pm7
1 files changed, 4 insertions, 3 deletions
diff --git a/Bugzilla/DB/Mysql.pm b/Bugzilla/DB/Mysql.pm
index f03c827b3..02cc8bc10 100644
--- a/Bugzilla/DB/Mysql.pm
+++ b/Bugzilla/DB/Mysql.pm
@@ -86,17 +86,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) {