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
dec992d8
Commit
dec992d8
authored
Aug 02, 2004
by
serg@serg.mylan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
hang in dummy natural join (no common columns) Bug #4807
parent
e8d23cfa
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
41 additions
and
22 deletions
+41
-22
mysql-test/r/join.result
mysql-test/r/join.result
+6
-0
mysql-test/t/join.test
mysql-test/t/join.test
+10
-0
sql/sql_base.cc
sql/sql_base.cc
+25
-22
No files found.
mysql-test/r/join.result
View file @
dec992d8
...
...
@@ -283,6 +283,12 @@ ID Value1 Value2
SELECT * FROM t1 NATURAL JOIN t2 WHERE (Value1 = 'A' AND Value2 <> 'B') AND 1;
ID Value1 Value2
drop table t1,t2;
CREATE TABLE t1 (a int);
CREATE TABLE t2 (b int);
CREATE TABLE t3 (c int);
SELECT * FROM t1 NATURAL JOIN t2 NATURAL JOIN t3;
a b c
DROP TABLE t1, t2, t3;
create table t1 (i int);
create table t2 (i int);
create table t3 (i int);
...
...
mysql-test/t/join.test
View file @
dec992d8
...
...
@@ -284,6 +284,16 @@ SELECT * FROM t1 NATURAL JOIN t2 WHERE 1 AND Value1 = 'A' AND Value2 <> 'B';
SELECT
*
FROM
t1
NATURAL
JOIN
t2
WHERE
(
Value1
=
'A'
AND
Value2
<>
'B'
)
AND
1
;
drop
table
t1
,
t2
;
#
# dummy natural join (no common columns) Bug #4807
#
CREATE
TABLE
t1
(
a
int
);
CREATE
TABLE
t2
(
b
int
);
CREATE
TABLE
t3
(
c
int
);
SELECT
*
FROM
t1
NATURAL
JOIN
t2
NATURAL
JOIN
t3
;
DROP
TABLE
t1
,
t2
,
t3
;
#
# Test combination of join methods
#
...
...
sql/sql_base.cc
View file @
dec992d8
...
...
@@ -2522,29 +2522,32 @@ int setup_conds(THD *thd,TABLE_LIST *tables,COND **conds)
// to prevent natural join processing during PS re-execution
table
->
natural_join
=
0
;
if
(
!
table
->
outer_join
)
// Not left join
if
(
cond_and
->
list
.
elements
)
{
*
conds
=
and_conds
(
*
conds
,
cond_and
);
// fix_fields() should be made with temporary memory pool
if
(
stmt
)
thd
->
restore_backup_item_arena
(
stmt
,
&
backup
);
if
(
*
conds
&&
!
(
*
conds
)
->
fixed
)
{
if
((
*
conds
)
->
fix_fields
(
thd
,
tables
,
conds
))
DBUG_RETURN
(
1
);
}
}
else
{
table
->
on_expr
=
and_conds
(
table
->
on_expr
,
cond_and
);
// fix_fields() should be made with temporary memory pool
if
(
stmt
)
thd
->
restore_backup_item_arena
(
stmt
,
&
backup
);
if
(
table
->
on_expr
&&
!
table
->
on_expr
->
fixed
)
{
if
(
table
->
on_expr
->
fix_fields
(
thd
,
tables
,
&
table
->
on_expr
))
DBUG_RETURN
(
1
);
}
if
(
!
table
->
outer_join
)
// Not left join
{
*
conds
=
and_conds
(
*
conds
,
cond_and
);
// fix_fields() should be made with temporary memory pool
if
(
stmt
)
thd
->
restore_backup_item_arena
(
stmt
,
&
backup
);
if
(
*
conds
&&
!
(
*
conds
)
->
fixed
)
{
if
((
*
conds
)
->
fix_fields
(
thd
,
tables
,
conds
))
DBUG_RETURN
(
1
);
}
}
else
{
table
->
on_expr
=
and_conds
(
table
->
on_expr
,
cond_and
);
// fix_fields() should be made with temporary memory pool
if
(
stmt
)
thd
->
restore_backup_item_arena
(
stmt
,
&
backup
);
if
(
table
->
on_expr
&&
!
table
->
on_expr
->
fixed
)
{
if
(
table
->
on_expr
->
fix_fields
(
thd
,
tables
,
&
table
->
on_expr
))
DBUG_RETURN
(
1
);
}
}
}
}
}
...
...
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