diff --git a/src/common/backend/nodes/readfuncs.cpp b/src/common/backend/nodes/readfuncs.cpp index 8ab7ea6e2f316bd84d44d47f4c41e68cd22b56ce..097803597c19ea02242cd06567fcae7ffaef316c 100755 --- a/src/common/backend/nodes/readfuncs.cpp +++ b/src/common/backend/nodes/readfuncs.cpp @@ -1808,13 +1808,13 @@ static RowMarkClause* _readRowMarkClause(void) READ_UINT_FIELD(rti); READ_BOOL_FIELD(forUpdate); - IF_EXIST(waitSec) { - READ_INT_FIELD(waitSec); - } IF_EXIST(waitPolicy) { READ_ENUM_FIELD(waitPolicy, LockWaitPolicy); } + IF_EXIST(waitSec) { + READ_INT_FIELD(waitSec); + } /* convert noWait (true/false) to LockWaitPolicy (LockWaitError/LockWaitBlock) */ IF_EXIST(noWait) { READ_ENUM_EXPR(waitPolicy, LockWaitPolicy, (strtobool(token) ? LockWaitError : LockWaitBlock)); diff --git a/src/test/regress/expected/create_view5.out b/src/test/regress/expected/create_view5.out index 39665f54a6f275efc5aa96db988e02401ff7f490..2796d0835990899b3127f9db37347f9f09c4ebd1 100644 --- a/src/test/regress/expected/create_view5.out +++ b/src/test/regress/expected/create_view5.out @@ -201,3 +201,14 @@ select pg_get_viewdef('tt20v', true); (1 row) drop view tt20v; +create table test_view_for_update_tbl (a int, b int); +create view test_view_for_update_view1 as select * from test_view_for_update_tbl for key share; +create view test_view_for_update_view2 as select * from test_view_for_update_tbl for share; +create view test_view_for_update_view3 as select * from test_view_for_update_tbl for no key update; +create view test_view_for_update_view4 as select * from test_view_for_update_tbl for update; +drop table test_view_for_update_tbl cascade; +NOTICE: drop cascades to 4 other objects +DETAIL: drop cascades to view test_view_for_update_view1 +drop cascades to view test_view_for_update_view2 +drop cascades to view test_view_for_update_view3 +drop cascades to view test_view_for_update_view4 diff --git a/src/test/regress/sql/create_view5.sql b/src/test/regress/sql/create_view5.sql index e68183fe758c3c62f0851c5ffcd75fd271240bc2..cf837dbe018aee6be7b1f341cf58958fe208e1ef 100644 --- a/src/test/regress/sql/create_view5.sql +++ b/src/test/regress/sql/create_view5.sql @@ -73,3 +73,10 @@ select * from cast(1+2 as int8) as i8; select pg_get_viewdef('tt20v', true); drop view tt20v; + +create table test_view_for_update_tbl (a int, b int); +create view test_view_for_update_view1 as select * from test_view_for_update_tbl for key share; +create view test_view_for_update_view2 as select * from test_view_for_update_tbl for share; +create view test_view_for_update_view3 as select * from test_view_for_update_tbl for no key update; +create view test_view_for_update_view4 as select * from test_view_for_update_tbl for update; +drop table test_view_for_update_tbl cascade;