MCPcopy Create free account
hub / github.com/actiontech/dtle / skipQueryDDL

Method skipQueryDDL

driver/mysql/binlog/binlog_reader.go:1186–1212  ·  view source on GitHub ↗

schema and tableName should be processed according to lower_case_table_names in advance

(schema string, tableName string)

Source from the content-addressed store, hash-verified

1184
1185// schema and tableName should be processed according to lower_case_table_names in advance
1186func (b *BinlogReader) skipQueryDDL(schema string, tableName string) bool {
1187 switch schema {
1188 case "mysql":
1189 if b.mysqlContext.ExpandSyntaxSupport {
1190 return false
1191 } else {
1192 return true
1193 }
1194 case "sys", "information_schema", "performance_schema", g.DtleSchemaName:
1195 return true
1196 default:
1197 if len(b.mysqlContext.ReplicateIgnoreDb) > 0 {
1198 if common.IgnoreDbByReplicateIgnoreDb(b.mysqlContext.ReplicateIgnoreDb, schema) {
1199 return true
1200 }
1201 if common.IgnoreTbByReplicateIgnoreDb(b.mysqlContext.ReplicateIgnoreDb, schema, tableName) {
1202 return true
1203 }
1204 }
1205 if len(b.mysqlContext.ReplicateDoDb) > 0 {
1206 return !b.matchTable(b.mysqlContext.ReplicateDoDb, schema, tableName)
1207 } else {
1208 // replicate all dbs and tbs
1209 return false
1210 }
1211 }
1212}
1213
1214var (
1215 // > A Regexp is safe for concurrent use by multiple goroutines...

Callers 2

Test_skipQueryDDLFunction · 0.95
handleQueryEventMethod · 0.95

Calls 3

matchTableMethod · 0.95

Tested by 1

Test_skipQueryDDLFunction · 0.76