diff options
author | Marko Mäkelä <marko.makela@mariadb.com> | 2019-03-06 09:00:52 +0200 |
---|---|---|
committer | Marko Mäkelä <marko.makela@mariadb.com> | 2019-03-06 09:00:52 +0200 |
commit | 2a791c53ad93c8bc1441dd227000234bd49c4990 (patch) | |
tree | 4c52ad715c99bd3c6681771d7cb77d451a34e216 /mysql-test | |
parent | b5c72a843abee033e9ea6028e1a109f03afc4455 (diff) | |
parent | 723ffdb32ee785cbc511abc457eb70d41c2fcce3 (diff) | |
download | mariadb-git-2a791c53ad93c8bc1441dd227000234bd49c4990.tar.gz |
Merge 10.3 into 10.4
Diffstat (limited to 'mysql-test')
47 files changed, 1003 insertions, 261 deletions
diff --git a/mysql-test/main/create_drop_role.result b/mysql-test/main/create_drop_role.result index 498dd4c1c02..886dcfd0e72 100644 --- a/mysql-test/main/create_drop_role.result +++ b/mysql-test/main/create_drop_role.result @@ -77,3 +77,12 @@ Note 1976 Can't drop role 'role_1'; it doesn't exist DROP ROLE role_1; ERROR HY000: Operation DROP ROLE failed for 'role_1' DROP USER u1@localhost; +CREATE ROLE r; +GRANT SHOW DATABASES ON *.* TO r; +CREATE USER foo; +CREATE USER bar; +GRANT r TO foo; +CREATE OR REPLACE USER foo IDENTIFIED WITH non_existing_plugin; +ERROR HY000: Plugin 'non_existing_plugin' is not loaded +DROP ROLE r; +DROP USER bar; diff --git a/mysql-test/main/create_drop_role.test b/mysql-test/main/create_drop_role.test index be33083e6c4..11bc832c6e9 100644 --- a/mysql-test/main/create_drop_role.test +++ b/mysql-test/main/create_drop_role.test @@ -54,3 +54,14 @@ DROP ROLE IF EXISTS role_1; DROP ROLE role_1; DROP USER u1@localhost; + +# MDEV-17942 +CREATE ROLE r; +GRANT SHOW DATABASES ON *.* TO r; +CREATE USER foo; +CREATE USER bar; +GRANT r TO foo; +--error ER_PLUGIN_IS_NOT_LOADED +CREATE OR REPLACE USER foo IDENTIFIED WITH non_existing_plugin; +DROP ROLE r; +DROP USER bar; diff --git a/mysql-test/main/derived_split_innodb.result b/mysql-test/main/derived_split_innodb.result index 5073aa84c13..e8f9df5f80d 100644 --- a/mysql-test/main/derived_split_innodb.result +++ b/mysql-test/main/derived_split_innodb.result @@ -100,3 +100,44 @@ id select_type table type possible_keys key key_len ref rows Extra 2 LATERAL DERIVED t1 eq_ref PRIMARY PRIMARY 4 test.t2.id 1 set join_cache_level=default; DROP TABLE t1,t2; +# +# Bug mdev-18467: join of grouping view and a base table as inner operand +# of left join with on condition containing impossible range +# +create table t1 (f1 int, f2 int, key(f2)) engine=InnoDB; +insert into t1 values (3,33), (7,77), (1,11); +create table t2 (f1 int, f2 int, primary key (f1)) engine=InnoDB; +insert into t2 values (3,33), (9,99), (1,11); +create view v1 as +select f1, max(f2) as f2 from t2 group by f1; +select t.f2 +from t1 +left join +(v1 join t1 as t on v1.f1=t.f1 and t.f2 = null) +on t1.f1=t.f1; +f2 +NULL +NULL +NULL +explain select t.f2 +from t1 +left join +(v1 join t1 as t on v1.f1=t.f1 and t.f2 = null) +on t1.f1=t.f1; +id select_type table type possible_keys key key_len ref rows Extra +1 PRIMARY t const f2 NULL NULL NULL 1 Impossible ON condition +1 PRIMARY <derived2> const key1 NULL NULL NULL 1 Impossible ON condition +1 PRIMARY t1 ALL NULL NULL NULL NULL 3 +2 DERIVED t2 ALL PRIMARY NULL NULL NULL 3 Using temporary; Using filesort +set statement optimizer_switch='split_materialized=off' for explain select t.f2 +from t1 +left join +(v1 join t1 as t on v1.f1=t.f1 and t.f2 = null) +on t1.f1=t.f1; +id select_type table type possible_keys key key_len ref rows Extra +1 PRIMARY t const f2 NULL NULL NULL 1 Impossible ON condition +1 PRIMARY <derived3> const key1 NULL NULL NULL 1 Impossible ON condition +1 PRIMARY t1 ALL NULL NULL NULL NULL 3 +3 DERIVED t2 index NULL PRIMARY 4 NULL 3 +drop view v1; +drop table t1,t2; diff --git a/mysql-test/main/derived_split_innodb.test b/mysql-test/main/derived_split_innodb.test index c3b3bcabede..1bf70cd8114 100644 --- a/mysql-test/main/derived_split_innodb.test +++ b/mysql-test/main/derived_split_innodb.test @@ -94,3 +94,32 @@ eval EXPLAIN $q; set join_cache_level=default; DROP TABLE t1,t2; + +--echo # +--echo # Bug mdev-18467: join of grouping view and a base table as inner operand +--echo # of left join with on condition containing impossible range +--echo # + +create table t1 (f1 int, f2 int, key(f2)) engine=InnoDB; +insert into t1 values (3,33), (7,77), (1,11); + +create table t2 (f1 int, f2 int, primary key (f1)) engine=InnoDB; +insert into t2 values (3,33), (9,99), (1,11); + +create view v1 as + select f1, max(f2) as f2 from t2 group by f1; + +let $q= +select t.f2 + from t1 + left join + (v1 join t1 as t on v1.f1=t.f1 and t.f2 = null) + on t1.f1=t.f1; + +eval $q; +eval explain $q; +eval set statement optimizer_switch='split_materialized=off' for explain $q; + +drop view v1; + +drop table t1,t2; diff --git a/mysql-test/main/loaddata.result b/mysql-test/main/loaddata.result index 4c5cee0aa25..b7d51a13c85 100644 --- a/mysql-test/main/loaddata.result +++ b/mysql-test/main/loaddata.result @@ -581,6 +581,56 @@ HEX(a) C3A4 DROP TABLE t1; # +# MDEV-15744: Assertion `derived->table' failed in mysql_derived_merge_for_insert +# +create table t1 (a int, b int); +CREATE OR REPLACE VIEW t2 AS SELECT * FROM t1; +CREATE VIEW v2 AS SELECT * FROM t2; +LOAD DATA INFILE '../../std_data/loaddata7.dat' INTO TABLE v2 +FIELDS TERMINATED BY ',' LINES TERMINATED BY '\r\n'; +select * from v2; +a b +2 2 +3 3 +4 4 +5 5 +6 6 +select * from t2; +a b +2 2 +3 3 +4 4 +5 5 +6 6 +DROP VIEW IF EXISTS v2,t2; +DROP TABLE IF EXISTS t1; +# +# MDEV-15950: LOAD DATA INTO compex_view crashed +# +create table t1 (a int, b int); +create table t0 (x int, y int); +CREATE OR REPLACE VIEW v1 AS SELECT * FROM t1,t0; +CREATE VIEW v2 AS SELECT * FROM v1; +LOAD DATA INFILE '../../std_data/loaddata7.dat' INTO TABLE v1 +FIELDS TERMINATED BY ',' LINES TERMINATED BY '\r\n'; +ERROR HY000: Incorrect usage of Multi-table VIEW and LOAD +LOAD DATA INFILE '../../std_data/loaddata7.dat' INTO TABLE v2 +FIELDS TERMINATED BY ',' LINES TERMINATED BY '\r\n'; +ERROR HY000: Incorrect usage of Multi-table VIEW and LOAD +DROP VIEW IF EXISTS v2,v1; +DROP TABLE IF EXISTS t1,t0; +CREATE TABLE t1 (a INT, b INT, PRIMARY KEY (a), UNIQUE(b)); +INSERT INTO t1 VALUES (1,1); +CREATE TABLE t2 (c INT); +CREATE VIEW v AS SELECT t1.* FROM t1 JOIN t2; +SELECT a, b INTO OUTFILE '15645.data' FROM t1; +LOAD DATA INFILE '15645.data' IGNORE INTO TABLE v (a,b); +ERROR HY000: Incorrect usage of Multi-table VIEW and LOAD +LOAD DATA INFILE '15645.data' REPLACE INTO TABLE v (a,b); +ERROR HY000: Incorrect usage of Multi-table VIEW and LOAD +drop table t1,t2; +drop view v; +# # MDEV-15497 Wrong empty value in a GEOMETRY column on LOAD DATA # SET sql_mode=''; diff --git a/mysql-test/main/loaddata.test b/mysql-test/main/loaddata.test index a283e64d473..8fb1877bbc5 100644 --- a/mysql-test/main/loaddata.test +++ b/mysql-test/main/loaddata.test @@ -677,6 +677,51 @@ LOAD DATA INFILE '../../std_data/loaddata/mdev-11631.txt' INTO TABLE t1 CHARACTE SELECT HEX(a) FROM t1; DROP TABLE t1; +--echo # +--echo # MDEV-15744: Assertion `derived->table' failed in mysql_derived_merge_for_insert +--echo # + +create table t1 (a int, b int); +CREATE OR REPLACE VIEW t2 AS SELECT * FROM t1; +CREATE VIEW v2 AS SELECT * FROM t2; +LOAD DATA INFILE '../../std_data/loaddata7.dat' INTO TABLE v2 + FIELDS TERMINATED BY ',' LINES TERMINATED BY '\r\n'; +select * from v2; +select * from t2; +DROP VIEW IF EXISTS v2,t2; +DROP TABLE IF EXISTS t1; + +--echo # +--echo # MDEV-15950: LOAD DATA INTO compex_view crashed +--echo # +create table t1 (a int, b int); +create table t0 (x int, y int); +CREATE OR REPLACE VIEW v1 AS SELECT * FROM t1,t0; +CREATE VIEW v2 AS SELECT * FROM v1; + +--error ER_WRONG_USAGE +LOAD DATA INFILE '../../std_data/loaddata7.dat' INTO TABLE v1 +FIELDS TERMINATED BY ',' LINES TERMINATED BY '\r\n'; + +--error ER_WRONG_USAGE +LOAD DATA INFILE '../../std_data/loaddata7.dat' INTO TABLE v2 +FIELDS TERMINATED BY ',' LINES TERMINATED BY '\r\n'; + +DROP VIEW IF EXISTS v2,v1; +DROP TABLE IF EXISTS t1,t0; + +CREATE TABLE t1 (a INT, b INT, PRIMARY KEY (a), UNIQUE(b)); +INSERT INTO t1 VALUES (1,1); +CREATE TABLE t2 (c INT); +CREATE VIEW v AS SELECT t1.* FROM t1 JOIN t2; +SELECT a, b INTO OUTFILE '15645.data' FROM t1; +--error ER_WRONG_USAGE +LOAD DATA INFILE '15645.data' IGNORE INTO TABLE v (a,b); +--error ER_WRONG_USAGE +LOAD DATA INFILE '15645.data' REPLACE INTO TABLE v (a,b); +drop table t1,t2; +drop view v; + --echo # --echo # MDEV-15497 Wrong empty value in a GEOMETRY column on LOAD DATA diff --git a/mysql-test/main/log_slow.result b/mysql-test/main/log_slow.result index 59149633b99..74a77e3f11d 100644 --- a/mysql-test/main/log_slow.result +++ b/mysql-test/main/log_slow.result @@ -77,3 +77,40 @@ set @@log_slow_filter=default; set @@log_slow_verbosity=default; set global log_output= default; truncate mysql.slow_log; +# +# MDEV-18333 Slow_queries count doesn't increase when slow_query_log is turned off +# +SET SESSION slow_query_log=OFF; +SET GLOBAL slow_query_log=OFF; +SET long_query_time=0.1; +# Although this query is disallowed by slow_query_log, it should still increment Slow_queries +SELECT VARIABLE_VALUE INTO @global_slow_queries +FROM INFORMATION_SCHEMA.GLOBAL_STATUS +WHERE VARIABLE_NAME='SLOW_QUERIES'; +SELECT sleep(0.2) INTO @tmp FROM DUAL; +SELECT +CAST(VARIABLE_VALUE AS UNSIGNED)-@global_slow_queries AS Slow_queries_increment +FROM +INFORMATION_SCHEMA.GLOBAL_STATUS +WHERE +VARIABLE_NAME='SLOW_QUERIES'; +Slow_queries_increment +0 +# Although this query is disallowed by log_slow_filter, it should still increment Slow_queries +SET log_slow_filter=filesort; +SELECT sleep(0.2) INTO @tmp FROM DUAL; +SELECT VARIABLE_VALUE INTO @global_slow_queries +FROM INFORMATION_SCHEMA.GLOBAL_STATUS +WHERE VARIABLE_NAME='SLOW_QUERIES'; +SELECT sleep(0.2) INTO @tmp FROM DUAL; +SELECT +CAST(VARIABLE_VALUE AS UNSIGNED)-@global_slow_queries AS Slow_queries_increment +FROM +INFORMATION_SCHEMA.GLOBAL_STATUS +WHERE +VARIABLE_NAME='SLOW_QUERIES'; +Slow_queries_increment +0 +SET log_slow_filter=DEFAULT; +SET @@long_query_time=default; +SET GLOBAL slow_query_log= @org_slow_query_log; diff --git a/mysql-test/main/log_slow.test b/mysql-test/main/log_slow.test index 56e35bd5a20..edb1865b5ae 100644 --- a/mysql-test/main/log_slow.test +++ b/mysql-test/main/log_slow.test @@ -58,3 +58,43 @@ set @@log_slow_filter=default; set @@log_slow_verbosity=default; set global log_output= default; truncate mysql.slow_log; + +--echo # +--echo # MDEV-18333 Slow_queries count doesn't increase when slow_query_log is turned off +--echo # + +SET SESSION slow_query_log=OFF; +SET GLOBAL slow_query_log=OFF; +SET long_query_time=0.1; + +--echo # Although this query is disallowed by slow_query_log, it should still increment Slow_queries + +SELECT VARIABLE_VALUE INTO @global_slow_queries + FROM INFORMATION_SCHEMA.GLOBAL_STATUS + WHERE VARIABLE_NAME='SLOW_QUERIES'; +SELECT sleep(0.2) INTO @tmp FROM DUAL; +SELECT + CAST(VARIABLE_VALUE AS UNSIGNED)-@global_slow_queries AS Slow_queries_increment + FROM + INFORMATION_SCHEMA.GLOBAL_STATUS + WHERE + VARIABLE_NAME='SLOW_QUERIES'; + +--echo # Although this query is disallowed by log_slow_filter, it should still increment Slow_queries + +SET log_slow_filter=filesort; +SELECT sleep(0.2) INTO @tmp FROM DUAL; +SELECT VARIABLE_VALUE INTO @global_slow_queries + FROM INFORMATION_SCHEMA.GLOBAL_STATUS + WHERE VARIABLE_NAME='SLOW_QUERIES'; +SELECT sleep(0.2) INTO @tmp FROM DUAL; +SELECT + CAST(VARIABLE_VALUE AS UNSIGNED)-@global_slow_queries AS Slow_queries_increment + FROM + INFORMATION_SCHEMA.GLOBAL_STATUS + WHERE + VARIABLE_NAME='SLOW_QUERIES'; +SET log_slow_filter=DEFAULT; + +SET @@long_query_time=default; +SET GLOBAL slow_query_log= @org_slow_query_log; diff --git a/mysql-test/main/sp.result b/mysql-test/main/sp.result index 39bc09e21d6..62663c7e91b 100644 --- a/mysql-test/main/sp.result +++ b/mysql-test/main/sp.result @@ -7906,6 +7906,39 @@ CALL sp; c a b a b DROP PROCEDURE sp; DROP TABLE t1; +# +# MDEV-17055: Server crashes in find_order_in_list upon +# 2nd (3rd) execution of SP with UPDATE +# +CREATE TABLE t1 (a INT); +CREATE VIEW v1 AS SELECT * FROM t1; +CREATE TABLE t2 (c INT); +CREATE PROCEDURE sp() UPDATE v1 SET a = 1 ORDER BY a, b LIMIT 1; +LOCK TABLE t2 READ; +CALL sp; +ERROR HY000: Table 'v1' was not locked with LOCK TABLES +UNLOCK TABLES; +CALL sp; +ERROR 42S22: Unknown column 'b' in 'order clause' +CALL sp; +ERROR 42S22: Unknown column 'b' in 'order clause' +CALL sp; +ERROR 42S22: Unknown column 'b' in 'order clause' +DROP PROCEDURE sp; +CREATE PROCEDURE sp() UPDATE v1 SET a = 1 WHERE a=1 and b=2; +LOCK TABLE t2 READ; +CALL sp; +ERROR HY000: Table 'v1' was not locked with LOCK TABLES +UNLOCK TABLES; +CALL sp; +ERROR 42S22: Unknown column 'b' in 'where clause' +CALL sp; +ERROR 42S22: Unknown column 'b' in 'where clause' +CALL sp; +ERROR 42S22: Unknown column 'b' in 'where clause' +DROP PROCEDURE sp; +DROP VIEW v1; +DROP TABLE t1, t2; # End of 5.5 test # # MDEV-7040: Crash in field_conv, memcpy_field_possible, part#2 diff --git a/mysql-test/main/sp.test b/mysql-test/main/sp.test index 230e9c8bb18..1000f172931 100644 --- a/mysql-test/main/sp.test +++ b/mysql-test/main/sp.test @@ -9352,6 +9352,47 @@ CALL sp; DROP PROCEDURE sp; DROP TABLE t1; +--echo # +--echo # MDEV-17055: Server crashes in find_order_in_list upon +--echo # 2nd (3rd) execution of SP with UPDATE +--echo # + +CREATE TABLE t1 (a INT); +CREATE VIEW v1 AS SELECT * FROM t1; +CREATE TABLE t2 (c INT); + +CREATE PROCEDURE sp() UPDATE v1 SET a = 1 ORDER BY a, b LIMIT 1; +LOCK TABLE t2 READ; +--error ER_TABLE_NOT_LOCKED +CALL sp; +UNLOCK TABLES; +--error ER_BAD_FIELD_ERROR +CALL sp; +--error ER_BAD_FIELD_ERROR +CALL sp; +--error ER_BAD_FIELD_ERROR +CALL sp; + +# Cleanup +DROP PROCEDURE sp; + +CREATE PROCEDURE sp() UPDATE v1 SET a = 1 WHERE a=1 and b=2; +LOCK TABLE t2 READ; +--error ER_TABLE_NOT_LOCKED +CALL sp; +UNLOCK TABLES; +--error ER_BAD_FIELD_ERROR +CALL sp; +--error ER_BAD_FIELD_ERROR +CALL sp; +--error ER_BAD_FIELD_ERROR +CALL sp; + +# Cleanup +DROP PROCEDURE sp; + +DROP VIEW v1; +DROP TABLE t1, t2; --echo # End of 5.5 test diff --git a/mysql-test/main/union.result b/mysql-test/main/union.result index e975e0f8591..ce14b68ae2d 100644 --- a/mysql-test/main/union.result +++ b/mysql-test/main/union.result @@ -2583,5 +2583,42 @@ c1 -10 drop table t1,t2; # +# MDEV-18700: EXPLAIN EXTENDED for query with UNION ALL +# after INTERSECT/EXCEPT operations +# +create table t1 (a int); +insert into t1 values (3), (1), (7), (3), (2), (7), (4); +create table t2 (a int); +insert into t2 values (4), (5), (9), (1), (8), (9); +create table t3 (a int); +insert into t3 values (8), (1), (8), (2), (3), (7), (2); +explain extended +select * from t2 where a < 5 +intersect +select * from t3 where a < 5 +union all +select * from t1 where a > 4; +id select_type table type possible_keys key key_len ref rows filtered Extra +1 PRIMARY t2 ALL NULL NULL NULL NULL 6 100.00 Using where +2 INTERSECT t3 ALL NULL NULL NULL NULL 7 100.00 Using where +3 UNION t1 ALL NULL NULL NULL NULL 7 100.00 Using where +NULL UNIT RESULT <unit1,2,3> ALL NULL NULL NULL NULL NULL NULL +Warnings: +Note 1003 /* select#1 */ select `test`.`t2`.`a` AS `a` from `test`.`t2` where `test`.`t2`.`a` < 5 intersect /* select#2 */ select `test`.`t3`.`a` AS `a` from `test`.`t3` where `test`.`t3`.`a` < 5 union all /* select#3 */ select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` > 4 +explain extended +select * from t2 where a < 5 +except +select * from t3 where a < 5 +union all +select * from t1 where a > 4; +id select_type table type possible_keys key key_len ref rows filtered Extra +1 PRIMARY t2 ALL NULL NULL NULL NULL 6 100.00 Using where +2 EXCEPT t3 ALL NULL NULL NULL NULL 7 100.00 Using where +3 UNION t1 ALL NULL NULL NULL NULL 7 100.00 Using where +NULL UNIT RESULT <unit1,2,3> ALL NULL NULL NULL NULL NULL NULL +Warnings: +Note 1003 /* select#1 */ select `test`.`t2`.`a` AS `a` from `test`.`t2` where `test`.`t2`.`a` < 5 except /* select#2 */ select `test`.`t3`.`a` AS `a` from `test`.`t3` where `test`.`t3`.`a` < 5 union all /* select#3 */ select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` > 4 +drop table t1,t2,t3; +# # End of 10.3 tests # diff --git a/mysql-test/main/union.test b/mysql-test/main/union.test index dc9a4617fb3..9d25708611e 100644 --- a/mysql-test/main/union.test +++ b/mysql-test/main/union.test @@ -1822,5 +1822,35 @@ SELECT c1 FROM t1 UNION SELECT - @a FROM t2; drop table t1,t2; --echo # +--echo # MDEV-18700: EXPLAIN EXTENDED for query with UNION ALL +--echo # after INTERSECT/EXCEPT operations +--echo # + +create table t1 (a int); +insert into t1 values (3), (1), (7), (3), (2), (7), (4); + +create table t2 (a int); +insert into t2 values (4), (5), (9), (1), (8), (9); + +create table t3 (a int); +insert into t3 values (8), (1), (8), (2), (3), (7), (2); + +explain extended +select * from t2 where a < 5 +intersect +select * from t3 where a < 5 +union all +select * from t1 where a > 4; + +explain extended +select * from t2 where a < 5 +except +select * from t3 where a < 5 +union all +select * from t1 where a > 4; + +drop table t1,t2,t3; + +--echo # --echo # End of 10.3 tests --echo # diff --git a/mysql-test/main/view.result b/mysql-test/main/view.result index bbe1d9b69d7..fccec1a5ef3 100644 --- a/mysql-test/main/view.result +++ b/mysql-test/main/view.result @@ -6717,5 +6717,27 @@ drop table t1; ALTER VIEW IF NOT EXISTS v1 AS SELECT 1; ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'IF NOT EXISTS v1 AS SELECT 1' at line 1 # +# MDEV-18605: Loss of column aliases by using view and group +# +CREATE TABLE t1 (id int, foo int); +CREATE VIEW v1 AS SELECT id, IFNULL(foo,'') AS foo FROM t1; +INSERT INTO t1 (id, foo) VALUES (1,1),(2,2); +SELECT v.id, v.foo AS bar FROM v1 v +WHERE id = 2; +id bar +2 2 +SELECT v.id, v.foo AS bar FROM v1 v +GROUP BY v.id; +id bar +1 1 +2 2 +SELECT v.id, v.foo AS bar FROM v1 v +WHERE id = 2 +GROUP BY v.id; +id bar +2 2 +Drop View v1; +Drop table t1; +# # End of 10.3 tests # diff --git a/mysql-test/main/view.test b/mysql-test/main/view.test index f5590e01639..94036273ce1 100644 --- a/mysql-test/main/view.test +++ b/mysql-test/main/view.test @@ -6416,5 +6416,28 @@ drop table t1; ALTER VIEW IF NOT EXISTS v1 AS SELECT 1; --echo # +--echo # MDEV-18605: Loss of column aliases by using view and group +--echo # + +CREATE TABLE t1 (id int, foo int); +CREATE VIEW v1 AS SELECT id, IFNULL(foo,'') AS foo FROM t1; + +INSERT INTO t1 (id, foo) VALUES (1,1),(2,2); + +SELECT v.id, v.foo AS bar FROM v1 v + WHERE id = 2; + +SELECT v.id, v.foo AS bar FROM v1 v + GROUP BY v.id; + +SELECT v.id, v.foo AS bar FROM v1 v + WHERE id = 2 + GROUP BY v.id; + +#Cleanup +Drop View v1; +Drop table t1; + +--echo # --echo # End of 10.3 tests --echo # diff --git a/mysql-test/suite/encryption/r/innodb-checksum-algorithm,32k.rdiff b/mysql-test/suite/encryption/r/innodb-checksum-algorithm,32k.rdiff index cd66df7440b..d963cde132a 100644 --- a/mysql-test/suite/encryption/r/innodb-checksum-algorithm,32k.rdiff +++ b/mysql-test/suite/encryption/r/innodb-checksum-algorithm,32k.rdiff @@ -1,5 +1,5 @@ --- suite/encryption/r/innodb-checksum-algorithm.result -+++ suite/encryption/r/innodb-checksum-algorithm,32k.reject ++++ suite/encryption/r/innodb-checksum-algorithm.result @@ -13,9 +13,9 @@ SET GLOBAL innodb_default_encryption_key_id=4; SET GLOBAL innodb_checksum_algorithm=crc32; @@ -9,10 +9,10 @@ create table tc_crc32(a serial, b blob, index(b(10))) engine=innodb -ROW_FORMAT=COMPRESSED encrypted=no; +ROW_FORMAT=DYNAMIC encrypted=no; + Warnings: + Warning 140 InnoDB: ENCRYPTED=NO implies ENCRYPTION_KEY_ID=1 create table te_crc32(a serial, b blob, index(b(10))) engine=innodb - encrypted=yes; - create table t_crc32(a serial, b blob, index(b(10))) engine=innodb -@@ -222,9 +222,9 @@ +@@ -153,9 +153,9 @@ t_crc32, tpe_crc32, tp_crc32; SET GLOBAL innodb_checksum_algorithm=innodb; create table tce_innodb(a serial, b blob, index(b(10))) engine=innodb @@ -21,10 +21,10 @@ create table tc_innodb(a serial, b blob, index(b(10))) engine=innodb -ROW_FORMAT=COMPRESSED encrypted=no; +ROW_FORMAT=DYNAMIC encrypted=no; + Warnings: + Warning 140 InnoDB: ENCRYPTED=NO implies ENCRYPTION_KEY_ID=1 create table te_innodb(a serial, b blob, index(b(10))) engine=innodb - encrypted=yes; - create table t_innodb(a serial, b blob, index(b(10))) engine=innodb -@@ -431,9 +431,9 @@ +@@ -293,9 +293,9 @@ t_innodb, tpe_innodb, tp_innodb; SET GLOBAL innodb_checksum_algorithm=none; create table tce_none(a serial, b blob, index(b(10))) engine=innodb @@ -33,6 +33,6 @@ create table tc_none(a serial, b blob, index(b(10))) engine=innodb -ROW_FORMAT=COMPRESSED encrypted=no; +ROW_FORMAT=DYNAMIC encrypted=no; + Warnings: + Warning 140 InnoDB: ENCRYPTED=NO implies ENCRYPTION_KEY_ID=1 create table te_none(a serial, b blob, index(b(10))) engine=innodb - encrypted=yes; - create table t_none(a serial, b blob, index(b(10))) engine=innodb diff --git a/mysql-test/suite/encryption/r/innodb-checksum-algorithm,64k.rdiff b/mysql-test/suite/encryption/r/innodb-checksum-algorithm,64k.rdiff index 523074297da..d963cde132a 100644 --- a/mysql-test/suite/encryption/r/innodb-checksum-algorithm,64k.rdiff +++ b/mysql-test/suite/encryption/r/innodb-checksum-algorithm,64k.rdiff @@ -1,5 +1,5 @@ --- suite/encryption/r/innodb-checksum-algorithm.result -+++ suite/encryption/r/innodb-checksum-algorithm,64k.reject ++++ suite/encryption/r/innodb-checksum-algorithm.result @@ -13,9 +13,9 @@ SET GLOBAL innodb_default_encryption_key_id=4; SET GLOBAL innodb_checksum_algorithm=crc32; @@ -9,10 +9,10 @@ create table tc_crc32(a serial, b blob, index(b(10))) engine=innodb -ROW_FORMAT=COMPRESSED encrypted=no; +ROW_FORMAT=DYNAMIC encrypted=no; + Warnings: + Warning 140 InnoDB: ENCRYPTED=NO implies ENCRYPTION_KEY_ID=1 create table te_crc32(a serial, b blob, index(b(10))) engine=innodb - encrypted=yes; - create table t_crc32(a serial, b blob, index(b(10))) engine=innodb -@@ -222,9 +222,9 @@ +@@ -153,9 +153,9 @@ t_crc32, tpe_crc32, tp_crc32; SET GLOBAL innodb_checksum_algorithm=innodb; create table tce_innodb(a serial, b blob, index(b(10))) engine=innodb @@ -21,10 +21,10 @@ create table tc_innodb(a serial, b blob, index(b(10))) engine=innodb -ROW_FORMAT=COMPRESSED encrypted=no; +ROW_FORMAT=DYNAMIC encrypted=no; + Warnings: + Warning 140 InnoDB: ENCRYPTED=NO implies ENCRYPTION_KEY_ID=1 create table te_innodb(a serial, b blob, index(b(10))) engine=innodb - encrypted=yes; - create table t_innodb(a serial, b blob, index(b(10))) engine=innodb -@@ -431,9 +431,9 @@ +@@ -293,9 +293,9 @@ t_innodb, tpe_innodb, tp_innodb; SET GLOBAL innodb_checksum_algorithm=none; create table tce_none(a serial, b blob, index(b(10))) engine=innodb @@ -33,6 +33,6 @@ create table tc_none(a serial, b blob, index(b(10))) engine=innodb -ROW_FORMAT=COMPRESSED encrypted=no; +ROW_FORMAT=DYNAMIC encrypted=no; + Warnings: + Warning 140 InnoDB: ENCRYPTED=NO implies ENCRYPTION_KEY_ID=1 create table te_none(a serial, b blob, index(b(10))) engine=innodb - encrypted=yes; - create table t_none(a serial, b blob, index(b(10))) engine=innodb diff --git a/mysql-test/suite/encryption/r/innodb-checksum-algorithm.result b/mysql-test/suite/encryption/r/innodb-checksum-algorithm.result index afb79dbad8a..ff42e975b8d 100644 --- a/mysql-test/suite/encryption/r/innodb-checksum-algorithm.result +++ b/mysql-test/suite/encryption/r/innodb-checksum-algorithm.result @@ -14,14 +14,20 @@ create table tce_crc32(a serial, b blob, index(b(10))) engine=innodb ROW_FORMAT=COMPRESSED encrypted=yes; create table tc_crc32(a serial, b blob, index(b(10))) engine=innodb ROW_FORMAT=COMPRESSED encrypted=no; +Warnings: +Warning 140 InnoDB: ENCRYPTED=NO implies ENCRYPTION_KEY_ID=1 create table te_crc32(a serial, b blob, index(b(10))) engine=innodb encrypted=yes; create table t_crc32(a serial, b blob, index(b(10))) engine=innodb encrypted=no; +Warnings: +Warning 140 InnoDB: ENCRYPTED=NO implies ENCRYPTION_KEY_ID=1 create table tpe_crc32(a serial, b blob, index(b(10))) engine=innodb page_compressed=yes encrypted=yes; create table tp_crc32(a serial, b blob, index(b(10))) engine=innodb page_compressed=yes encrypted=no; +Warnings: +Warning 140 InnoDB: ENCRYPTED=NO implies ENCRYPTION_KEY_ID=1 begin; insert into tce_crc32(b) values (repeat('secret',20)); insert into tc_crc32(b) values (repeat('secret',20)); @@ -149,14 +155,20 @@ create table tce_innodb(a serial, b blob, index(b(10))) engine=innodb ROW_FORMAT=COMPRESSED encrypted=yes; create table tc_innodb(a serial, b blob, index(b(10))) engine=innodb ROW_FORMAT=COMPRESSED encrypted=no; +Warnings: +Warning 140 InnoDB: ENCRYPTED=NO implies ENCRYPTION_KEY_ID=1 create table te_innodb(a serial, b blob, index(b(10))) engine=innodb encrypted=yes; create table t_innodb(a serial, b blob, index(b(10))) engine=innodb encrypted=no; +Warnings: +Warning 140 InnoDB: ENCRYPTED=NO implies ENCRYPTION_KEY_ID=1 create table tpe_innodb(a serial, b blob, index(b(10))) engine=innodb page_compressed=yes encrypted=yes; create table tp_innodb(a serial, b blob, index(b(10))) engine=innodb page_compressed=yes encrypted=no; +Warnings: +Warning 140 InnoDB: ENCRYPTED=NO implies ENCRYPTION_KEY_ID=1 begin; insert into tce_innodb(b) values (repeat('secret',20)); insert into tc_innodb(b) values (repeat('secret',20)); @@ -284,14 +296,20 @@ create table tce_none(a serial, b blob, index(b(10))) engine=innodb ROW_FORMAT=COMPRESSED encrypted=yes; create table tc_none(a serial, b blob, index(b(10))) engine=innodb ROW_FORMAT=COMPRESSED encrypted=no; +Warnings: +Warning 140 InnoDB: ENCRYPTED=NO implies ENCRYPTION_KEY_ID=1 create table te_none(a serial, b blob, index(b(10))) engine=innodb encrypted=yes; create table t_none(a serial, b blob, index(b(10))) engine=innodb encrypted=no; +Warnings: +Warning 140 InnoDB: ENCRYPTED=NO implies ENCRYPTION_KEY_ID=1 create table tpe_none(a serial, b blob, index(b(10))) engine=innodb page_compressed=yes encrypted=yes; create table tp_none(a serial, b blob, index(b(10))) engine=innodb page_compressed=yes encrypted=no; +Warnings: +Warning 140 InnoDB: ENCRYPTED=NO implies ENCRYPTION_KEY_ID=1 begin; insert into tce_none(b) values (repeat('secret',20)); insert into tc_none(b) values (repeat('secret',20)); diff --git a/mysql-test/suite/encryption/r/innodb-compressed-blob.result b/mysql-test/suite/encryption/r/innodb-compressed-blob.result index e156266edc6..f163f6141dd 100644 --- a/mysql-test/suite/encryption/r/innodb-compressed-blob.result +++ b/mysql-test/suite/encryption/r/innodb-compressed-blob.result @@ -7,6 +7,8 @@ set GLOBAL innodb_default_encryption_key_id=4; create table t1(a int not null primary key, b blob, index(b(10))) engine=innodb row_format=compressed; create table t2(a int not null primary key, b blob, index(b(10))) engine=innodb row_format=compressed encrypted=yes; create table t3(a int not null primary key, b blob, index(b(10))) engine=innodb row_format=compressed encrypted=no; +Warnings: +Warning 140 InnoDB: ENCRYPTED=NO implies ENCRYPTION_KEY_ID=1 insert into t1 values (1, repeat('secret',6000)); insert into t2 values (1, repeat('secret',6000)); insert into t3 values (1, repeat('secret',6000)); diff --git a/mysql-test/suite/encryption/r/innodb-encryption-alter.result b/mysql-test/suite/encryption/r/innodb-encryption-alter.result index 2c6372e1c61..934f0607958 100644 --- a/mysql-test/suite/encryption/r/innodb-encryption-alter.result +++ b/mysql-test/suite/encryption/r/innodb-encryption-alter.result @@ -2,9 +2,16 @@ SET GLOBAL innodb_encrypt_tables = ON; SET GLOBAL innodb_encryption_threads = 4; CREATE TABLE t1 (pk INT PRIMARY KEY AUTO_INCREMENT, c VARCHAR(256)) ENGINE=INNODB ENCRYPTED=NO ENCRYPTION_KEY_ID=4; Warnings: -Warning 140 InnoDB: Ignored ENCRYPTION_KEY_ID 4 when encryption is disabled +Warning 140 InnoDB: ENCRYPTED=NO implies ENCRYPTION_KEY_ID=1 DROP TABLE t1; +set @save_global = @@GLOBAL.innodb_default_encryption_key_id; set innodb_default_encryption_key_id = 99; +Warnings: +Warning 1210 innodb_default_encryption_key=99 is not available +set global innodb_default_encryption_key_id = 99; +Warnings: +Warning 1210 innodb_default_encryption_key=99 is not available +set global innodb_default_encryption_key_id = @save_global; CREATE TABLE t1 (pk INT PRIMARY KEY AUTO_INCREMENT, c VARCHAR(256)) ENGINE=INNODB; ERROR HY000: Can't create table `test`.`t1` (errno: 140 "Wrong create options") SHOW WARNINGS; @@ -38,8 +45,6 @@ t1 CREATE TABLE `t1` ( PRIMARY KEY (`pk`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 `ENCRYPTION_KEY_ID`=4 CREATE TABLE t2 (pk INT PRIMARY KEY AUTO_INCREMENT, c VARCHAR(256)) ENGINE=INNODB ENCRYPTED=NO ENCRYPTION_KEY_ID=1; -Warnings: -Warning 140 InnoDB: Ignored ENCRYPTION_KEY_ID 1 when encryption is disabled ALTER TABLE t1 ENCRYPTION_KEY_ID=99; ERROR HY000: Table storage engine 'InnoDB' does not support the create option 'ENCRYPTION_KEY_ID' SHOW WARNINGS; @@ -51,38 +56,32 @@ drop table t1,t2; SET GLOBAL innodb_encrypt_tables=OFF; CREATE TABLE t1 (a int not null primary key) engine=innodb; ALTER TABLE t1 ENCRYPTION_KEY_ID=4; -ERROR HY000: Table storage engine 'InnoDB' does not support the create option 'ENCRYPTION_KEY_ID' -SHOW WARNINGS; -Level Code Message -Warning 140 InnoDB: innodb_encrypt_tables=OFF only allows ENCRYPTION_KEY_ID=1 -Error 1478 Table storage engine 'InnoDB' does not support the create option 'ENCRYPTION_KEY_ID' SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) NOT NULL, PRIMARY KEY (`a`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1 +) ENGINE=InnoDB DEFAULT CHARSET=latin1 `ENCRYPTION_KEY_ID`=4 DROP TABLE t1; CREATE TABLE t2 (a int not null primary key) engine=innodb; ALTER TABLE t2 ENCRYPTION_KEY_ID=4, ALGORITHM=COPY; -ERROR HY000: Can't create table `test`.`t2` (errno: 140 "Wrong create options") SHOW WARNINGS; Level Code Message -Warning 140 InnoDB: innodb_encrypt_tables=OFF only allows ENCRYPTION_KEY_ID=1 -Error 1005 Can't create table `test`.`t2` (errno: 140 "Wrong create options") -Warning 1030 Got error 140 "Wrong create options" from storage engine InnoDB SHOW CREATE TABLE t2; Table Create Table t2 CREATE TABLE `t2` ( `a` int(11) NOT NULL, PRIMARY KEY (`a`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1 +) ENGINE=InnoDB DEFAULT CHARSET=latin1 `ENCRYPTION_KEY_ID`=4 CREATE TABLE t3 (a int not null primary key) engine=innodb ENCRYPTION_KEY_ID=4; -ERROR HY000: Can't create table `test`.`t3` (errno: 140 "Wrong create options") +DROP TABLE t3; +SET GLOBAL innodb_encrypt_tables='FORCE'; +CREATE TABLE t1 (a int primary key) engine=innodb encrypted=no; +ERROR HY000: Can't create table `test`.`t1` (errno: 140 "Wrong create options") SHOW WARNINGS; Level Code Message -Warning 140 InnoDB: innodb_encrypt_tables=OFF only allows ENCRYPTION_KEY_ID=1 -Error 1005 Can't create table `test`.`t3` (errno: 140 "Wrong create options") +Warning 140 InnoDB: ENCRYPTED=NO cannot be used with innodb_encrypt_tables=FORCE +Error 1005 Can't create table `test`.`t1` (errno: 140 "Wrong create options") Warning 1030 Got error 140 "Wrong create options" from storage engine InnoDB FLUSH TABLES; create table t1(f1 int not null, f2 int not null)engine=innodb encrypted=yes; diff --git a/mysql-test/suite/encryption/t/innodb-encryption-alter.test b/mysql-test/suite/encryption/t/innodb-encryption-alter.test index bc7c3b3f13d..d9a0e4e95cd 100644 --- a/mysql-test/suite/encryption/t/innodb-encryption-alter.test +++ b/mysql-test/suite/encryption/t/innodb-encryption-alter.test @@ -12,7 +12,10 @@ SET GLOBAL innodb_encryption_threads = 4; CREATE TABLE t1 (pk INT PRIMARY KEY AUTO_INCREMENT, c VARCHAR(256)) ENGINE=INNODB ENCRYPTED=NO ENCRYPTION_KEY_ID=4; DROP TABLE t1; +set @save_global = @@GLOBAL.innodb_default_encryption_key_id; set innodb_default_encryption_key_id = 99; +set global innodb_default_encryption_key_id = 99; +set global innodb_default_encryption_key_id = @save_global; --error 1005 CREATE TABLE t1 (pk INT PRIMARY KEY AUTO_INCREMENT, c VARCHAR(256)) ENGINE=INNODB; SHOW WARNINGS; @@ -83,22 +86,24 @@ drop table t1,t2; # # MDEV-17230: encryption_key_id from alter is ignored by encryption threads # +--enable_warnings SET GLOBAL innodb_encrypt_tables=OFF; CREATE TABLE t1 (a int not null primary key) engine=innodb; ---error ER_ILLEGAL_HA_CREATE_OPTION ALTER TABLE t1 ENCRYPTION_KEY_ID=4; -SHOW WARNINGS; SHOW CREATE TABLE t1; DROP TABLE t1; CREATE TABLE t2 (a int not null primary key) engine=innodb; ---error ER_CANT_CREATE_TABLE ALTER TABLE t2 ENCRYPTION_KEY_ID=4, ALGORITHM=COPY; SHOW WARNINGS; SHOW CREATE TABLE t2; ---error ER_CANT_CREATE_TABLE CREATE TABLE t3 (a int not null primary key) engine=innodb ENCRYPTION_KEY_ID=4; +DROP TABLE t3; + +SET GLOBAL innodb_encrypt_tables='FORCE'; +--error ER_CANT_CREATE_TABLE +CREATE TABLE t1 (a int primary key) engine=innodb encrypted=no; SHOW WARNINGS; FLUSH TABLES; diff --git a/mysql-test/suite/galera/disabled.def b/mysql-test/suite/galera/disabled.def index 0ad0327f6fc..930229fc6da 100644 --- a/mysql-test/suite/galera/disabled.def +++ b/mysql-test/suite/galera/disabled.def @@ -23,22 +23,16 @@ galera_var_notify_cmd : MDEV-13549 Galera test failures galera_as_slave_replication_bundle : MDEV-13549 Galera test failures galera_ssl_upgrade : MDEV-13549 Galera test failures MW-329 : wsrep_local_replays not stable +MW-336 : MDEV-13549 incorrect wait_condition for wsrep_slave_threads changes MW-416 : MDEV-13549 Galera test failures -MW-388 : MDEV-13549 Galera test failures MW-44 : MDEV-15809 Test failure on galera.MW-44 galera_pc_ignore_sb : MDEV-15811 Test failure on galera_pc_ignore_sb galera_kill_applier : race condition at the start of the test galera_ist_progress: MDEV-15236 galera_ist_progress fails when trying to read transfer status pxc-421: Lock timeout exceeded galera_sst_mysqldump_with_key : MDEV-16890 Galera test failure -galera_gcs_fc_limit : Timeouts -pool_of_threads: WSREP has not yet prepared node for application use -galera_var_innodb_disallow_writes : Timeout -MW-336 : nondeterministic wsrep_thread_count -galera_binlog_stmt_autoinc : MDEV-17106 Test failure on galera.galera_binlog_stmt_autoinc galera_kill_ddl : MDEV-17108 Test failure on galera.galera_kill_ddl galera_var_node_address : MDEV-17151 Galera test failure on galera.galera_var_node_address -galera_binlog_stmt_autoinc: MDEV-17106 Test failure on galera.galera_binlog_stmt_autoinc galera_gc_fc_limit : MDEV-17061 Test failure on galera.galera_gc_fc_limit galera_as_slave_replication_budle : MDEV-15785 Test case galera_as_slave_replication_bundle caused debug assertion galera_wan : MDEV-17259: Test failure on galera.galera_wan diff --git a/mysql-test/suite/galera/r/MW-336.result b/mysql-test/suite/galera/r/MW-336.result index 5961d1f3e24..d344775648f 100644 --- a/mysql-test/suite/galera/r/MW-336.result +++ b/mysql-test/suite/galera/r/MW-336.result @@ -5,30 +5,9 @@ INSERT INTO t1 values(0); connection node_1; SET GLOBAL wsrep_slave_threads = 10; SET GLOBAL wsrep_slave_threads = 1; -<<<<<<< HEAD -SELECT COUNT(*) FROM INFORMATION_SCHEMA.PROCESSLIST WHERE USER = 'system user' AND (STATE IS NULL OR STATE NOT LIKE 'InnoDB%'); -COUNT(*) -11 -SHOW STATUS LIKE 'wsrep_thread_count'; -Variable_name Value -wsrep_thread_count 11 -connection node_2; -INSERT INTO t1 VALUES (1); -INSERT INTO t1 VALUES (1); -INSERT INTO t1 VALUES (1); -INSERT INTO t1 VALUES (1); -INSERT INTO t1 VALUES (1); -INSERT INTO t1 VALUES (1); -INSERT INTO t1 VALUES (1); -INSERT INTO t1 VALUES (1); -INSERT INTO t1 VALUES (1); -INSERT INTO t1 VALUES (1); -INSERT INTO t1 VALUES (1); -======= # Wait 10 slave threads to start 1 connection node_2; # Generate 12 replication events ->>>>>>> 10.2 connection node_1; SELECT COUNT(*) FROM t1; COUNT(*) @@ -40,90 +19,18 @@ SET GLOBAL wsrep_slave_threads = 20; # Wait 20 slave threads to start 3 SET GLOBAL wsrep_slave_threads = 1; connection node_2; -<<<<<<< HEAD -INSERT INTO t1 VALUES (1); -INSERT INTO t1 VALUES (1); -INSERT INTO t1 VALUES (1); -INSERT INTO t1 VALUES (1); -INSERT INTO t1 VALUES (1); -INSERT INTO t1 VALUES (1); -INSERT INTO t1 VALUES (1); -INSERT INTO t1 VALUES (1); -INSERT INTO t1 VALUES (1); -INSERT INTO t1 VALUES (1); -INSERT INTO t1 VALUES (1); -INSERT INTO t1 VALUES (1); -INSERT INTO t1 VALUES (1); -INSERT INTO t1 VALUES (1); -INSERT INTO t1 VALUES (1); -INSERT INTO t1 VALUES (1); -INSERT INTO t1 VALUES (1); -INSERT INTO t1 VALUES (1); -INSERT INTO t1 VALUES (1); -INSERT INTO t1 VALUES (1); -INSERT INTO t1 VALUES (1); -======= # Generate 40 replication events connection node_1; SELECT COUNT(*) FROM t1; COUNT(*) 53 # Wait 10 slave threads to exit 3 ->>>>>>> 10.2 SET GLOBAL wsrep_slave_threads = 10; SET GLOBAL wsrep_slave_threads = 0; Warnings: Warning 1292 Truncated incorrect wsrep_slave_threads value: '0' # Wait 10 slave threads to start 3 connection node_2; -<<<<<<< HEAD -INSERT INTO t1 VALUES (1); -INSERT INTO t1 VALUES (1); -INSERT INTO t1 VALUES (1); -INSERT INTO t1 VALUES (1); -INSERT INTO t1 VALUES (1); -INSERT INTO t1 VALUES (1); -INSERT INTO t1 VALUES (1); -INSERT INTO t1 VALUES (1); -INSERT INTO t1 VALUES (1); -INSERT INTO t1 VALUES (1); -INSERT INTO t1 VALUES (1); -INSERT INTO t1 VALUES (1); -INSERT INTO t1 VALUES (1); -INSERT INTO t1 VALUES (1); -INSERT INTO t1 VALUES (1); -INSERT INTO t1 VALUES (1); -INSERT INTO t1 VALUES (1); -INSERT INTO t1 VALUES (1); -INSERT INTO t1 VALUES (1); -INSERT INTO t1 VALUES (1); -INSERT INTO t1 VALUES (1); -connection node_1; -SET GLOBAL wsrep_slave_threads = 1; -connection node_2; -INSERT INTO t1 VALUES (1); -INSERT INTO t1 VALUES (1); -INSERT INTO t1 VALUES (1); -INSERT INTO t1 VALUES (1); -INSERT INTO t1 VALUES (1); -INSERT INTO t1 VALUES (1); -INSERT INTO t1 VALUES (1); -INSERT INTO t1 VALUES (1); -INSERT INTO t1 VALUES (1); -INSERT INTO t1 VALUES (1); -INSERT INTO t1 VALUES (1); -INSERT INTO t1 VALUES (1); -INSERT INTO t1 VALUES (1); -INSERT INTO t1 VALUES (1); -INSERT INTO t1 VALUES (1); -INSERT INTO t1 VALUES (1); -INSERT INTO t1 VALUES (1); -INSERT INTO t1 VALUES (1); -INSERT INTO t1 VALUES (1); -INSERT INTO t1 VALUES (1); -INSERT INTO t1 VALUES (1); -connection node_1; -======= # Generate 12 replication events connection node_1; SELECT COUNT(*) FROM t1; @@ -131,5 +38,4 @@ COUNT(*) 65 # Wait 10 slave threads to exit 4 connection node_1; ->>>>>>> 10.2 DROP TABLE t1; diff --git a/mysql-test/suite/galera/r/MW-86-wait1.result b/mysql-test/suite/galera/r/MW-86-wait1.result index 36cbfadf302..8ad9c8bf181 100644 --- a/mysql-test/suite/galera/r/MW-86-wait1.result +++ b/mysql-test/suite/galera/r/MW-86-wait1.result @@ -1,6 +1,6 @@ connection node_2; connection node_1; -SET @orig_debug=@@debug; +SET @orig_debug=@@debug_dbug; connection node_2; SELECT @@debug_sync; @@debug_sync diff --git a/mysql-test/suite/galera/r/MW-86-wait8.result b/mysql-test/suite/galera/r/MW-86-wait8.result index 6ac2c5f5e1f..07e59ebbe0a 100644 --- a/mysql-test/suite/galera/r/MW-86-wait8.result +++ b/mysql-test/suite/galera/r/MW-86-wait8.result @@ -1,6 +1,6 @@ connection node_2; connection node_1; -SET @orig_debug=@@debug; +SET @orig_debug=@@debug_dbug; connection node_2; SELECT @@debug_sync; @@debug_sync diff --git a/mysql-test/suite/galera/r/galera_binlog_stmt_autoinc.result b/mysql-test/suite/galera/r/galera_binlog_stmt_autoinc.result index 8e8b79b168f..a09ad6b97b9 100644 --- a/mysql-test/suite/galera/r/galera_binlog_stmt_autoinc.result +++ b/mysql-test/suite/galera/r/galera_binlog_stmt_autoinc.result @@ -1,4 +1,10 @@ +connection node_2; +connection node_1; +connection node_1; +connection node_2; +connection node_2; SET GLOBAL wsrep_forced_binlog_format='STATEMENT'; +connection node_1; SET GLOBAL wsrep_forced_binlog_format='STATEMENT'; CREATE TABLE t1 ( i int(11) NOT NULL AUTO_INCREMENT, @@ -8,21 +14,23 @@ PRIMARY KEY (i) insert into t1(i) values(null); select * from t1; i c -3 dummy_text +1 dummy_text insert into t1(i) values(null), (null), (null); select * from t1; i c +1 dummy_text 3 dummy_text 5 dummy_text 7 dummy_text -9 dummy_text +connection node_2; select * from t1; i c +1 dummy_text 3 dummy_text 5 dummy_text 7 dummy_text -9 dummy_text SET GLOBAL wsrep_forced_binlog_format='none'; +connection node_1; SET GLOBAL wsrep_forced_binlog_format='none'; drop table t1; SET SESSION binlog_format='STATEMENT'; @@ -40,20 +48,22 @@ PRIMARY KEY (i) insert into t1(i) values(null); select * from t1; i c -4 dummy_text +1 dummy_text insert into t1(i) values(null), (null), (null); select * from t1; i c +1 dummy_text 4 dummy_text 7 dummy_text 10 dummy_text -13 dummy_text +connection node_2; select * from t1; i c +1 dummy_text 4 dummy_text 7 dummy_text 10 dummy_text -13 dummy_text +connection node_1; SET GLOBAL wsrep_auto_increment_control='ON'; SET SESSION binlog_format='ROW'; show variables like 'binlog_format'; @@ -67,12 +77,14 @@ wsrep_auto_increment_control ON SET GLOBAL wsrep_auto_increment_control='OFF'; show variables like '%auto_increment%'; Variable_name Value -auto_increment_increment 2 +auto_increment_increment 3 auto_increment_offset 1 wsrep_auto_increment_control OFF SET GLOBAL wsrep_auto_increment_control='ON'; drop table t1; +connection node_2; SET GLOBAL wsrep_forced_binlog_format='ROW'; +connection node_1; SET GLOBAL wsrep_forced_binlog_format='ROW'; CREATE TABLE t1 ( i int(11) NOT NULL AUTO_INCREMENT, @@ -82,21 +94,23 @@ PRIMARY KEY (i) insert into t1(i) values(null); select * from t1; i c -3 dummy_text +1 dummy_text insert into t1(i) values(null), (null), (null); select * from t1; i c +1 dummy_text 3 dummy_text 5 dummy_text 7 dummy_text -9 dummy_text +connection node_2; select * from t1; i c +1 dummy_text 3 dummy_text 5 dummy_text 7 dummy_text -9 dummy_text SET GLOBAL wsrep_forced_binlog_format='none'; +connection node_1; SET GLOBAL wsrep_forced_binlog_format='none'; drop table t1; SET SESSION binlog_format='ROW'; @@ -114,20 +128,22 @@ PRIMARY KEY (i) insert into t1(i) values(null); select * from t1; i c -4 dummy_text +1 dummy_text insert into t1(i) values(null), (null), (null); select * from t1; i c +1 dummy_text 4 dummy_text 7 dummy_text 10 dummy_text -13 dummy_text +connection node_2; select * from t1; i c +1 dummy_text 4 dummy_text 7 dummy_text 10 dummy_text -13 dummy_text +connection node_1; SET GLOBAL wsrep_auto_increment_control='ON'; show variables like 'binlog_format'; Variable_name Value @@ -140,7 +156,7 @@ wsrep_auto_increment_control ON SET GLOBAL wsrep_auto_increment_control='OFF'; show variables like '%auto_increment%'; Variable_name Value -auto_increment_increment 2 +auto_increment_increment 3 auto_increment_offset 1 wsrep_auto_increment_control OFF SET GLOBAL wsrep_auto_increment_control='ON'; diff --git a/mysql-test/suite/galera/r/galera_mdl_race.result b/mysql-test/suite/galera/r/galera_mdl_race.result index e05c1493322..cf747ed8efb 100644 --- a/mysql-test/suite/galera/r/galera_mdl_race.result +++ b/mysql-test/suite/galera/r/galera_mdl_race.result @@ -1,7 +1,7 @@ connection node_2; connection node_1; -CREATE TABLE t1 (f1 INTEGER PRIMARY KEY, f2 CHAR(1)); -CREATE TABLE t2 (f1 INTEGER PRIMARY KEY, f2 CHAR(1)); +CREATE TABLE t1 (f1 INTEGER PRIMARY KEY, f2 CHAR(1)) engine=innodb; +CREATE TABLE t2 (f1 INTEGER PRIMARY KEY, f2 CHAR(1)) engine=innodb; INSERT INTO t1 VALUES (1, 'a'); INSERT INTO t1 VALUES (2, 'a'); connection node_1; @@ -12,20 +12,14 @@ connect node_1a, 127.0.0.1, root, , test, $NODE_MYPORT_1; connection node_1a; LOCK TABLE t2 WRITE; connection node_1; -SET GLOBAL DEBUG = "d,sync.wsrep_before_mdl_wait"; -Warnings: -Warning 1287 '@@debug' is deprecated and will be removed in a future release. Please use '@@debug_dbug' instead +SET @@debug_dbug = "d,sync.wsrep_before_mdl_wait"; SELECT * FROM t2;; connection node_1a; -SET GLOBAL DEBUG = "d,sync.wsrep_after_BF_victim_lock"; -Warnings: -Warning 1287 '@@debug' is deprecated and will be removed in a future release. Please use '@@debug_dbug' instead +SET @@debug_dbug = "d,sync.wsrep_after_BF_victim_lock"; connection node_2; UPDATE t1 SET f2 = 'c' WHERE f1 = 1; connection node_1a; -SET GLOBAL DEBUG = ""; -Warnings: -Warning 1287 '@@debug' is deprecated and will be removed in a future release. Please use '@@debug_dbug' instead +SET @@debug_dbug = ""; SET DEBUG_SYNC = "now SIGNAL signal.wsrep_before_mdl_wait"; SET DEBUG_SYNC = "now SIGNAL signal.wsrep_after_BF_victim_lock"; UNLOCK TABLES; diff --git a/mysql-test/suite/galera/r/galera_query_cache_sync_wait.result b/mysql-test/suite/galera/r/galera_query_cache_sync_wait.result index 4ee910f9169..0f2f61ea97f 100644 --- a/mysql-test/suite/galera/r/galera_query_cache_sync_wait.result +++ b/mysql-test/suite/galera/r/galera_query_cache_sync_wait.result @@ -4,9 +4,7 @@ CREATE TABLE t1 (id INT PRIMARY KEY AUTO_INCREMENT) ENGINE=InnoDB; INSERT INTO t1 VALUES (1); connection node_2; SET GLOBAL wsrep_provider_options = "repl.causal_read_timeout=PT1S"; -SET GLOBAL DEBUG = "d,sync.wsrep_apply_cb"; -Warnings: -Warning 1287 '@@debug' is deprecated and will be removed in a future release. Please use '@@debug_dbug' instead +SET GLOBAL debug_dbug = "d,sync.wsrep_apply_cb"; SELECT MAX(id) FROM t1; MAX(id) 1 @@ -15,23 +13,17 @@ INSERT INTO t1 VALUES (2); connection node_2; SELECT MAX(id) FROM t1; ERROR HY000: Lock wait timeout exceeded; try restarting transaction -SET GLOBAL DEBUG = ""; -Warnings: -Warning 1287 '@@debug' is deprecated and will be removed in a future release. Please use '@@debug_dbug' instead +SET GLOBAL debug_dbug = ""; SET DEBUG_SYNC = "now SIGNAL signal.wsrep_apply_cb"; FLUSH QUERY CACHE; -SET GLOBAL DEBUG = "d,sync.wsrep_apply_cb"; -Warnings: -Warning 1287 '@@debug' is deprecated and will be removed in a future release. Please use '@@debug_dbug' instead +SET GLOBAL debug_dbug = "d,sync.wsrep_apply_cb"; SET DEBUG_SYNC = "RESET"; connection node_1; INSERT INTO t1 VALUES (3); connection node_2; SELECT MAX(id) FROM t1; ERROR HY000: Lock wait timeout exceeded; try restarting transaction -SET GLOBAL DEBUG = ""; -Warnings: -Warning 1287 '@@debug' is deprecated and will be removed in a future release. Please use '@@debug_dbug' instead +SET GLOBAL debug_dbug = ""; SET DEBUG_SYNC = "now SIGNAL signal.wsrep_apply_cb"; connection node_1; INSERT INTO t1 VALUES (4); @@ -46,18 +38,14 @@ MAX(id) SELECT VARIABLE_VALUE = 1 FROM INFORMATION_SCHEMA.SESSION_STATUS WHERE VARIABLE_NAME = 'Qcache_hits'; VARIABLE_VALUE = 1 1 -SET GLOBAL DEBUG = "d,sync.wsrep_apply_cb"; -Warnings: -Warning 1287 '@@debug' is deprecated and will be removed in a future release. Please use '@@debug_dbug' instead +SET GLOBAL debug_dbug = "d,sync.wsrep_apply_cb"; connection node_1; INSERT INTO t1 VALUES (5); connection node_2; SELECT MAX(id) FROM t1 ; connect node_2a, 127.0.0.1, root, , test, $NODE_MYPORT_2; connection node_2a; -SET GLOBAL DEBUG = ""; -Warnings: -Warning 1287 '@@debug' is deprecated and will be removed in a future release. Please use '@@debug_dbug' instead +SET GLOBAL debug_dbug = ""; SET DEBUG_SYNC = "now SIGNAL signal.wsrep_apply_cb"; connection node_2; MAX(id) diff --git a/mysql-test/suite/galera/t/MW-336.test b/mysql-test/suite/galera/t/MW-336.test index 67715c24992..6549ecfe6ea 100644 --- a/mysql-test/suite/galera/t/MW-336.test +++ b/mysql-test/suite/galera/t/MW-336.test @@ -6,74 +6,118 @@ --source include/have_innodb.inc CREATE TABLE t1 (f1 INTEGER) Engine=InnoDB; +INSERT INTO t1 values(0); --connection node_1 SET GLOBAL wsrep_slave_threads = 10; SET GLOBAL wsrep_slave_threads = 1; + +--echo # Wait 10 slave threads to start 1 --let $wait_timeout=600 --let $wait_condition = SELECT COUNT(*) = 12 FROM INFORMATION_SCHEMA.PROCESSLIST WHERE USER = 'system user' AND (STATE IS NULL OR STATE NOT LIKE 'InnoDB%'); --source include/wait_condition.inc -SELECT COUNT(*) FROM INFORMATION_SCHEMA.PROCESSLIST WHERE USER = 'system user' AND (STATE IS NULL OR STATE NOT LIKE 'InnoDB%'); -SHOW STATUS LIKE 'wsrep_thread_count'; - --connection node_2 -# Generate 11 replication events ---let $count = 11 +# Wait until inserts are replicated +--let $wait_condition = SELECT COUNT(*) = 1 FROM t1; +--source include/wait_condition.inc +--echo # Generate 12 replication events +--disable_query_log +--disable_result_log +--let $count = 12 while ($count) { INSERT INTO t1 VALUES (1); --dec $count } +--enable_result_log +--enable_query_log --connection node_1 +# Wait until inserts are replicated +--let $wait_condition = SELECT COUNT(*) = 13 FROM t1; +--source include/wait_condition.inc + +SELECT COUNT(*) FROM t1; + +--echo # Wait 9 slave threads to exit 1 +# Wait until appliers exit +--let $wait_condition = SELECT COUNT(*) = 2 FROM INFORMATION_SCHEMA.PROCESSLIST WHERE USER = 'system user' AND (STATE IS NULL OR STATE NOT LIKE 'InnoDB%'); +--source include/wait_condition.inc SET GLOBAL wsrep_slave_threads = 10; + +--echo # Wait 10 slave threads to start 2 --let $wait_condition = SELECT COUNT(*) = 12 FROM INFORMATION_SCHEMA.PROCESSLIST WHERE USER = 'system user' AND (STATE IS NULL OR STATE NOT LIKE 'InnoDB%'); --source include/wait_condition.inc SET GLOBAL wsrep_slave_threads = 20; + +--echo # Wait 20 slave threads to start 3 --let $wait_condition = SELECT COUNT(*) = 22 FROM INFORMATION_SCHEMA.PROCESSLIST WHERE USER = 'system user' AND (STATE IS NULL OR STATE NOT LIKE 'InnoDB%'); --source include/wait_condition.inc SET GLOBAL wsrep_slave_threads = 1; --connection node_2 -# Generate 21 replication events ---let $count = 21 +--echo # Generate 40 replication events +--disable_query_log +--disable_result_log +--let $count = 40 while ($count) { INSERT INTO t1 VALUES (1); --dec $count } +--enable_query_log +--enable_result_log + +--connection node_1 + +# Wait until inserts are replicated +--let $wait_condition = SELECT COUNT(*) = 53 FROM t1; +--source include/wait_condition.inc + +SELECT COUNT(*) FROM t1; + +--echo # Wait 10 slave threads to exit 3 +# Wait until appliers exit +--let $wait_condition = SELECT COUNT(*) = 2 FROM INFORMATION_SCHEMA.PROCESSLIST WHERE USER = 'system user' AND (STATE IS NULL OR STATE NOT LIKE 'InnoDB%'); +--source include/wait_condition.inc SET GLOBAL wsrep_slave_threads = 10; SET GLOBAL wsrep_slave_threads = 0; +--echo # Wait 10 slave threads to start 3 +--let $wait_timeout=600 +--let $wait_condition = SELECT COUNT(*) = 11 FROM INFORMATION_SCHEMA.PROCESSLIST WHERE USER = 'system user' AND (STATE IS NULL OR STATE NOT LIKE 'InnoDB%'); +--source include/wait_condition.inc + --connection node_2 -# Generate 21 replication events ---let $count = 21 +--echo # Generate 12 replication events +--disable_query_log +--disable_result_log +--let $count = 12 while ($count) { INSERT INTO t1 VALUES (1); --dec $count } +--enable_result_log +--enable_query_log --connection node_1 ---let $wait_condition = SELECT COUNT(*) = 3 FROM INFORMATION_SCHEMA.PROCESSLIST WHERE USER = 'system user' AND (STATE IS NULL OR STATE NOT LIKE 'InnoDB%'); +# Wait until inserts are replicated +--let $wait_condition = SELECT COUNT(*) = 65 FROM t1; --source include/wait_condition.inc -SET GLOBAL wsrep_slave_threads = 1; +SELECT COUNT(*) FROM t1; ---connection node_2 -# Generate 21 replication events ---let $count = 21 -while ($count) -{ - INSERT INTO t1 VALUES (1); - --dec $count -} +--echo # Wait 10 slave threads to exit 4 +# Wait until appliers exit +--let $wait_condition = SELECT COUNT(*) = 2 FROM INFORMATION_SCHEMA.PROCESSLIST WHERE USER = 'system user' AND (STATE IS NULL OR STATE NOT LIKE 'InnoDB%'); +--source include/wait_condition.inc --connection node_1 DROP TABLE t1; diff --git a/mysql-test/suite/galera/t/MW-388.test b/mysql-test/suite/galera/t/MW-388.test index 9cf176434ba..4df1fc1a03f 100644 --- a/mysql-test/suite/galera/t/MW-388.test +++ b/mysql-test/suite/galera/t/MW-388.test @@ -1,6 +1,4 @@ --source include/galera_cluster.inc ---source include/have_innodb.inc ---source include/have_debug.inc --source include/have_debug_sync.inc --connection node_1 CREATE TABLE t1 (f1 INTEGER PRIMARY KEY, f2 CHAR(255)) Engine=InnoDB; @@ -28,6 +26,7 @@ DELIMITER ;| # that of the INSERT. Because there is only one slave thread, # commit cut is not processed and therefore does not advance # local monitor, and our INSERT remains stuck there. + SET GLOBAL wsrep_slave_threads = 2; SET GLOBAL DEBUG_DBUG = "d,sync.wsrep_apply_cb"; diff --git a/mysql-test/suite/galera/t/MW-86-wait1.test b/mysql-test/suite/galera/t/MW-86-wait1.test index aee5a0b2486..9fe863bf340 100644 --- a/mysql-test/suite/galera/t/MW-86-wait1.test +++ b/mysql-test/suite/galera/t/MW-86-wait1.test @@ -6,7 +6,7 @@ --source include/galera_cluster.inc --source include/have_binlog_format_row.inc --source include/have_debug_sync.inc -SET @orig_debug=@@debug; +SET @orig_debug=@@debug_dbug; --connection node_2 # Make sure no signals have been leftover from previous tests to surprise us. @@ -92,7 +92,6 @@ SHOW WARNINGS; --enable_result_log # Unblock the background INSERT and remove the sync point. -#SET GLOBAL debug_dbug = "-d,sync.wsrep_apply_cb"; SET GLOBAL debug_dbug = @orig_debug; SET SESSION debug_sync = "now SIGNAL signal.wsrep_apply_cb"; diff --git a/mysql-test/suite/galera/t/MW-86-wait8.test b/mysql-test/suite/galera/t/MW-86-wait8.test index c40cd8b77c7..7d9e54a16ba 100644 --- a/mysql-test/suite/galera/t/MW-86-wait8.test +++ b/mysql-test/suite/galera/t/MW-86-wait8.test @@ -4,7 +4,7 @@ --source include/galera_cluster.inc --source include/have_binlog_format_row.inc --source include/have_debug_sync.inc -SET @orig_debug=@@debug; +SET @orig_debug=@@debug_dbug; --connection node_2 # Make sure no signals have been leftover from previous tests to surprise us. @@ -113,7 +113,6 @@ SHOW WARNINGS; --enable_query_log # Unblock the background INSERT and remove the sync point. -#SET GLOBAL debug = "-d,sync.wsrep_apply_cb"; SET GLOBAL debug_dbug = @orig_debug; SET DEBUG_SYNC = "now SIGNAL signal.wsrep_apply_cb"; diff --git a/mysql-test/suite/galera/t/galera_mdl_race.test b/mysql-test/suite/galera/t/galera_mdl_race.test index 508b85add4b..ad6770f9991 100644 --- a/mysql-test/suite/galera/t/galera_mdl_race.test +++ b/mysql-test/suite/galera/t/galera_mdl_race.test @@ -3,11 +3,10 @@ # --source include/galera_cluster.inc ---source include/have_innodb.inc --source include/have_debug_sync.inc -CREATE TABLE t1 (f1 INTEGER PRIMARY KEY, f2 CHAR(1)); -CREATE TABLE t2 (f1 INTEGER PRIMARY KEY, f2 CHAR(1)); +CREATE TABLE t1 (f1 INTEGER PRIMARY KEY, f2 CHAR(1)) engine=innodb; +CREATE TABLE t2 (f1 INTEGER PRIMARY KEY, f2 CHAR(1)) engine=innodb; INSERT INTO t1 VALUES (1, 'a'); INSERT INTO t1 VALUES (2, 'a'); @@ -24,7 +23,7 @@ LOCK TABLE t2 WRITE; # Block before MLD lock wait --connection node_1 - SET GLOBAL DEBUG = "d,sync.wsrep_before_mdl_wait"; + SET @@debug_dbug = "d,sync.wsrep_before_mdl_wait"; --send SELECT * FROM t2; # Wait for SELECT to be blocked @@ -35,27 +34,21 @@ LOCK TABLE t2 WRITE; #--source include/wait_condition.inc # block applier to wait after BF victim is locked -SET GLOBAL DEBUG = "d,sync.wsrep_after_BF_victim_lock"; +SET @@debug_dbug = "d,sync.wsrep_after_BF_victim_lock"; # Issue a conflicting update on node #2 --connection node_2 UPDATE t1 SET f2 = 'c' WHERE f1 = 1; ---sleep 3 - # Unblock the SELECT, to enter wsrep_thd_is_BF --connection node_1a -SET GLOBAL DEBUG = ""; +SET @@debug_dbug = ""; SET DEBUG_SYNC = "now SIGNAL signal.wsrep_before_mdl_wait"; ---sleep 3 - # unblock applier to try to BF the SELECT SET DEBUG_SYNC = "now SIGNAL signal.wsrep_after_BF_victim_lock"; - # table lock is not needed anymore ---sleep 3 UNLOCK TABLES; # SELECT succeeds diff --git a/mysql-test/suite/galera/t/galera_query_cache_sync_wait.test b/mysql-test/suite/galera/t/galera_query_cache_sync_wait.test index 87afc2d7bb2..e13e7f1f748 100644 --- a/mysql-test/suite/galera/t/galera_query_cache_sync_wait.test +++ b/mysql-test/suite/galera/t/galera_query_cache_sync_wait.test @@ -1,5 +1,4 @@ --source include/galera_cluster.inc ---source include/have_innodb.inc --source include/have_debug_sync.inc --source include/have_query_cache.inc @@ -9,7 +8,7 @@ INSERT INTO t1 VALUES (1); --connection node_2 --let $wsrep_provider_options_orig = `SELECT @@wsrep_provider_options` SET GLOBAL wsrep_provider_options = "repl.causal_read_timeout=PT1S"; -SET GLOBAL DEBUG = "d,sync.wsrep_apply_cb"; +SET GLOBAL debug_dbug = "d,sync.wsrep_apply_cb"; SELECT MAX(id) FROM t1; # first lookup miss # @@ -22,11 +21,11 @@ INSERT INTO t1 VALUES (2); --connection node_2 --error ER_LOCK_WAIT_TIMEOUT SELECT MAX(id) FROM t1; -SET GLOBAL DEBUG = ""; +SET GLOBAL debug_dbug = ""; SET DEBUG_SYNC = "now SIGNAL signal.wsrep_apply_cb"; FLUSH QUERY CACHE; -SET GLOBAL DEBUG = "d,sync.wsrep_apply_cb"; +SET GLOBAL debug_dbug = "d,sync.wsrep_apply_cb"; SET DEBUG_SYNC = "RESET"; # @@ -39,7 +38,7 @@ INSERT INTO t1 VALUES (3); --connection node_2 --error ER_LOCK_WAIT_TIMEOUT SELECT MAX(id) FROM t1; -SET GLOBAL DEBUG = ""; +SET GLOBAL debug_dbug = ""; SET DEBUG_SYNC = "now SIGNAL signal.wsrep_apply_cb"; # @@ -59,7 +58,7 @@ SELECT MAX(id) FROM t1; FLUSH STATUS; SELECT MAX(id) FROM t1; SELECT VARIABLE_VALUE = 1 FROM INFORMATION_SCHEMA.SESSION_STATUS WHERE VARIABLE_NAME = 'Qcache_hits'; -SET GLOBAL DEBUG = "d,sync.wsrep_apply_cb"; +SET GLOBAL debug_dbug = "d,sync.wsrep_apply_cb"; # # Query cache invalidated @@ -73,7 +72,7 @@ INSERT INTO t1 VALUES (5); --connect node_2a, 127.0.0.1, root, , test, $NODE_MYPORT_2 --connection node_2a -SET GLOBAL DEBUG = ""; +SET GLOBAL debug_dbug = ""; SET DEBUG_SYNC = "now SIGNAL signal.wsrep_apply_cb"; --connection node_2 diff --git a/mysql-test/suite/innodb/r/alter_table.result b/mysql-test/suite/innodb/r/alter_table.result index 3a765a61dd2..0cfd3096f3f 100644 --- a/mysql-test/suite/innodb/r/alter_table.result +++ b/mysql-test/suite/innodb/r/alter_table.result @@ -22,6 +22,37 @@ alter table t1 change column id2 id4 varchar(100) not null; select * from t1 where id4 like 'a'; id1 id4 id3 drop table t1; +# +# MDEV-17725 Assertion `!is_set() || (m_status == DA_OK_BULK && is_bulk_op())' failed in Diagnostics_area::set_ok_status upon ALTER failing due to error from engine +# +SET sql_mode=STRICT_ALL_TABLES; +CREATE TABLE t1 (pk INT PRIMARY KEY) ENGINE=InnoDB; +ALTER TABLE t1 ORDER BY a; +Warnings: +Warning 1105 ORDER BY ignored as there is a user-defined clustered index in the table 't1' +DROP TABLE t1; +SET sql_mode=''; +CREATE TABLE t1 (pk INT PRIMARY KEY) ENGINE=InnoDB; +ALTER TABLE t1 ORDER BY a; +Warnings: +Warning 1105 ORDER BY ignored as there is a user-defined clustered index in the table 't1' +DROP TABLE t1; +SET sql_mode=DEFAULT; +# +# MDEV-18775 Server crashes in dict_table_t::instant_column +# upon ADD COLUMN +# +CREATE TABLE tx (pk INT PRIMARY KEY) ENGINE=InnoDB; +CREATE TABLE t1 (pk INT, a INT, PRIMARY KEY (pk), KEY (a), FOREIGN KEY (a) REFERENCES tx (pk)) ENGINE=InnoDB; +SET FOREIGN_KEY_CHECKS=OFF; +ALTER TABLE t1 DROP a; +ERROR HY000: Cannot drop column 'a': needed in a foreign key constraint 'test/t1_ibfk_1' +SET FOREIGN_KEY_CHECKS=ON; +ALTER TABLE t1 ADD b INT; +ALTER TABLE t1 DROP a; +ERROR HY000: Cannot drop index 'a': needed in a foreign key constraint +ALTER TABLE t1 ADD c INT; +DROP TABLE t1, tx; create table t1 (a int) transactional=1 engine=aria; create table t2 (a int) transactional=1 engine=innodb; show create table t1; diff --git a/mysql-test/suite/innodb/r/innodb-alter-nullable.result b/mysql-test/suite/innodb/r/innodb-alter-nullable.result index 632f7885b8e..68ad6762335 100644 --- a/mysql-test/suite/innodb/r/innodb-alter-nullable.result +++ b/mysql-test/suite/innodb/r/innodb-alter-nullable.result @@ -3,12 +3,9 @@ INSERT INTO t VALUES (1,2,3),(4,5,6),(7,8,9); ALTER TABLE t CHANGE c1 c1 INT NULL FIRST, ALGORITHM=INPLACE; affected rows: 0 info: Records: 0 Duplicates: 0 Warnings: 0 -set @old_sql_mode = @@sql_mode; -set @@sql_mode = 'STRICT_TRANS_TABLES'; ALTER TABLE t MODIFY c3 INT NOT NULL, ALGORITHM=INPLACE; affected rows: 0 info: Records: 0 Duplicates: 0 Warnings: 0 -set @@sql_mode = @old_sql_mode; ALTER TABLE t CHANGE c2 c2 INT, CHANGE c2 c2 INT NOT NULL; ERROR 42S22: Unknown column 'c2' in 't' ALTER TABLE t MODIFY c2 INT, MODIFY c2 INT NOT NULL; @@ -24,8 +21,6 @@ ALTER TABLE t MODIFY c2 INT NOT NULL; affected rows: 0 info: Records: 0 Duplicates: 0 Warnings: 0 connect con1,localhost,root,,; -connection con1; -SET SQL_MODE='STRICT_ALL_TABLES'; UPDATE t SET c2=NULL; ERROR 23000: Column 'c2' cannot be null SELECT * FROM t; @@ -61,3 +56,152 @@ CREATE TABLE t1(c1 INT) ENGINE=InnoDB; ALTER TABLE t1 ADD CONSTRAINT UNIQUE KEY i1(c1); ALTER TABLE t1 CHANGE c1 c1 INT NOT NULL,ADD KEY(c1); DROP TABLE t1; +# +# MDEV-18732 InnoDB: ALTER IGNORE returns error for NULL +# +CREATE TABLE t1(c INT) ENGINE=InnoDB; +INSERT INTO t1 VALUES (NULL); +ALTER IGNORE TABLE t1 MODIFY c INT NOT NULL; +affected rows: 0 +info: Records: 0 Duplicates: 0 Warnings: 1 +Warnings: +Warning 1265 Data truncated for column 'c' at row 1 +INSERT INTO t1 VALUES (NULL); +ERROR 23000: Column 'c' cannot be null +SELECT * FROM t1; +c +0 +DROP TABLE t1; +CREATE TABLE t1(c INT) ENGINE=InnoDB; +INSERT INTO t1 VALUES (NULL),(1),(1); +ALTER IGNORE TABLE t1 ADD UNIQUE(c); +affected rows: 3 +info: Records: 3 Duplicates: 1 Warnings: 0 +ALTER IGNORE TABLE t1 ADD PRIMARY KEY(c); +affected rows: 2 +info: Records: 2 Duplicates: 0 Warnings: 1 +Warnings: +Warning 1265 Data truncated for column 'c' at row 1 +SELECT * FROM t1; +c +0 +1 +DROP TABLE t1; +CREATE TABLE t1(c INT, g INT AS (c) PERSISTENT) ENGINE=InnoDB; +CREATE TABLE t2(c INT, v INT AS (c) VIRTUAL) ENGINE=InnoDB; +CREATE TABLE t3(c INT, v INT AS (c) VIRTUAL, INDEX(v)) ENGINE=InnoDB; +INSERT INTO t1 SET c=NULL; +INSERT INTO t2 SET c=NULL; +INSERT INTO t3 SET c=NULL; +SET @old_sql_mode = @@sql_mode; +SET sql_mode = ''; +ALTER TABLE t1 MODIFY c INT NOT NULL; +affected rows: 0 +info: Records: 0 Duplicates: 0 Warnings: 1 +Warnings: +Warning 1265 Data truncated for column 'c' at row 1 +ALTER TABLE t2 MODIFY c INT NOT NULL; +affected rows: 0 +info: Records: 0 Duplicates: 0 Warnings: 1 +Warnings: +Warning 1265 Data truncated for column 'c' at row 1 +ALTER TABLE t3 MODIFY c INT NOT NULL; +affected rows: 1 +info: Records: 1 Duplicates: 0 Warnings: 1 +Warnings: +Warning 1265 Data truncated for column 'c' at row 1 +SET sql_mode = @old_sql_mode; +# MDEV-18819 FIXME: Wrong result g=NULL +SELECT * FROM t1; +c g +0 NULL +SELECT * FROM t2; +c v +0 0 +SELECT * FROM t3; +c v +0 0 +SELECT v FROM t3 FORCE INDEX(v); +v +0 +CHECK TABLE t1,t2,t3; +Table Op Msg_type Msg_text +test.t1 check status OK +test.t2 check status OK +test.t3 check status OK +DROP TABLE t1,t2,t3; +CREATE TABLE t1(c INT, g INT AS (c) PERSISTENT) ENGINE=InnoDB; +CREATE TABLE t2(c INT, v INT AS (c) VIRTUAL) ENGINE=InnoDB; +CREATE TABLE t3(c INT, v INT AS (c) VIRTUAL, INDEX(v)) ENGINE=InnoDB; +INSERT INTO t1 SET c=NULL; +INSERT INTO t2 SET c=NULL; +INSERT INTO t3 SET c=NULL; +ALTER IGNORE TABLE t1 MODIFY c INT NOT NULL; +affected rows: 0 +info: Records: 0 Duplicates: 0 Warnings: 1 +Warnings: +Warning 1265 Data truncated for column 'c' at row 1 +ALTER IGNORE TABLE t2 MODIFY c INT NOT NULL; +affected rows: 0 +info: Records: 0 Duplicates: 0 Warnings: 1 +Warnings: +Warning 1265 Data truncated for column 'c' at row 1 +ALTER IGNORE TABLE t3 MODIFY c INT NOT NULL; +affected rows: 1 +info: Records: 1 Duplicates: 0 Warnings: 1 +Warnings: +Warning 1265 Data truncated for column 'c' at row 1 +# MDEV-18819 FIXME: Wrong result g=NULL +SELECT * FROM t1; +c g +0 NULL +SELECT * FROM t2; +c v +0 0 +SELECT * FROM t3; +c v +0 0 +SELECT v FROM t3 FORCE INDEX(v); +v +0 +CHECK TABLE t1,t2,t3; +Table Op Msg_type Msg_text +test.t1 check status OK +test.t2 check status OK +test.t3 check status OK +DROP TABLE t1,t2,t3; +CREATE TABLE t1(c INT, g INT AS (c) PERSISTENT) ENGINE=InnoDB; +CREATE TABLE t2(c INT, v INT AS (c) VIRTUAL) ENGINE=InnoDB; +CREATE TABLE t3(c INT, v INT AS (c) VIRTUAL, INDEX(v)) ENGINE=InnoDB; +INSERT INTO t1 SET c=NULL; +INSERT INTO t2 SET c=NULL; +INSERT INTO t3 SET c=NULL; +ALTER TABLE t1 MODIFY c INT NOT NULL; +ERROR 01000: Data truncated for column 'c' at row 1 +ALTER TABLE t2 MODIFY c INT NOT NULL; +ERROR 01000: Data truncated for column 'c' at row 1 +ALTER TABLE t3 MODIFY c INT NOT NULL; +ERROR 01000: Data truncated for column 'c' at row 1 +UPDATE t1 SET c=0; +UPDATE t2 SET c=0; +UPDATE t3 SET c=0; +ALTER TABLE t1 MODIFY c INT NOT NULL; +affected rows: 0 +info: Records: 0 Duplicates: 0 Warnings: 0 +ALTER TABLE t2 MODIFY c INT NOT NULL; +affected rows: 0 +info: Records: 0 Duplicates: 0 Warnings: 0 +# MDEV-18819 FIXME: This should not require ALGORITHM=COPY. +ALTER TABLE t3 MODIFY c INT NOT NULL; +affected rows: 1 +info: Records: 1 Duplicates: 0 Warnings: 0 +SELECT * FROM t1; +c g +0 0 +SELECT * FROM t2; +c v +0 0 +SELECT * FROM t3; +c v +0 0 +DROP TABLE t1,t2,t3; diff --git a/mysql-test/suite/innodb/r/innodb-alter-timestamp.result b/mysql-test/suite/innodb/r/innodb-alter-timestamp.result index d4c0aa6a50e..516ac333a87 100644 --- a/mysql-test/suite/innodb/r/innodb-alter-timestamp.result +++ b/mysql-test/suite/innodb/r/innodb-alter-timestamp.result @@ -10,10 +10,15 @@ ALTER TABLE t1 CHANGE i1 id INT UNSIGNED NOT NULL AUTO_INCREMENT, ADD PRIMARY KEY(id), ALGORITHM=INPLACE; ERROR 0A000: ALGORITHM=INPLACE is not supported. Reason: Cannot change column type INPLACE. Try ALGORITHM=COPY ALTER IGNORE TABLE t1 ADD PRIMARY KEY(i1), ALGORITHM=INPLACE; +ERROR 0A000: ALGORITHM=INPLACE is not supported. Reason: Creating unique indexes with IGNORE requires COPY algorithm to remove duplicate rows. Try ALGORITHM=COPY +SET @old_sql_mode = @@sql_mode; +SET sql_mode = ''; +ALTER TABLE t1 ADD PRIMARY KEY(i1), ALGORITHM=INPLACE; affected rows: 0 info: Records: 0 Duplicates: 0 Warnings: 1 Warnings: Warning 1265 Data truncated for column 'i1' at row 1 +SET sql_mode = @old_sql_mode; ALTER TABLE t1 CHANGE i1 id INT UNSIGNED NOT NULL AUTO_INCREMENT; affected rows: 1 info: Records: 1 Duplicates: 0 Warnings: 0 diff --git a/mysql-test/suite/innodb/r/innodb-table-online.result b/mysql-test/suite/innodb/r/innodb-table-online.result index 363ca07e1bc..7872332a4a8 100644 --- a/mysql-test/suite/innodb/r/innodb-table-online.result +++ b/mysql-test/suite/innodb/r/innodb-table-online.result @@ -397,15 +397,11 @@ UPDATE t1 SET c3 = NULL WHERE c3 = ''; SET lock_wait_timeout = 1; ALTER TABLE t1 DROP COLUMN c22f, ADD PRIMARY KEY c3p5(c3(5)); ERROR 42000: Key column 'c22f' doesn't exist in table -SET @old_sql_mode = @@sql_mode; -SET @@sql_mode = 'STRICT_TRANS_TABLES'; ALTER IGNORE TABLE t1 DROP COLUMN c22f, DROP PRIMARY KEY, ADD PRIMARY KEY c3p5(c3(5)), ALGORITHM = INPLACE; -ERROR 23000: Duplicate entry '' for key 'PRIMARY' -SET @@sql_mode = @old_sql_mode; +ERROR 0A000: ALGORITHM=INPLACE is not supported. Reason: Creating unique indexes with IGNORE requires COPY algorithm to remove duplicate rows. Try ALGORITHM=COPY UPDATE t1 SET c3=LEFT(CONCAT(c1,REPEAT('foo',c1)),255) WHERE c3 IS NULL; SET DEBUG_SYNC = 'row_log_table_apply1_before SIGNAL c3p5_created0 WAIT_FOR ins_done0'; -SET @@sql_mode = 'STRICT_TRANS_TABLES'; ALTER TABLE t1 MODIFY c3 CHAR(255) NOT NULL, DROP COLUMN c22f, DROP PRIMARY KEY, ADD PRIMARY KEY(c1,c4(5)), ADD COLUMN c5 CHAR(5) DEFAULT 'tired' FIRST; @@ -419,7 +415,6 @@ SET DEBUG_SYNC = 'now SIGNAL ins_done0'; # session con1 connection con1; ERROR 01000: Data truncated for column 'c3' at row 323 -SET @@sql_mode = @old_sql_mode; # session default connection default; ROLLBACK; diff --git a/mysql-test/suite/innodb/r/instant_alter_debug.result b/mysql-test/suite/innodb/r/instant_alter_debug.result index 4989c801738..866aeb48f67 100644 --- a/mysql-test/suite/innodb/r/instant_alter_debug.result +++ b/mysql-test/suite/innodb/r/instant_alter_debug.result @@ -246,7 +246,7 @@ ALTER TABLE t1 ADD COLUMN d INT, ALGORITHM=INSTANT; UPDATE t1 SET d=1; connection ddl; SET DEBUG_SYNC='row_log_table_apply1_before SIGNAL copied WAIT_FOR logged'; -ALTER IGNORE TABLE t1 DROP PRIMARY KEY, ADD PRIMARY KEY (a,d); +ALTER TABLE t1 DROP PRIMARY KEY, ADD PRIMARY KEY (a,d); connection default; SET DEBUG_SYNC = 'now WAIT_FOR copied'; BEGIN; diff --git a/mysql-test/suite/innodb/t/alter_table.test b/mysql-test/suite/innodb/t/alter_table.test index 1a43016a38e..a8b52732c91 100644 --- a/mysql-test/suite/innodb/t/alter_table.test +++ b/mysql-test/suite/innodb/t/alter_table.test @@ -23,6 +23,43 @@ alter table t1 change column id2 id4 varchar(100) not null; select * from t1 where id4 like 'a'; drop table t1; +--echo # +--echo # MDEV-17725 Assertion `!is_set() || (m_status == DA_OK_BULK && is_bulk_op())' failed in Diagnostics_area::set_ok_status upon ALTER failing due to error from engine +--echo # + +SET sql_mode=STRICT_ALL_TABLES; +CREATE TABLE t1 (pk INT PRIMARY KEY) ENGINE=InnoDB; +ALTER TABLE t1 ORDER BY a; +DROP TABLE t1; + +SET sql_mode=''; +CREATE TABLE t1 (pk INT PRIMARY KEY) ENGINE=InnoDB; +ALTER TABLE t1 ORDER BY a; +DROP TABLE t1; + +SET sql_mode=DEFAULT; + +--echo # +--echo # MDEV-18775 Server crashes in dict_table_t::instant_column +--echo # upon ADD COLUMN +--echo # + +CREATE TABLE tx (pk INT PRIMARY KEY) ENGINE=InnoDB; +CREATE TABLE t1 (pk INT, a INT, PRIMARY KEY (pk), KEY (a), FOREIGN KEY (a) REFERENCES tx (pk)) ENGINE=InnoDB; + +SET FOREIGN_KEY_CHECKS=OFF; + +--error ER_FK_COLUMN_CANNOT_DROP +ALTER TABLE t1 DROP a; + +SET FOREIGN_KEY_CHECKS=ON; + +ALTER TABLE t1 ADD b INT; +--error ER_DROP_INDEX_FK +ALTER TABLE t1 DROP a; +ALTER TABLE t1 ADD c INT; +DROP TABLE t1, tx; + # # Check that innodb supports transactional=1 # diff --git a/mysql-test/suite/innodb/t/innodb-alter-nullable.test b/mysql-test/suite/innodb/t/innodb-alter-nullable.test index d039459f91f..9e6f5df2bc9 100644 --- a/mysql-test/suite/innodb/t/innodb-alter-nullable.test +++ b/mysql-test/suite/innodb/t/innodb-alter-nullable.test @@ -13,14 +13,7 @@ INSERT INTO t VALUES (1,2,3),(4,5,6),(7,8,9); ALTER TABLE t CHANGE c1 c1 INT NULL FIRST, ALGORITHM=INPLACE; # NULL -> NOT NULL only allowed INPLACE if strict sql_mode is on. ---disable_info -set @old_sql_mode = @@sql_mode; -set @@sql_mode = 'STRICT_TRANS_TABLES'; ---enable_info ALTER TABLE t MODIFY c3 INT NOT NULL, ALGORITHM=INPLACE; ---disable_info -set @@sql_mode = @old_sql_mode; ---enable_info # Request some conflicting changes for a single column. --error ER_BAD_FIELD_ERROR @@ -38,9 +31,6 @@ ALTER TABLE t MODIFY c2 INT NOT NULL; --disable_info connect (con1,localhost,root,,); -connection con1; - -SET SQL_MODE='STRICT_ALL_TABLES'; --error ER_BAD_NULL_ERROR UPDATE t SET c2=NULL; @@ -76,6 +66,99 @@ ALTER TABLE t1 ADD CONSTRAINT UNIQUE KEY i1(c1); ALTER TABLE t1 CHANGE c1 c1 INT NOT NULL,ADD KEY(c1); DROP TABLE t1; +--echo # +--echo # MDEV-18732 InnoDB: ALTER IGNORE returns error for NULL +--echo # + +CREATE TABLE t1(c INT) ENGINE=InnoDB; +INSERT INTO t1 VALUES (NULL); +--enable_info +ALTER IGNORE TABLE t1 MODIFY c INT NOT NULL; +--disable_info +--error ER_BAD_NULL_ERROR +INSERT INTO t1 VALUES (NULL); +SELECT * FROM t1; +DROP TABLE t1; + +CREATE TABLE t1(c INT) ENGINE=InnoDB; +INSERT INTO t1 VALUES (NULL),(1),(1); +--enable_info +ALTER IGNORE TABLE t1 ADD UNIQUE(c); +ALTER IGNORE TABLE t1 ADD PRIMARY KEY(c); +--disable_info +SELECT * FROM t1; +DROP TABLE t1; + +CREATE TABLE t1(c INT, g INT AS (c) PERSISTENT) ENGINE=InnoDB; +CREATE TABLE t2(c INT, v INT AS (c) VIRTUAL) ENGINE=InnoDB; +CREATE TABLE t3(c INT, v INT AS (c) VIRTUAL, INDEX(v)) ENGINE=InnoDB; +INSERT INTO t1 SET c=NULL; +INSERT INTO t2 SET c=NULL; +INSERT INTO t3 SET c=NULL; +SET @old_sql_mode = @@sql_mode; +# Allow lossy conversions of data +SET sql_mode = ''; +--enable_info +ALTER TABLE t1 MODIFY c INT NOT NULL; +ALTER TABLE t2 MODIFY c INT NOT NULL; +ALTER TABLE t3 MODIFY c INT NOT NULL; +--disable_info +SET sql_mode = @old_sql_mode; +--echo # MDEV-18819 FIXME: Wrong result g=NULL +SELECT * FROM t1; +SELECT * FROM t2; +SELECT * FROM t3; +SELECT v FROM t3 FORCE INDEX(v); +CHECK TABLE t1,t2,t3; +DROP TABLE t1,t2,t3; + +CREATE TABLE t1(c INT, g INT AS (c) PERSISTENT) ENGINE=InnoDB; +CREATE TABLE t2(c INT, v INT AS (c) VIRTUAL) ENGINE=InnoDB; +CREATE TABLE t3(c INT, v INT AS (c) VIRTUAL, INDEX(v)) ENGINE=InnoDB; +INSERT INTO t1 SET c=NULL; +INSERT INTO t2 SET c=NULL; +INSERT INTO t3 SET c=NULL; +--enable_info +ALTER IGNORE TABLE t1 MODIFY c INT NOT NULL; +ALTER IGNORE TABLE t2 MODIFY c INT NOT NULL; +ALTER IGNORE TABLE t3 MODIFY c INT NOT NULL; +--disable_info +--echo # MDEV-18819 FIXME: Wrong result g=NULL +SELECT * FROM t1; +SELECT * FROM t2; +SELECT * FROM t3; +SELECT v FROM t3 FORCE INDEX(v); +CHECK TABLE t1,t2,t3; +DROP TABLE t1,t2,t3; + +CREATE TABLE t1(c INT, g INT AS (c) PERSISTENT) ENGINE=InnoDB; +CREATE TABLE t2(c INT, v INT AS (c) VIRTUAL) ENGINE=InnoDB; +CREATE TABLE t3(c INT, v INT AS (c) VIRTUAL, INDEX(v)) ENGINE=InnoDB; +INSERT INTO t1 SET c=NULL; +INSERT INTO t2 SET c=NULL; +INSERT INTO t3 SET c=NULL; +--enable_info +--error WARN_DATA_TRUNCATED +ALTER TABLE t1 MODIFY c INT NOT NULL; +--error WARN_DATA_TRUNCATED +ALTER TABLE t2 MODIFY c INT NOT NULL; +--error WARN_DATA_TRUNCATED +ALTER TABLE t3 MODIFY c INT NOT NULL; +--disable_info +UPDATE t1 SET c=0; +UPDATE t2 SET c=0; +UPDATE t3 SET c=0; +--enable_info +ALTER TABLE t1 MODIFY c INT NOT NULL; +ALTER TABLE t2 MODIFY c INT NOT NULL; +--echo # MDEV-18819 FIXME: This should not require ALGORITHM=COPY. +ALTER TABLE t3 MODIFY c INT NOT NULL; +--disable_info +SELECT * FROM t1; +SELECT * FROM t2; +SELECT * FROM t3; +DROP TABLE t1,t2,t3; + # Check that all connections opened by test cases in this file are really # gone so execution of other tests won't be affected by their presence. --source include/wait_until_count_sessions.inc diff --git a/mysql-test/suite/innodb/t/innodb-alter-timestamp.test b/mysql-test/suite/innodb/t/innodb-alter-timestamp.test index 8b56fb5be5d..1fabdc8f24d 100644 --- a/mysql-test/suite/innodb/t/innodb-alter-timestamp.test +++ b/mysql-test/suite/innodb/t/innodb-alter-timestamp.test @@ -12,7 +12,19 @@ ALGORITHM=COPY; --error ER_ALTER_OPERATION_NOT_SUPPORTED_REASON ALTER TABLE t1 CHANGE i1 id INT UNSIGNED NOT NULL AUTO_INCREMENT, ADD PRIMARY KEY(id), ALGORITHM=INPLACE; + +# ALTER IGNORE cannot create unique or primary key with ALGORITHM=INPLACE. +--error ER_ALTER_OPERATION_NOT_SUPPORTED_REASON ALTER IGNORE TABLE t1 ADD PRIMARY KEY(i1), ALGORITHM=INPLACE; +# Try the same with ALTER TABLE, using non-strict sql_mode. +--disable_info +SET @old_sql_mode = @@sql_mode; +SET sql_mode = ''; +--enable_info +ALTER TABLE t1 ADD PRIMARY KEY(i1), ALGORITHM=INPLACE; +--disable_info +SET sql_mode = @old_sql_mode; +--enable_info ALTER TABLE t1 CHANGE i1 id INT UNSIGNED NOT NULL AUTO_INCREMENT; --disable_info SELECT * FROM t1; diff --git a/mysql-test/suite/innodb/t/innodb-table-online.test b/mysql-test/suite/innodb/t/innodb-table-online.test index 2b3879bc707..ce014b0aa00 100644 --- a/mysql-test/suite/innodb/t/innodb-table-online.test +++ b/mysql-test/suite/innodb/t/innodb-table-online.test @@ -350,20 +350,16 @@ UPDATE t1 SET c3 = NULL WHERE c3 = ''; SET lock_wait_timeout = 1; --error ER_KEY_COLUMN_DOES_NOT_EXITS ALTER TABLE t1 DROP COLUMN c22f, ADD PRIMARY KEY c3p5(c3(5)); -SET @old_sql_mode = @@sql_mode; -# NULL -> NOT NULL only allowed INPLACE if strict sql_mode is on. -# And adding a PRIMARY KEY will also add NOT NULL implicitly! -SET @@sql_mode = 'STRICT_TRANS_TABLES'; ---error ER_DUP_ENTRY +# NULL -> NOT NULL is only allowed INPLACE without IGNORE. +# Adding a PRIMARY KEY will add NOT NULL implicitly! +--error ER_ALTER_OPERATION_NOT_SUPPORTED_REASON ALTER IGNORE TABLE t1 DROP COLUMN c22f, DROP PRIMARY KEY, ADD PRIMARY KEY c3p5(c3(5)), ALGORITHM = INPLACE; -SET @@sql_mode = @old_sql_mode; UPDATE t1 SET c3=LEFT(CONCAT(c1,REPEAT('foo',c1)),255) WHERE c3 IS NULL; SET DEBUG_SYNC = 'row_log_table_apply1_before SIGNAL c3p5_created0 WAIT_FOR ins_done0'; -# NULL -> NOT NULL only allowed INPLACE if strict sql_mode is on. -SET @@sql_mode = 'STRICT_TRANS_TABLES'; +# NULL -> NOT NULL is allowed INPLACE. --send ALTER TABLE t1 MODIFY c3 CHAR(255) NOT NULL, DROP COLUMN c22f, DROP PRIMARY KEY, ADD PRIMARY KEY(c1,c4(5)), @@ -382,7 +378,6 @@ SET DEBUG_SYNC = 'now SIGNAL ins_done0'; connection con1; --error WARN_DATA_TRUNCATED reap; -SET @@sql_mode = @old_sql_mode; --echo # session default connection default; diff --git a/mysql-test/suite/innodb/t/instant_alter_debug.test b/mysql-test/suite/innodb/t/instant_alter_debug.test index fcccbd9a750..73a222cb23c 100644 --- a/mysql-test/suite/innodb/t/instant_alter_debug.test +++ b/mysql-test/suite/innodb/t/instant_alter_debug.test @@ -281,7 +281,7 @@ UPDATE t1 SET d=1; connection ddl; SET DEBUG_SYNC='row_log_table_apply1_before SIGNAL copied WAIT_FOR logged'; -send ALTER IGNORE TABLE t1 DROP PRIMARY KEY, ADD PRIMARY KEY (a,d); +send ALTER TABLE t1 DROP PRIMARY KEY, ADD PRIMARY KEY (a,d); connection default; SET DEBUG_SYNC = 'now WAIT_FOR copied'; diff --git a/mysql-test/suite/parts/r/partition_auto_increment_max.result b/mysql-test/suite/parts/r/partition_auto_increment_max.result new file mode 100644 index 00000000000..65a3900e8e6 --- /dev/null +++ b/mysql-test/suite/parts/r/partition_auto_increment_max.result @@ -0,0 +1,7 @@ +CREATE TABLE t1 (pk INT AUTO_INCREMENT PRIMARY KEY) PARTITION BY KEY (pk) PARTITIONS 2; +INSERT INTO t1 VALUES (NULL),(NULL); +UPDATE t1 SET pk = 2147483647; +ERROR 23000: Duplicate entry '2147483647' for key 'PRIMARY' +REPLACE INTO t1 VALUES (NULL); +ERROR 22003: Out of range value for column 'pk' at row 1 +DROP TABLE t1; diff --git a/mysql-test/suite/parts/t/partition_auto_increment_max.test b/mysql-test/suite/parts/t/partition_auto_increment_max.test new file mode 100644 index 00000000000..74e6139131d --- /dev/null +++ b/mysql-test/suite/parts/t/partition_auto_increment_max.test @@ -0,0 +1,12 @@ +--source include/have_partition.inc +--source include/have_log_bin.inc + +CREATE TABLE t1 (pk INT AUTO_INCREMENT PRIMARY KEY) PARTITION BY KEY (pk) PARTITIONS 2; +INSERT INTO t1 VALUES (NULL),(NULL); + +--error ER_DUP_ENTRY +UPDATE t1 SET pk = 2147483647; +--error HA_ERR_AUTOINC_ERANGE +REPLACE INTO t1 VALUES (NULL); + +DROP TABLE t1; diff --git a/mysql-test/suite/vcol/r/vcol_keys_myisam.result b/mysql-test/suite/vcol/r/vcol_keys_myisam.result index 0b257d12ca0..a2613e0dfa1 100644 --- a/mysql-test/suite/vcol/r/vcol_keys_myisam.result +++ b/mysql-test/suite/vcol/r/vcol_keys_myisam.result @@ -376,3 +376,11 @@ repair table t1 extended; Table Op Msg_type Msg_text test.t1 repair status OK drop table t1; +create table t1 ( id int primary key, +hexid varchar(10) generated always as (hex(id)) stored, +key (hexid)) engine=myisam; +insert into t1 (id) select 100; +select * from t1; +id hexid +100 64 +drop table t1; diff --git a/mysql-test/suite/vcol/t/vcol_keys_myisam.test b/mysql-test/suite/vcol/t/vcol_keys_myisam.test index 337d14c3074..3269979fc9e 100644 --- a/mysql-test/suite/vcol/t/vcol_keys_myisam.test +++ b/mysql-test/suite/vcol/t/vcol_keys_myisam.test @@ -262,3 +262,13 @@ create table t1 ( insert into t1 values (null, 0); repair table t1 extended; drop table t1; + +# +# MDEV-18486 Database crash on a table with indexed virtual column +# +create table t1 ( id int primary key, + hexid varchar(10) generated always as (hex(id)) stored, + key (hexid)) engine=myisam; +insert into t1 (id) select 100; +select * from t1; +drop table t1; |