Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
cherishman2005 opened this issue Apr 10, 2024 · 0 comments

Comments

@cherishman2005
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant