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
da63a927
Commit
da63a927
authored
May 15, 2004
by
serg@serg.mylan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
bad old merge fixed
parent
6a594c07
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
19 additions
and
1 deletion
+19
-1
mysql-test/r/order_by.result
mysql-test/r/order_by.result
+9
-0
mysql-test/t/order_by.test
mysql-test/t/order_by.test
+10
-0
sql/sql_select.cc
sql/sql_select.cc
+0
-1
No files found.
mysql-test/r/order_by.result
View file @
da63a927
...
...
@@ -85,6 +85,15 @@ i
1
3
drop table t1;
create table t1 ( pk int primary key, name varchar(255) not null, number varchar(255) not null);
insert into t1 values (1, 'Gamma', '123'), (2, 'Gamma Ext', '123a'), (3, 'Alpha', '001'), (4, 'Beta', '200c');
select distinct t1.name as 'Building Name',t1.number as 'Building Number' from t1 order by t1.name asc;
Building Name Building Number
Gamma 123
Gamma Ext 123a
Alpha 001
Beta 200c
drop table t1;
create table t1 (id int not null,col1 int not null,col2 int not null,index(col1));
insert into t1 values(1,2,2),(2,2,1),(3,1,2),(4,1,1),(5,1,4),(6,2,3),(7,3,1),(8,2,4);
select * from t1 order by col1,col2;
...
...
mysql-test/t/order_by.test
View file @
da63a927
...
...
@@ -79,6 +79,16 @@ select distinct i from t1 order by 1-i;
select
distinct
i
from
t1
order
by
mod
(
i
,
2
),
i
;
drop
table
t1
;
#
# bug#3681
#
create
table
t1
(
pk
int
primary
key
,
name
varchar
(
255
)
not
null
,
number
varchar
(
255
)
not
null
);
insert
into
t1
values
(
1
,
'Gamma'
,
'123'
),
(
2
,
'Gamma Ext'
,
'123a'
),
(
3
,
'Alpha'
,
'001'
),
(
4
,
'Beta'
,
'200c'
);
select
distinct
t1
.
name
as
'Building Name'
,
t1
.
number
as
'Building Number'
from
t1
order
by
t1
.
name
asc
;
drop
table
t1
;
#
# Order by on first index part
#
...
...
sql/sql_select.cc
View file @
da63a927
...
...
@@ -665,7 +665,6 @@ JOIN::optimize()
if
(
!
order
&&
org_order
)
skip_sort_order
=
1
;
}
order
=
remove_const
(
this
,
order
,
conds
,
&
simple_order
);
if
(
group_list
||
tmp_table_param
.
sum_func_count
)
{
if
(
!
hidden_group_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