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

return EOF response on COM_SET_OPTION commands #590

Merged
merged 1 commit into from
Jun 18, 2021

Conversation

skoef
Copy link
Contributor

@skoef skoef commented Jun 17, 2021

I'm implementing a server that needs to respect the CLIENT_MULTI_STATEMENTS capability and the MYSQL_OPTION_MULTI_STATEMENTS_ON and _OFF options that can be set through COM_SET_OPTION. According to the docs it is supposed to return EOF on success so I added a backwards compatible way of handling these commands properly.

@skoef skoef force-pushed the comSetOptionEOF branch from da40892 to b560922 Compare June 18, 2021 07:09
@@ -125,6 +125,12 @@ func (c *Conn) dispatch(data []byte) interface{} {
} else {
return r
}
case COM_SET_OPTION:
if err := c.h.HandleOtherCommand(cmd, data); err != nil {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Currently this is always EmptyHandler, so always returns an error 🤔 . Is this your expectation?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well in my server implementation I implemented a Handler that does handle these commands. And EmptyHandler would've returned an error for this anyway.

Or perhaps I don't understand what you mean?

@lance6716 lance6716 merged commit a18ba90 into go-mysql-org:master Jun 18, 2021
@skoef skoef deleted the comSetOptionEOF branch June 18, 2021 07:27
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

Successfully merging this pull request may close these issues.

2 participants