Use mysql.ParseDSN func instead of url.Parse
The MySQL DB driver has it's own DSN parsing function. Previously we were using the url.Parse function, but this causes problems because a valid MySQL DSN can be an invalid http URL, namely when using some special characters in the password. This change uses the MySQL DB driver's builtin ParseDSN function and applies a timeout parameter natively via that. Another benefit of this change is that we fail earlier if given an invalid MySQL DSN. closes #870 closes #1842
Showing
- CHANGELOG.md 1 addition, 0 deletionsCHANGELOG.md
- plugins/inputs/mysql/mysql.go 37 additions, 81 deletionsplugins/inputs/mysql/mysql.go
- plugins/inputs/mysql/mysql_test.go 17 additions, 5 deletionsplugins/inputs/mysql/mysql_test.go
- plugins/inputs/mysql/parse_dsn.go 0 additions, 85 deletionsplugins/inputs/mysql/parse_dsn.go
Loading
Please register or sign in to comment