go-sql-driver/mysql — pull request #130 by JulienSchmidt (2013-10-16 18:31:45+00:00)
Title: New DSN parser

A new parser, which doesn't use RegExp.

Go 1.2RC1
```
BenchmarkParseDSN_new 200000 10545 ns/op 4039 B/op 42 allocs/op
BenchmarkParseDSN_old 10000 233313 ns/op 7588 B/op 91 allocs/op
```
The current RC has too many string (slice) bound checks, I guess. Go 1.1 is a bit faster:

Go 1.1
```
BenchmarkParseDSN_new 200000 7940 ns/op 4204 B/op 42 allocs/op
BenchmarkParseDSN_old 10000 264115 ns/op 8083 B/op 91 allocs/op
```

Moreover, this PR requires DSN param values to be escaped with [url.QueryEscape](http://golang.org/pkg/net/url/#QueryEscape). Before, values couldn't contain special characters like `&` because the ampersand is the param delimiter.