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
0583c7c5
Commit
0583c7c5
authored
Feb 11, 2007
by
igor@olga.mysql.com
Browse files
Options
Browse Files
Download
Plain Diff
Merge olga.mysql.com:/home/igor/mysql-5.0-opt
into olga.mysql.com:/home/igor/dev-opt/mysql-5.0-opt-bug26159
parents
976e747a
ffdf7b15
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
55 additions
and
3 deletions
+55
-3
mysql-test/r/information_schema.result
mysql-test/r/information_schema.result
+1
-2
mysql-test/r/view.result
mysql-test/r/view.result
+39
-0
mysql-test/t/view.test
mysql-test/t/view.test
+14
-0
sql/sql_lex.cc
sql/sql_lex.cc
+0
-1
sql/sql_view.cc
sql/sql_view.cc
+1
-0
No files found.
mysql-test/r/information_schema.result
View file @
0583c7c5
...
...
@@ -1262,8 +1262,7 @@ from information_schema.tables
order by object_schema;
explain select * from v1;
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY <derived2> system NULL NULL NULL NULL 0 const row not found
2 DERIVED tables ALL NULL NULL NULL NULL 2 Using filesort
1 SIMPLE tables ALL NULL NULL NULL NULL 2 Using filesort
explain select * from (select table_name from information_schema.tables) as a;
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY <derived2> system NULL NULL NULL NULL 0 const row not found
...
...
mysql-test/r/view.result
View file @
0583c7c5
...
...
@@ -3078,4 +3078,43 @@ b
2
DROP VIEW v1;
DROP TABLE t1,t2;
create table t1(f1 int, f2 int);
insert into t1 values(1,2),(1,3),(1,1),(2,3),(2,1),(2,2);
select * from t1;
f1 f2
1 2
1 3
1 1
2 3
2 1
2 2
create view v1 as select * from t1 order by f2;
select * from v1;
f1 f2
1 1
2 1
1 2
2 2
1 3
2 3
explain extended select * from v1;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 ALL NULL NULL NULL NULL 6 Using filesort
Warnings:
Note 1003 select `test`.`t1`.`f1` AS `f1`,`test`.`t1`.`f2` AS `f2` from `test`.`t1` order by `test`.`t1`.`f2`
select * from v1 order by f1;
f1 f2
1 1
1 2
1 3
2 1
2 2
2 3
explain extended select * from v1 order by f1;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 ALL NULL NULL NULL NULL 6 Using filesort
Warnings:
Note 1003 select `test`.`t1`.`f1` AS `f1`,`test`.`t1`.`f2` AS `f2` from `test`.`t1` order by `test`.`t1`.`f1`,`test`.`t1`.`f2`
drop view v1;
drop table t1;
End of 5.0 tests.
mysql-test/t/view.test
View file @
0583c7c5
...
...
@@ -3024,4 +3024,18 @@ SELECT * FROM t2;
DROP
VIEW
v1
;
DROP
TABLE
t1
,
t2
;
#
# Bug#12122: Views with ORDER BY can't be resolved using MERGE algorithm.
#
create
table
t1
(
f1
int
,
f2
int
);
insert
into
t1
values
(
1
,
2
),(
1
,
3
),(
1
,
1
),(
2
,
3
),(
2
,
1
),(
2
,
2
);
select
*
from
t1
;
create
view
v1
as
select
*
from
t1
order
by
f2
;
select
*
from
v1
;
explain
extended
select
*
from
v1
;
select
*
from
v1
order
by
f1
;
explain
extended
select
*
from
v1
order
by
f1
;
drop
view
v1
;
drop
table
t1
;
--
echo
End
of
5.0
tests
.
sql/sql_lex.cc
View file @
0583c7c5
...
...
@@ -1751,7 +1751,6 @@ bool st_lex::can_be_merged()
}
return
(
selects_allow_merge
&&
select_lex
.
order_list
.
elements
==
0
&&
select_lex
.
group_list
.
elements
==
0
&&
select_lex
.
having
==
0
&&
select_lex
.
with_sum_func
==
0
&&
...
...
sql/sql_view.cc
View file @
0583c7c5
...
...
@@ -1263,6 +1263,7 @@ bool mysql_make_view(THD *thd, File_parser *parser, TABLE_LIST *table,
but it will not be included to SELECT_LEX tree, because it
will not be executed
*/
table
->
select_lex
->
order_list
.
push_back
(
&
lex
->
select_lex
.
order_list
);
goto
ok
;
}
...
...
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