Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
mariadb
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
mariadb
Commits
946745e1
Commit
946745e1
authored
Mar 07, 2007
by
gkodinov/kgeorge@magare.gmz
Browse files
Options
Browse Files
Download
Plain Diff
Merge gkodinov@bk-internal.mysql.com:/home/bk/mysql-5.0-opt
into magare.gmz:/home/kgeorge/mysql/autopush/B19342-5.0-opt
parents
db04328c
7b77956f
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
27 additions
and
0 deletions
+27
-0
mysql-test/r/order_by.result
mysql-test/r/order_by.result
+8
-0
mysql-test/t/order_by.test
mysql-test/t/order_by.test
+8
-0
sql/sql_select.cc
sql/sql_select.cc
+11
-0
No files found.
mysql-test/r/order_by.result
View file @
946745e1
...
@@ -926,3 +926,11 @@ NULL
...
@@ -926,3 +926,11 @@ NULL
2
2
3
3
DROP TABLE t1,t2,t3,t4;
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;
mysql-test/t/order_by.test
View file @
946745e1
...
@@ -640,3 +640,11 @@ SELECT t2.b FROM t1 LEFT JOIN (t2, t3 LEFT JOIN t4 ON t3.a=t4.a)
...
@@ -640,3 +640,11 @@ SELECT t2.b FROM t1 LEFT JOIN (t2, t3 LEFT JOIN t4 ON t3.a=t4.a)
ON
(
t1
.
a
=
t2
.
a
AND
t1
.
b
=
t3
.
b
)
order
by
t2
.
b
;
ON
(
t1
.
a
=
t2
.
a
AND
t1
.
b
=
t3
.
b
)
order
by
t2
.
b
;
DROP
TABLE
t1
,
t2
,
t3
,
t4
;
DROP
TABLE
t1
,
t2
,
t3
,
t4
;
#
# Bug#25376: Incomplete setup of ORDER BY clause results in a wrong result.
#
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
;
drop
table
t1
;
sql/sql_select.cc
View file @
946745e1
...
@@ -456,6 +456,17 @@ JOIN::prepare(Item ***rref_pointer_array,
...
@@ -456,6 +456,17 @@ JOIN::prepare(Item ***rref_pointer_array,
select_lex
->
fix_prepare_information
(
thd
,
&
conds
,
&
having
);
select_lex
->
fix_prepare_information
(
thd
,
&
conds
,
&
having
);
if
(
order
)
{
ORDER
*
ord
;
for
(
ord
=
order
;
ord
;
ord
=
ord
->
next
)
{
Item
*
item
=
*
ord
->
item
;
if
(
item
->
with_sum_func
&&
item
->
type
()
!=
Item
::
SUM_FUNC_ITEM
)
item
->
split_sum_func
(
thd
,
ref_pointer_array
,
all_fields
);
}
}
if
(
having
&&
having
->
with_sum_func
)
if
(
having
&&
having
->
with_sum_func
)
having
->
split_sum_func2
(
thd
,
ref_pointer_array
,
all_fields
,
having
->
split_sum_func2
(
thd
,
ref_pointer_array
,
all_fields
,
&
having
,
TRUE
);
&
having
,
TRUE
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment