Skip to content

Commit 4db4eb6

Browse files
committed
Uncomment and Fix mutable function/self references check in qual code. Closes #177
1 parent 0de6658 commit 4db4eb6

File tree

1 file changed

+4
-7
lines changed

1 file changed

+4
-7
lines changed

quals.go

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -92,13 +92,10 @@ func qualFromOpExpr(restriction *C.OpExpr, node *C.ForeignScanState, cinfos *con
9292
right := C.list_nth(restriction.args, 1)
9393

9494
// Do not add it if it either contains a mutable function, or makes self references in the right hand side.
95-
// TODO pull_varnos signature has changed in PG14 - we also need a *PlannerInfo which is not available to us
96-
// at this point
97-
// https://github.com/turbot/steampipe-postgres-fdw/issues/177
98-
//if C.contain_volatile_functions((*C.Node)(right)) || C.bms_is_subset(relids, C.pull_varnos((*C.Node)(right))) {
99-
// log.Printf("[TRACE] restriction either contains a mutable function, or makes self references in the right hand side - NOT adding qual for OpExpr")
100-
// return nil
101-
//}
95+
if C.contain_volatile_functions((*C.Node)(right)) || C.bms_is_subset(relids, C.pull_varnos(nil, (*C.Node)(right))) {
96+
log.Printf("[TRACE] restriction either contains a mutable function, or makes self references in the right hand side - NOT adding qual for OpExpr")
97+
return nil
98+
}
10299

103100
var arrayIndex = int(left.varattno - 1)
104101
ci := cinfos.get(arrayIndex)

0 commit comments

Comments
 (0)