Skip Menu |

This queue is for tickets about the DBD-mysql CPAN distribution.

Report information
The Basics
Id: 83487
Status: resolved
Priority: 0/
Queue: DBD-mysql

People
Owner: Nobody in particular
Requestors: sveta.smirnova [...] oracle.com
Cc:
AdminCc:

Bug Information
Severity: Normal
Broken in: 4.010
Fixed in: (no value)



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.
Thanks, I fixed this by setting the values explicitly in session variables here: https://github.com/perl5-dbi/DBD-mysql/commit/3c50975599bbfa5afcdfc691b6d45b5a63c0f70d On Wed Feb 20 17:05:37 2013, svetasmirnova wrote: Show quoted text
> 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.