summaryrefslogtreecommitdiff
path: root/mysql-test
diff options
context:
space:
mode:
authorSinisa@sinisa.nasamreza.org <>2002-12-04 15:27:08 +0200
committerSinisa@sinisa.nasamreza.org <>2002-12-04 15:27:08 +0200
commitdd2012067ee434fb26c7ce22856be3c12d3a65bc (patch)
tree4c86c643f7836ec8f11bca8f6638dc95dcc91ecc /mysql-test
parentad2be3b2b23c34cea95fcca5603dc55819dc4666 (diff)
downloadmariadb-git-dd2012067ee434fb26c7ce22856be3c12d3a65bc.tar.gz
A fix for the bug in a SELECT with joined tables with ORDER BY and
LIMIT clause when filesort had to be used. In that case LIMIT was applied to filesort of one of the tables, although it could not be. This fix solved problems with LEFT JOIN too...
Diffstat (limited to 'mysql-test')
-rw-r--r--mysql-test/r/select.result13
-rw-r--r--mysql-test/t/select.test8
2 files changed, 20 insertions, 1 deletions
diff --git a/mysql-test/r/select.result b/mysql-test/r/select.result
index fdcc7f9cdea..a921d75f20a 100644
--- a/mysql-test/r/select.result
+++ b/mysql-test/r/select.result
@@ -3468,3 +3468,16 @@ a a a
2 2 2
3 3 3
drop table t1;
+drop table if exists t1,t2;
+CREATE TABLE t1 ( aa char(2), id int(11) NOT NULL auto_increment, t2_id int(11) NOT NULL default '0', PRIMARY KEY (id), KEY replace_id (t2_id)) TYPE=MyISAM;
+INSERT INTO t1 VALUES ("1",8264,2506),("2",8299,2517),("3",8301,2518),("4",8302,2519),("5",8303,2520),("6",8304,2521),("7",8305,2522);
+CREATE TABLE t2 ( id int(11) NOT NULL auto_increment, PRIMARY KEY (id)) TYPE=MyISAM;
+INSERT INTO t2 VALUES (2517), (2518), (2519), (2520), (2521), (2522);
+select * from t1, t2 WHERE t1.t2_id = t2.id and t1.t2_id > 0 order by t1.id LIMIT 0, 5;
+aa id t2_id id
+2 8299 2517 2517
+3 8301 2518 2518
+4 8302 2519 2519
+5 8303 2520 2520
+6 8304 2521 2521
+drop table if exists t1,t2;
diff --git a/mysql-test/t/select.test b/mysql-test/t/select.test
index 15d44bcd672..d9b75fca362 100644
--- a/mysql-test/t/select.test
+++ b/mysql-test/t/select.test
@@ -1795,5 +1795,11 @@ select * from t1 natural right join (t1 as t2 left join t1 as t3 using (a));
# natural join
select * from t1 natural join (t1 as t2 left join t1 as t3 using (a));
select * from (t1 as t2 left join t1 as t3 using (a)) natural join t1;
-
drop table t1;
+drop table if exists t1,t2;
+CREATE TABLE t1 ( aa char(2), id int(11) NOT NULL auto_increment, t2_id int(11) NOT NULL default '0', PRIMARY KEY (id), KEY replace_id (t2_id)) TYPE=MyISAM;
+INSERT INTO t1 VALUES ("1",8264,2506),("2",8299,2517),("3",8301,2518),("4",8302,2519),("5",8303,2520),("6",8304,2521),("7",8305,2522);
+CREATE TABLE t2 ( id int(11) NOT NULL auto_increment, PRIMARY KEY (id)) TYPE=MyISAM;
+INSERT INTO t2 VALUES (2517), (2518), (2519), (2520), (2521), (2522);
+select * from t1, t2 WHERE t1.t2_id = t2.id and t1.t2_id > 0 order by t1.id LIMIT 0, 5;
+drop table if exists t1,t2;