summaryrefslogtreecommitdiff
path: root/mysql-test/t/subselect_innodb.test
diff options
context:
space:
mode:
authorMarko Mäkelä <marko.makela@mariadb.com>2017-03-08 11:40:43 +0200
committerMarko Mäkelä <marko.makela@mariadb.com>2017-03-08 11:40:43 +0200
commit47396ddea91698f6ea1829697566a4d7c31bc789 (patch)
tree552acc26b963574a234d2a3bc22b2190e5eabf0e /mysql-test/t/subselect_innodb.test
parentc4f3e64c23fe7f7fd18c0a79f87f9771df15fe9f (diff)
parent6860a4b55664d8fc53636906240c089417e1849d (diff)
downloadmariadb-git-47396ddea91698f6ea1829697566a4d7c31bc789.tar.gz
Merge 5.5 into 10.0
Also, implement MDEV-11027 a little differently from 5.5: recv_sys_t::report(ib_time_t): Determine whether progress should be reported. recv_apply_hashed_log_recs(): Rename the parameter to last_batch.
Diffstat (limited to 'mysql-test/t/subselect_innodb.test')
-rw-r--r--mysql-test/t/subselect_innodb.test59
1 files changed, 12 insertions, 47 deletions
diff --git a/mysql-test/t/subselect_innodb.test b/mysql-test/t/subselect_innodb.test
index af6ec90ba74..384464a9b7a 100644
--- a/mysql-test/t/subselect_innodb.test
+++ b/mysql-test/t/subselect_innodb.test
@@ -483,56 +483,21 @@ drop table t1;
set optimizer_switch=@subselect_innodb_tmp;
--echo #
---echo # MDEV-6041: ORDER BY+subqueries: subquery_table.key=outer_table.col is not recongized as binding
+--echo # MDEV-9635:Server crashes in part_of_refkey or assertion
+--echo # `!created && key_to_save < (int)s->keys' failed in
+--echo # TABLE::use_index(int) or with join_cache_level>2
--echo #
-create table t1(a int) engine=innodb;
-insert into t1 values (0),(1),(2),(3),(4),(5),(6),(7),(8),(9);
-
-create table t2(
- id int primary key,
- key1 int,
- col1 int,
- key(key1)
-) engine=innodb;
-insert into t2
- select
- A.a + B.a*10 + C.a*100 + D.a* 1000,
- A.a + 10*B.a,
- 123456
-from t1 A, t1 B, t1 C, t1 D;
-
---echo # Table tsubq:
---echo # - must use 'ref' (not 'index'), and must not use 'Using filesort'
---echo # - shows a bad estimate for 'rows' (but I'm not sure if one can do better w/o histograms)
-explain select
- (SELECT
- concat(id, '-', key1, '-', col1)
- FROM t2
- WHERE t2.key1 = t1.a
- ORDER BY t2.id ASC LIMIT 1)
-from
- t1;
+SET join_cache_level=3;
---echo #
---echo # MDEV-6081: ORDER BY+ref(const): selectivity is very incorrect (MySQL Bug#14338686)
---echo #
+CREATE TABLE t1 (f1 VARCHAR(1024)) ENGINE=InnoDB;
+CREATE ALGORITHM=TEMPTABLE VIEW v1 AS SELECT * FROM t1;
-alter table t2 add key2 int;
-update t2 set key2=key1;
-alter table t2 add key(key2);
-analyze table t2;
-flush tables;
---echo # Table tsubq must use 'ref' + Using filesort (not 'index' w/o filesort)
---replace_column 9 #
-explain select
- (SELECT
- concat(id, '-', key1, '-', col1)
- FROM t2
- WHERE t2.key1 = t1.a
- ORDER BY t2.key2 ASC LIMIT 1)
-from
- t1;
+CREATE TABLE t2 (f2 VARCHAR(4)) ENGINE=InnoDB;
+INSERT INTO t2 VALUES ('foo'),('bar');
-drop table t1,t2;
+SELECT * FROM v1, t2 WHERE ( f1, f2 ) IN ( SELECT f1, f1 FROM t1 );
+set join_cache_level = default;
+drop view v1;
+drop table t1,t2;