MCPcopy Index your code
hub / github.com/bytebase/bytebase / execOK

Function execOK

backend/plugin/parser/tidb/completion.go:307–322  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

305// stores in information_schema.VIEWS.VIEW_DEFINITION — is NOT a success, so the
306// caller falls through to the wrapped CREATE VIEW form.
307func 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.

Callers 2

execTableDDLFunction · 0.85
defineViewFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected