summaryrefslogtreecommitdiff
path: root/mysql-test/suite/gcol
diff options
context:
space:
mode:
authorMarko Mäkelä <marko.makela@oracle.com>2016-08-30 08:34:49 +0300
committerMarko Mäkelä <marko.makela@mariadb.com>2017-04-24 17:45:23 +0300
commit6f5f720848c867987407a15b0a91ba8052944fd4 (patch)
tree65d18ea9354d363baea2fe3fea4ccea3d28ad275 /mysql-test/suite/gcol
parent223eb5fb9a28c11898a3789515d37abe5dceb856 (diff)
downloadmariadb-git-6f5f720848c867987407a15b0a91ba8052944fd4.tar.gz
Bug#22018745 CORRUPTION IN ONLINE TABLE REBUILD (ROW_FORMAT=REDUNDANT, INDEXED VIRTUAL COLUMN)
Apparently, WL#8149 QA did not cover the code changes made to online table rebuild (which was introduced in MySQL 5.6.8 by WL#6255) for ROW_FORMAT=REDUNDANT tables. row_log_table_low_redundant(): Log the new values of indexed virtual columns (ventry) only once. row_log_table_low(): Assert that if o_ventry is specified, the logged operation must not be ROW_T_INSERT, and ventry must be specified as well. row_log_table_low(): When computing the size of old_pk, pass v_entry=NULL to rec_get_converted_size_temp(), to be consistent with the subsequent call to rec_convert_dtuple_to_temp() for logging old_pk. Assert that old_pk never contains information on virtual columns, thus proving that this change is a no-op. RB: 13822 Reviewed-by: Jimmy Yang <jimmy.yang@oracle.com>
Diffstat (limited to 'mysql-test/suite/gcol')
-rw-r--r--mysql-test/suite/gcol/r/innodb_virtual_debug.result30
-rw-r--r--mysql-test/suite/gcol/t/innodb_virtual_debug.test30
2 files changed, 60 insertions, 0 deletions
diff --git a/mysql-test/suite/gcol/r/innodb_virtual_debug.result b/mysql-test/suite/gcol/r/innodb_virtual_debug.result
index a80ec95a2ca..af220c7cd17 100644
--- a/mysql-test/suite/gcol/r/innodb_virtual_debug.result
+++ b/mysql-test/suite/gcol/r/innodb_virtual_debug.result
@@ -223,5 +223,35 @@ vbcol
11
ac
drop table ibstd_14;
+#
+# Bug#22018745 CORRUPTION IN ONLINE TABLE REBUILD
+# (ROW_FORMAT=REDUNDANT, INDEXED VIRTUAL COLUMN)
+#
+CREATE TABLE t (
+b char(5) PRIMARY KEY,
+v char(3) GENERATED ALWAYS AS (substr(b,1,3)) VIRTUAL, KEY(v)
+) ENGINE=InnoDB DEFAULT CHARSET=latin1 ROW_FORMAT=REDUNDANT;
+connection con1;
+SET DEBUG_SYNC='row_log_table_apply1_before SIGNAL prepared WAIT_FOR apply';
+OPTIMIZE TABLE t;
+connection default;
+SET DEBUG_SYNC='now WAIT_FOR prepared';
+INSERT INTO t SET b='fubar';
+BEGIN;
+DELETE FROM t;
+ROLLBACK;
+SET DEBUG_SYNC='now SIGNAL apply';
+connection con1;
+Table Op Msg_type Msg_text
+test.t optimize note Table does not support optimize, doing recreate + analyze instead
+test.t optimize status OK
+connection default;
+CHECK TABLE t;
+Table Op Msg_type Msg_text
+test.t check status OK
+SELECT * FROM t;
+b v
+fubar fub
+DROP TABLE t;
disconnect con1;
SET DEBUG_SYNC = 'RESET';
diff --git a/mysql-test/suite/gcol/t/innodb_virtual_debug.test b/mysql-test/suite/gcol/t/innodb_virtual_debug.test
index 72be27775ed..7ccf0fb8fc7 100644
--- a/mysql-test/suite/gcol/t/innodb_virtual_debug.test
+++ b/mysql-test/suite/gcol/t/innodb_virtual_debug.test
@@ -233,6 +233,36 @@ select vbcol from ibstd_14;
drop table ibstd_14;
+--echo #
+--echo # Bug#22018745 CORRUPTION IN ONLINE TABLE REBUILD
+--echo # (ROW_FORMAT=REDUNDANT, INDEXED VIRTUAL COLUMN)
+--echo #
+
+CREATE TABLE t (
+ b char(5) PRIMARY KEY,
+ v char(3) GENERATED ALWAYS AS (substr(b,1,3)) VIRTUAL, KEY(v)
+) ENGINE=InnoDB DEFAULT CHARSET=latin1 ROW_FORMAT=REDUNDANT;
+
+connection con1;
+SET DEBUG_SYNC='row_log_table_apply1_before SIGNAL prepared WAIT_FOR apply';
+--send OPTIMIZE TABLE t
+connection default;
+
+SET DEBUG_SYNC='now WAIT_FOR prepared';
+INSERT INTO t SET b='fubar';
+BEGIN;
+DELETE FROM t;
+ROLLBACK;
+SET DEBUG_SYNC='now SIGNAL apply';
+
+connection con1;
+reap;
+
+connection default;
+CHECK TABLE t;
+SELECT * FROM t;
+DROP TABLE t;
+
disconnect con1;
SET DEBUG_SYNC = 'RESET';