-
Notifications
You must be signed in to change notification settings - Fork 976
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
Support DSN without 'user:password@' #888
Merged
Merged
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
d9f59f9
correctly parseDSN when username is not present
dvilaverde 0700035
one more test caset
dvilaverde 572dfc7
fixing golangci-lint errors
dvilaverde e876e5b
added collation to README.md
dvilaverde 286d15e
fixing incorrect comment
dvilaverde File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -285,10 +285,8 @@ func (c *Conn) writeAuthHandshake() error { | |
return fmt.Errorf("invalid collation name %s", collationName) | ||
} | ||
|
||
// the MySQL protocol calls for the collation id to be sent as 1, where only the | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. updating this comment which was incorrect regarding the first byte of the 23 bytes of filter being used to store the right 8 bits of the collation id. |
||
// lower 8 bits are used in this field. But wireshark shows that the first byte of | ||
// the 23 bytes of filler is used to send the right middle 8 bits of the collation id. | ||
// see https://github.com/mysql/mysql-server/pull/541 | ||
// the MySQL protocol calls for the collation id to be sent as 1 byte, where only the | ||
// lower 8 bits are used in this field. | ||
data[12] = byte(collation.ID & 0xff) | ||
|
||
// SSL Connection Request Packet | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -92,6 +92,12 @@ func TestParseDSN(t *testing.T) { | |
"user:[email protected]/db?readTimeout=1m": {standardDSN: true, addr: "5.domain.com", user: "user", password: "password", db: "db", params: url.Values{"readTimeout": []string{"1m"}}}, | ||
"user:[email protected]/db?writeTimeout=1m": {standardDSN: true, addr: "5.domain.com", user: "user", password: "password", db: "db", params: url.Values{"writeTimeout": []string{"1m"}}}, | ||
"user:[email protected]/db?compress=zlib": {standardDSN: true, addr: "5.domain.com", user: "user", password: "password", db: "db", params: url.Values{"compress": []string{"zlib"}}}, | ||
|
||
// per the documentation in the README, the 'user:password@' is optional as are the '/db?param=X' portions of the DSN | ||
"6.domain.com": {standardDSN: false, addr: "6.domain.com", user: "", password: "", db: "", params: url.Values{}}, | ||
"7.domain.com?db": {standardDSN: false, addr: "7.domain.com", user: "", password: "", db: "db", params: url.Values{}}, | ||
"8.domain.com/db": {standardDSN: true, addr: "8.domain.com", user: "", password: "", db: "db", params: url.Values{}}, | ||
"9.domain.com/db?compress=zlib": {standardDSN: true, addr: "9.domain.com", user: "", password: "", db: "db", params: url.Values{"compress": []string{"zlib"}}}, | ||
} | ||
|
||
for supplied, expected := range testDSNs { | ||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i forgot to add this connection param in my previous commits