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
eb08458c
Commit
eb08458c
authored
Nov 21, 2003
by
hf@deer.(none)
Browse files
Options
Browse Files
Download
Plain Diff
Merge abotchkov@bk-internal.mysql.com:/home/bk/mysql-4.1
into deer.(none):/home/hf/work/mysql-4.1.1727
parents
0a5af444
a88f4ea3
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
25 additions
and
29 deletions
+25
-29
mysql-test/r/derived.result
mysql-test/r/derived.result
+17
-0
mysql-test/t/derived.test
mysql-test/t/derived.test
+6
-0
sql/sql_lex.cc
sql/sql_lex.cc
+2
-29
No files found.
mysql-test/r/derived.result
View file @
eb08458c
...
...
@@ -228,3 +228,20 @@ id select_type table type possible_keys key key_len ref rows Extra
2 DERIVED t1 ALL NULL NULL NULL NULL 2 Using where
3 DEPENDENT SUBQUERY B ALL NULL NULL NULL NULL 2 Using where
drop table t1;
create table t1 (a int);
insert into t1 values (1),(2);
select * from ( select * from t1 union select * from t1) a,(select * from t1 union select * from t1) b;
a a
1 1
2 1
1 2
2 2
explain select * from ( select * from t1 union select * from t1) a,(select * from t1 union select * from t1) b;
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY <derived2> ALL NULL NULL NULL NULL 2
1 PRIMARY <derived4> ALL NULL NULL NULL NULL 2
4 DERIVED t1 ALL NULL NULL NULL NULL 2
5 UNION t1 ALL NULL NULL NULL NULL 2
2 DERIVED t1 ALL NULL NULL NULL NULL 2
3 UNION t1 ALL NULL NULL NULL NULL 2
drop table t1;
mysql-test/t/derived.test
View file @
eb08458c
...
...
@@ -132,3 +132,9 @@ insert into t1 VALUES(1,1,1), (2,2,1);
select
count
(
*
)
from
t1
INNER
JOIN
(
SELECT
A
.
E1
,
A
.
E2
,
A
.
E3
FROM
t1
AS
A
WHERE
A
.
E3
=
(
SELECT
MAX
(
B
.
E3
)
FROM
t1
AS
B
WHERE
A
.
E2
=
B
.
E2
))
AS
THEMAX
ON
t1
.
E1
=
THEMAX
.
E2
AND
t1
.
E1
=
t1
.
E2
;
explain
select
count
(
*
)
from
t1
INNER
JOIN
(
SELECT
A
.
E1
,
A
.
E2
,
A
.
E3
FROM
t1
AS
A
WHERE
A
.
E3
=
(
SELECT
MAX
(
B
.
E3
)
FROM
t1
AS
B
WHERE
A
.
E2
=
B
.
E2
))
AS
THEMAX
ON
t1
.
E1
=
THEMAX
.
E2
AND
t1
.
E1
=
t1
.
E2
;
drop
table
t1
;
create
table
t1
(
a
int
);
insert
into
t1
values
(
1
),(
2
);
select
*
from
(
select
*
from
t1
union
select
*
from
t1
)
a
,(
select
*
from
t1
union
select
*
from
t1
)
b
;
explain
select
*
from
(
select
*
from
t1
union
select
*
from
t1
)
a
,(
select
*
from
t1
union
select
*
from
t1
)
b
;
drop
table
t1
;
sql/sql_lex.cc
View file @
eb08458c
...
...
@@ -1270,28 +1270,6 @@ bool st_select_lex::test_limit()
return
(
0
);
}
/*
Interface method of table list creation for query
...
...
@@ -1316,13 +1294,8 @@ bool st_select_lex_unit::create_total_list(THD *thd, st_lex *lex,
bool
check_derived
)
{
*
result
=
0
;
for
(
SELECT_LEX_UNIT
*
unit
=
this
;
unit
;
unit
=
unit
->
next_unit
())
{
if
((
res
=
unit
->
create_total_list_n_last_return
(
thd
,
lex
,
&
result
,
check_derived
)))
return
res
;
}
return
0
;
res
=
create_total_list_n_last_return
(
thd
,
lex
,
&
result
,
check_derived
);
return
res
;
}
/*
...
...
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