collectCTENames extracts CTE names from the SQL text before the statement Loc. MySQL's UPDATE/DELETE CTEs are not in the omni AST, so we parse the prefix.
(fullSQL string, stmtLoc ast.Loc)
| 278 | // collectCTENames extracts CTE names from the SQL text before the statement Loc. |
| 279 | // MySQL's UPDATE/DELETE CTEs are not in the omni AST, so we parse the prefix. |
| 280 | func collectCTENames(fullSQL string, stmtLoc ast.Loc) map[string]bool { |
| 281 | result := make(map[string]bool) |
| 282 | for _, cte := range parseCTEPrefix(fullSQL, stmtLoc) { |
| 283 | result[cte.Name] = true |
| 284 | } |
| 285 | return result |
| 286 | } |
| 287 | |
| 288 | // extractCTE extracts the CTE (WITH clause) text from the SQL before the statement. |
| 289 | func extractCTE(fullSQL string, stmtLoc ast.Loc) string { |
no test coverage detected