isCTERef reports whether ref resolves to a CTE. A CTE reference is always unqualified, so a schema-qualified physical table (db.test) is never a CTE even if its name matches one. CTE names match case-insensitively (TiDB resolves a case-mismatched reference to the CTE, which shadows a same-named real
(cteNames map[string]bool, ref *TableReference)
| 421 | // resolves a case-mismatched reference to the CTE, which shadows a same-named |
| 422 | // real table), consistent with the file's other identifier comparisons. |
| 423 | func isCTERef(cteNames map[string]bool, ref *TableReference) bool { |
| 424 | return !ref.ExplicitSchema && cteNames[strings.ToLower(ref.Table)] |
| 425 | } |
| 426 | |
| 427 | // writeCTEPrefix writes the statement's WITH (CTE) clause before the backup |
| 428 | // SELECT, so a SELECT whose FROM references a CTE stays valid. omni does not |
no outgoing calls
no test coverage detected