Subject: | Test Failure Under ANSI SQL Mode |
Date: | Fri, 15 Sep 2006 19:05:02 -0700 |
To: | bug-dbd-mysql [...] rt.cpan.org |
From: | "David E. Wheeler" <dwheeler [...] cpan.org> |
I have my MySQL server set up with the following configuration in /
etc/my.cnf:
sql-mode=ansi,strict_trans_tables
character-set-server=utf8
default-storage-engine=InnoDB
default-time-zone=utc
I believe that it is the ANSI SQL mode that is causing a test failure
in DBD::mysql:
t/40bindparam........DBD::mysql::db do failed: Unknown column '?' in
'field list' at t/40bindparam.t line 128.
The offending test is:
Test($state or $dbh->do("INSERT INTO $table VALUES (7, \"?\")"))
or DbiError($dbh->err, $dbh->errstr);
Of course, in ANSI-standard SQL, double-quotes are used only for
database objects (tables, columns, etc.), and cannot be used for
parameters.
Perhaps the test suite can use
SELECT @@global.sql_mode;
To detect that the server is using ANSI_QUOTES and skip that test if
it is?
Best,
David