diff options
author | Sergei Golubchik <serg@mariadb.org> | 2018-05-11 13:12:18 +0200 |
---|---|---|
committer | Sergei Golubchik <serg@mariadb.org> | 2018-05-11 13:15:10 +0200 |
commit | c9717dc0190731c656cce31fa6e39a3db123e3af (patch) | |
tree | 3db056a3f50e565294d127edb5339afb0a994749 /mysql-test/main | |
parent | 33721d91389759a917463a044fbd6f0b7654d629 (diff) | |
parent | 1d411a8a440922f0538c1be254d6f4396af453a1 (diff) | |
download | mariadb-git-c9717dc0190731c656cce31fa6e39a3db123e3af.tar.gz |
Merge branch '10.2' into 10.3
Diffstat (limited to 'mysql-test/main')
-rw-r--r-- | mysql-test/main/assign_key_cache.result | 13 | ||||
-rw-r--r-- | mysql-test/main/assign_key_cache.test | 13 | ||||
-rw-r--r-- | mysql-test/main/assign_key_cache_debug.result (renamed from mysql-test/main/assign_key_cache-5405.result) | 0 | ||||
-rw-r--r-- | mysql-test/main/assign_key_cache_debug.test (renamed from mysql-test/main/assign_key_cache-5405.test) | 0 | ||||
-rw-r--r-- | mysql-test/main/connect_debug.result | 5 | ||||
-rw-r--r-- | mysql-test/main/connect_debug.test | 12 | ||||
-rw-r--r-- | mysql-test/main/implicit_commit.result | 4 | ||||
-rw-r--r-- | mysql-test/main/ps.result | 11 | ||||
-rw-r--r-- | mysql-test/main/ps.test | 15 | ||||
-rw-r--r-- | mysql-test/main/sp-innodb.result | 34 | ||||
-rw-r--r-- | mysql-test/main/sp-innodb.test | 42 | ||||
-rw-r--r-- | mysql-test/main/subselect_sj.result | 26 | ||||
-rw-r--r-- | mysql-test/main/subselect_sj.test | 30 | ||||
-rw-r--r-- | mysql-test/main/subselect_sj_jcl6.result | 26 |
14 files changed, 229 insertions, 2 deletions
diff --git a/mysql-test/main/assign_key_cache.result b/mysql-test/main/assign_key_cache.result new file mode 100644 index 00000000000..4ed6170136b --- /dev/null +++ b/mysql-test/main/assign_key_cache.result @@ -0,0 +1,13 @@ +set global my_cache.key_buffer_size = 1024*1024; +create table t1 (i int) engine=myisam partition by hash (i) partitions 2; +xa start 'xid'; +cache index t1 partition (non_existing_partition) in my_cache; +Table Op Msg_type Msg_text +test.t1 assign_to_keycache error Error in list of partitions to test.t1 +cache index t1 partition (p1) in my_cache; +Table Op Msg_type Msg_text +test.t1 assign_to_keycache status OK +xa end 'xid'; +xa rollback 'xid'; +drop table t1; +set global my_cache.key_buffer_size = 0; diff --git a/mysql-test/main/assign_key_cache.test b/mysql-test/main/assign_key_cache.test new file mode 100644 index 00000000000..401e7bf9138 --- /dev/null +++ b/mysql-test/main/assign_key_cache.test @@ -0,0 +1,13 @@ +# +# MDEV-15216 Assertion `! is_set() || m_can_overwrite_status' failed in Diagnostics_area::set_error_status upon operation inside XA +# +--source include/have_partition.inc +set global my_cache.key_buffer_size = 1024*1024; +create table t1 (i int) engine=myisam partition by hash (i) partitions 2; +xa start 'xid'; +cache index t1 partition (non_existing_partition) in my_cache; +cache index t1 partition (p1) in my_cache; +xa end 'xid'; +xa rollback 'xid'; +drop table t1; +set global my_cache.key_buffer_size = 0; diff --git a/mysql-test/main/assign_key_cache-5405.result b/mysql-test/main/assign_key_cache_debug.result index c4cb56f3f72..c4cb56f3f72 100644 --- a/mysql-test/main/assign_key_cache-5405.result +++ b/mysql-test/main/assign_key_cache_debug.result diff --git a/mysql-test/main/assign_key_cache-5405.test b/mysql-test/main/assign_key_cache_debug.test index 2839e040bd3..2839e040bd3 100644 --- a/mysql-test/main/assign_key_cache-5405.test +++ b/mysql-test/main/assign_key_cache_debug.test diff --git a/mysql-test/main/connect_debug.result b/mysql-test/main/connect_debug.result new file mode 100644 index 00000000000..0452b238db9 --- /dev/null +++ b/mysql-test/main/connect_debug.result @@ -0,0 +1,5 @@ +set @old_dbug=@@global.debug_dbug; +set global debug_dbug='+d,auth_disconnect'; +create user 'bad' identified by 'worse'; +set global debug_dbug=@old_dbug; +drop user bad; diff --git a/mysql-test/main/connect_debug.test b/mysql-test/main/connect_debug.test new file mode 100644 index 00000000000..299b605b2cd --- /dev/null +++ b/mysql-test/main/connect_debug.test @@ -0,0 +1,12 @@ +source include/have_debug.inc; +set @old_dbug=@@global.debug_dbug; + +# +# use after free if need plugin change and auth aborted +# +set global debug_dbug='+d,auth_disconnect'; +create user 'bad' identified by 'worse'; +--error 1 +--exec $MYSQL --default-auth=mysql_old_password --user=bad --password=worse +set global debug_dbug=@old_dbug; +drop user bad; diff --git a/mysql-test/main/implicit_commit.result b/mysql-test/main/implicit_commit.result index 07536ab0719..b0cd0b75e8d 100644 --- a/mysql-test/main/implicit_commit.result +++ b/mysql-test/main/implicit_commit.result @@ -562,7 +562,7 @@ INSERT INTO db1.trans (a) VALUES (1); cache index t3 in keycache; CALL db1.test_if_commit(); IMPLICIT COMMIT -YES +NO set global keycache.key_buffer_size=0; # # SQLCOM_PRELOAD_KEYS @@ -571,7 +571,7 @@ INSERT INTO db1.trans (a) VALUES (1); load index into cache t3; CALL db1.test_if_commit(); IMPLICIT COMMIT -YES +NO # # SQLCOM_FLUSH # diff --git a/mysql-test/main/ps.result b/mysql-test/main/ps.result index 89de00a38bc..f9d0b004591 100644 --- a/mysql-test/main/ps.result +++ b/mysql-test/main/ps.result @@ -5240,3 +5240,14 @@ END; $$ CALL p1('x'); DROP PROCEDURE p1; +create table t1 (b blob default ''); +prepare stmt from "alter table t1 force"; +execute stmt; +execute stmt; +execute stmt; +set names latin1; +prepare stmt from "alter table t1 modify b text character set utf8 default 'a'"; +execute stmt; +execute stmt; +execute stmt; +drop table t1; diff --git a/mysql-test/main/ps.test b/mysql-test/main/ps.test index 59b157e2393..7ab24cd541d 100644 --- a/mysql-test/main/ps.test +++ b/mysql-test/main/ps.test @@ -4672,3 +4672,18 @@ DELIMITER ;$$ --disable_result_log CALL p1('x'); DROP PROCEDURE p1; + +# +# MDEV-15746 ASAN heap-use-after-free in Item_change_list::rollback_item_tree_changes on ALTER executed as PS +# +create table t1 (b blob default ''); +prepare stmt from "alter table t1 force"; +execute stmt; +execute stmt; +execute stmt; +set names latin1; +prepare stmt from "alter table t1 modify b text character set utf8 default 'a'"; +execute stmt; +execute stmt; +execute stmt; +drop table t1; diff --git a/mysql-test/main/sp-innodb.result b/mysql-test/main/sp-innodb.result index 2c3bc7dc4f3..6a4fe5146a4 100644 --- a/mysql-test/main/sp-innodb.result +++ b/mysql-test/main/sp-innodb.result @@ -133,3 +133,37 @@ SET @@innodb_lock_wait_timeout= @innodb_lock_wait_timeout_saved; # # BUG 16041903: End of test case # +# +# MDEV-15035: SP using query with outer join and a parameter +# in ON expression +# +CREATE TABLE t1 ( +id int NOT NULL, +PRIMARY KEY (id) +) ENGINE=InnoDB; +INSERT INTO t1 VALUES (1), (2); +CREATE TABLE t2 ( +id int NOT NULL, +id_foo int NOT NULL, +PRIMARY KEY (id) +) ENGINE=InnoDB; +INSERT INTO t2 VALUES (1, 1); +DROP PROCEDURE IF EXISTS test_proc; +CREATE PROCEDURE test_proc(IN param int) +LANGUAGE SQL +READS SQL DATA +BEGIN +SELECT DISTINCT f.id +FROM t1 f +LEFT OUTER JOIN t2 b ON b.id_foo = f.id +WHERE (param <> 0 OR b.id IS NOT NULL); +END| +CALL test_proc(0); +id +1 +CALL test_proc(1); +id +1 +2 +DROP PROCEDURE IF EXISTS test_proc; +DROP TABLE t1, t2; diff --git a/mysql-test/main/sp-innodb.test b/mysql-test/main/sp-innodb.test index 23715166a02..e44a853e713 100644 --- a/mysql-test/main/sp-innodb.test +++ b/mysql-test/main/sp-innodb.test @@ -158,5 +158,47 @@ SET @@innodb_lock_wait_timeout= @innodb_lock_wait_timeout_saved; --echo # BUG 16041903: End of test case --echo # +--echo # +--echo # MDEV-15035: SP using query with outer join and a parameter +--echo # in ON expression +--echo # + +CREATE TABLE t1 ( + id int NOT NULL, + PRIMARY KEY (id) +) ENGINE=InnoDB; + +INSERT INTO t1 VALUES (1), (2); + +CREATE TABLE t2 ( + id int NOT NULL, + id_foo int NOT NULL, + PRIMARY KEY (id) +) ENGINE=InnoDB; + +INSERT INTO t2 VALUES (1, 1); + +--disable_warnings +DROP PROCEDURE IF EXISTS test_proc; +--enable_warnings + +DELIMITER |; +CREATE PROCEDURE test_proc(IN param int) +LANGUAGE SQL +READS SQL DATA +BEGIN + SELECT DISTINCT f.id + FROM t1 f + LEFT OUTER JOIN t2 b ON b.id_foo = f.id + WHERE (param <> 0 OR b.id IS NOT NULL); +END| +DELIMITER ;| + +CALL test_proc(0); +CALL test_proc(1); + +DROP PROCEDURE IF EXISTS test_proc; +DROP TABLE t1, t2; + # Wait till we reached the initial number of concurrent sessions --source include/wait_until_count_sessions.inc diff --git a/mysql-test/main/subselect_sj.result b/mysql-test/main/subselect_sj.result index 9631192da33..b50ae942899 100644 --- a/mysql-test/main/subselect_sj.result +++ b/mysql-test/main/subselect_sj.result @@ -3165,4 +3165,30 @@ id select_type table type possible_keys key key_len ref rows filtered Extra Warnings: Note 1003 /* select#1 */ select `test`.`t1`.`c1` AS `c1`,`test`.`t2`.`c2` AS `c2`,`test`.`t4`.`c4` AS `c4` from `test`.`t1` left join (`test`.`t2` join `test`.`t4`) on(`test`.`t2`.`c2` = `test`.`t1`.`c1` and <in_optimizer>(`test`.`t1`.`c1`,<exists>(/* select#3 */ select `test`.`t3`.`c3` from `test`.`t3` where <cache>(`test`.`t2`.`c2`) = `test`.`t3`.`c3`))) where 1 DROP TABLE t1,t2,t3,t4; +# +# MDEV-13699: Assertion `!new_field->field_name.str || +# strlen(new_field->field_name.str) == new_field->field_name.length' +# failed in create_tmp_table on 2nd execution of PS with semijoin +# +CREATE TABLE t1 (a INT); +INSERT INTO t1 VALUES (1),(2); +CREATE TABLE t2 (b INT); +INSERT INTO t2 VALUES (3),(4); +CREATE TABLE t3 (c INT); +CREATE ALGORITHM=MERGE VIEW v3 AS SELECT * FROM t3; +INSERT INTO t3 VALUES (5),(6); +PREPARE stmt FROM +"SELECT * FROM t1 + WHERE EXISTS ( + SELECT * FROM t2 WHERE t1.a IN ( SELECT c AS fld FROM v3 ) + )"; +EXECUTE stmt; +a +EXECUTE stmt; +a +EXECUTE stmt; +a +drop view v3; +drop table t1,t2,t3; +# End of 5.5 test set optimizer_switch=@subselect_sj_tmp; diff --git a/mysql-test/main/subselect_sj.test b/mysql-test/main/subselect_sj.test index 6fdccee339d..04770761553 100644 --- a/mysql-test/main/subselect_sj.test +++ b/mysql-test/main/subselect_sj.test @@ -2846,5 +2846,35 @@ eval EXPLAIN EXTENDED $q2; DROP TABLE t1,t2,t3,t4; +--echo # +--echo # MDEV-13699: Assertion `!new_field->field_name.str || +--echo # strlen(new_field->field_name.str) == new_field->field_name.length' +--echo # failed in create_tmp_table on 2nd execution of PS with semijoin +--echo # + +CREATE TABLE t1 (a INT); +INSERT INTO t1 VALUES (1),(2); + +CREATE TABLE t2 (b INT); +INSERT INTO t2 VALUES (3),(4); + +CREATE TABLE t3 (c INT); +CREATE ALGORITHM=MERGE VIEW v3 AS SELECT * FROM t3; +INSERT INTO t3 VALUES (5),(6); + +PREPARE stmt FROM + "SELECT * FROM t1 + WHERE EXISTS ( + SELECT * FROM t2 WHERE t1.a IN ( SELECT c AS fld FROM v3 ) + )"; +EXECUTE stmt; +EXECUTE stmt; +EXECUTE stmt; + +drop view v3; +drop table t1,t2,t3; + +--echo # End of 5.5 test + # The following command must be the last one the file set optimizer_switch=@subselect_sj_tmp; diff --git a/mysql-test/main/subselect_sj_jcl6.result b/mysql-test/main/subselect_sj_jcl6.result index 77a073ea2d3..d7b77be7b54 100644 --- a/mysql-test/main/subselect_sj_jcl6.result +++ b/mysql-test/main/subselect_sj_jcl6.result @@ -3179,6 +3179,32 @@ id select_type table type possible_keys key key_len ref rows filtered Extra Warnings: Note 1003 /* select#1 */ select `test`.`t1`.`c1` AS `c1`,`test`.`t2`.`c2` AS `c2`,`test`.`t4`.`c4` AS `c4` from `test`.`t1` left join (`test`.`t2` join `test`.`t4`) on(`test`.`t2`.`c2` = `test`.`t1`.`c1` and <in_optimizer>(`test`.`t1`.`c1`,<exists>(/* select#3 */ select `test`.`t3`.`c3` from `test`.`t3` where <cache>(`test`.`t2`.`c2`) = `test`.`t3`.`c3`))) where 1 DROP TABLE t1,t2,t3,t4; +# +# MDEV-13699: Assertion `!new_field->field_name.str || +# strlen(new_field->field_name.str) == new_field->field_name.length' +# failed in create_tmp_table on 2nd execution of PS with semijoin +# +CREATE TABLE t1 (a INT); +INSERT INTO t1 VALUES (1),(2); +CREATE TABLE t2 (b INT); +INSERT INTO t2 VALUES (3),(4); +CREATE TABLE t3 (c INT); +CREATE ALGORITHM=MERGE VIEW v3 AS SELECT * FROM t3; +INSERT INTO t3 VALUES (5),(6); +PREPARE stmt FROM +"SELECT * FROM t1 + WHERE EXISTS ( + SELECT * FROM t2 WHERE t1.a IN ( SELECT c AS fld FROM v3 ) + )"; +EXECUTE stmt; +a +EXECUTE stmt; +a +EXECUTE stmt; +a +drop view v3; +drop table t1,t2,t3; +# End of 5.5 test set optimizer_switch=@subselect_sj_tmp; # # BUG#49129: Wrong result with IN-subquery with join_cache_level=6 and firstmatch=off |