From 22251c5e31f377c1a95de69d2c3de87272ccb407 Mon Sep 17 00:00:00 2001 From: liang_-123 Date: Wed, 30 Dec 2020 17:08:10 +0800 Subject: [PATCH] fix unrecognized node type 355 for outer join --- src/common/backend/nodes/nodeFuncs.cpp | 1 + src/test/regress/expected/join.out | 13 +++++++++++++ src/test/regress/sql/join.sql | 9 +++++++++ 3 files changed, 23 insertions(+) diff --git a/src/common/backend/nodes/nodeFuncs.cpp b/src/common/backend/nodes/nodeFuncs.cpp index f167c9dbf..1a64b2e9f 100755 --- a/src/common/backend/nodes/nodeFuncs.cpp +++ b/src/common/backend/nodes/nodeFuncs.cpp @@ -2759,6 +2759,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: diff --git a/src/test/regress/expected/join.out b/src/test/regress/expected/join.out index 478983cc4..47f41ac1c 100644 --- a/src/test/regress/expected/join.out +++ b/src/test/regress/expected/join.out @@ -3763,3 +3763,16 @@ 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; diff --git a/src/test/regress/sql/join.sql b/src/test/regress/sql/join.sql index 46d33af9a..7c3202593 100644 --- a/src/test/regress/sql/join.sql +++ b/src/test/regress/sql/join.sql @@ -1208,3 +1208,12 @@ 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;