1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-30 16:24:05 +03:00

Changed last_insert_id() to be unsigned.

Fixed MDEV-331: last_insert_id() returns a signed number

mysql-test/r/auto_increment.result:
  Added test case
mysql-test/t/auto_increment.test:
  Added test case
sql/item_func.h:
  Changed last_insert_id() to be unsigned.
This commit is contained in:
Michael Widenius
2012-06-08 22:12:44 +03:00
parent cb6109cde1
commit 438e9eca68
3 changed files with 39 additions and 0 deletions

View File

@ -516,3 +516,25 @@ pk
1
18446744073709551614
DROP TABLE t1;
CREATE TABLE t1 (pk BIGINT UNSIGNED AUTO_INCREMENT, PRIMARY KEY (pk));
insert into t1 values((1<<63)+1);
insert into t1 values(null);
select last_insert_id();
last_insert_id()
9223372036854775810
select * from t1;
pk
9223372036854775809
9223372036854775810
drop table t1;
CREATE TABLE t1 (pk BIGINT AUTO_INCREMENT, PRIMARY KEY (pk));
insert into t1 values(-5);
insert into t1 values(null);
select last_insert_id();
last_insert_id()
1
select * from t1;
pk
-5
1
drop table t1;