diff options
author | unknown <evgen@moonbone.local> | 2007-03-06 23:58:10 +0300 |
---|---|---|
committer | unknown <evgen@moonbone.local> | 2007-03-06 23:58:10 +0300 |
commit | 38acf43e34a617480f9bdb21df25f5ca76d54c8a (patch) | |
tree | ccb854158cca2e3513366cbd5d024863066eba1d /mysql-test/r/order_by.result | |
parent | 476f91b50c9e8993920f4aafbf16a447e65689cb (diff) | |
download | mariadb-git-38acf43e34a617480f9bdb21df25f5ca76d54c8a.tar.gz |
Bug#25376: Incomplete setup of ORDER BY clause results in a wrong result.
Functions over sum functions wasn't set up correctly for the ORDER BY clause
which leads to a wrong order of the result set.
The split_sum_func() function is called now for each ORDER BY item that
contains a sum function to set it up correctly.
mysql-test/t/order_by.test:
Added a test case for bug#25376: Incomplete setup of ORDER BY clause results in a wrong result.
mysql-test/r/order_by.result:
Added a test case for bug#25376: Incomplete setup of ORDER BY clause results in a wrong result.
sql/sql_select.cc:
Bug#25376: Incomplete setup of ORDER BY clause results in a wrong result.
The split_sum_func() function is called now for each ORDER BY item that
contains a sum function to set it up correctly.
Diffstat (limited to 'mysql-test/r/order_by.result')
-rw-r--r-- | mysql-test/r/order_by.result | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/mysql-test/r/order_by.result b/mysql-test/r/order_by.result index e81d46c9199..0b1edfd3e8f 100644 --- a/mysql-test/r/order_by.result +++ b/mysql-test/r/order_by.result @@ -926,3 +926,11 @@ NULL 2 3 DROP TABLE t1,t2,t3,t4; +create table t1 (a int, b int, c int); +insert into t1 values (1,2,3), (9,8,3), (19,4,3), (1,4,9); +select a,(sum(b)/sum(c)) as ratio from t1 group by a order by sum(b)/sum(c) asc; +a ratio +1 0.5000 +19 1.3333 +9 2.6667 +drop table t1; |