Skip to content

Conversation

@dveeden
Copy link
Collaborator

@dveeden dveeden commented Dec 6, 2025

Related to: #1067 (comment)

	h.conn, err = client.Connect("127.0.0.1:3306", "root", "", "", func(conn *client.Conn) error {
		conn.SetCapability(mysql.CLIENT_SESSION_TRACK)
		return nil
	})

As we don't support mysql.CLIENT_SESSION_TRACK the SetCapability() call above didn't result in the flag being set in the network packet. This should make that a bit more obvious.

Other things that we could do:

  • Have SetCapability() return an error
  • Have SetCapability() emit a log message
  • Have writeAuthHandshake() return an error instead of emitting a log message.

@lance6716
Copy link
Collaborator

I prefer we choose "Have SetCapability() return something", because it's earlier than the logging in this PR and can save some time for developers to locate the root cause. Maybe return an error (so some linters can tell user to check this error) or bool (like ok value from map access or type cast)? Will take a look later.

@dveeden
Copy link
Collaborator Author

dveeden commented Dec 8, 2025

I plan to create a new PR that returns an error when calling SetCapability() with something we don't (yet) support.

@dveeden dveeden marked this pull request as draft December 8, 2025 11:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants