Comments (9)
I'm open, but please don't assume I will merge it.
Please be clear about edge cases and backward compatibility.
from mysql.
Do you feel that the current test cases are sufficient to cover edge cases and backwards compatibility?
from mysql.
I don't know.
from mysql.
@derekperkins Have you tried filling a Config
(use NewConfig
) with your settings and call its FormatDSN
method to see what it outputs? I expect that your case is already handled (I see a call to url.PathEscape
in the code).
Here is a template: https://go.dev/play/p/8E3WFHsTTJc
from mysql.
@dolmen I'm not using this driver directly, I'm configuring the backing grafana database. That being said, I've been using the single url option, so maybe setting the individual fields will have a better outcome
https://grafana.com/docs/grafana/latest/setup-grafana/configure-grafana/#url
from mysql.
@derekperkins mysql://username:password@host:1234/dbname/0?interpolateParams=true
is not a valid DSN for the MySQL driver. Our DSN doesn't have that mysql://
prefix. It looks like Grafana has another DSN layer over it. You should start investigating there first.
from mysql.
Our README says:
dbname is escaped by PathEscape() since v1.8.0. If your database name is dbname/withslash
... but v1.8.0 is not yet released.
This is commit d3e4fe6 from #1432.
So the issue is fixed, but not released yet.
from mysql.
Looks like Grafana does a url parse
https://github.com/grafana/grafana/blob/41e3b3bea2d91f9da38d65bfee89f321499ea3f9/pkg/services/sqlstore/sqlstore.go#L471-L491
Then fmt it into a go-sql-driver compatible DSN
https://github.com/grafana/grafana/blob/16d0aff26707b80fda408708d1c67bb2fe0586e9/pkg/services/sqlstore/sqlstore.go#L283-L317C33
I also checked with https://github.com/xo/usql, which uses https://github.com/xo/dburl to parse the agnostic string, and it returned the same error from go-sql-driver.
I can test it out directly to see if it works going straight through the driver
from mysql.
So the issue is fixed, but not released yet.
Oh, awesome - sorry for not seeing your comment before I posted. Thanks for tracking down that PR @dolmen and thanks @methane for the implementation!
from mysql.
Related Issues (20)
- 保存时报错:Prepared statement contains too many placeholders
- too may ram usage when lost connection HOT 13
- SEGV writing packet HOT 1
- Connection liveness/goodeness check and AWS Aurora HOT 1
- Data race between mysqlConn watcher and okHandler during context cancellation HOT 3
- v1.6.0 get error
- Data race between mysqlConn.cleanup() and writeHandshakeResponsePacket HOT 2
- MaxOpenConns is not working
- Receiving "(using password: NO)" when password was given HOT 2
- Why must use port 3306?
- Scanner should return one of int64,float64,bool,[]byte,string,time.Time,nil , but I got uint64 HOT 3
- Do I need logic backup mysql data using mysqldump while I have master-slave mysql cluster.
- Improve ErrBadConn
- closing bad idle connection: EOF HOT 3
- Can I use this library to parse these byte sequences into the MySQL protocol?
- Function to achieve batch insert with mysql go library since go sql is lacking the functionality HOT 1
- connect to doris panic("invalid connection') HOT 11
- Connection collations limit use of custom collation specification
- ssl-ca param contains slash, which will cause errInvalidDSNUnescaped HOT 5
- when the connect is more than 900,it will panic HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from mysql.