go-sql-driver/mysql — pull request #231 by gkristic (2014-05-01 21:04:23+00:00)
Title: Export errors

Error declarations are currently private to the driver, which means application code cannot easily compare for specific conditions. Checks must be done based on comparisons like:

```go
db, err := sql.Open("mysql", dsn)

if err != nil {
if string.Contains(err.Error(), "insecure old password") {
// do something (like retrying with allowOldPassword=1)
}
}
```

That looks plain wrong; it shouldn't depend on the string `errOldPassword` resolves to. This change exports all error variables declared in errors.go, so that the code above can be more succinctly written as:

```go
db, err := sql.Open("mysql", dsn)

if err == mysql.ErrOldPassword {
// do something (like retrying with allowOldPassword=1)
}
```

This also fixes a small error in the README and adds a comment on accepted boolean literals.