1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-30 16:24:05 +03:00

Fix bug #7422 "order by" doesn't work

Field with wrong buffer was used to make sort key, which results in producing
same sort key for all records.



sql/filesort.cc:
  Fix bug#7422 "order by" doesn't work
mysql-test/t/view.test:
  Test case for bug#7422 "order by" doesn't work
mysql-test/r/view.result:
  Test case for bug#7422 "order by" doesn't work
This commit is contained in:
unknown
2005-06-21 20:14:50 +04:00
parent aece56e30a
commit c4257ae3ce
3 changed files with 31 additions and 5 deletions

View File

@ -1726,3 +1726,17 @@ sum(a)
drop procedure p1;
drop view v1;
drop table t1;
CREATE TABLE t1(a char(2) primary key, b char(2));
CREATE TABLE t2(a char(2), b char(2), index i(a));
INSERT INTO t1 VALUES ('a','1'), ('b','2');
INSERT INTO t2 VALUES ('a','5'), ('a','6'), ('b','5'), ('b','6');
CREATE VIEW v1 AS
SELECT t1.b as c, t2.b as d FROM t1,t2 WHERE t1.a=t2.a;
SELECT d, c FROM v1 ORDER BY d;
d c
5 1
5 2
6 1
6 2
DROP VIEW v1;
DROP TABLE t1, t2;

View File

@ -1569,3 +1569,15 @@ drop procedure p1;
drop view v1;
drop table t1;
#
# Bug#7422 "order by" doesn't work
#
CREATE TABLE t1(a char(2) primary key, b char(2));
CREATE TABLE t2(a char(2), b char(2), index i(a));
INSERT INTO t1 VALUES ('a','1'), ('b','2');
INSERT INTO t2 VALUES ('a','5'), ('a','6'), ('b','5'), ('b','6');
CREATE VIEW v1 AS
SELECT t1.b as c, t2.b as d FROM t1,t2 WHERE t1.a=t2.a;
SELECT d, c FROM v1 ORDER BY d;
DROP VIEW v1;
DROP TABLE t1, t2;