1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-30 16:24:05 +03:00

Fix for BUG#6276.

mysql-test/r/select.result:
  Test for BUG#6276.
mysql-test/t/select.test:
  Test for BUG#6276.
sql/sql_base.cc:
  Add a true ON condition for outer joins without common columns.
This commit is contained in:
unknown
2005-08-23 20:03:32 +03:00
parent 142f65834b
commit b4e830c3e3
3 changed files with 56 additions and 0 deletions

View File

@ -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;

View File

@ -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;