diff options
author | Alexey Botchkov <holyfoot@askmonty.org> | 2021-10-20 14:53:01 +0400 |
---|---|---|
committer | Alexey Botchkov <holyfoot@askmonty.org> | 2021-10-26 00:29:27 +0400 |
commit | efedf3da68aa0c0a70e0686d9b92c9d0924df098 (patch) | |
tree | a6772efd4a6f8901993d9c10020b7b251f3523e6 /mysql-test | |
parent | d627d00b13ab2f2c0954ea7b77202470cb102944 (diff) | |
download | mariadb-git-efedf3da68aa0c0a70e0686d9b92c9d0924df098.tar.gz |
MDEV-22711 Assertion `nr != 0' failed in handler::update_auto_increment.bb-10.2-mdev-22711-hf
DBUG_ASSERT removed as the AUTO INCREMENT can actually be 0 when the
SET insert_id= 0; was done.
Diffstat (limited to 'mysql-test')
-rw-r--r-- | mysql-test/suite/sys_vars/r/insert_id_func.result | 25 | ||||
-rw-r--r-- | mysql-test/suite/sys_vars/t/insert_id_func.test | 20 |
2 files changed, 45 insertions, 0 deletions
diff --git a/mysql-test/suite/sys_vars/r/insert_id_func.result b/mysql-test/suite/sys_vars/r/insert_id_func.result index 6a5746e130d..e4486cd5acf 100644 --- a/mysql-test/suite/sys_vars/r/insert_id_func.result +++ b/mysql-test/suite/sys_vars/r/insert_id_func.result @@ -69,3 +69,28 @@ id name drop table t1; disconnect test_con1; disconnect test_con2; +connection default; +CREATE TABLE t1(id int primary key auto_increment); +SET SESSION insert_id=123; +SET SESSION insert_id=0; +INSERT INTO t1 VALUES (); +SET SESSION insert_id=123; +SET SESSION insert_id=default; +INSERT INTO t1 VALUES (); +SET SESSION insert_id=123; +SET SESSION insert_id=-1; +Warnings: +Warning 1292 Truncated incorrect insert_id value: '-1' +INSERT INTO t1 VALUES (); +SET SESSION insert_id=123; +SET SESSION insert_id=-10; +Warnings: +Warning 1292 Truncated incorrect insert_id value: '-10' +INSERT INTO t1 VALUES (); +SELECT * FROM t1; +id +1 +2 +3 +4 +DROP TABLE t1; diff --git a/mysql-test/suite/sys_vars/t/insert_id_func.test b/mysql-test/suite/sys_vars/t/insert_id_func.test index a710afbb0cc..feb510c091b 100644 --- a/mysql-test/suite/sys_vars/t/insert_id_func.test +++ b/mysql-test/suite/sys_vars/t/insert_id_func.test @@ -103,3 +103,23 @@ drop table t1; disconnect test_con1; disconnect test_con2; + +# MDEV-22711 Assertion `nr != 0' failed in handler::update_auto_increment. +# +connection default; +CREATE TABLE t1(id int primary key auto_increment); +SET SESSION insert_id=123; +SET SESSION insert_id=0; +INSERT INTO t1 VALUES (); +SET SESSION insert_id=123; +SET SESSION insert_id=default; +INSERT INTO t1 VALUES (); +SET SESSION insert_id=123; +SET SESSION insert_id=-1; +INSERT INTO t1 VALUES (); +SET SESSION insert_id=123; +SET SESSION insert_id=-10; +INSERT INTO t1 VALUES (); +SELECT * FROM t1; +DROP TABLE t1; + |