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

mysql8.0X not support "SHOW BINARY LOG STATUS" #2123

Open
I-Like-Pepsi opened this issue Oct 28, 2024 · 1 comment
Open

mysql8.0X not support "SHOW BINARY LOG STATUS" #2123

I-Like-Pepsi opened this issue Oct 28, 2024 · 1 comment

Comments

@I-Like-Pepsi
Copy link

image
错误信息如下:
java.sql.SQLSyntaxErrorException: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'LOG STATUS' at line
1

I encountered a minor issue while using Maxwell.
mysql-version:8.0.40
I found the following code after reviewing the source code

	public String getShowBinlogSQL() {
		try {
			DatabaseMetaData md = connection.getMetaData();
			if ( md.getDatabaseMajorVersion() >= 8 ) {
				return "SHOW BINARY LOG STATUS";
			}
		} catch ( SQLException e ) {
		}

		return "SHOW MASTER STATUS";
	}

I think the code should be changed to the following

	public String getShowBinlogSQL() {
		try {
			DatabaseMetaData md = connection.getMetaData();
			if ( md.getDatabaseMajorVersion() >= 8 && md.getDatabaseMinorVersion() >= 4) {
				return "SHOW BINARY LOG STATUS";
			}
		} catch ( SQLException e ) {
		}

		return "SHOW MASTER STATUS";
	}

https://dev.mysql.com/doc/refman/8.4/en/show-binary-log-status.html
https://dev.mysql.com/doc/refman/8.0/en/show-master-status.html

@Tang-RoseChild
Copy link

@osheroff
hi, please take a look at it, if should fix it, then release a new version ? current v1.41.2 doesn't support mysql 8.4.xx

Thanks a lot

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

2 participants