Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit7a28e9a

Browse files
committed
Fix test_rls_hooks to assign expression collations properly.
This module overlooked this necessary fixup step on the results oftransformWhereClause(). It accidentally worked anyway, because theconstructed expression involved type "name" which is not collatable,but it fell over while I was experimenting with changing "name" tobe collatable.Back-patch, not because there's any live bug here in back branches,but because somebody might use this code as a model for some realapplication and then not understand why it doesn't work.
1 parentd65ddb2 commit7a28e9a

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

‎src/test/modules/test_rls_hooks/test_rls_hooks.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
#include"nodes/makefuncs.h"
2323
#include"nodes/makefuncs.h"
2424
#include"parser/parse_clause.h"
25+
#include"parser/parse_collate.h"
2526
#include"parser/parse_node.h"
2627
#include"parser/parse_relation.h"
2728
#include"rewrite/rowsecurity.h"
@@ -107,6 +108,8 @@ test_rls_hooks_permissive(CmdType cmdtype, Relation relation)
107108
policy->qual= (Expr*)transformWhereClause(qual_pstate,copyObject(e),
108109
EXPR_KIND_POLICY,
109110
"POLICY");
111+
/* Fix up collation information */
112+
assign_expr_collations(qual_pstate, (Node*)policy->qual);
110113

111114
policy->with_check_qual=copyObject(policy->qual);
112115
policy->hassublinks= false;
@@ -165,6 +168,8 @@ test_rls_hooks_restrictive(CmdType cmdtype, Relation relation)
165168
policy->qual= (Expr*)transformWhereClause(qual_pstate,copyObject(e),
166169
EXPR_KIND_POLICY,
167170
"POLICY");
171+
/* Fix up collation information */
172+
assign_expr_collations(qual_pstate, (Node*)policy->qual);
168173

169174
policy->with_check_qual=copyObject(policy->qual);
170175
policy->hassublinks= false;

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp