summaryrefslogtreecommitdiff
path: root/mysql-test
diff options
context:
space:
mode:
Diffstat (limited to 'mysql-test')
-rw-r--r--mysql-test/lib/My/SafeProcess/wsrep_check_version.c21
-rw-r--r--mysql-test/main/long_unique_bugs.result5
-rw-r--r--mysql-test/main/long_unique_bugs.test23
-rw-r--r--mysql-test/main/parser.result10
-rw-r--r--mysql-test/main/parser.test10
-rw-r--r--mysql-test/suite/innodb/r/instant_alter_bugs.result9
-rw-r--r--mysql-test/suite/innodb/r/instant_alter_debug.result24
-rw-r--r--mysql-test/suite/innodb/t/instant_alter_bugs.test10
-rw-r--r--mysql-test/suite/innodb/t/instant_alter_debug.test26
-rw-r--r--mysql-test/suite/versioning/r/sysvars.result16
-rw-r--r--mysql-test/suite/versioning/t/sysvars.test16
-rw-r--r--mysql-test/suite/wsrep/r/MDEV-20625.result5
-rw-r--r--mysql-test/suite/wsrep/t/MDEV-20625.cnf8
-rw-r--r--mysql-test/suite/wsrep/t/MDEV-20625.test10
14 files changed, 188 insertions, 5 deletions
diff --git a/mysql-test/lib/My/SafeProcess/wsrep_check_version.c b/mysql-test/lib/My/SafeProcess/wsrep_check_version.c
index 616548d4f2d..91098be882a 100644
--- a/mysql-test/lib/My/SafeProcess/wsrep_check_version.c
+++ b/mysql-test/lib/My/SafeProcess/wsrep_check_version.c
@@ -1,5 +1,4 @@
-/* Copyright (c) 2009, 2019, MariaDB
-
+/*
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; version 2 of the License.
@@ -86,12 +85,24 @@ int main(int argc, char **argv)
int rc = EINVAL;
void *dlh;
wsrep_loader_fun dlfun;
+ const char *provider= getenv("WSREP_PROVIDER");
- if (!(dlh = dlopen(getenv("WSREP_PROVIDER"), RTLD_NOW | RTLD_LOCAL))) {
- goto err;
+ if (!provider)
+ {
+ fprintf(stderr, "WSREP_PROVIDER is not set\n");
+ return 1;
+ }
+ if (!(dlh = dlopen(provider, RTLD_NOW | RTLD_LOCAL)))
+ {
+ fprintf(stderr, "Can't open WSREP_PROVIDER (%s) library, error: %s\n",
+ provider, dlerror());
+ goto err;
}
- if (!(dlfun = wsrep_dlf(dlh, "wsrep_loader"))) {
+ if (!(dlfun = wsrep_dlf(dlh, "wsrep_loader")))
+ {
+ fprintf(stderr, "Can't find 'wsrep_loader' symbol in %s\n",
+ provider);
goto err;
}
diff --git a/mysql-test/main/long_unique_bugs.result b/mysql-test/main/long_unique_bugs.result
index 33496c4e20d..9aca32c24eb 100644
--- a/mysql-test/main/long_unique_bugs.result
+++ b/mysql-test/main/long_unique_bugs.result
@@ -265,3 +265,8 @@ ERROR 40001: Deadlock found when trying to get lock; try restarting transaction
disconnect con1;
connection default;
DROP TABLE t1, t2;
+CREATE TABLE t1 (a TEXT, UNIQUE(a)) ENGINE=Aria;
+ERROR 42000: Specified key was too long; max key length is 2000 bytes
+create table t1(a int, unique(a) using hash);
+#BULK insert > 100 rows (MI_MIN_ROWS_TO_DISABLE_INDEXES)
+drop table t1;
diff --git a/mysql-test/main/long_unique_bugs.test b/mysql-test/main/long_unique_bugs.test
index dc78f6c7067..13a4e1367a0 100644
--- a/mysql-test/main/long_unique_bugs.test
+++ b/mysql-test/main/long_unique_bugs.test
@@ -317,3 +317,26 @@ INSERT IGNORE INTO t1 VALUES (4, 1)/*4*/;
--disconnect con1
--connection default
DROP TABLE t1, t2;
+
+#
+# MDEV-18791 Wrong error upon creating Aria table with long index on BLOB
+#
+--error ER_TOO_LONG_KEY
+CREATE TABLE t1 (a TEXT, UNIQUE(a)) ENGINE=Aria;
+
+#
+# MDEV-20001 Potential dangerous regression: INSERT INTO >=100 rows fail for myisam table with HASH indexes
+#
+create table t1(a int, unique(a) using hash);
+--let $count=150
+--let insert_stmt= insert into t1 values(200)
+while ($count)
+{
+ --let $insert_stmt=$insert_stmt,($count)
+ --dec $count
+}
+--disable_query_log
+--echo #BULK insert > 100 rows (MI_MIN_ROWS_TO_DISABLE_INDEXES)
+--eval $insert_stmt
+--enable_query_log
+drop table t1;
diff --git a/mysql-test/main/parser.result b/mysql-test/main/parser.result
index fa40ffa6942..6c895f0b184 100644
--- a/mysql-test/main/parser.result
+++ b/mysql-test/main/parser.result
@@ -1797,6 +1797,16 @@ select * from t2;
ERROR HY000: Table 't2' was not locked with LOCK TABLES
SET STATEMENT max_statement_time=900 FOR unlock tables;
drop table t1, t2;
+#
+# MDEV-21616: Server crash when using
+# "SET STATEMENT max_statement_time=0 FOR desc xxx" lead to collapse
+#
+create table t1 (a int);
+SET STATEMENT max_statement_time=0 FOR desc t1;
+Field Type Null Key Default Extra
+a int(11) YES NULL
+drop table t1;
+SET STATEMENT max_statement_time=0 FOR do 1;
# End of 10.4 tests
#
# Start of 10.5 tests
diff --git a/mysql-test/main/parser.test b/mysql-test/main/parser.test
index 006f409e6b7..7fe870722a2 100644
--- a/mysql-test/main/parser.test
+++ b/mysql-test/main/parser.test
@@ -1565,6 +1565,16 @@ select * from t2;
SET STATEMENT max_statement_time=900 FOR unlock tables;
drop table t1, t2;
+--echo #
+--echo # MDEV-21616: Server crash when using
+--echo # "SET STATEMENT max_statement_time=0 FOR desc xxx" lead to collapse
+--echo #
+
+create table t1 (a int);
+SET STATEMENT max_statement_time=0 FOR desc t1;
+drop table t1;
+SET STATEMENT max_statement_time=0 FOR do 1;
+
--echo # End of 10.4 tests
diff --git a/mysql-test/suite/innodb/r/instant_alter_bugs.result b/mysql-test/suite/innodb/r/instant_alter_bugs.result
index 4512542f612..53f2d4f1c60 100644
--- a/mysql-test/suite/innodb/r/instant_alter_bugs.result
+++ b/mysql-test/suite/innodb/r/instant_alter_bugs.result
@@ -358,4 +358,13 @@ t1 CREATE TABLE `t1` (
`a` char(1) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin2 ROW_FORMAT=REDUNDANT
DROP TABLE t1;
+#
+# MDEV-21645 SIGSEGV in innobase_get_computed_value
+#
+CREATE TABLE t1 (a INT PRIMARY KEY, b INT, va INTEGER GENERATED ALWAYS AS (a))
+ENGINE=InnoDB;
+INSERT INTO t1 SET a=1, b=NULL;
+ALTER TABLE t1 MODIFY COLUMN b INT FIRST;
+ALTER TABLE t1 ADD UNIQUE INDEX (va);
+DROP TABLE t1;
SET GLOBAL innodb_purge_rseg_truncate_frequency=@save_frequency;
diff --git a/mysql-test/suite/innodb/r/instant_alter_debug.result b/mysql-test/suite/innodb/r/instant_alter_debug.result
index 72c9a85e369..9fcb8b05a34 100644
--- a/mysql-test/suite/innodb/r/instant_alter_debug.result
+++ b/mysql-test/suite/innodb/r/instant_alter_debug.result
@@ -343,6 +343,30 @@ UPDATE t1 SET b = 1;
SET DEBUG_SYNC='now SIGNAL update';
connection con2;
connection default;
+DROP TABLE t1;
+#
+# MDEV-21658 Error on online ADD PRIMARY KEY after instant DROP/reorder
+#
+CREATE TABLE t1 (a INT, b INT, c INT, col INT) ENGINE=InnoDB;
+INSERT INTO t1 () VALUES ();
+ALTER TABLE t1 DROP b, DROP c, DROP col;
+ALTER TABLE t1 ADD COLUMN col INT;
+ALTER TABLE t1 DROP a, DROP col, ADD COLUMN b INT;
+connection con2;
+SET SQL_MODE= '';
+SET DEBUG_SYNC = 'row_log_table_apply1_before SIGNAL scanned WAIT_FOR dml';
+ALTER TABLE t1 ADD PRIMARY KEY(b);
+connection default;
+SET DEBUG_SYNC = 'now WAIT_FOR scanned';
+UPDATE t1 SET b = 1;
+SET DEBUG_SYNC = 'now SIGNAL dml';
+connection con2;
+Warnings:
+Warning 1265 Data truncated for column 'b' at row 1
+connection default;
+SELECT * FROM t1;
+b
+1
SET DEBUG_SYNC='RESET';
disconnect con2;
DROP TABLE t1;
diff --git a/mysql-test/suite/innodb/t/instant_alter_bugs.test b/mysql-test/suite/innodb/t/instant_alter_bugs.test
index 0a1de256b6a..d76a586cfa1 100644
--- a/mysql-test/suite/innodb/t/instant_alter_bugs.test
+++ b/mysql-test/suite/innodb/t/instant_alter_bugs.test
@@ -374,4 +374,14 @@ ALTER TABLE t1 MODIFY a CHAR, ALGORITHM=INSTANT;
SHOW CREATE TABLE t1;
DROP TABLE t1;
+--echo #
+--echo # MDEV-21645 SIGSEGV in innobase_get_computed_value
+--echo #
+CREATE TABLE t1 (a INT PRIMARY KEY, b INT, va INTEGER GENERATED ALWAYS AS (a))
+ENGINE=InnoDB;
+INSERT INTO t1 SET a=1, b=NULL;
+ALTER TABLE t1 MODIFY COLUMN b INT FIRST;
+ALTER TABLE t1 ADD UNIQUE INDEX (va);
+DROP TABLE t1;
+
SET GLOBAL innodb_purge_rseg_truncate_frequency=@save_frequency;
diff --git a/mysql-test/suite/innodb/t/instant_alter_debug.test b/mysql-test/suite/innodb/t/instant_alter_debug.test
index 22452c78f4d..fe80de2ca51 100644
--- a/mysql-test/suite/innodb/t/instant_alter_debug.test
+++ b/mysql-test/suite/innodb/t/instant_alter_debug.test
@@ -385,6 +385,32 @@ SET DEBUG_SYNC='now SIGNAL update';
--reap
--connection default
+DROP TABLE t1;
+
+--echo #
+--echo # MDEV-21658 Error on online ADD PRIMARY KEY after instant DROP/reorder
+--echo #
+
+CREATE TABLE t1 (a INT, b INT, c INT, col INT) ENGINE=InnoDB;
+INSERT INTO t1 () VALUES ();
+ALTER TABLE t1 DROP b, DROP c, DROP col;
+ALTER TABLE t1 ADD COLUMN col INT;
+ALTER TABLE t1 DROP a, DROP col, ADD COLUMN b INT;
+
+--connection con2
+SET SQL_MODE= '';
+SET DEBUG_SYNC = 'row_log_table_apply1_before SIGNAL scanned WAIT_FOR dml';
+send ALTER TABLE t1 ADD PRIMARY KEY(b);
+
+--connection default
+SET DEBUG_SYNC = 'now WAIT_FOR scanned';
+UPDATE t1 SET b = 1;
+SET DEBUG_SYNC = 'now SIGNAL dml';
+--connection con2
+reap;
+--connection default
+SELECT * FROM t1;
+
SET DEBUG_SYNC='RESET';
--disconnect con2
DROP TABLE t1;
diff --git a/mysql-test/suite/versioning/r/sysvars.result b/mysql-test/suite/versioning/r/sysvars.result
index 79aa8fce746..165458ef170 100644
--- a/mysql-test/suite/versioning/r/sysvars.result
+++ b/mysql-test/suite/versioning/r/sysvars.result
@@ -31,6 +31,14 @@ set global system_versioning_asof= 1;
ERROR 42000: Incorrect argument type to variable 'system_versioning_asof'
set global system_versioning_asof= 1.1;
ERROR 42000: Incorrect argument type to variable 'system_versioning_asof'
+set global system_versioning_asof= '2011-02-29 00:00';
+ERROR 42000: Variable 'system_versioning_asof' can't be set to the value of '2011-02-29 00:00'
+set global system_versioning_asof= '2011-02-28 24:00';
+ERROR 42000: Variable 'system_versioning_asof' can't be set to the value of '2011-02-28 24:00'
+set global system_versioning_asof= '2011-00-28 00:00';
+ERROR 42000: Variable 'system_versioning_asof' can't be set to the value of '2011-00-28 00:00'
+set global system_versioning_asof= '0000-00-00 00:00';
+ERROR 42000: Variable 'system_versioning_asof' can't be set to the value of '0000-00-00 00:00'
set system_versioning_asof= 'alley';
ERROR 42000: Variable 'system_versioning_asof' can't be set to the value of 'alley'
set system_versioning_asof= null;
@@ -39,6 +47,14 @@ set system_versioning_asof= 1;
ERROR 42000: Incorrect argument type to variable 'system_versioning_asof'
set system_versioning_asof= 1.1;
ERROR 42000: Incorrect argument type to variable 'system_versioning_asof'
+set system_versioning_asof= '2011-02-29 00:00';
+ERROR 42000: Variable 'system_versioning_asof' can't be set to the value of '2011-02-29 00:00'
+set system_versioning_asof= '2011-02-28 24:00';
+ERROR 42000: Variable 'system_versioning_asof' can't be set to the value of '2011-02-28 24:00'
+set system_versioning_asof= '2011-00-28 00:00';
+ERROR 42000: Variable 'system_versioning_asof' can't be set to the value of '2011-00-28 00:00'
+set system_versioning_asof= '0000-00-00 00:00';
+ERROR 42000: Variable 'system_versioning_asof' can't be set to the value of '0000-00-00 00:00'
# GLOBAL @@system_versioning_asof
set global system_versioning_asof= '1911-11-11 11:11:11.1111119';
Warnings:
diff --git a/mysql-test/suite/versioning/t/sysvars.test b/mysql-test/suite/versioning/t/sysvars.test
index 52fab81b8e6..e82a116f30e 100644
--- a/mysql-test/suite/versioning/t/sysvars.test
+++ b/mysql-test/suite/versioning/t/sysvars.test
@@ -23,6 +23,14 @@ set global system_versioning_asof= null;
set global system_versioning_asof= 1;
--error ER_WRONG_TYPE_FOR_VAR
set global system_versioning_asof= 1.1;
+--error ER_WRONG_VALUE_FOR_VAR
+set global system_versioning_asof= '2011-02-29 00:00';
+--error ER_WRONG_VALUE_FOR_VAR
+set global system_versioning_asof= '2011-02-28 24:00';
+--error ER_WRONG_VALUE_FOR_VAR
+set global system_versioning_asof= '2011-00-28 00:00';
+--error ER_WRONG_VALUE_FOR_VAR
+set global system_versioning_asof= '0000-00-00 00:00';
# session
--error ER_WRONG_VALUE_FOR_VAR
@@ -33,6 +41,14 @@ set system_versioning_asof= null;
set system_versioning_asof= 1;
--error ER_WRONG_TYPE_FOR_VAR
set system_versioning_asof= 1.1;
+--error ER_WRONG_VALUE_FOR_VAR
+set system_versioning_asof= '2011-02-29 00:00';
+--error ER_WRONG_VALUE_FOR_VAR
+set system_versioning_asof= '2011-02-28 24:00';
+--error ER_WRONG_VALUE_FOR_VAR
+set system_versioning_asof= '2011-00-28 00:00';
+--error ER_WRONG_VALUE_FOR_VAR
+set system_versioning_asof= '0000-00-00 00:00';
--echo # GLOBAL @@system_versioning_asof
set global system_versioning_asof= '1911-11-11 11:11:11.1111119';
diff --git a/mysql-test/suite/wsrep/r/MDEV-20625.result b/mysql-test/suite/wsrep/r/MDEV-20625.result
new file mode 100644
index 00000000000..3e2b621c8f9
--- /dev/null
+++ b/mysql-test/suite/wsrep/r/MDEV-20625.result
@@ -0,0 +1,5 @@
+SET GLOBAL wsrep_on=ON;
+SHOW GLOBAL STATUS LIKE 'wsrep_cluster_size';
+Variable_name Value
+wsrep_cluster_size 0
+SET GLOBAL wsrep_on=OFF;
diff --git a/mysql-test/suite/wsrep/t/MDEV-20625.cnf b/mysql-test/suite/wsrep/t/MDEV-20625.cnf
new file mode 100644
index 00000000000..75f8a25caff
--- /dev/null
+++ b/mysql-test/suite/wsrep/t/MDEV-20625.cnf
@@ -0,0 +1,8 @@
+!include ../my.cnf
+
+[mysqld.1]
+wsrep-on=OFF
+binlog-format=ROW
+wsrep-provider=@ENV.WSREP_PROVIDER
+wsrep-cluster-address='gcomm://'
+innodb_autoinc_lock_mode=2
diff --git a/mysql-test/suite/wsrep/t/MDEV-20625.test b/mysql-test/suite/wsrep/t/MDEV-20625.test
new file mode 100644
index 00000000000..2a537fe432e
--- /dev/null
+++ b/mysql-test/suite/wsrep/t/MDEV-20625.test
@@ -0,0 +1,10 @@
+#
+# Check SHOW GLOBAL STATUS after dynamic setting WSREP=ON
+#
+--source include/have_innodb.inc
+--source include/have_wsrep_provider.inc
+--source include/have_binlog_format_row.inc
+
+SET GLOBAL wsrep_on=ON;
+SHOW GLOBAL STATUS LIKE 'wsrep_cluster_size';
+SET GLOBAL wsrep_on=OFF;