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

Commit86e4ebb

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 parentc0d21bd commit86e4ebb

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
@@ -617,6 +617,14 @@ rel_is_distinct_for(PlannerInfo *root, RelOptInfo *rel, List *clause_list)
617617
else
618618
var= (Var*)get_leftop(rinfo->clause);
619619

620+
/*
621+
* We may ignore any RelabelType node above the operand. (There
622+
* won't be more than one, since eval_const_expressions() has been
623+
* applied already.)
624+
*/
625+
if (var&&IsA(var,RelabelType))
626+
var= (Var*) ((RelabelType*)var)->arg;
627+
620628
/*
621629
* If inner side isn't a Var referencing a subquery output column,
622630
* this clause doesn't help us.

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp