lib / pq

Pure Go Postgres driver for database/sql
https://pkg.go.dev/github.com/lib/pq
MIT License
8.98k stars 909 forks source link

fix concurrent map write when using unix sockets #967

Closed mightyguava closed 4 years ago

mightyguava commented 4 years ago

opts being mutated in dial may cause a concurrent write panic when many connections are created in parallel. Moving this to NewConnector where mutations are safe.

fixes #948

mightyguava commented 4 years ago

I can't tell if this build failure is due to my change? I also don't know how to run this test locally, it requires this PQSSLCERTTEST_PATH expecting a special cert.


=== RUN   TestSSLVerifyFull
    TestSSLVerifyFull: ssl_test.go:84: expected x509.UnknownAuthorityError, got x509.HostnameError{Certificate:(*x509.Certificate)(0xc0001f8b00), Host:"postgres"}```
maddyblue commented 4 years ago

Yeah I think those are due to recent changes in the x509 stuff.