diff options
Diffstat (limited to 'mysql-test/t/select.test')
-rw-r--r-- | mysql-test/t/select.test | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/mysql-test/t/select.test b/mysql-test/t/select.test index 4ad23be2649..f7de7239292 100644 --- a/mysql-test/t/select.test +++ b/mysql-test/t/select.test @@ -2181,6 +2181,16 @@ select found_rows(); DROP TABLE t1; +# +# Bug #13356 assertion failed in resolve_const_item() +# +create table t1(f1 int, f2 int); +create table t2(f3 int); +select f1 from t1,t2 where f1=f2 and (f1,f2) = ((1,1)); +select f1 from t1,t2 where f1=f2 and (f1,NULL) = ((1,1)); +select f1 from t1,t2 where f1=f2 and (f1,f2) = ((1,NULL)); +drop table t1,t2; + # End of 4.1 tests # @@ -2565,3 +2575,37 @@ select * from v1 left join v3 using (id); drop table t1, t2; drop view v1, v2, v3; + +# +# Bug #13597 Column in ON condition not resolved if references a table in +# nested right join. +# + +create table a ( + id int(11) not null default '0' +) engine=myisam default charset=latin1; + +insert into a values (123),(191),(192); + +create table b ( + id char(16) character set utf8 not null default '' +) engine=myisam default charset=latin1; + +insert into b values ('58013'),('58014'),('58015'),('58016'); + +create table c ( + a_id int(11) not null default '0', + b_id char(16) character set utf8 default null +) engine=myisam default charset=latin1; + +insert into c values +(123,null),(123,null),(123,null),(123,null),(123,null),(123,'58013'); + +-- both queries are equivalent +select count(*) +from a inner join (c left join b on b.id = c.b_id) on a.id = c.a_id; + +select count(*) +from a inner join (b right join c on b.id = c.b_id) on a.id = c.a_id; + +drop table a, b, c; |