summaryrefslogtreecommitdiff
path: root/mysql-test/r/view.result
diff options
context:
space:
mode:
authorunknown <evgen@moonbone.local>2005-07-12 23:22:08 +0400
committerunknown <evgen@moonbone.local>2005-07-12 23:22:08 +0400
commita578be339d93a3d1d2866bd407c2c733d1ef5ee4 (patch)
treee48307d4039b3e35acd9a776216c88ccf251253a /mysql-test/r/view.result
parent995abb0ed20a19cf91615bf9ae5dca6c2ce44498 (diff)
downloadmariadb-git-a578be339d93a3d1d2866bd407c2c733d1ef5ee4.tar.gz
Fix bug#11709 View was ordered by wrong column.
When searching column to sort on, item was compared to field under view column, but not the column itself. Because names of view column and underlaid field may differ, it leads to possibly choosing wrong column for sorting on. This patch makes Item_direct_view_ref::eq(Item *item,...) compare item's name with it's own name proir to comparing to *ref item. sql/item.cc: Fix bug #11709 View was ordered by wrong column sql/item.h: Fix bug #11709 View was ordered by wrong column mysql-test/t/view.test: Test case for bug #11709 View was ordered by wrong column. mysql-test/r/view.result: Test case for bug #11709 View was ordered by wrong column.
Diffstat (limited to 'mysql-test/r/view.result')
-rw-r--r--mysql-test/r/view.result9
1 files changed, 9 insertions, 0 deletions
diff --git a/mysql-test/r/view.result b/mysql-test/r/view.result
index 7bcfaf8bdc3..bd4e94bd1b3 100644
--- a/mysql-test/r/view.result
+++ b/mysql-test/r/view.result
@@ -1940,3 +1940,12 @@ s1 s2
DROP PROCEDURE p1;
DROP VIEW v1;
DROP TABLE t1;
+create table t1 (f1 int, f2 int);
+create view v1 as select f1 as f3, f2 as f1 from t1;
+insert into t1 values (1,3),(2,1),(3,2);
+select * from v1 order by f1;
+f3 f1
+2 1
+3 2
+1 3
+drop table t1;