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
9a6aefab
Commit
9a6aefab
authored
Aug 23, 2005
by
timour@mysql.com
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix for BUG#6276.
parent
2f2347e5
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
56 additions
and
0 deletions
+56
-0
mysql-test/r/select.result
mysql-test/r/select.result
+31
-0
mysql-test/t/select.test
mysql-test/t/select.test
+20
-0
sql/sql_base.cc
sql/sql_base.cc
+5
-0
No files found.
mysql-test/r/select.result
View file @
9a6aefab
...
...
@@ -2829,3 +2829,34 @@ Warnings:
Warning 1292 Truncated incorrect DOUBLE value: 'x'
drop table t1;
drop view v1;
create table t1(a1 int);
create table t2(a2 int);
insert into t1 values(1),(2);
insert into t2 values(1),(2);
create view v2 (c) as select a1 from t1;
select * from t1 natural left join t2;
a1 a2
1 1
1 2
2 1
2 2
select * from t1 natural right join t2;
a2 a1
1 1
1 2
2 1
2 2
select * from v2 natural left join t2;
c a2
1 1
1 2
2 1
2 2
select * from v2 natural right join t2;
a2 c
1 1
1 2
2 1
2 2
drop table t1, t2;
drop view v2;
mysql-test/t/select.test
View file @
9a6aefab
...
...
@@ -2406,3 +2406,23 @@ insert into t1 values (1,'x',5);
select
*
from
t1
natural
join
v1
;
drop
table
t1
;
drop
view
v1
;
#
# Bug #6276 A SELECT that does a NATURAL OUTER JOIN without common
# columns crashes server because of empty ON condition
#
create
table
t1
(
a1
int
);
create
table
t2
(
a2
int
);
insert
into
t1
values
(
1
),(
2
);
insert
into
t2
values
(
1
),(
2
);
create
view
v2
(
c
)
as
select
a1
from
t1
;
select
*
from
t1
natural
left
join
t2
;
select
*
from
t1
natural
right
join
t2
;
select
*
from
v2
natural
left
join
t2
;
select
*
from
v2
natural
right
join
t2
;
drop
table
t1
,
t2
;
drop
view
v2
;
sql/sql_base.cc
View file @
9a6aefab
...
...
@@ -3851,6 +3851,11 @@ store_top_level_join_columns(THD *thd, TABLE_LIST *table_ref,
*/
table_ref_1
->
natural_join
=
table_ref_2
->
natural_join
=
NULL
;
/* Add a TRUE condition to outer joins that have no common columns. */
if
(
table_ref_2
->
outer_join
&&
!
table_ref_1
->
on_expr
&&
!
table_ref_2
->
on_expr
)
table_ref_2
->
on_expr
=
new
Item_int
((
longlong
)
1
,
1
);
/* Always true. */
/* Change this table reference to become a leaf for name resolution. */
if
(
left_neighbor
)
{
...
...
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