(ddl string, schema string, table string)
| 494 | } |
| 495 | |
| 496 | func isCreateTableDDL(ddl string, schema string, table string) bool { |
| 497 | table = regexp.QuoteMeta(table) |
| 498 | var re string |
| 499 | if schema == "" { |
| 500 | re = fmt.Sprintf("(?i)^CREATE TABLE (%s|`%s`)\\s*\\(", table, table) |
| 501 | } else { |
| 502 | re = fmt.Sprintf("(?i)^CREATE TABLE (%s|`%s`)\\.(%s|`%s`)\\s*\\(", schema, schema, table, table) |
| 503 | } |
| 504 | return regexp.MustCompile(re).MatchString(ddl) |
| 505 | } |
| 506 | |
| 507 | type ShowTablesStatement struct { |
| 508 | Schema string |
no outgoing calls