summaryrefslogtreecommitdiffstats
path: root/mysql-test/suite/versioning
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-13 12:33:02 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-13 12:33:02 +0000
commit4fa488fb0159c629483b7994aa84e73926b132b9 (patch)
tree182a19db69cdcb92be54cc6a5b0b9bfab28f80fd /mysql-test/suite/versioning
parentAdding debian version 1:10.11.6-2. (diff)
downloadmariadb-4fa488fb0159c629483b7994aa84e73926b132b9.tar.xz
mariadb-4fa488fb0159c629483b7994aa84e73926b132b9.zip
Merging upstream version 1:10.11.7.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'mysql-test/suite/versioning')
-rw-r--r--mysql-test/suite/versioning/r/alter.result64
-rw-r--r--mysql-test/suite/versioning/r/delete_history.result4
-rw-r--r--mysql-test/suite/versioning/r/select.result11
-rw-r--r--mysql-test/suite/versioning/t/alter.test67
-rw-r--r--mysql-test/suite/versioning/t/delete_history.test4
-rw-r--r--mysql-test/suite/versioning/t/select.test12
6 files changed, 156 insertions, 6 deletions
diff --git a/mysql-test/suite/versioning/r/alter.result b/mysql-test/suite/versioning/r/alter.result
index 9751f7c7..b3c342fd 100644
--- a/mysql-test/suite/versioning/r/alter.result
+++ b/mysql-test/suite/versioning/r/alter.result
@@ -787,6 +787,68 @@ modify row_start varchar(8);
ERROR HY000: PERIOD FOR SYSTEM_TIME must use columns `row_start` and `row_end`
drop table t1;
#
+# MDEV-20545 Assertion (col.vers_sys_end()) upon inplace ALTER with virtual columns
+#
+create table t1 (
+a int,
+va int as (a) virtual,
+b int,
+vb int as (b) virtual,
+c int,
+vc int as (c) virtual,
+d int,
+e int,
+index(va)
+) engine=innodb with system versioning;
+replace into t1 () values (),();
+set statement system_versioning_alter_history=keep for alter table t1 drop e;
+alter table t1 algorithm=inplace, drop system versioning;
+drop table t1;
+#
+# MDEV-20765 Assertion (type.vers_sys_end()) upon inplace ALTER with virtual columns
+#
+create table t1 (
+a int,
+b int as (a) virtual,
+c int,
+d int as (c) virtual,
+e int,
+f int as (e) virtual,
+g int,
+h int,
+i int,
+index(d),
+key(h),
+foreign key (g) references t1 (h)
+) engine=innodb with system versioning;
+set system_versioning_alter_history= keep;
+alter table t1 drop column i;
+insert into t1 (g,h) values (1,1);
+drop table t1;
+#
+# MDEV-29034 Assertion (o->ind == vers_start) upon inplace ALTER with virtual columns
+#
+create table b (
+pk integer auto_increment,
+col_int_key integer,
+col_varchar_key varchar(1),
+o bit, n bit,
+h float as ( n + 2 ) virtual,
+v bit,
+primary key (pk),
+key (col_varchar_key, col_int_key)
+) engine = innodb;
+set `system_versioning_alter_history`= keep;
+alter table `b` add system versioning;
+alter table `b` add column if not exists ( w bit, v serial );
+Warnings:
+Note 1060 Duplicate column name 'v'
+alter table `b` add column if not exists ( p bit );
+drop table `b`;
+#
+# End of 10.4 tests
+#
+#
# MDEV-21941 RENAME doesn't work for system time or period fields
#
create or replace table t1 (a int) with system versioning;
@@ -809,4 +871,6 @@ t1 CREATE TABLE `t1` (
PERIOD FOR SYSTEM_TIME (`x`, `y`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci WITH SYSTEM VERSIONING
drop table t1;
+#
# End of 10.5 tests
+#
diff --git a/mysql-test/suite/versioning/r/delete_history.result b/mysql-test/suite/versioning/r/delete_history.result
index 4e8c6f8b..d2ebcd72 100644
--- a/mysql-test/suite/versioning/r/delete_history.result
+++ b/mysql-test/suite/versioning/r/delete_history.result
@@ -193,7 +193,7 @@ drop table t1;
# MDEV-25004 Missing row in FTS_DOC_ID_INDEX during DELETE HISTORY
#
create table t1 (a integer, c0 varchar(255), fulltext key (c0))
-with system versioning engine innodb;
+with system versioning engine innodb stats_persistent=0;
set system_versioning_alter_history= keep;
alter table t1 drop system versioning;
alter table t1 add system versioning;
@@ -203,7 +203,7 @@ InnoDB 0 transactions not purged
delete history from t1;
drop table t1;
create table t1 (id int primary key, ftx varchar(255))
-with system versioning engine innodb;
+with system versioning engine innodb stats_persistent=0;
insert into t1 values (1, 'c');
delete from t1;
alter table t1 add fulltext key(ftx);
diff --git a/mysql-test/suite/versioning/r/select.result b/mysql-test/suite/versioning/r/select.result
index 90c99d1b..714455b6 100644
--- a/mysql-test/suite/versioning/r/select.result
+++ b/mysql-test/suite/versioning/r/select.result
@@ -443,7 +443,7 @@ create or replace table t1 (x int) with system versioning;
select * from t1 for system_time as of current_timestamp;
x
select * from t1 for system_time as of now;
-ERROR 42S22: Unknown column 'now' in 'FOR SYSTEM_TIME'
+ERROR HY000: Illegal parameter data type now for operation 'FOR SYSTEM_TIME'
### Issue #405, NATURAL JOIN failure
create or replace table t1 (a int) with system versioning;
create or replace table t2 (b int);
@@ -708,3 +708,12 @@ No A B C D
33 1 1 1 1
34 1 1 1 1
SET GLOBAL innodb_stats_persistent = @saved_stats_persistent;
+#
+# MDEV-32082 Server crash in find_field_in_table
+#
+create table t0 (c0 int) with system versioning;
+select x0 from (
+select c0 x0 from t0
+) for system_time as of nowasdf deriv;
+ERROR HY000: Illegal parameter data type nowasdf for operation 'FOR SYSTEM_TIME'
+drop table t0;
diff --git a/mysql-test/suite/versioning/t/alter.test b/mysql-test/suite/versioning/t/alter.test
index 61653550..44f52ddf 100644
--- a/mysql-test/suite/versioning/t/alter.test
+++ b/mysql-test/suite/versioning/t/alter.test
@@ -680,6 +680,71 @@ alter table t1
# cleanup
drop table t1;
+--echo #
+--echo # MDEV-20545 Assertion (col.vers_sys_end()) upon inplace ALTER with virtual columns
+--echo #
+create table t1 (
+ a int,
+ va int as (a) virtual,
+ b int,
+ vb int as (b) virtual,
+ c int,
+ vc int as (c) virtual,
+ d int,
+ e int,
+ index(va)
+) engine=innodb with system versioning;
+replace into t1 () values (),();
+set statement system_versioning_alter_history=keep for alter table t1 drop e;
+alter table t1 algorithm=inplace, drop system versioning;
+# cleanup
+drop table t1;
+
+--echo #
+--echo # MDEV-20765 Assertion (type.vers_sys_end()) upon inplace ALTER with virtual columns
+--echo #
+create table t1 (
+ a int,
+ b int as (a) virtual,
+ c int,
+ d int as (c) virtual,
+ e int,
+ f int as (e) virtual,
+ g int,
+ h int,
+ i int,
+ index(d),
+ key(h),
+ foreign key (g) references t1 (h)
+) engine=innodb with system versioning;
+set system_versioning_alter_history= keep;
+alter table t1 drop column i;
+insert into t1 (g,h) values (1,1);
+# cleanup
+drop table t1;
+
+--echo #
+--echo # MDEV-29034 Assertion (o->ind == vers_start) upon inplace ALTER with virtual columns
+--echo #
+create table b (
+ pk integer auto_increment,
+ col_int_key integer,
+ col_varchar_key varchar(1),
+ o bit, n bit,
+ h float as ( n + 2 ) virtual,
+ v bit,
+ primary key (pk),
+ key (col_varchar_key, col_int_key)
+) engine = innodb;
+set `system_versioning_alter_history`= keep;
+alter table `b` add system versioning;
+alter table `b` add column if not exists ( w bit, v serial );
+alter table `b` add column if not exists ( p bit );
+drop table `b`;
+
+--echo #
+--echo # End of 10.4 tests
+--echo #
--echo #
--echo # MDEV-21941 RENAME doesn't work for system time or period fields
@@ -702,4 +767,6 @@ show create table t1;
# cleanup
drop table t1;
+--echo #
--echo # End of 10.5 tests
+--echo #
diff --git a/mysql-test/suite/versioning/t/delete_history.test b/mysql-test/suite/versioning/t/delete_history.test
index f82fe9bd..66c28568 100644
--- a/mysql-test/suite/versioning/t/delete_history.test
+++ b/mysql-test/suite/versioning/t/delete_history.test
@@ -195,7 +195,7 @@ drop table t1;
--echo # MDEV-25004 Missing row in FTS_DOC_ID_INDEX during DELETE HISTORY
--echo #
create table t1 (a integer, c0 varchar(255), fulltext key (c0))
-with system versioning engine innodb;
+with system versioning engine innodb stats_persistent=0;
set system_versioning_alter_history= keep;
alter table t1 drop system versioning;
alter table t1 add system versioning;
@@ -206,7 +206,7 @@ delete history from t1;
drop table t1;
create table t1 (id int primary key, ftx varchar(255))
-with system versioning engine innodb;
+with system versioning engine innodb stats_persistent=0;
insert into t1 values (1, 'c');
delete from t1;
alter table t1 add fulltext key(ftx);
diff --git a/mysql-test/suite/versioning/t/select.test b/mysql-test/suite/versioning/t/select.test
index 9142a8fa..5603d1a3 100644
--- a/mysql-test/suite/versioning/t/select.test
+++ b/mysql-test/suite/versioning/t/select.test
@@ -314,7 +314,7 @@ select * from t1 where (a, 2) in ((1, 1), (2, 2)) and b = 1;
--echo ### Issue #398, NOW is now non-magic
create or replace table t1 (x int) with system versioning;
select * from t1 for system_time as of current_timestamp;
---error ER_BAD_FIELD_ERROR
+--error ER_ILLEGAL_PARAMETER_DATA_TYPE_FOR_OPERATION
select * from t1 for system_time as of now;
--echo ### Issue #405, NATURAL JOIN failure
@@ -487,4 +487,14 @@ call verify_trt_dummy(34);
SET GLOBAL innodb_stats_persistent = @saved_stats_persistent;
+--echo #
+--echo # MDEV-32082 Server crash in find_field_in_table
+--echo #
+create table t0 (c0 int) with system versioning;
+--error ER_ILLEGAL_PARAMETER_DATA_TYPE_FOR_OPERATION
+select x0 from (
+ select c0 x0 from t0
+) for system_time as of nowasdf deriv;
+drop table t0;
+
-- source suite/versioning/common_finish.inc