Commit 52683755 authored by unknown's avatar unknown
Browse files

A fix and test case for bug#5510 "inserting Null in AutoIncrement primary

key Column Fails".


mysql-test/r/ps.result:
  Test results updated: a test case for Bug#5510 "inserting Null in 
  AutoIncrement primary key Column Fails".
mysql-test/r/ps_2myisam.result:
  Bug#5510: a different warning in case of NULL->default truncation.This is 
  OK, the new warning is the same as produced by conventional execution.
mysql-test/r/ps_3innodb.result:
  Bug#5510: a different warning in case of NULL->default truncation.This is 
  OK, the new warning is the same as produced by conventional execution.
mysql-test/r/ps_4heap.result:
  Bug#5510: a different warning in case of NULL->default truncation.This is 
  OK, the new warning is the same as produced by conventional execution.
mysql-test/r/ps_5merge.result:
  Bug#5510: a different warning in case of NULL->default truncation.This is 
  OK, the new warning is the same as produced by conventional execution.
mysql-test/r/ps_6bdb.result:
  Bug#5510: a different warning in case of NULL->default truncation.This is 
  OK, the new warning is the same as produced by conventional execution.
mysql-test/t/ps.test:
  A test case for Bug#5510 "inserting Null in AutoIncrement primary key Column 
  Fails".
sql/item.cc:
  A fix for bug#5510 "inserting Null in AutoIncrement primary key Column 
  Fails": use proper Field API function for NULL placholeders.
parent ca65afeb
Loading
Loading
Loading
Loading
+19 −0
Original line number Diff line number Diff line
@@ -270,3 +270,22 @@ execute stmt using @var;
a
deallocate prepare stmt;
drop table t1;
create table t1 (a bigint(20) not null primary key auto_increment);
insert into t1 (a) values (null);
select * from t1;
a
1
prepare stmt from "insert into t1 (a) values (?)";
set @var=null;
execute stmt using @var;
select * from t1;
a
1
2
drop table t1;
create table t1 (a timestamp not null);
prepare stmt from "insert into t1 (a) values (?)";
execute stmt using @var;
select * from t1;
deallocate prepare stmt;
drop table t1;
+1 −1
Original line number Diff line number Diff line
@@ -1015,7 +1015,7 @@ set @arg00=NULL;
set @arg01=2;
execute stmt1 using @arg00, @arg01;
Warnings:
Warning	1265	Data truncated for column 'a' at row 1
Warning	1263	Data truncated; NULL supplied to NOT NULL column 'a' at row 1
select a,b from t1;
a	b
1	one
+1 −1
Original line number Diff line number Diff line
@@ -1015,7 +1015,7 @@ set @arg00=NULL;
set @arg01=2;
execute stmt1 using @arg00, @arg01;
Warnings:
Warning	1265	Data truncated for column 'a' at row 1
Warning	1263	Data truncated; NULL supplied to NOT NULL column 'a' at row 1
select a,b from t1;
a	b
0	two
+1 −1
Original line number Diff line number Diff line
@@ -1016,7 +1016,7 @@ set @arg00=NULL;
set @arg01=2;
execute stmt1 using @arg00, @arg01;
Warnings:
Warning	1265	Data truncated for column 'a' at row 1
Warning	1263	Data truncated; NULL supplied to NOT NULL column 'a' at row 1
select a,b from t1;
a	b
1	one
+2 −2
Original line number Diff line number Diff line
@@ -1058,7 +1058,7 @@ set @arg00=NULL;
set @arg01=2;
execute stmt1 using @arg00, @arg01;
Warnings:
Warning	1265	Data truncated for column 'a' at row 1
Warning	1263	Data truncated; NULL supplied to NOT NULL column 'a' at row 1
select a,b from t1;
a	b
3	three
@@ -2253,7 +2253,7 @@ set @arg00=NULL;
set @arg01=2;
execute stmt1 using @arg00, @arg01;
Warnings:
Warning	1265	Data truncated for column 'a' at row 1
Warning	1263	Data truncated; NULL supplied to NOT NULL column 'a' at row 1
select a,b from t1;
a	b
3	three
Loading