diff options
author | olav%bkor.dhs.org <> | 2006-11-15 02:17:36 +0100 |
---|---|---|
committer | olav%bkor.dhs.org <> | 2006-11-15 02:17:36 +0100 |
commit | b2df778fe5ea692b0175f67c9129f0283b6eeadc (patch) | |
tree | 7e5bacbe97b50958daabdc2bc07003f4a7f58419 /Bugzilla/DB | |
parent | 350158b2dea58146f8428561ddcb61fa34c8a47c (diff) | |
download | bugzilla-b2df778fe5ea692b0175f67c9129f0283b6eeadc.tar.gz bugzilla-b2df778fe5ea692b0175f67c9129f0283b6eeadc.tar.xz |
Bug 321645: [MySQL 5] MySql Error on insert... "DBD::mysql::st execute failed: Field 'status_whiteboard' "....
Patch by Olav Vitters <olav@bkor.dhs.org> r=mkanat a=justdave
Diffstat (limited to 'Bugzilla/DB')
-rw-r--r-- | Bugzilla/DB/Mysql.pm | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/Bugzilla/DB/Mysql.pm b/Bugzilla/DB/Mysql.pm index 2f23e8345..b3b1cba10 100644 --- a/Bugzilla/DB/Mysql.pm +++ b/Bugzilla/DB/Mysql.pm @@ -65,6 +65,18 @@ sub new { bless ($self, $class); + # Bug 321645 - disable MySQL strict mode, if set + my $sql_mode = $self->selectrow_array('SELECT @@sql_mode'); + if ($sql_mode) { + my $new_sql_mode = + join(",", grep {$_ !~ /^STRICT_(?:TRANS|ALL)_TABLES|TRADITIONAL$/} + split(/,/, $sql_mode)); + + if ($sql_mode ne $new_sql_mode) { + $self->do("SET SESSION sql_mode = ?", undef, $new_sql_mode); + } + } + return $self; } |