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

fix(driver): Extract scheme from DSN using sqlcon.GetDriverName #156

Merged
merged 1 commit into from Feb 29, 2020
Merged

fix(driver): Extract scheme from DSN using sqlcon.GetDriverName #156

merged 1 commit into from Feb 29, 2020

Conversation

kaorimatz
Copy link
Contributor

Related issue

#145

Proposed changes

Extract a scheme from a DSN string using sqlcon.GetDriverName instead of url.Parse since a DSN string for MySQL is no longer always parsable with url.Parse after this change (Ref: golang/go#33646).

$ cat <<EOF > main.go
package main

import (
        "fmt"
        "net/url"
)

func main() {
        fmt.Println(url.Parse("mysql://tcp(127.0.0.1:3306)/"))
}
EOF
$ go version
go version go1.14 darwin/amd64
$ go run main.go
<nil> parse "mysql://tcp(127.0.0.1:3306)/": invalid port ":3306)" after host

Checklist

  • I have read the contributing guidelines
  • I have read the security policy
  • I confirm that this pull request does not address a security vulnerability. If this pull request addresses a security
    vulnerability, I confirm that I got green light (please contact security@ory.sh) from the maintainers to push the changes.
  • I have added tests that prove my fix is effective or that my feature works
  • I have added necessary documentation within the code base (if appropriate)
  • I have documented my changes in the developer guide (if appropriate)

Further comments

@kaorimatz kaorimatz changed the title Extract scheme from DSN using sqlcon.GetDriverName fix(driver): Extract scheme from DSN using sqlcon.GetDriverName Feb 29, 2020
@aeneasr aeneasr merged commit 187e289 into ory:master Feb 29, 2020
@aeneasr
Copy link
Member

aeneasr commented Feb 29, 2020

thank you!

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.

None yet

2 participants