execOK runs DDL against the catalog and reports whether it actually installed a schema object: every statement parsed without error AND at least one was a non-DML (utility) statement that mutated the catalog. A definition that reduces to only skipped DML — e.g. a bare SELECT view body, which TiDB sy
(cat *catalog.Catalog, ddl string)
| 305 | // stores in information_schema.VIEWS.VIEW_DEFINITION — is NOT a success, so the |
| 306 | // caller falls through to the wrapped CREATE VIEW form. |
| 307 | func execOK(cat *catalog.Catalog, ddl string) bool { |
| 308 | results, err := cat.Exec(ddl, &catalog.ExecOptions{ContinueOnError: true}) |
| 309 | if err != nil { |
| 310 | return false |
| 311 | } |
| 312 | applied := false |
| 313 | for _, r := range results { |
| 314 | if r.Error != nil { |
| 315 | return false |
| 316 | } |
| 317 | if !r.Skipped { |
| 318 | applied = true |
| 319 | } |
| 320 | } |
| 321 | return applied |
| 322 | } |
| 323 | |
| 324 | // backtickIdentifier quotes an identifier for TiDB DDL, escaping embedded |
| 325 | // backticks by doubling them. |
no outgoing calls
no test coverage detected