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
ac28b199
Commit
ac28b199
authored
May 06, 2002
by
bell@sanja.is.com.ua
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fixed bug in derived tables if derived tables more than 1
parent
06ed215c
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
16 additions
and
5 deletions
+16
-5
mysql-test/r/derived.result
mysql-test/r/derived.result
+8
-2
mysql-test/t/derived.test
mysql-test/t/derived.test
+5
-2
sql/sql_yacc.yy
sql/sql_yacc.yy
+3
-1
No files found.
mysql-test/r/derived.result
View file @
ac28b199
drop table if exists t1,t2;
drop table if exists t1,t2
,t3
;
CREATE TABLE t1 (a int not null, b char (10) not null);
insert into t1 values(1,'a'),(2,'b'),(3,'c'),(3,'c');
CREATE TABLE t2 (a int not null, b char (10) not null);
...
...
@@ -7,4 +7,10 @@ select t1.a,t3.y from t1,(select a as y from t2 where b='c') as t3 where t1.a
a y
3 3
3 3
drop table if exists t1.t2;
CREATE TABLE t3 (a int not null, b char (10) not null);
insert into t3 values (3,'f'),(4,'y'),(5,'z'),(6,'c');
select t1.a,t4.y from t1,(select t2.a as y from t2,(select t3.b from t3 where t3.a>3) as t5 where t2.b=t5.b) as t4 where t1.a = t4.y;
a y
3 3
3 3
drop table if exists t1.t2,t3;
mysql-test/t/derived.test
View file @
ac28b199
drop
table
if
exists
t1
,
t2
;
drop
table
if
exists
t1
,
t2
,
t3
;
CREATE
TABLE
t1
(
a
int
not
null
,
b
char
(
10
)
not
null
);
insert
into
t1
values
(
1
,
'a'
),(
2
,
'b'
),(
3
,
'c'
),(
3
,
'c'
);
CREATE
TABLE
t2
(
a
int
not
null
,
b
char
(
10
)
not
null
);
insert
into
t2
values
(
3
,
'c'
),(
4
,
'd'
),(
5
,
'f'
),(
6
,
'e'
);
select
t1
.
a
,
t3
.
y
from
t1
,(
select
a
as
y
from
t2
where
b
=
'c'
)
as
t3
where
t1
.
a
=
t3
.
y
;
drop
table
if
exists
t1
.
t2
;
\ No newline at end of file
CREATE
TABLE
t3
(
a
int
not
null
,
b
char
(
10
)
not
null
);
insert
into
t3
values
(
3
,
'f'
),(
4
,
'y'
),(
5
,
'z'
),(
6
,
'c'
);
select
t1
.
a
,
t4
.
y
from
t1
,(
select
t2
.
a
as
y
from
t2
,(
select
t3
.
b
from
t3
where
t3
.
a
>
3
)
as
t5
where
t2
.
b
=
t5
.
b
)
as
t4
where
t1
.
a
=
t4
.
y
;
drop
table
if
exists
t1
.
t2
,
t3
;
sql/sql_yacc.yy
View file @
ac28b199
...
...
@@ -2155,8 +2155,10 @@ join_table:
| '(' SELECT_SYM select_part3 ')' opt_table_alias
{
LEX *lex=Lex;
SELECT_LEX *select_to_execute= lex->select;
lex->select=lex->select->prev;
if (!($$=add_table_to_list(new Table_ident(Lex->last_select),$5,0,TL_UNLOCK)))
if (!($$=add_table_to_list(new Table_ident(select_to_execute),
$5,0,TL_UNLOCK)))
YYABORT;
}
...
...
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