summaryrefslogtreecommitdiff
path: root/mysql-test/suite
diff options
context:
space:
mode:
authorSergei Golubchik <serg@mariadb.org>2019-05-13 14:19:10 +0200
committerSergei Golubchik <serg@mariadb.org>2019-05-17 13:53:22 +0200
commite506bef430c3648f88469d42631136080db9f332 (patch)
tree3c6672521b7116262e4bdc6453b8af3a4f5cc9ae /mysql-test/suite
parent43623f04a98263301b302961be092a0244494ec3 (diff)
downloadmariadb-git-e506bef430c3648f88469d42631136080db9f332.tar.gz
MDEV-15458 Segfault in heap_scan() upon UPDATE after ADD SYSTEM VERSIONING
* Versioning tests support Closes #1043
Diffstat (limited to 'mysql-test/suite')
-rw-r--r--mysql-test/suite/versioning/common.inc4
-rw-r--r--mysql-test/suite/versioning/engines.combinations3
-rw-r--r--mysql-test/suite/versioning/r/create.result3
-rw-r--r--mysql-test/suite/versioning/r/rpl.result6
-rw-r--r--mysql-test/suite/versioning/r/update-big.result25
-rw-r--r--mysql-test/suite/versioning/t/create.test2
-rw-r--r--mysql-test/suite/versioning/t/rpl.test6
-rw-r--r--mysql-test/suite/versioning/t/update-big.test34
8 files changed, 74 insertions, 9 deletions
diff --git a/mysql-test/suite/versioning/common.inc b/mysql-test/suite/versioning/common.inc
index 137480e1f62..bf31cd38771 100644
--- a/mysql-test/suite/versioning/common.inc
+++ b/mysql-test/suite/versioning/common.inc
@@ -46,6 +46,10 @@ if ($MTR_COMBINATION_MYISAM)
{
--let $MTR_COMBINATION_TIMESTAMP= 1
}
+if ($MTR_COMBINATION_HEAP)
+{
+ --let $MTR_COMBINATION_TIMESTAMP= 1
+}
if ($MTR_COMBINATION_TRX_ID)
{
let $sys_datatype_expl= bigint(20) unsigned;
diff --git a/mysql-test/suite/versioning/engines.combinations b/mysql-test/suite/versioning/engines.combinations
index 561c5656929..26b5bab23f1 100644
--- a/mysql-test/suite/versioning/engines.combinations
+++ b/mysql-test/suite/versioning/engines.combinations
@@ -6,3 +6,6 @@ default-storage-engine=innodb
[myisam]
default-storage-engine=myisam
+
+[heap]
+default-storage-engine=memory
diff --git a/mysql-test/suite/versioning/r/create.result b/mysql-test/suite/versioning/r/create.result
index 9c77859ffce..6cacdd1fd54 100644
--- a/mysql-test/suite/versioning/r/create.result
+++ b/mysql-test/suite/versioning/r/create.result
@@ -13,14 +13,13 @@ t1 CREATE TABLE `t1` (
`Sys_end` SYS_DATATYPE GENERATED ALWAYS AS ROW END INVISIBLE COMMENT 'end',
PERIOD FOR SYSTEM_TIME (`Sys_start`, `Sys_end`)
) ENGINE=DEFAULT_ENGINE DEFAULT CHARSET=latin1 WITH SYSTEM VERSIONING
-select table_catalog,table_schema,table_name,table_type,version,table_rows,avg_row_length,data_free,auto_increment,check_time,table_collation,checksum,create_options,table_comment from information_schema.tables where table_name='t1';
+select table_catalog,table_schema,table_name,table_type,version,table_rows,data_free,auto_increment,check_time,table_collation,checksum,create_options,table_comment from information_schema.tables where table_name='t1';
table_catalog def
table_schema test
table_name t1
table_type SYSTEM VERSIONED
version 10
table_rows 0
-avg_row_length 0
data_free 0
auto_increment NULL
check_time NULL
diff --git a/mysql-test/suite/versioning/r/rpl.result b/mysql-test/suite/versioning/r/rpl.result
index fd62a65f473..627f3991499 100644
--- a/mysql-test/suite/versioning/r/rpl.result
+++ b/mysql-test/suite/versioning/r/rpl.result
@@ -128,7 +128,7 @@ Table Create Table
t1 CREATE TABLE `t1` (
`a` int(11) DEFAULT NULL,
`b` int(11) DEFAULT NULL
-) ENGINE=INNODB_OR_MYISAM DEFAULT CHARSET=latin1 WITH SYSTEM VERSIONING
+) ENGINE=ENGINE DEFAULT CHARSET=latin1 WITH SYSTEM VERSIONING
## Case 2: ERROR on the master, it'll fail on the master, the slave won't see it
connection master;
set system_versioning_alter_history= ERROR;
@@ -140,7 +140,7 @@ Table Create Table
t1 CREATE TABLE `t1` (
`a` int(11) DEFAULT NULL,
`b` int(11) DEFAULT NULL
-) ENGINE=INNODB_OR_MYISAM DEFAULT CHARSET=latin1 WITH SYSTEM VERSIONING
+) ENGINE=ENGINE DEFAULT CHARSET=latin1 WITH SYSTEM VERSIONING
## Case 3: table is not versioned on the master, ALTER will work on the slave
connection master;
create or replace table t1 (a int);
@@ -154,7 +154,7 @@ Table Create Table
t1 CREATE TABLE `t1` (
`a` int(11) DEFAULT NULL,
`b` int(11) DEFAULT NULL
-) ENGINE=INNODB_OR_MYISAM DEFAULT CHARSET=latin1 WITH SYSTEM VERSIONING
+) ENGINE=ENGINE DEFAULT CHARSET=latin1 WITH SYSTEM VERSIONING
connection master;
drop table t1, t2;
create table t1 (i int) with system versioning partition by system_time limit 8 ( partition p1 history, partition p2 history, partition pn current );
diff --git a/mysql-test/suite/versioning/r/update-big.result b/mysql-test/suite/versioning/r/update-big.result
new file mode 100644
index 00000000000..89297fe5d89
--- /dev/null
+++ b/mysql-test/suite/versioning/r/update-big.result
@@ -0,0 +1,25 @@
+#
+# MDEV-15458 Segfault in heap_scan() upon UPDATE after ADD SYSTEM VERSIONING
+#
+create or replace table t1 (a int);
+insert into t1 values (1),(2),(3),(4),(5),(6),(7),(8);
+insert into t1 select * from t1;
+insert into t1 select * from t1;
+insert into t1 select * from t1;
+insert into t1 select * from t1;
+insert into t1 select * from t1;
+insert into t1 select * from t1;
+insert into t1 select * from t1;
+insert into t1 select * from t1;
+insert into t1 select * from t1;
+connect con1,localhost,root,,test;
+alter table t1 add system versioning;
+connection default;
+update t1 set a= 7 where a = 3;
+update t1 set a= 2 where a = 7;
+update t1 set a= 5 where a = 2;
+update t1 set a= 1 where a = 5;
+update t1 set a= 8 where a = 1;
+update t1 set a= 4 where a = 8;
+update t1 set a= 6;
+drop table t1;
diff --git a/mysql-test/suite/versioning/t/create.test b/mysql-test/suite/versioning/t/create.test
index 81dd3cdb2c2..7c7be3e02e3 100644
--- a/mysql-test/suite/versioning/t/create.test
+++ b/mysql-test/suite/versioning/t/create.test
@@ -15,7 +15,7 @@ eval create table t1 (
--replace_result $default_engine DEFAULT_ENGINE $sys_datatype_expl SYS_DATATYPE
show create table t1;
---query_vertical select table_catalog,table_schema,table_name,table_type,version,table_rows,avg_row_length,data_free,auto_increment,check_time,table_collation,checksum,create_options,table_comment from information_schema.tables where table_name='t1'
+--query_vertical select table_catalog,table_schema,table_name,table_type,version,table_rows,data_free,auto_increment,check_time,table_collation,checksum,create_options,table_comment from information_schema.tables where table_name='t1'
--query_vertical select table_catalog,table_schema,table_name,column_name,ordinal_position,column_default,character_maximum_length,character_octet_length,character_set_name,collation_name,column_key,extra,column_comment,is_generated,generation_expression from information_schema.columns where table_name='t1'
--echo # Implicit fields test
diff --git a/mysql-test/suite/versioning/t/rpl.test b/mysql-test/suite/versioning/t/rpl.test
index e59d41c38a3..b5be68feece 100644
--- a/mysql-test/suite/versioning/t/rpl.test
+++ b/mysql-test/suite/versioning/t/rpl.test
@@ -96,7 +96,7 @@ create or replace table t1 (a int) with system versioning;
set system_versioning_alter_history= KEEP;
alter table t1 add column b int;
sync_slave_with_master;
---replace_result InnoDB INNODB_OR_MYISAM MyISAM INNODB_OR_MYISAM
+--replace_result InnoDB ENGINE MyISAM ENGINE MEMORY ENGINE
show create table t1;
--echo ## Case 2: ERROR on the master, it'll fail on the master, the slave won't see it
@@ -105,7 +105,7 @@ set system_versioning_alter_history= ERROR;
--error ER_VERS_ALTER_NOT_ALLOWED
alter table t1 drop column b;
sync_slave_with_master;
---replace_result InnoDB INNODB_OR_MYISAM MyISAM INNODB_OR_MYISAM
+--replace_result InnoDB ENGINE MyISAM ENGINE MEMORY ENGINE
show create table t1;
--echo ## Case 3: table is not versioned on the master, ALTER will work on the slave
@@ -116,7 +116,7 @@ create or replace table t1 (a int) with system versioning;
connection master;
alter table t1 add column b int;
sync_slave_with_master;
---replace_result InnoDB INNODB_OR_MYISAM MyISAM INNODB_OR_MYISAM
+--replace_result InnoDB ENGINE MyISAM ENGINE MEMORY ENGINE
show create table t1;
connection master;
diff --git a/mysql-test/suite/versioning/t/update-big.test b/mysql-test/suite/versioning/t/update-big.test
new file mode 100644
index 00000000000..175bfc79a48
--- /dev/null
+++ b/mysql-test/suite/versioning/t/update-big.test
@@ -0,0 +1,34 @@
+source include/big_test.inc;
+source suite/versioning/engines.inc;
+source suite/versioning/common.inc;
+
+--echo #
+--echo # MDEV-15458 Segfault in heap_scan() upon UPDATE after ADD SYSTEM VERSIONING
+--echo #
+create or replace table t1 (a int);
+insert into t1 values (1),(2),(3),(4),(5),(6),(7),(8);
+insert into t1 select * from t1;
+insert into t1 select * from t1;
+insert into t1 select * from t1;
+insert into t1 select * from t1;
+insert into t1 select * from t1;
+insert into t1 select * from t1;
+insert into t1 select * from t1;
+insert into t1 select * from t1;
+insert into t1 select * from t1;
+
+--connect (con1,localhost,root,,test)
+alter table t1 add system versioning;
+
+--connection default
+update t1 set a= 7 where a = 3;
+update t1 set a= 2 where a = 7;
+update t1 set a= 5 where a = 2;
+update t1 set a= 1 where a = 5;
+update t1 set a= 8 where a = 1;
+update t1 set a= 4 where a = 8;
+update t1 set a= 6;
+
+drop table t1;
+
+source suite/versioning/common_finish.inc;