!3518 修复视图定义中包含row mark子句时报错的问题

Merge pull request !3518 from chenxiaobin/fixViewUpdate
This commit is contained in:
opengauss-bot
2023-06-06 06:32:29 +00:00
committed by Gitee
3 changed files with 21 additions and 3 deletions

View File

@ -1808,13 +1808,13 @@ static RowMarkClause* _readRowMarkClause(void)
READ_UINT_FIELD(rti); READ_UINT_FIELD(rti);
READ_BOOL_FIELD(forUpdate); READ_BOOL_FIELD(forUpdate);
IF_EXIST(waitSec) {
READ_INT_FIELD(waitSec);
}
IF_EXIST(waitPolicy) { IF_EXIST(waitPolicy) {
READ_ENUM_FIELD(waitPolicy, LockWaitPolicy); READ_ENUM_FIELD(waitPolicy, LockWaitPolicy);
} }
IF_EXIST(waitSec) {
READ_INT_FIELD(waitSec);
}
/* convert noWait (true/false) to LockWaitPolicy (LockWaitError/LockWaitBlock) */ /* convert noWait (true/false) to LockWaitPolicy (LockWaitError/LockWaitBlock) */
IF_EXIST(noWait) { IF_EXIST(noWait) {
READ_ENUM_EXPR(waitPolicy, LockWaitPolicy, (strtobool(token) ? LockWaitError : LockWaitBlock)); READ_ENUM_EXPR(waitPolicy, LockWaitPolicy, (strtobool(token) ? LockWaitError : LockWaitBlock));

View File

@ -201,3 +201,14 @@ select pg_get_viewdef('tt20v', true);
(1 row) (1 row)
drop view tt20v; 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

View File

@ -73,3 +73,10 @@ select * from
cast(1+2 as int8) as i8; cast(1+2 as int8) as i8;
select pg_get_viewdef('tt20v', true); select pg_get_viewdef('tt20v', true);
drop view tt20v; 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;