diff options
author | Marko Mäkelä <marko.makela@mariadb.com> | 2022-03-15 08:32:28 +0200 |
---|---|---|
committer | Marko Mäkelä <marko.makela@mariadb.com> | 2022-03-15 08:32:28 +0200 |
commit | e1246775a99372a57834617331bf9f66921fffdc (patch) | |
tree | 02a952ee2f121de1077082070d40c9c384b874e3 /mysql-test | |
parent | 258c34f17cd5a06e29888498064bb46d019dc58f (diff) | |
parent | 9c6135e81f29b3e3286d6b864c0fdafc2fea16ce (diff) | |
download | mariadb-git-e1246775a99372a57834617331bf9f66921fffdc.tar.gz |
Merge 10.4 into 10.5
Diffstat (limited to 'mysql-test')
-rw-r--r-- | mysql-test/lib/mtr_cases.pm | 2 | ||||
-rw-r--r-- | mysql-test/main/sql_safe_updates.result | 24 | ||||
-rw-r--r-- | mysql-test/main/sql_safe_updates.test | 25 | ||||
-rw-r--r-- | mysql-test/suite/innodb/r/instant_alter_bugs.result | 9 | ||||
-rw-r--r-- | mysql-test/suite/innodb/r/undo_truncate.result | 2 | ||||
-rw-r--r-- | mysql-test/suite/innodb/t/instant_alter_bugs.test | 9 | ||||
-rw-r--r-- | mysql-test/suite/innodb/t/undo_truncate.test | 2 |
7 files changed, 69 insertions, 4 deletions
diff --git a/mysql-test/lib/mtr_cases.pm b/mysql-test/lib/mtr_cases.pm index adc911ba937..de7041409f6 100644 --- a/mysql-test/lib/mtr_cases.pm +++ b/mysql-test/lib/mtr_cases.pm @@ -1037,7 +1037,7 @@ sub get_tags_from_file($$) { } # Check for a sourced include file. - if ($line =~ /^(--)?[[:space:]]*source[[:space:]]+([^;[:space:]]+)/) + if ($line =~ /^[[:space:]]*(--)?[[:space:]]*source[[:space:]]+([^;[:space:]]+)/) { my $include= $2; # The rules below must match open_file() function of mysqltest.cc diff --git a/mysql-test/main/sql_safe_updates.result b/mysql-test/main/sql_safe_updates.result index 356cd36bad9..f2944e60489 100644 --- a/mysql-test/main/sql_safe_updates.result +++ b/mysql-test/main/sql_safe_updates.result @@ -1,3 +1,27 @@ +# +# MDEV-14429 sql_safe_updates in my.cnf not work +# select @@sql_safe_updates; @@sql_safe_updates 1 +# +# MDEV-18304 sql_safe_updates does not work with OR clauses +# +create table t1 (a int, b int, primary key (a), key (b)); +update t1 set b=2 where a=1 or b=2; +ERROR HY000: You are using safe update mode and you tried to update a table without a WHERE that uses a KEY column +explain update t1 set b=2 where a=1 or b=2; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 ALL NULL NULL NULL NULL 1 Using where +delete from t1 where a=1 or b=2; +ERROR HY000: You are using safe update mode and you tried to update a table without a WHERE that uses a KEY column +explain delete from t1 where a=1 or b=2; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 ALL NULL NULL NULL NULL 1 Using where +insert into t1 values (1,1),(2,2),(3,3),(4,4),(5,5),(6,6),(7,7),(8,8); +update t1 set b=2 where a=1 or b=2; +delete from t1 where a=1 or b=2; +drop table t1; +# +# End of 10.3 tests +# diff --git a/mysql-test/main/sql_safe_updates.test b/mysql-test/main/sql_safe_updates.test index 18decd0ff2c..25fe4a15ca2 100644 --- a/mysql-test/main/sql_safe_updates.test +++ b/mysql-test/main/sql_safe_updates.test @@ -1,4 +1,23 @@ -# -# MDEV-14429 sql_safe_updates in my.cnf not work -# +--echo # +--echo # MDEV-14429 sql_safe_updates in my.cnf not work +--echo # select @@sql_safe_updates; + +--echo # +--echo # MDEV-18304 sql_safe_updates does not work with OR clauses +--echo # +create table t1 (a int, b int, primary key (a), key (b)); +--error ER_UPDATE_WITHOUT_KEY_IN_SAFE_MODE +update t1 set b=2 where a=1 or b=2; +explain update t1 set b=2 where a=1 or b=2; +--error ER_UPDATE_WITHOUT_KEY_IN_SAFE_MODE +delete from t1 where a=1 or b=2; +explain delete from t1 where a=1 or b=2; +insert into t1 values (1,1),(2,2),(3,3),(4,4),(5,5),(6,6),(7,7),(8,8); +update t1 set b=2 where a=1 or b=2; +delete from t1 where a=1 or b=2; +drop table t1; + +--echo # +--echo # End of 10.3 tests +--echo # diff --git a/mysql-test/suite/innodb/r/instant_alter_bugs.result b/mysql-test/suite/innodb/r/instant_alter_bugs.result index 79f1b0eb068..1f8351b87f0 100644 --- a/mysql-test/suite/innodb/r/instant_alter_bugs.result +++ b/mysql-test/suite/innodb/r/instant_alter_bugs.result @@ -451,4 +451,13 @@ ALTER TABLE t ADD d INT; affected rows: 0 info: Records: 0 Duplicates: 0 Warnings: 0 DROP TABLE t; +# +# MDEV-28060 Online DDL fails while checking for instant +# alter condition +# +CREATE TABLE t1(f1 CHAR(10) NOT NULL)ROW_FORMAT=REDUNDANT,ENGINE=InnoDB; +ALTER TABLE t1 ADD COLUMN(f2 INT NOT NULL, f3 INT NOT NULL, +f4 INT NOT NULL, f5 INT NOT NULL), +CHANGE COLUMN f1 f1 CHAR(10) DEFAULT NULL; +DROP TABLE t1; SET GLOBAL innodb_purge_rseg_truncate_frequency=@save_frequency; diff --git a/mysql-test/suite/innodb/r/undo_truncate.result b/mysql-test/suite/innodb/r/undo_truncate.result index fbfd061c9cc..5be1e5c3426 100644 --- a/mysql-test/suite/innodb/r/undo_truncate.result +++ b/mysql-test/suite/innodb/r/undo_truncate.result @@ -28,6 +28,8 @@ connection con2; commit; disconnect con2; connection default; +SET GLOBAL innodb_purge_rseg_truncate_frequency=1; +SET GLOBAL innodb_max_purge_lag_wait=0; set global innodb_fast_shutdown=0; # restart drop table t1, t2; diff --git a/mysql-test/suite/innodb/t/instant_alter_bugs.test b/mysql-test/suite/innodb/t/instant_alter_bugs.test index ec9f609138c..ada7f9e2bfe 100644 --- a/mysql-test/suite/innodb/t/instant_alter_bugs.test +++ b/mysql-test/suite/innodb/t/instant_alter_bugs.test @@ -467,4 +467,13 @@ ALTER TABLE t ADD d INT; --disable_info DROP TABLE t; +--echo # +--echo # MDEV-28060 Online DDL fails while checking for instant +--echo # alter condition +--echo # +CREATE TABLE t1(f1 CHAR(10) NOT NULL)ROW_FORMAT=REDUNDANT,ENGINE=InnoDB; +ALTER TABLE t1 ADD COLUMN(f2 INT NOT NULL, f3 INT NOT NULL, + f4 INT NOT NULL, f5 INT NOT NULL), + CHANGE COLUMN f1 f1 CHAR(10) DEFAULT NULL; +DROP TABLE t1; SET GLOBAL innodb_purge_rseg_truncate_frequency=@save_frequency; diff --git a/mysql-test/suite/innodb/t/undo_truncate.test b/mysql-test/suite/innodb/t/undo_truncate.test index cf8c1a8d5e3..437103de787 100644 --- a/mysql-test/suite/innodb/t/undo_truncate.test +++ b/mysql-test/suite/innodb/t/undo_truncate.test @@ -46,6 +46,8 @@ connection default; let $trx_before= `SHOW ENGINE INNODB STATUS`; let $trx_before= `select substr('$trx_before',9)+2`; +SET GLOBAL innodb_purge_rseg_truncate_frequency=1; +SET GLOBAL innodb_max_purge_lag_wait=0; set global innodb_fast_shutdown=0; --source include/restart_mysqld.inc --replace_regex /.*Trx id counter ([0-9]+).*/\1/ |