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
86da2b8f
Commit
86da2b8f
authored
Jan 26, 2005
by
marko@hundin.mysql.fi
Browse files
Options
Browse Files
Download
Plain Diff
Merge marko@bk-internal.mysql.com:/home/bk/mysql-4.0
into hundin.mysql.fi:/home/marko/k/mysql-4.0
parents
638e2bd7
34fa69a1
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
37 additions
and
6 deletions
+37
-6
mysql-test/r/order_by.result
mysql-test/r/order_by.result
+17
-0
mysql-test/t/order_by.test
mysql-test/t/order_by.test
+12
-1
sql/sql_yacc.yy
sql/sql_yacc.yy
+8
-5
No files found.
mysql-test/r/order_by.result
View file @
86da2b8f
...
@@ -554,3 +554,20 @@ explain select id,t from t1 force index (primary) order by id;
...
@@ -554,3 +554,20 @@ explain select id,t from t1 force index (primary) order by id;
table type possible_keys key key_len ref rows Extra
table type possible_keys key key_len ref rows Extra
t1 index NULL PRIMARY 4 NULL 1000
t1 index NULL PRIMARY 4 NULL 1000
drop table t1;
drop table t1;
CREATE TABLE t1 (a int);
INSERT INTO t1 VALUES (2), (1), (1), (2), (1);
SELECT a FROM t1 ORDER BY a;
a
1
1
1
2
2
(SELECT a FROM t1) ORDER BY a;
a
1
1
1
2
2
DROP TABLE t1;
mysql-test/t/order_by.test
View file @
86da2b8f
...
@@ -364,3 +364,14 @@ enable_query_log;
...
@@ -364,3 +364,14 @@ enable_query_log;
explain
select
id
,
t
from
t1
order
by
id
;
explain
select
id
,
t
from
t1
order
by
id
;
explain
select
id
,
t
from
t1
force
index
(
primary
)
order
by
id
;
explain
select
id
,
t
from
t1
force
index
(
primary
)
order
by
id
;
drop
table
t1
;
drop
table
t1
;
#
# Bug #7672 - a wrong result for a select query in braces followed by order by
#
CREATE
TABLE
t1
(
a
int
);
INSERT
INTO
t1
VALUES
(
2
),
(
1
),
(
1
),
(
2
),
(
1
);
SELECT
a
FROM
t1
ORDER
BY
a
;
(
SELECT
a
FROM
t1
)
ORDER
BY
a
;
DROP
TABLE
t1
;
sql/sql_yacc.yy
View file @
86da2b8f
...
@@ -4033,12 +4033,15 @@ optional_order_or_limit:
...
@@ -4033,12 +4033,15 @@ optional_order_or_limit:
send_error(&lex->thd->net, ER_SYNTAX_ERROR);
send_error(&lex->thd->net, ER_SYNTAX_ERROR);
YYABORT;
YYABORT;
}
}
if (lex->select != &lex->select_lex)
{
if (mysql_new_select(lex))
if (mysql_new_select(lex))
YYABORT;
YYABORT;
mysql_init_select(lex);
mysql_init_select(lex);
lex->select->linkage=NOT_A_SELECT;
lex->select->linkage=NOT_A_SELECT;
lex->select->select_limit=lex->thd->variables.select_limit;
lex->select->select_limit=lex->thd->variables.select_limit;
}
}
}
opt_order_clause limit_clause
opt_order_clause limit_clause
;
;
...
...
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