diff options
Diffstat (limited to 'mysql-test/t')
-rw-r--r-- | mysql-test/t/derived_view.test | 27 | ||||
-rw-r--r-- | mysql-test/t/failed_auth_unixsocket.test | 30 | ||||
-rw-r--r-- | mysql-test/t/func_compress.test | 21 | ||||
-rw-r--r-- | mysql-test/t/func_misc.test | 17 | ||||
-rw-r--r-- | mysql-test/t/locked_temporary-5955.test | 10 | ||||
-rw-r--r-- | mysql-test/t/partition.test | 46 | ||||
-rw-r--r-- | mysql-test/t/partition_innodb.test | 47 | ||||
-rw-r--r-- | mysql-test/t/subselect4.test | 21 | ||||
-rw-r--r-- | mysql-test/t/subselect_sj_mat.test | 18 | ||||
-rw-r--r-- | mysql-test/t/view.test | 19 |
10 files changed, 209 insertions, 47 deletions
diff --git a/mysql-test/t/derived_view.test b/mysql-test/t/derived_view.test index 61e11cebad4..de08b1c4d0d 100644 --- a/mysql-test/t/derived_view.test +++ b/mysql-test/t/derived_view.test @@ -1704,6 +1704,33 @@ ORDER BY gallery_name ASC drop table galleries, pictures; --echo # +--echo # MDEV-5740: Assertion +--echo #`!derived->first_select()->exclude_from_table_unique_test || +--echo #derived->outer_select()-> exclude_from_table_unique_test' +--echo #failed on 2nd execution of PS with derived_merge +--echo # + +set @save_optimizer_switch5740=@@optimizer_switch; +SET optimizer_switch = 'derived_merge=on'; + +CREATE TABLE t1 (a INT); +INSERT INTO t1 VALUES (1),(2); +CREATE TABLE t2 (b INT); +INSERT INTO t2 VALUES (3),(4); + +PREPARE stmt FROM ' + INSERT INTO t1 SELECT * FROM t2 UNION SELECT * FROM (SELECT * FROM t1) AS sq +'; +EXECUTE stmt; +select * from t1; +EXECUTE stmt; +select * from t1; +deallocate prepare stmt; + +drop table t1,t2; +set optimizer_switch=@save_optimizer_switch5740; + +--echo # --echo # end of 5.3 tests --echo # diff --git a/mysql-test/t/failed_auth_unixsocket.test b/mysql-test/t/failed_auth_unixsocket.test new file mode 100644 index 00000000000..ba31cf6a59f --- /dev/null +++ b/mysql-test/t/failed_auth_unixsocket.test @@ -0,0 +1,30 @@ +--source include/have_unix_socket.inc + +# +# MDEV-3909 remote user enumeration +# unix_socket tests +# +update mysql.user set plugin='unix_socket'; +flush privileges; + +--replace_result $MASTER_MYSOCK MASTER_SOCKET $MASTER_MYPORT MASTER_PORT $USER USER +--error ER_PLUGIN_IS_NOT_LOADED +connect (fail,localhost,$USER); + +--error ER_PLUGIN_IS_NOT_LOADED +change_user $USER; + +eval install plugin unix_socket soname '$AUTH_SOCKET_SO'; + +--replace_result $MASTER_MYSOCK MASTER_SOCKET $MASTER_MYPORT MASTER_PORT $USER USER +--error ER_ACCESS_DENIED_NO_PASSWORD_ERROR +connect (fail,localhost,$USER); + +--replace_result $USER USER +--error ER_ACCESS_DENIED_NO_PASSWORD_ERROR +change_user $USER; + +update mysql.user set plugin=''; +flush privileges; +uninstall plugin unix_socket; + diff --git a/mysql-test/t/func_compress.test b/mysql-test/t/func_compress.test index 207f3a436d0..eaed0c88fe1 100644 --- a/mysql-test/t/func_compress.test +++ b/mysql-test/t/func_compress.test @@ -115,3 +115,24 @@ DROP TABLE t1; set @@global.max_allowed_packet=default; --enable_result_log --enable_query_log + + +--echo # +--echo # Start of 5.3 tests +--echo # + +--echo # +--echo # MDEV-5783 Assertion `0' failed in make_sortkey(SORTPARAM*, uchar*, uchar*) on ORDER BY HEX(UNCOMPRESSED_LENGTH(pk)) +--echo # +CREATE TABLE t1 (pk INT PRIMARY KEY); +INSERT INTO t1 VALUES (1),(2); +SELECT UNCOMPRESSED_LENGTH(pk) FROM t1; +# ORDER is not strict, so disable results +--disable_result_log +SELECT * FROM t1 ORDER BY HEX(UNCOMPRESSED_LENGTH(pk)); +--enable_result_log +DROP TABLE t1; + +--echo # +--echo # End of 5.3 tests +--echo # diff --git a/mysql-test/t/func_misc.test b/mysql-test/t/func_misc.test index a7ae99cd2d0..44fd0b274e8 100644 --- a/mysql-test/t/func_misc.test +++ b/mysql-test/t/func_misc.test @@ -308,6 +308,22 @@ SELECT NAME_CONST('a', -(1 AND 2)) AND 1; SELECT NAME_CONST('a', -(1)) OR 1; --echo # +--echo #MDEV-5446: Assertion `!table || (!table->read_set || +--echo #bitmap_is_set(table->read_set, field_index))' fails on +--echo #EXPLAIN EXTENDED with VALUES function +--echo # +CREATE TABLE t1 (a INT, b INT) ENGINE=MyISAM; +INSERT INTO t1 VALUES (1,10); +CREATE VIEW v1 AS SELECT * FROM t1; + +EXPLAIN EXTENDED SELECT VALUES(b) FROM v1; + +drop view v1; +drop table t1; + +--echo End of 5.3 tests + +--echo # --echo # Bug #52165: Assertion failed: file .\dtoa.c, line 465 --echo # @@ -556,4 +572,3 @@ select release_lock(repeat('a', 193)); --echo # --echo # End of 5.5 tests --echo # - diff --git a/mysql-test/t/locked_temporary-5955.test b/mysql-test/t/locked_temporary-5955.test new file mode 100644 index 00000000000..1ade63f4913 --- /dev/null +++ b/mysql-test/t/locked_temporary-5955.test @@ -0,0 +1,10 @@ +# +# MDEV-5955 Server crashes in handler::ha_external_lock or assertion `m_lock_type == 2' fails in handler::ha_close on disconnect with a locked temporary table +# + +--source include/have_innodb.inc +--connect (con1,localhost,root,,) +CREATE TEMPORARY TABLE tmp (i INT) ENGINE=InnoDB; +LOCK TABLES tmp AS p WRITE; +--disconnect con1 + diff --git a/mysql-test/t/partition.test b/mysql-test/t/partition.test index 7eb541ab331..1e1150157c7 100644 --- a/mysql-test/t/partition.test +++ b/mysql-test/t/partition.test @@ -2531,52 +2531,6 @@ SELECT * from t1 order by i; DROP TABLE t1; --echo # ---echo # MDEV-5177: ha_partition and innodb index intersection produce fewer rows (MySQL Bug#70703) ---echo # -create table t1 ( - a int not null, - b int not null, - pk int not null, - primary key (pk), - key(a), - key(b) -) partition by hash(pk) partitions 10; - -insert into t1 values (1,2,4); # both -insert into t1 values (1,0,17); # left -insert into t1 values (1,2,25); # both - -insert into t1 values (10,20,122); -insert into t1 values (10,20,123); - -# Now, fill in some data so that the optimizer choses index_merge -create table t2 (a int); -insert into t2 values (0),(1),(2),(3),(4),(5),(6),(7),(8),(9); - -insert into t1 select 1,2, 200 + A.a + 10*B.a + 100*C.a from t2 A, t2 B, t2 C; - -insert into t1 select 10+A.a + 10*B.a + 100*C.a + 1000*D.a, - 10+A.a + 10*B.a + 100*C.a + 1000*D.a, - 2000 + A.a + 10*B.a + 100*C.a + 1000*D.a - from t2 A, t2 B, t2 C ,t2 D; - -# This should show index_merge, using intersect -explain select * from t1 where a=1 and b=2 and pk between 1 and 999999 ; -# 794 rows in output -create temporary table t3 as -select * from t1 where a=1 and b=2 and pk between 1 and 999 ; -select count(*) from t3; -drop table t3; - -# 802 rows in output -create temporary table t3 as -select * from t1 ignore index(a,b) where a=1 and b=2 and pk between 1 and 999 ; -select count(*) from t3; -drop table t3; - -drop table t1,t2; - ---echo # --echo # MDEV-5555: Incorrect index_merge on BTREE indices --echo # diff --git a/mysql-test/t/partition_innodb.test b/mysql-test/t/partition_innodb.test index ad9de559a9c..1445eaa72b4 100644 --- a/mysql-test/t/partition_innodb.test +++ b/mysql-test/t/partition_innodb.test @@ -729,5 +729,52 @@ GROUP BY 1, 2, 3; DROP TABLE t1; +--echo # +--echo # MDEV-5177: ha_partition and innodb index intersection produce fewer rows (MySQL Bug#70703) +--echo # +create table t1 ( + a int not null, + b int not null, + pk int not null, + primary key (pk), + key(a), + key(b) +) engine=innodb partition by hash(pk) partitions 10; + +insert into t1 values (1,2,4); # both +insert into t1 values (1,0,17); # left +insert into t1 values (1,2,25); # both + +insert into t1 values (10,20,122); +insert into t1 values (10,20,123); + +# Now, fill in some data so that the optimizer choses index_merge +create table t2 (a int); +insert into t2 values (0),(1),(2),(3),(4),(5),(6),(7),(8),(9); + +insert into t1 select 1,2, 200 + A.a + 10*B.a + 100*C.a from t2 A, t2 B, t2 C; + +insert into t1 select 10+A.a + 10*B.a + 100*C.a + 1000*D.a, + 10+A.a + 10*B.a + 100*C.a + 1000*D.a, + 2000 + A.a + 10*B.a + 100*C.a + 1000*D.a + from t2 A, t2 B, t2 C ,t2 D; + +# This should show index_merge, using intersect +--replace_column 9 # +explain select * from t1 where a=1 and b=2 and pk between 1 and 999999 ; +# 794 rows in output +create temporary table t3 as +select * from t1 where a=1 and b=2 and pk between 1 and 999 ; +select count(*) from t3; +drop table t3; + +# 802 rows in output +create temporary table t3 as +select * from t1 ignore index(a,b) where a=1 and b=2 and pk between 1 and 999 ; +select count(*) from t3; +drop table t3; + +drop table t1,t2; + set global default_storage_engine=default; diff --git a/mysql-test/t/subselect4.test b/mysql-test/t/subselect4.test index d56b3df3505..4eb9701ee71 100644 --- a/mysql-test/t/subselect4.test +++ b/mysql-test/t/subselect4.test @@ -1886,6 +1886,27 @@ DROP VIEW v2; DROP TABLE t1,t2; --echo # +--echo # MDEV-5686: degenerate disjunct in NOT IN subquery +--echo # + +CREATE TABLE t1 (a int, b int, c varchar(3)) ENGINE=MyISAM; +INSERT INTO t1 VALUES (1,1,'CAN'),(2,2,'AUS'); + +CREATE TABLE t2 (f int) ENGINE=MyISAM; +INSERT INTO t2 VALUES (3); + +EXPLAIN EXTENDED +SELECT * FROM t2 + WHERE f NOT IN (SELECT b FROM t1 + WHERE 0 OR (c IN ('USA') OR c NOT IN ('USA')) AND a = b); + +SELECT * FROM t2 + WHERE f NOT IN (SELECT b FROM t1 + WHERE 0 OR (c IN ('USA') OR c NOT IN ('USA')) AND a = b); + +DROP TABLE t1,t2; + +--echo # --echo # MDEV-3899 Valgrind warnings (blocks are definitely lost) in filesort on IN subquery with SUM and DISTINCT --echo # diff --git a/mysql-test/t/subselect_sj_mat.test b/mysql-test/t/subselect_sj_mat.test index 52a73d24822..91b69a6a09c 100644 --- a/mysql-test/t/subselect_sj_mat.test +++ b/mysql-test/t/subselect_sj_mat.test @@ -1745,6 +1745,24 @@ EXECUTE stmt; DROP TABLE t1, t2; DROP VIEW v2; +--echo # +--echo # MDEV-5811: Server crashes in best_access_path with materialization+semijoin and big_tables=ON +--echo # +SET @tmp_mdev5811= @@big_tables; +SET big_tables = ON; + +CREATE TABLE t1 (a INT); +INSERT INTO t1 VALUES (1),(2); + +CREATE TABLE t2 (b INT); +INSERT INTO t2 VALUES (3),(4); + +SELECT * FROM t1 AS t1_1, t1 AS t1_2 + WHERE ( t1_1.a, t1_2.a ) IN ( SELECT MAX(b), MIN(b) FROM t2 ); + +DROP TABLE t1,t2; +SET big_tables=@tmp_mdev5811; + --echo # End of 5.3 tests diff --git a/mysql-test/t/view.test b/mysql-test/t/view.test index 633624bf4bf..7402e992350 100644 --- a/mysql-test/t/view.test +++ b/mysql-test/t/view.test @@ -4918,6 +4918,25 @@ deallocate prepare my_stmt; DROP VIEW v1,v2; DROP TABLE t1,t2,t3,t4; +--echo # +--echo #MDEV-5717: Server crash with insert statement containing DEFAULT into +--echo #view +--echo # +CREATE TABLE t1 ( + `id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `test` tinyint(3) unsigned NOT NULL DEFAULT '0', + PRIMARY KEY (`id`) +); + +CREATE VIEW v1 AS (select t1.id AS id, t1.test AS test from t1); + +INSERT INTO v1 SET test = DEFAULT; + +select * from v1; + +drop view v1; +drop table t1; + --echo # ----------------------------------------------------------------- --echo # -- End of 5.3 tests. --echo # ----------------------------------------------------------------- |