mirror of
https://github.com/MariaDB/server.git
synced 2025-01-16 03:52:35 +01:00
MDEV-16703: Update AUTO_INCREMENT in the UPDATE statement
Currently RocksDB engine doesn't update AUTO_INCREMENT in the UPDATE statement. For example, CREATE TABLE t1 (pk INT AUTO_INCREMENT, a INT, PRIMARY KEY(pk)) ENGINE=RocksDB; INSERT INTO t1 (a) VALUES (1); UPDATE t1 SET pk = 3; ==> AUTO_INCREMENT should be updated to 4. Without this fix, it hits the Assertion `dd_val >= last_val' failed in myrocks::ha_rocksdb::load_auto_incr_value_from_index.
This commit is contained in:
parent
c43d11b96e
commit
f7154242b8
3 changed files with 19 additions and 1 deletions
|
@ -9553,7 +9553,7 @@ int ha_rocksdb::update_pk(const Rdb_key_def &kd,
|
|||
}
|
||||
}
|
||||
|
||||
if (table->next_number_field) {
|
||||
if (table->found_next_number_field) {
|
||||
update_auto_incr_val_from_field();
|
||||
}
|
||||
|
||||
|
|
|
@ -150,3 +150,11 @@ CREATE TABLE t0(c0 BLOB) ENGINE=ROCKSDB;
|
|||
INSERT INTO t0 VALUES(0);
|
||||
ALTER TABLE t0 AUTO_INCREMENT=0;
|
||||
DROP TABLE t0;
|
||||
#---------------------------------------------------------------
|
||||
# MDEV-16703 Assertion failed in load_auto_incr_value_from_index
|
||||
#---------------------------------------------------------------
|
||||
CREATE TABLE t1 (pk INT AUTO_INCREMENT, a INT, PRIMARY KEY(pk)) ENGINE=RocksDB;
|
||||
INSERT INTO t1 (a) VALUES (1);
|
||||
UPDATE t1 SET pk = 3;
|
||||
ALTER TABLE t1 AUTO_INCREMENT 2;
|
||||
DROP TABLE t1;
|
||||
|
|
|
@ -116,3 +116,13 @@ CREATE TABLE t0(c0 BLOB) ENGINE=ROCKSDB;
|
|||
INSERT INTO t0 VALUES(0);
|
||||
ALTER TABLE t0 AUTO_INCREMENT=0;
|
||||
DROP TABLE t0;
|
||||
|
||||
--echo #---------------------------------------------------------------
|
||||
--echo # MDEV-16703 Assertion failed in load_auto_incr_value_from_index
|
||||
--echo #---------------------------------------------------------------
|
||||
|
||||
CREATE TABLE t1 (pk INT AUTO_INCREMENT, a INT, PRIMARY KEY(pk)) ENGINE=RocksDB;
|
||||
INSERT INTO t1 (a) VALUES (1);
|
||||
UPDATE t1 SET pk = 3;
|
||||
ALTER TABLE t1 AUTO_INCREMENT 2;
|
||||
DROP TABLE t1;
|
||||
|
|
Loading…
Reference in a new issue