summaryrefslogtreecommitdiff
path: root/mysql-test
diff options
context:
space:
mode:
authorMarko Mäkelä <marko.makela@mariadb.com>2020-06-05 18:05:22 +0300
committerMarko Mäkelä <marko.makela@mariadb.com>2020-06-05 18:05:22 +0300
commit68d9d512e933a1d40670add50f205e5266bc5507 (patch)
tree24f483a40449b28b4414360fbdd03646315ac1ec /mysql-test
parent6404645980db51fdc1e5dae2ac94eca57804284b (diff)
parent286e52e948eee9e5f908c5944467149df35d25e7 (diff)
downloadmariadb-git-68d9d512e933a1d40670add50f205e5266bc5507.tar.gz
Merge 10.3 into 10.4
Diffstat (limited to 'mysql-test')
-rw-r--r--mysql-test/main/win.result45
-rw-r--r--mysql-test/main/win.test13
-rwxr-xr-xmysql-test/mysql-test-run.pl1
-rw-r--r--mysql-test/suite/innodb/r/xa_recovery.result11
-rw-r--r--mysql-test/suite/innodb/t/leaf_page_corrupted_during_recovery.test2
-rw-r--r--mysql-test/suite/innodb/t/xa_recovery.test13
-rw-r--r--mysql-test/suite/stress/r/misc.result9
-rw-r--r--mysql-test/suite/stress/t/misc.test32
-rw-r--r--mysql-test/suite/versioning/r/partition.result10
-rw-r--r--mysql-test/suite/versioning/t/partition.test17
10 files changed, 151 insertions, 2 deletions
diff --git a/mysql-test/main/win.result b/mysql-test/main/win.result
index f1628f43e8c..6ef3a10966a 100644
--- a/mysql-test/main/win.result
+++ b/mysql-test/main/win.result
@@ -3743,6 +3743,51 @@ a ROW_NUMBER() OVER v2
1 1
drop table t0;
#
+# MDEV-16230:Server crashes when Analyze format=json is run with a window function with
+# empty PARTITION BY and ORDER BY clauses
+#
+CREATE TABLE t1(a INT, b INT);
+INSERT INTO t1 VALUES (1,1),(2,2),(3,3);
+ANALYZE FORMAT=JSON SELECT row_number() OVER() FROM t1;
+ANALYZE
+{
+ "query_block": {
+ "select_id": 1,
+ "r_loops": 1,
+ "r_total_time_ms": "REPLACED",
+ "window_functions_computation": {
+ "sorts": {
+ "filesort": {
+ "sort_key": "`row_number() OVER()`",
+ "r_loops": 1,
+ "r_total_time_ms": "REPLACED",
+ "r_used_priority_queue": false,
+ "r_output_rows": 3,
+ "r_buffer_size": "REPLACED"
+ }
+ },
+ "temporary_table": {
+ "table": {
+ "table_name": "t1",
+ "access_type": "ALL",
+ "r_loops": 1,
+ "rows": 3,
+ "r_rows": 3,
+ "r_total_time_ms": "REPLACED",
+ "filtered": 100,
+ "r_filtered": 100
+ }
+ }
+ }
+ }
+}
+SELECT row_number() OVER() FROM t1;
+row_number() OVER()
+1
+2
+3
+DROP TABLE t1;
+#
# End of 10.2 tests
#
#
diff --git a/mysql-test/main/win.test b/mysql-test/main/win.test
index 2abfc6ce657..824c5f9fa56 100644
--- a/mysql-test/main/win.test
+++ b/mysql-test/main/win.test
@@ -2447,6 +2447,19 @@ WINDOW v2 AS ( PARTITION BY a ORDER BY a DESC );
drop table t0;
--echo #
+--echo # MDEV-16230:Server crashes when Analyze format=json is run with a window function with
+--echo # empty PARTITION BY and ORDER BY clauses
+--echo #
+
+CREATE TABLE t1(a INT, b INT);
+INSERT INTO t1 VALUES (1,1),(2,2),(3,3);
+
+--source include/analyze-format.inc
+ANALYZE FORMAT=JSON SELECT row_number() OVER() FROM t1;
+SELECT row_number() OVER() FROM t1;
+DROP TABLE t1;
+
+--echo #
--echo # End of 10.2 tests
--echo #
diff --git a/mysql-test/mysql-test-run.pl b/mysql-test/mysql-test-run.pl
index 495d5b664fb..afd07ec55ba 100755
--- a/mysql-test/mysql-test-run.pl
+++ b/mysql-test/mysql-test-run.pl
@@ -198,6 +198,7 @@ my @DEFAULT_SUITES= qw(
plugins-
roles-
rpl-
+ stress-
sys_vars-
sql_sequence-
unit-
diff --git a/mysql-test/suite/innodb/r/xa_recovery.result b/mysql-test/suite/innodb/r/xa_recovery.result
index b559de388e2..ed9f19b7eb3 100644
--- a/mysql-test/suite/innodb/r/xa_recovery.result
+++ b/mysql-test/suite/innodb/r/xa_recovery.result
@@ -5,12 +5,20 @@ XA START 'x';
UPDATE t1 set a=2;
XA END 'x';
XA PREPARE 'x';
+connect con2,localhost,root;
+CREATE TABLE t2 (a INT) ENGINE=InnoDB;
+XA START 'y';
+INSERT INTO t2 VALUES (1);
+XA END 'y';
+XA PREPARE 'y';
connection default;
# restart: --innodb-force-recovery=2
disconnect con1;
+disconnect con2;
connect con1,localhost,root;
SELECT * FROM t1 LOCK IN SHARE MODE;
connection default;
+DROP TABLE t2;
# restart
disconnect con1;
SET TRANSACTION ISOLATION LEVEL READ UNCOMMITTED;
@@ -22,3 +30,6 @@ SELECT * FROM t1;
a
1
DROP TABLE t1;
+SET GLOBAL innodb_fast_shutdown=0;
+# restart
+XA ROLLBACK 'y';
diff --git a/mysql-test/suite/innodb/t/leaf_page_corrupted_during_recovery.test b/mysql-test/suite/innodb/t/leaf_page_corrupted_during_recovery.test
index bd8784236b6..8943ee2352f 100644
--- a/mysql-test/suite/innodb/t/leaf_page_corrupted_during_recovery.test
+++ b/mysql-test/suite/innodb/t/leaf_page_corrupted_during_recovery.test
@@ -9,7 +9,7 @@ call mtr.add_suppression("\\[ERROR\\] InnoDB: Plugin initialization aborted at s
call mtr.add_suppression("\\[ERROR\\] Plugin 'InnoDB' (init function|registration)");
call mtr.add_suppression("\\[ERROR\\] InnoDB: We detected index corruption");
call mtr.add_suppression("\\[ERROR\\] mysqld.*: Index for table 't1' is corrupt; try to repair it");
-call mtr.add_suppression("InnoDB: Error code: [0-9][0-9][0-9]* btr_pcur_open_low level: 0 called from file: ");
+call mtr.add_suppression("InnoDB: btr_pcur_open_low level: 0 called from file: ");
--enable_query_log
CREATE TABLE t1 (pk INT PRIMARY KEY, c CHAR(255))ENGINE=InnoDB STATS_PERSISTENT=0;
diff --git a/mysql-test/suite/innodb/t/xa_recovery.test b/mysql-test/suite/innodb/t/xa_recovery.test
index 20bb52c22f2..bb8e3316860 100644
--- a/mysql-test/suite/innodb/t/xa_recovery.test
+++ b/mysql-test/suite/innodb/t/xa_recovery.test
@@ -5,7 +5,7 @@
# MDEV-8841 - close tables opened by previous tests,
# so they don't get marked crashed when the server gets crashed
--disable_query_log
-call mtr.add_suppression("Found 1 prepared XA transactions");
+call mtr.add_suppression("Found [12] prepared XA transactions");
FLUSH TABLES;
--enable_query_log
@@ -13,6 +13,9 @@ CREATE TABLE t1 (a INT) ENGINE=InnoDB;
INSERT INTO t1 VALUES (1);
connect (con1,localhost,root);
XA START 'x'; UPDATE t1 set a=2; XA END 'x'; XA PREPARE 'x';
+connect (con2,localhost,root);
+CREATE TABLE t2 (a INT) ENGINE=InnoDB;
+XA START 'y'; INSERT INTO t2 VALUES (1); XA END 'y'; XA PREPARE 'y';
connection default;
# innodb_force_recovery=2 prevents the purge and tests that the fix of
@@ -25,6 +28,7 @@ connection default;
--let $shutdown_timeout=
disconnect con1;
+disconnect con2;
connect (con1,localhost,root);
--send SELECT * FROM t1 LOCK IN SHARE MODE
@@ -35,6 +39,8 @@ let $wait_condition=
info = 'SELECT * FROM t1 LOCK IN SHARE MODE';
--source include/wait_condition.inc
+DROP TABLE t2;
+
--source include/restart_mysqld.inc
disconnect con1;
@@ -45,3 +51,8 @@ XA ROLLBACK 'x';
SELECT * FROM t1;
DROP TABLE t1;
+
+SET GLOBAL innodb_fast_shutdown=0;
+--source include/restart_mysqld.inc
+
+XA ROLLBACK 'y';
diff --git a/mysql-test/suite/stress/r/misc.result b/mysql-test/suite/stress/r/misc.result
new file mode 100644
index 00000000000..6d0a3ea5050
--- /dev/null
+++ b/mysql-test/suite/stress/r/misc.result
@@ -0,0 +1,9 @@
+#
+# MDEV-22339 - Assertion `str_length < len' failed in
+# Binary_string::realloc_raw
+#
+CREATE TABLE t1(a INT) ENGINE=MyISAM;
+connect con1, localhost, root;
+disconnect con1;
+connection default;
+DROP TABLE t1;
diff --git a/mysql-test/suite/stress/t/misc.test b/mysql-test/suite/stress/t/misc.test
new file mode 100644
index 00000000000..e8255cb3a81
--- /dev/null
+++ b/mysql-test/suite/stress/t/misc.test
@@ -0,0 +1,32 @@
+--echo #
+--echo # MDEV-22339 - Assertion `str_length < len' failed in
+--echo # Binary_string::realloc_raw
+--echo #
+CREATE TABLE t1(a INT) ENGINE=MyISAM;
+connect con1, localhost, root;
+let $i=1000;
+disable_query_log;
+disable_result_log;
+while ($i)
+{
+ connection default;
+ HANDLER t1 OPEN;
+ send SELECT * FROM t1, t1 t1a1over8, t1 t1a2over8, t1 t1a3over8, t1 t1a4over8, t1 t1a5over8, t1 t1a6over8;
+
+ connection con1;
+ send REPAIR TABLE t1;
+
+ connection default;
+ reap;
+ HANDLER t1 CLOSE;
+
+ connection con1;
+ reap;
+ dec $i;
+}
+enable_query_log;
+enable_result_log;
+disconnect con1;
+
+connection default;
+DROP TABLE t1;
diff --git a/mysql-test/suite/versioning/r/partition.result b/mysql-test/suite/versioning/r/partition.result
index 2e66fb2ba9b..9e25dc6910b 100644
--- a/mysql-test/suite/versioning/r/partition.result
+++ b/mysql-test/suite/versioning/r/partition.result
@@ -681,6 +681,16 @@ delete from v1;
ERROR HY000: Table 't1' was locked with a READ lock and can't be updated
drop view v1;
drop table t1;
+#
+# MDEV-22112 Assertion `tab_part_info->part_type == RANGE_PARTITION || tab_part_info->part_type == LIST_PARTITION' failed in prep_alter_part_table
+#
+create table t1 (a int) with system versioning partition by system_time;
+ERROR HY000: For SYSTEM_TIME partitions each partition must be defined
+create table t1 (a int) with system versioning partition by system_time
+(partition p1 history, partition pn current);
+alter table t1 add partition (partition p2);
+ERROR HY000: Wrong partitioning type, expected type: `SYSTEM_TIME`
+drop table t1;
# End of 10.3 tests
#
# MDEV-22283 Server crashes in key_copy or unexpected error 156: The table already existed in the storage engine
diff --git a/mysql-test/suite/versioning/t/partition.test b/mysql-test/suite/versioning/t/partition.test
index 5fcd1d6ecfb..03d396b5e6c 100644
--- a/mysql-test/suite/versioning/t/partition.test
+++ b/mysql-test/suite/versioning/t/partition.test
@@ -626,6 +626,23 @@ delete from v1;
drop view v1;
drop table t1;
+--echo #
+--echo # MDEV-22112 Assertion `tab_part_info->part_type == RANGE_PARTITION || tab_part_info->part_type == LIST_PARTITION' failed in prep_alter_part_table
+--echo #
+
+### TMP: Please remove this error check in 10.5 (MDEV-19903)
+--error ER_PARTITIONS_MUST_BE_DEFINED_ERROR
+create table t1 (a int) with system versioning partition by system_time;
+### TMP end
+
+create table t1 (a int) with system versioning partition by system_time
+(partition p1 history, partition pn current);
+--error ER_PARTITION_WRONG_TYPE
+alter table t1 add partition (partition p2);
+
+# Cleanup
+drop table t1;
+
--echo # End of 10.3 tests
--echo #