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
47f67214
Commit
47f67214
authored
Apr 10, 2003
by
Sinisa@sinisa.nasamreza.org
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
A fix for a crashing bug in EXPLAIN on derived tables with a join.
parent
3cef0070
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
10 additions
and
1 deletion
+10
-1
mysql-test/r/derived.result
mysql-test/r/derived.result
+5
-0
mysql-test/t/derived.test
mysql-test/t/derived.test
+1
-0
sql/sql_derived.cc
sql/sql_derived.cc
+4
-1
No files found.
mysql-test/r/derived.result
View file @
47f67214
...
...
@@ -105,6 +105,11 @@ a b
1 a
2 b
3 c
explain select * from (select * from t1,t2 where t1.a=t2.a) t1;
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY <derived2> system NULL NULL NULL NULL 1
2 DERIVED t2 system NULL NULL NULL NULL 1
2 DERIVED t1 ALL NULL NULL NULL NULL 4 Using where
drop table t1, t2;
create table t1(a int not null, t char(8), index(a));
SELECT * FROM (SELECT * FROM t1) as b ORDER BY a ASC LIMIT 0,20;
...
...
mysql-test/t/derived.test
View file @
47f67214
...
...
@@ -41,6 +41,7 @@ CREATE TABLE t2 (a int not null);
insert
into
t2
values
(
1
);
select
*
from
(
select
*
from
t1
where
t1
.
a
=
(
select
a
from
t2
where
t2
.
a
=
t1
.
a
))
a
;
select
*
from
(
select
*
from
t1
where
t1
.
a
=
(
select
t2
.
a
from
t2
where
t2
.
a
=
t1
.
a
)
union
select
t1
.
a
,
t1
.
b
from
t1
)
a
;
explain
select
*
from
(
select
*
from
t1
,
t2
where
t1
.
a
=
t2
.
a
)
t1
;
drop
table
t1
,
t2
;
create
table
t1
(
a
int
not
null
,
t
char
(
8
),
index
(
a
));
disable_query_log
;
...
...
sql/sql_derived.cc
View file @
47f67214
...
...
@@ -194,7 +194,10 @@ int mysql_derived(THD *thd, LEX *lex, SELECT_LEX_UNIT *unit,
{
// to fix a problem in EXPLAIN
if
(
tables
)
tables
->
table_list
->
table
=
tables
->
table
;
{
for
(
TABLE_LIST
*
cursor
=
tables
;
cursor
;
cursor
=
cursor
->
next
)
cursor
->
table_list
->
table
=
cursor
->
table
;
}
}
else
unit
->
exclude_level
();
...
...
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