(node *pg_query.Node)
| 328 | } |
| 329 | |
| 330 | func (t *OperatorTransform) transformFromItem(node *pg_query.Node) bool { |
| 331 | if node == nil { |
| 332 | return false |
| 333 | } |
| 334 | |
| 335 | changed := false |
| 336 | |
| 337 | // Handle JoinExpr |
| 338 | if joinExpr := node.GetJoinExpr(); joinExpr != nil { |
| 339 | if joinExpr.Quals != nil { |
| 340 | if newQuals := t.transformExpression(joinExpr.Quals); newQuals != nil { |
| 341 | joinExpr.Quals = newQuals |
| 342 | changed = true |
| 343 | } |
| 344 | } |
| 345 | if t.transformFromItem(joinExpr.Larg) { |
| 346 | changed = true |
| 347 | } |
| 348 | if t.transformFromItem(joinExpr.Rarg) { |
| 349 | changed = true |
| 350 | } |
| 351 | } |
| 352 | |
| 353 | // Handle subselects |
| 354 | if rangeSubselect := node.GetRangeSubselect(); rangeSubselect != nil { |
| 355 | if rangeSubselect.Subquery != nil { |
| 356 | if subSelect := rangeSubselect.Subquery.GetSelectStmt(); subSelect != nil { |
| 357 | if t.transformSelectStmt(subSelect) { |
| 358 | changed = true |
| 359 | } |
| 360 | } |
| 361 | } |
| 362 | } |
| 363 | |
| 364 | return changed |
| 365 | } |
| 366 | |
| 367 | // transformExpression recursively transforms an expression, replacing regex operators |
| 368 | // with function calls. Returns the new node if transformed, nil otherwise. |
no test coverage detected