From 75285fdaf15db6ec4996b37bbdf3d50545e53375 Mon Sep 17 00:00:00 2001 From: chenxiaobin19 <1025221611@qq.com> Date: Sat, 3 Jun 2023 11:15:59 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E8=A7=86=E5=9B=BE=E5=AE=9A?= =?UTF-8?q?=E4=B9=89=E4=B8=AD=E5=8C=85=E5=90=ABrow=20mark=E6=97=B6?= =?UTF-8?q?=E6=8A=A5=E9=94=99=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/common/backend/nodes/readfuncs.cpp | 6 +++--- src/test/regress/expected/create_view5.out | 11 +++++++++++ src/test/regress/sql/create_view5.sql | 7 +++++++ 3 files changed, 21 insertions(+), 3 deletions(-) diff --git a/src/common/backend/nodes/readfuncs.cpp b/src/common/backend/nodes/readfuncs.cpp index 8ab7ea6e2f..097803597c 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 39665f54a6..2796d08359 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 e68183fe75..cf837dbe01 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; -- Gitee