!544 fix unrecognized node type 355 for outer join

Merge pull request !544 from scarbor_fair/master
This commit is contained in:
opengauss-bot
2020-12-28 20:34:31 +08:00
committed by Gitee
3 changed files with 24 additions and 1 deletions

View File

@ -2755,6 +2755,7 @@ bool raw_expression_tree_walker(Node* node, bool (*walker)(), void* context)
case T_ParamRef:
case T_A_Const:
case T_A_Star:
case T_Rownum:
/* primitive node types with no subnodes */
break;
case T_Alias:

View File

@ -3763,6 +3763,19 @@ select * from hash_right_anti_y where not exists (select hash_right_anti_x.y fro
drop table hash_right_anti_x;
drop table hash_right_anti_y;
-- test rownum in outer join
create table t_a (id int, name varchar(10), code int);
create table t_b (id int, name varchar(10), code int);
insert into t_a values (1, 'tom', 3);
insert into t_b values (1, 'bat', 6);
select * from t_a a, t_b b where a.id(+) = b.id and rownum = 1;
id | name | code | id | name | code
----+------+------+----+------+------
1 | tom | 3 | 1 | bat | 6
(1 row)
drop table t_a;
drop table t_b;
-- test datatype varchar in left join
create table testa (id varchar);
create table testb (id varchar);

View File

@ -1209,6 +1209,15 @@ select * from hash_right_anti_y where not exists (select hash_right_anti_x.y fro
drop table hash_right_anti_x;
drop table hash_right_anti_y;
-- test rownum in outer join
create table t_a (id int, name varchar(10), code int);
create table t_b (id int, name varchar(10), code int);
insert into t_a values (1, 'tom', 3);
insert into t_b values (1, 'bat', 6);
select * from t_a a, t_b b where a.id(+) = b.id and rownum = 1;
drop table t_a;
drop table t_b;
-- test datatype varchar in left join
create table testa (id varchar);
create table testb (id varchar);
@ -1222,4 +1231,4 @@ insert into testb values('2');
select a.id from testa as a left join (select distinct id from testb) as b on a.id = b.id;
drop table testa;
drop table testb;
drop table testb;