diff options
author | Michael Widenius <monty@askmonty.org> | 2012-06-08 22:12:44 +0300 |
---|---|---|
committer | Michael Widenius <monty@askmonty.org> | 2012-06-08 22:12:44 +0300 |
commit | 438e9eca68c45e3e735ed21dfaccaf29b0ca16b1 (patch) | |
tree | 0342d0af4f883d07465996d361059d4585a16f5b /mysql-test/t | |
parent | cb6109cde188b5e018f2169e43bb08ac2bc3e68f (diff) | |
download | mariadb-git-438e9eca68c45e3e735ed21dfaccaf29b0ca16b1.tar.gz |
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.
Diffstat (limited to 'mysql-test/t')
-rw-r--r-- | mysql-test/t/auto_increment.test | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/mysql-test/t/auto_increment.test b/mysql-test/t/auto_increment.test index 2854f503034..884e0fabb5e 100644 --- a/mysql-test/t/auto_increment.test +++ b/mysql-test/t/auto_increment.test @@ -380,3 +380,19 @@ CREATE TABLE t1 (pk BIGINT UNSIGNED AUTO_INCREMENT, PRIMARY KEY (pk)); INSERT INTO t1 VALUES (NULL), (18446744073709551615-1), (NULL); SELECT * FROM t1; DROP TABLE t1; + +# MDEV-331 last_insert_id() returns a signed number +# Check that last_insert_id() generates a signed value +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(); +select * from t1; +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(); +select * from t1; +drop table t1; |