mirror of
https://github.com/postgres/postgres.git
synced 2025-07-08 11:42:09 +03:00
Add assign_expr_collations() to CreatePolicy() and AlterPolicy().
As noted by Noah Misch, CreatePolicy() and AlterPolicy() omit to call assign_expr_collations() on the node trees. Fix the omission and add his test case to the rowsecurity regression test.
This commit is contained in:
@ -538,6 +538,10 @@ CreatePolicy(CreatePolicyStmt *stmt)
|
||||
EXPR_KIND_WHERE,
|
||||
"POLICY");
|
||||
|
||||
/* Fix up collation information */
|
||||
assign_expr_collations(qual_pstate, qual);
|
||||
assign_expr_collations(with_check_pstate, with_check_qual);
|
||||
|
||||
/* Open pg_policy catalog */
|
||||
pg_policy_rel = heap_open(PolicyRelationId, RowExclusiveLock);
|
||||
|
||||
@ -681,6 +685,9 @@ AlterPolicy(AlterPolicyStmt *stmt)
|
||||
EXPR_KIND_WHERE,
|
||||
"POLICY");
|
||||
|
||||
/* Fix up collation information */
|
||||
assign_expr_collations(qual_pstate, qual);
|
||||
|
||||
qual_parse_rtable = qual_pstate->p_rtable;
|
||||
free_parsestate(qual_pstate);
|
||||
}
|
||||
@ -701,6 +708,9 @@ AlterPolicy(AlterPolicyStmt *stmt)
|
||||
EXPR_KIND_WHERE,
|
||||
"POLICY");
|
||||
|
||||
/* Fix up collation information */
|
||||
assign_expr_collations(with_check_pstate, with_check_qual);
|
||||
|
||||
with_check_parse_rtable = with_check_pstate->p_rtable;
|
||||
free_parsestate(with_check_pstate);
|
||||
}
|
||||
|
Reference in New Issue
Block a user