未验证 提交 2ef36a59 编写于 作者: Z Zhenghua Lyu 提交者: GitHub

Add deserialization method for lockingclause

`create rule <...> do instead select * from t for update`
will dispatch a query with lockingclause node. Add
deserialization method for it to make things correct.
上级 81762810
......@@ -2912,6 +2912,18 @@ _readLockRows(void)
READ_DONE();
}
static LockingClause *
_readLockingClause(void)
{
READ_LOCALS(LockingClause);
READ_NODE_FIELD(lockedRels);
READ_ENUM_FIELD(strength, LockClauseStrength);
READ_BOOL_FIELD(noWait);
READ_DONE();
}
static Node *
_readValue(NodeTag nt)
{
......@@ -3851,6 +3863,9 @@ readNodeBinary(void)
case T_AlterTableMoveAllStmt:
return_value = _readAlterTableMoveAllStmt();
break;
case T_LockingClause:
return_value = _readLockingClause();
break;
default:
return_value = NULL; /* keep the compiler silent */
elog(ERROR, "could not deserialize unrecognized node type: %d",
......
......@@ -2727,3 +2727,7 @@ SELECT pg_get_functiondef('func_with_set_params()'::regprocedure);
(1 row)
-- test rule for select-for-update
create table t_test_rules_select_for_update (c int) distributed randomly;
create rule myrule as on insert to t_test_rules_select_for_update
do instead select * from t_test_rules_select_for_update for update;
......@@ -1035,3 +1035,8 @@ CREATE FUNCTION func_with_set_params() RETURNS integer
SET search_path TO PG_CATALOG, "Mixed/Case", 'c:/''a"/path', '', '0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789'
IMMUTABLE STRICT;
SELECT pg_get_functiondef('func_with_set_params()'::regprocedure);
-- test rule for select-for-update
create table t_test_rules_select_for_update (c int) distributed randomly;
create rule myrule as on insert to t_test_rules_select_for_update
do instead select * from t_test_rules_select_for_update for update;
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册