mirror of
https://github.com/postgres/postgres.git
synced 2025-04-22 23:02:54 +03:00
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 Carlsen Discussion: https://postgr.es/m/VI1PR05MB17091F9A9876528055D6A827C76D0@VI1PR05MB1709.eurprd05.prod.outlook.com
This commit is contained in:
parent
27c6619e9c
commit
6f44fe7f12
@ -703,6 +703,14 @@ rel_is_distinct_for(PlannerInfo *root, RelOptInfo *rel, List *clause_list)
|
||||
else
|
||||
var = (Var *) get_leftop(rinfo->clause);
|
||||
|
||||
/*
|
||||
* We may ignore any RelabelType node above the operand. (There
|
||||
* won't be more than one, since eval_const_expressions() has been
|
||||
* applied already.)
|
||||
*/
|
||||
if (var && IsA(var, RelabelType))
|
||||
var = (Var *) ((RelabelType *) var)->arg;
|
||||
|
||||
/*
|
||||
* If inner side isn't a Var referencing a subquery output column,
|
||||
* this clause doesn't help us.
|
||||
|
Loading…
x
Reference in New Issue
Block a user