summaryrefslogtreecommitdiff
path: root/mysql-test/t/subselect.test
diff options
context:
space:
mode:
authorunknown <bell@laptop.sanja.is.com.ua>2003-10-10 21:49:48 +0300
committerunknown <bell@laptop.sanja.is.com.ua>2003-10-10 21:49:48 +0300
commit8b09f4b074f1b31453fd142b7f3417b33fc0b6f2 (patch)
treee60d9e7ab843bfb80babd2dfe3bbec6a6af13f00 /mysql-test/t/subselect.test
parentbc8f801bf0f239b85ee95ea5410915f0f5424fc1 (diff)
downloadmariadb-git-8b09f4b074f1b31453fd142b7f3417b33fc0b6f2.tar.gz
samall optimisation (any independent query will not save data for rexecution)
saving/restoring join_tab array (to save it of chnging by create_sort_index() before reexecuting) (BUG#1523) mysql-test/r/subselect.result: test of BUG#1523 mysql-test/t/subselect.test: test of BUG#1523 sql/sql_select.cc: samall optimisation (any independent query will not save data for rexecution) layout fix saving/restoring join_tab array (to save it of chnging by create_sort_index() before reexecuting) sql/sql_select.h: field for storing saved join_tab_array
Diffstat (limited to 'mysql-test/t/subselect.test')
-rw-r--r--mysql-test/t/subselect.test10
1 files changed, 10 insertions, 0 deletions
diff --git a/mysql-test/t/subselect.test b/mysql-test/t/subselect.test
index 9ba91c7e0a6..7c3e825bdb2 100644
--- a/mysql-test/t/subselect.test
+++ b/mysql-test/t/subselect.test
@@ -965,3 +965,13 @@ insert into t2 values (2,2), (2,1), (3,3), (3,1);
select * from t3 where a > all (select max(b) from t2 group by a);
explain select * from t3 where a > all (select max(b) from t2 group by a);
drop table if exists t2, t3;
+
+#
+# filesort in subquery (restoring join_tab)
+#
+CREATE TABLE t1 (number char(11) NOT NULL default '') TYPE=MyISAM CHARSET=latin1;
+INSERT INTO t1 VALUES ('69294728265'),('18621828126'),('89356874041'),('95895001874');
+CREATE TABLE t2 (code char(5) NOT NULL default '',UNIQUE KEY code (code)) TYPE=MyISAM CHARSET=latin1;
+INSERT INTO t2 VALUES ('1'),('1226'),('1245'),('1862'),('18623'),('1874'),('1967'),('6');
+select c.number as phone,(select p.code from t2 p where c.number like concat(p.code, '%') order by length(p.code) desc limit 1) as code from t1 c;
+drop table t1, t2;