Skip to content

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

@cherishman2005

Description

@cherishman2005

Version:

  • Bifrost Version: [v1.8.8-release and master branch]

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

  • [case 1]
insert ignore into table_xxx values(...)

parse result: table is into . -- it is error, and not expected!

  • [case 2]
insert table_xxx values(...)

parse result: table is values. -- it is error, and not expected!

Screenshots

image

image

Additional context

binlog_format=STATEMENT

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions