Skip to content

Fix OldAuthSwitchRequest support #870

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

Merged
merged 2 commits into from
Oct 20, 2018
Merged

Conversation

methane
Copy link
Member

@methane methane commented Oct 15, 2018

Description

Fixes #844

This is an obvious bug fix, but testing it on Travis is bit hard...

Checklist

  • Code compiles correctly
  • Created tests which fail without the change (if possible)
  • All tests passing
  • Extended the README / documentation, if necessary
  • Added myself / the copyright holder to the AUTHORS file

@@ -479,7 +479,7 @@ func (mc *mysqlConn) readAuthResult() ([]byte, string, error) {
return data[1:], "", err

case iEOF:
if len(data) < 1 {
if len(data) == 1 {
Copy link
Member Author

Choose a reason for hiding this comment

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

We already uses data[0]. So len(data) must not be < 1.

@julienschmidt
Copy link
Member

Writing a test shouldn't be too hard. Just use mockConn. See auth_test.go for a lot of examples.

@julienschmidt julienschmidt added this to the v1.4.1 milestone Oct 15, 2018
@methane methane merged commit 7daee5b into go-sql-driver:master Oct 20, 2018
@methane methane deleted the oldauthswitch branch October 20, 2018 13:49
julienschmidt pushed a commit that referenced this pull request Nov 14, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Malformed packet error
2 participants