diff options
author | Marko Mäkelä <marko.makela@mariadb.com> | 2018-10-17 18:55:46 +0300 |
---|---|---|
committer | Marko Mäkelä <marko.makela@mariadb.com> | 2018-10-17 18:55:46 +0300 |
commit | 2fa4ed031ce6cc6370671058ccc3d119b8cb3d91 (patch) | |
tree | 8b584229d69f9f07e6516d7fc532b323469e21f0 /mysql-test | |
parent | c2c1550f57bf61e60b778dc889be132cca176ff3 (diff) | |
download | mariadb-git-2fa4ed031ce6cc6370671058ccc3d119b8cb3d91.tar.gz |
MDEV-17483 Insert on delete-marked record can wrongly inherit old values for instantly added column
row_ins_clust_index_entry_low(): Do not call dtuple_t::trim()
before row_ins_clust_index_entry_by_modify(), so that the values
of all columns will be available in row_upd_build_difference_binary().
If applicable, the tuple can be trimmed in btr_cur_optimistic_update()
or btr_cur_pessimistic_update(), which will be called by
row_ins_clust_index_entry_by_modify().
Diffstat (limited to 'mysql-test')
-rw-r--r-- | mysql-test/suite/innodb/r/instant_alter.result | 47 | ||||
-rw-r--r-- | mysql-test/suite/innodb/t/instant_alter.test | 18 |
2 files changed, 64 insertions, 1 deletions
diff --git a/mysql-test/suite/innodb/r/instant_alter.result b/mysql-test/suite/innodb/r/instant_alter.result index 2f56d0eca4f..3ebc161caf1 100644 --- a/mysql-test/suite/innodb/r/instant_alter.result +++ b/mysql-test/suite/innodb/r/instant_alter.result @@ -471,6 +471,21 @@ Table Op Msg_type Msg_text test.t2 check status OK test.t1 check status OK DROP TABLE t2, t1; +CREATE TABLE t1 (a INT PRIMARY KEY) ENGINE=InnoDB ROW_FORMAT=REDUNDANT; +INSERT INTO t1 SET a = 1; +ALTER TABLE t1 ADD COLUMN b TEXT; +BEGIN; +UPDATE t1 SET b = REPEAT('1', 32768); +UPDATE t1 SET a = 2; +INSERT INTO t1 SET a = 1; +SELECT a,LENGTH(b) FROM t1; +a LENGTH(b) +1 NULL +2 32768 +DELETE FROM t1; +COMMIT; +InnoDB 0 transactions not purged +DROP TABLE t1; CREATE TABLE t1 (id INT PRIMARY KEY, c2 INT UNIQUE, c3 POINT NOT NULL DEFAULT ST_GeomFromText('POINT(3 4)'), @@ -888,6 +903,21 @@ Table Op Msg_type Msg_text test.t2 check status OK test.t1 check status OK DROP TABLE t2, t1; +CREATE TABLE t1 (a INT PRIMARY KEY) ENGINE=InnoDB ROW_FORMAT=COMPACT; +INSERT INTO t1 SET a = 1; +ALTER TABLE t1 ADD COLUMN b TEXT; +BEGIN; +UPDATE t1 SET b = REPEAT('1', 32768); +UPDATE t1 SET a = 2; +INSERT INTO t1 SET a = 1; +SELECT a,LENGTH(b) FROM t1; +a LENGTH(b) +1 NULL +2 32768 +DELETE FROM t1; +COMMIT; +InnoDB 0 transactions not purged +DROP TABLE t1; CREATE TABLE t1 (id INT PRIMARY KEY, c2 INT UNIQUE, c3 POINT NOT NULL DEFAULT ST_GeomFromText('POINT(3 4)'), @@ -1305,10 +1335,25 @@ Table Op Msg_type Msg_text test.t2 check status OK test.t1 check status OK DROP TABLE t2, t1; +CREATE TABLE t1 (a INT PRIMARY KEY) ENGINE=InnoDB ROW_FORMAT=DYNAMIC; +INSERT INTO t1 SET a = 1; +ALTER TABLE t1 ADD COLUMN b TEXT; +BEGIN; +UPDATE t1 SET b = REPEAT('1', 32768); +UPDATE t1 SET a = 2; +INSERT INTO t1 SET a = 1; +SELECT a,LENGTH(b) FROM t1; +a LENGTH(b) +1 NULL +2 32768 +DELETE FROM t1; +COMMIT; +InnoDB 0 transactions not purged +DROP TABLE t1; disconnect analyze; SELECT variable_value-@old_instant instants FROM information_schema.global_status WHERE variable_name = 'innodb_instant_alter_column'; instants -48 +51 SET GLOBAL innodb_purge_rseg_truncate_frequency= @saved_frequency; diff --git a/mysql-test/suite/innodb/t/instant_alter.test b/mysql-test/suite/innodb/t/instant_alter.test index 720e495e3a7..3e62038e591 100644 --- a/mysql-test/suite/innodb/t/instant_alter.test +++ b/mysql-test/suite/innodb/t/instant_alter.test @@ -343,6 +343,24 @@ DEFAULT REPEAT('a', @@GLOBAL.innodb_page_size * .75); CHECK TABLE t2, t1; DROP TABLE t2, t1; +# +# MDEV-17483 Insert on delete-marked record can wrongly inherit old values +# for instantly added column +# + +eval CREATE TABLE t1 (a INT PRIMARY KEY) $engine; +INSERT INTO t1 SET a = 1; +ALTER TABLE t1 ADD COLUMN b TEXT; +BEGIN; +UPDATE t1 SET b = REPEAT('1', 32768); +UPDATE t1 SET a = 2; +INSERT INTO t1 SET a = 1; +SELECT a,LENGTH(b) FROM t1; +DELETE FROM t1; +COMMIT; +--source include/wait_all_purged.inc +DROP TABLE t1; + dec $format; } disconnect analyze; |