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
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nexedi
MariaDB
Commits
7dabb641
Commit
7dabb641
authored
Nov 25, 2004
by
serg@serg.mylan
Browse files
Options
Browse Files
Download
Plain Diff
merged
parents
538a3f7a
831c0246
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
31 additions
and
43 deletions
+31
-43
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/protocol.cc
sql/protocol.cc
+0
-30
sql/sql_class.cc
sql/sql_class.cc
+2
-1
sql/sql_parse.cc
sql/sql_parse.cc
+8
-6
sql/sql_select.cc
sql/sql_select.cc
+8
-6
No files found.
mysql-test/r/order_by.result
View file @
7dabb641
...
...
@@ -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 @
7dabb641
...
...
@@ -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/protocol.cc
View file @
7dabb641
...
...
@@ -131,36 +131,6 @@ void net_send_error(THD *thd, uint sql_errno, const char *err)
DBUG_VOID_RETURN
;
}
/*
Send a warning to the end user
SYNOPSIS
send_warning()
thd Thread handler
sql_errno Warning number (error message)
err Error string. If not set, use ER(sql_errno)
DESCRIPTION
Register the warning so that the user can get it with mysql_warnings()
Send an ok (+ warning count) to the end user.
*/
void
send_warning
(
THD
*
thd
,
uint
sql_errno
,
const
char
*
err
)
{
DBUG_ENTER
(
"send_warning"
);
if
(
thd
->
spcont
&&
thd
->
spcont
->
find_handler
(
sql_errno
,
MYSQL_ERROR
::
WARN_LEVEL_WARN
))
{
DBUG_VOID_RETURN
;
}
push_warning
(
thd
,
MYSQL_ERROR
::
WARN_LEVEL_WARN
,
sql_errno
,
err
?
err
:
ER
(
sql_errno
));
send_ok
(
thd
);
DBUG_VOID_RETURN
;
}
/*
Write error package and flush to client
It's a little too low level, but I don't want to use another buffer for
...
...
sql/sql_class.cc
View file @
7dabb641
...
...
@@ -1754,7 +1754,8 @@ bool select_dumpvar::send_data(List<Item> &items)
bool
select_dumpvar
::
send_eof
()
{
if
(
!
row_count
)
send_warning
(
thd
,
ER_SP_FETCH_NO_DATA
);
push_warning
(
thd
,
MYSQL_ERROR
::
WARN_LEVEL_WARN
,
ER_SP_FETCH_NO_DATA
,
ER
(
ER_SP_FETCH_NO_DATA
));
::
send_ok
(
thd
,
row_count
);
return
0
;
}
...
...
sql/sql_parse.cc
View file @
7dabb641
...
...
@@ -3594,9 +3594,10 @@ mysql_execute_command(THD *thd)
message in the error log, so we don't send it.
*/
if
((
thd
->
options
&
OPTION_STATUS_NO_TRANS_UPDATE
)
&&
!
thd
->
slave_thread
)
send_warning
(
thd
,
ER_WARNING_NOT_COMPLETE_ROLLBACK
,
0
);
else
send_ok
(
thd
);
push_warning
(
thd
,
MYSQL_ERROR
::
WARN_LEVEL_WARN
,
ER_WARNING_NOT_COMPLETE_ROLLBACK
,
ER
(
ER_WARNING_NOT_COMPLETE_ROLLBACK
));
send_ok
(
thd
);
}
else
res
=
TRUE
;
...
...
@@ -3606,9 +3607,10 @@ mysql_execute_command(THD *thd)
if
(
!
ha_rollback_to_savepoint
(
thd
,
lex
->
savepoint_name
))
{
if
((
thd
->
options
&
OPTION_STATUS_NO_TRANS_UPDATE
)
&&
!
thd
->
slave_thread
)
send_warning
(
thd
,
ER_WARNING_NOT_COMPLETE_ROLLBACK
,
0
);
else
send_ok
(
thd
);
push_warning
(
thd
,
MYSQL_ERROR
::
WARN_LEVEL_WARN
,
ER_WARNING_NOT_COMPLETE_ROLLBACK
,
ER
(
ER_WARNING_NOT_COMPLETE_ROLLBACK
));
send_ok
(
thd
);
}
else
goto
error
;
...
...
sql/sql_select.cc
View file @
7dabb641
...
...
@@ -263,11 +263,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
,
leaves
,
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
,
leaves
,
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
);
}
...
...
@@ -11346,7 +11348,7 @@ int setup_order(THD *thd, Item **ref_pointer_array, TABLE_LIST *tables,
setup_group()
thd Thread handler
ref_pointer_array We store references to all fields that was not in
'fields' here.
'fields' here.
fields All fields in the select part. Any item in 'order'
that is part of these list is replaced by a pointer
to this fields.
...
...
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