Subject: | t/31insertid.t and t/40bindparam2.t do not properly handle auto_increment_offset |
Originally reported by Ian Barton at http://bugs.mysql.com/bug.php?id=40960
Description:
Tests 31insertid.t and 40bindparam2.t are failing because they presume
the first value assigned to an AUTOINCREMENT primary-key column will
always be 1. This behavior is not true when the database has been
configured with a value for the auto_increment_offset parameter in
/etc/my.cnf.
The module is being built for Perl 5.10.0 on Mac OS X Leopard (10.5.5).
The behavior is identical on a MacBook Pro and a Mac Mini.
How to repeat:
On the host that runs the database to be used for testing, add the
following lines to the [mysqld] section of /etc/my.cnf
auto_increment_increment = 3
auto_increment_offset = 2
--or--
auto_increment_increment = 3
auto_increment_offset = 4
Suggested fix:
40bindparam2.t can be made to pass by changing line 46 to be:
ok ($sth->bind_param(2, $dbh->{mysql_insertid}, SQL_INTEGER()));
However, it appears that the only way to get 31insertid.t to pass right
now is to skip test 6 (line 42) altogether. It would appear that there
is currently no way to query the host to determine the value of
auto_increment_offset.