From b2df778fe5ea692b0175f67c9129f0283b6eeadc Mon Sep 17 00:00:00 2001 From: "olav%bkor.dhs.org" <> Date: Wed, 15 Nov 2006 01:17:36 +0000 Subject: Bug 321645: [MySQL 5] MySql Error on insert... "DBD::mysql::st execute failed: Field 'status_whiteboard' ".... Patch by Olav Vitters r=mkanat a=justdave --- Bugzilla/DB/Mysql.pm | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'Bugzilla') 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; } -- cgit v1.2.3-24-g4f1b