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
c47c5645
Commit
c47c5645
authored
May 31, 2003
by
unknown
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix for the optimiser problem caused by the fact that with derived
tables one (or more tables) is opened / closed twice.
parent
4637832f
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
3 additions
and
1 deletion
+3
-1
mysql-test/r/derived.result
mysql-test/r/derived.result
+1
-1
sql/sql_derived.cc
sql/sql_derived.cc
+2
-0
No files found.
mysql-test/r/derived.result
View file @
c47c5645
...
@@ -137,7 +137,7 @@ a t
...
@@ -137,7 +137,7 @@ a t
explain select count(*) from t1 as tt1, (select * from t1) as tt2;
explain select count(*) from t1 as tt1, (select * from t1) as tt2;
id select_type table type possible_keys key key_len ref rows Extra
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Select tables optimized away
1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Select tables optimized away
2 DERIVED tt1
index NULL a 4 NULL 10000 Using index
2 DERIVED tt1
ALL NULL NULL NULL NULL 10000
drop table t1;
drop table t1;
SELECT * FROM (SELECT (SELECT * FROM (SELECT 1 as a) as a )) as b;
SELECT * FROM (SELECT (SELECT * FROM (SELECT 1 as a) as a )) as b;
(SELECT * FROM (SELECT 1 as a) as a )
(SELECT * FROM (SELECT 1 as a) as a )
...
...
sql/sql_derived.cc
View file @
c47c5645
...
@@ -219,6 +219,8 @@ int mysql_derived(THD *thd, LEX *lex, SELECT_LEX_UNIT *unit,
...
@@ -219,6 +219,8 @@ int mysql_derived(THD *thd, LEX *lex, SELECT_LEX_UNIT *unit,
/* Add new temporary table to list of open derived tables */
/* Add new temporary table to list of open derived tables */
table
->
next
=
thd
->
derived_tables
;
table
->
next
=
thd
->
derived_tables
;
thd
->
derived_tables
=
table
;
thd
->
derived_tables
=
table
;
thd
->
query_id
++
;
query_id
++
;
}
}
exit:
exit:
...
...
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