brokercap / Bifrost

Bifrost ---- 面向生产环境的 MySQL,MariaDB,kafka 同步到Redis,MongoDB,ClickHouse,StarRocks,Doris,Kafka等服务的异构中间件
https://www.xbifrost.com
Apache License 2.0
1.95k stars 330 forks source link

[mysql binlog-subscribe]mysql not support 'insert ignore into table_xxx' and 'insert table_xxx' #278

Open cherishman2005 opened 6 months ago

cherishman2005 commented 6 months ago

Version:

Describe the bug

bug file is https://github.com/brokercap/Bifrost/blob/master/Bristol/mysql/binlog_query.go

    // UPDATE Table
    // INSERT INTO Table
    // DELETE FROM Table
    // REPLACE INTO Table
    var tableNameIndex = 0
    if len(sqlUpper) < 6 {
        return
    }
    switch sqlUpper[0:6] {
    case "UPDATE":
        tableNameIndex = 1
        isDDL = false
        break
    case "INSERT","DELETE","REPLAC":
        tableNameIndex = 2
        isDDL = false
        break
    default:
        return
    }

To Reproduce

Screenshots

image

image

Additional context

binlog_format=STATEMENT