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

Commit6f44fe7

Browse files
committed
Allow rel_is_distinct_for() to look through RelabelType below OpExpr.
This lets it do the right thing for, eg, varchar columns.Back-patch to 9.5 where this logic appeared.David Rowley, per report from Kim Rose CarlsenDiscussion:https://postgr.es/m/VI1PR05MB17091F9A9876528055D6A827C76D0@VI1PR05MB1709.eurprd05.prod.outlook.com
1 parent27c6619 commit6f44fe7

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

‎src/backend/optimizer/plan/analyzejoins.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -703,6 +703,14 @@ rel_is_distinct_for(PlannerInfo *root, RelOptInfo *rel, List *clause_list)
703703
else
704704
var= (Var*)get_leftop(rinfo->clause);
705705

706+
/*
707+
* We may ignore any RelabelType node above the operand. (There
708+
* won't be more than one, since eval_const_expressions() has been
709+
* applied already.)
710+
*/
711+
if (var&&IsA(var,RelabelType))
712+
var= (Var*) ((RelabelType*)var)->arg;
713+
706714
/*
707715
* If inner side isn't a Var referencing a subquery output column,
708716
* this clause doesn't help us.

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp