Bug #20325 t/41bindparam.t: All parts of a PRIMARY KEY must be NOT NULL
Submitted: 7 Jun 2006 22:11 Modified: 19 Mar 2007 19:18
Reporter: Julian Ladisch Email Updates:
Status: Closed Impact on me:
None 
Category:Connectors: DBD::mysql ( Perl ) Severity:S3 (Non-critical)
Version:3.0004 OS:Linux (SLES 8)
Assigned to: Jim Winstead CPU Architecture:Any

[7 Jun 2006 22:11] Julian Ladisch
Description:
create table $table (a int, primary key (a))
in t/41bindparam.t line 51 and
in t/42bindparam.t line 48
fails because of bug #390.
These are the error messages:

t/41bindparam........DBD::mysql::db do failed: All parts of a PRIMARY KEY must be NOT NULL;  If you need NULL in a key, use UNIQUE instead at t/41bindparam.t line 50.
DBD::mysql::db do failed: All parts of a PRIMARY KEY must be NOT NULL;  If you need NULL in a key, use UNIQUE instead at t/41bindparam.t line 50.

t/42bindparam........DBD::mysql::db do failed: All parts of a PRIMARY KEY must be NOT NULL;  If you need NULL in a key, use UNIQUE instead at t/42bindparam.t line 47.
DBD::mysql::db do failed: All parts of a PRIMARY KEY must be NOT NULL;  If you need NULL in a key, use UNIQUE instead at t/42bindparam.t line 47.

How to repeat:
use a MySQL server before fix of bug #390, eg. 3.23.52 or 4.0.13.

perl -MCPAN -e shell
install Bundle::DBD::mysql

Installation fails because the invokation of "make test" fails.

3.23.52 is used in SLES8, SLES8 is supported until 30 Nov 2007:
http://support.novell.com/lifecycle/lcSearchResults.jsp?st=SUSE+LINUX+Enterprise+Server+8
Therefore it is reasonable to make DBD::mysql work with this old MySQL version.

Suggested fix:
replace
create table $table (a int, primary key (a))
by
create table $table (a int not null, primary key (a))
[19 Mar 2007 19:18] Jim Winstead
I've fixed this in the repository, so it will be fixed in 4.004. Note that we don't generally test with 3.23, so it is possible that additional problems like this will pop up in the test cases.