summaryrefslogtreecommitdiff
path: root/mysql-test
diff options
context:
space:
mode:
authorevgen@moonbone.local <>2007-02-11 21:03:40 +0300
committerevgen@moonbone.local <>2007-02-11 21:03:40 +0300
commit9e2a0c7528613927717f3ff7530145749d7edbbd (patch)
treea5f9aa63476871b662d225e20e1b24f3cfbf9371 /mysql-test
parent3fe9de287901be540e31784eef4ed1002ccf926e (diff)
parenta24144636295d4f2a1d95477872c56c46e59bbff (diff)
downloadmariadb-git-9e2a0c7528613927717f3ff7530145749d7edbbd.tar.gz
Merge epotemkin@bk-internal.mysql.com:/home/bk/mysql-5.0-opt
into moonbone.local:/mnt/gentoo64/work/12122-bug-5.0-opt-mysql
Diffstat (limited to 'mysql-test')
-rw-r--r--mysql-test/r/view.result39
-rw-r--r--mysql-test/t/view.test14
2 files changed, 53 insertions, 0 deletions
diff --git a/mysql-test/r/view.result b/mysql-test/r/view.result
index a52882fef2f..462916ec09b 100644
--- a/mysql-test/r/view.result
+++ b/mysql-test/r/view.result
@@ -3078,4 +3078,43 @@ b
2
DROP VIEW v1;
DROP TABLE t1,t2;
+create table t1(f1 int, f2 int);
+insert into t1 values(1,2),(1,3),(1,1),(2,3),(2,1),(2,2);
+select * from t1;
+f1 f2
+1 2
+1 3
+1 1
+2 3
+2 1
+2 2
+create view v1 as select * from t1 order by f2;
+select * from v1;
+f1 f2
+1 1
+2 1
+1 2
+2 2
+1 3
+2 3
+explain extended select * from v1;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 6 Using filesort
+Warnings:
+Note 1003 select `test`.`t1`.`f1` AS `f1`,`test`.`t1`.`f2` AS `f2` from `test`.`t1` order by `test`.`t1`.`f2`
+select * from v1 order by f1;
+f1 f2
+1 1
+1 2
+1 3
+2 1
+2 2
+2 3
+explain extended select * from v1 order by f1;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 6 Using filesort
+Warnings:
+Note 1003 select `test`.`t1`.`f1` AS `f1`,`test`.`t1`.`f2` AS `f2` from `test`.`t1` order by `test`.`t1`.`f1`,`test`.`t1`.`f2`
+drop view v1;
+drop table t1;
End of 5.0 tests.
diff --git a/mysql-test/t/view.test b/mysql-test/t/view.test
index 0fa5765bb64..7fdca1ff7e0 100644
--- a/mysql-test/t/view.test
+++ b/mysql-test/t/view.test
@@ -3024,4 +3024,18 @@ SELECT * FROM t2;
DROP VIEW v1;
DROP TABLE t1,t2;
+#
+# Bug#12122: Views with ORDER BY can't be resolved using MERGE algorithm.
+#
+create table t1(f1 int, f2 int);
+insert into t1 values(1,2),(1,3),(1,1),(2,3),(2,1),(2,2);
+select * from t1;
+create view v1 as select * from t1 order by f2;
+select * from v1;
+explain extended select * from v1;
+select * from v1 order by f1;
+explain extended select * from v1 order by f1;
+drop view v1;
+drop table t1;
+
--echo End of 5.0 tests.