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
831c0246
Commit
831c0246
authored
Nov 25, 2004
by
serg@serg.mylan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
order by group_func
parent
5924413d
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
21 additions
and
6 deletions
+21
-6
mysql-test/r/order_by.result
mysql-test/r/order_by.result
+7
-0
mysql-test/t/order_by.test
mysql-test/t/order_by.test
+6
-0
sql/sql_select.cc
sql/sql_select.cc
+8
-6
No files found.
mysql-test/r/order_by.result
View file @
831c0246
...
...
@@ -733,3 +733,10 @@ xxxxxxxxxxxxxxxxxxxaa
xxxxxxxxxxxxxxxxxxxx
xxxxxxxxxxxxxxxxxxxz
drop table t1;
create table t1 (a int not null, b int not null, c int not null);
insert t1 values (1,1,1),(1,1,2),(1,2,1);
select a, b from t1 group by a, b order by sum(c);
a b
1 2
1 1
drop table t1;
mysql-test/t/order_by.test
View file @
831c0246
...
...
@@ -500,3 +500,9 @@ insert into t1 set a = concat(repeat('x', 19), 'aa');
set
max_sort_length
=
20
;
select
a
from
t1
order
by
a
;
drop
table
t1
;
create
table
t1
(
a
int
not
null
,
b
int
not
null
,
c
int
not
null
);
insert
t1
values
(
1
,
1
,
1
),(
1
,
1
,
2
),(
1
,
2
,
1
);
select
a
,
b
from
t1
group
by
a
,
b
order
by
sum
(
c
);
drop
table
t1
;
sql/sql_select.cc
View file @
831c0246
...
...
@@ -262,11 +262,13 @@ inline int setup_without_group(THD *thd, Item **ref_pointer_array,
save_allow_sum_func
=
thd
->
allow_sum_func
;
thd
->
allow_sum_func
=
0
;
res
=
(
setup_conds
(
thd
,
tables
,
conds
)
||
setup_order
(
thd
,
ref_pointer_array
,
tables
,
fields
,
all_fields
,
order
)
||
setup_group
(
thd
,
ref_pointer_array
,
tables
,
fields
,
all_fields
,
group
,
hidden_group_fields
));
res
=
setup_conds
(
thd
,
tables
,
conds
);
thd
->
allow_sum_func
=
save_allow_sum_func
;
res
=
res
||
setup_order
(
thd
,
ref_pointer_array
,
tables
,
fields
,
all_fields
,
order
);
thd
->
allow_sum_func
=
0
;
res
=
res
||
setup_group
(
thd
,
ref_pointer_array
,
tables
,
fields
,
all_fields
,
group
,
hidden_group_fields
);
thd
->
allow_sum_func
=
save_allow_sum_func
;
DBUG_RETURN
(
res
);
}
...
...
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