collectCTENames returns the set of CTE (WITH clause) names that precede the statement, lower-cased for case-insensitive matching. omni does not attach UPDATE/DELETE CTEs to the statement node, so we parse the text before the statement Loc as a WITH clause.
(fullSQL string, stmtLoc ast.Loc)
| 408 | // UPDATE/DELETE CTEs to the statement node, so we parse the text before the |
| 409 | // statement Loc as a WITH clause. |
| 410 | func collectCTENames(fullSQL string, stmtLoc ast.Loc) map[string]bool { |
| 411 | result := make(map[string]bool) |
| 412 | for _, cte := range parseCTEPrefix(fullSQL, stmtLoc) { |
| 413 | result[strings.ToLower(cte.Name)] = true |
| 414 | } |
| 415 | return result |
| 416 | } |
| 417 | |
| 418 | // isCTERef reports whether ref resolves to a CTE. A CTE reference is always |
| 419 | // unqualified, so a schema-qualified physical table (db.test) is never a CTE |
no test coverage detected