Skip to content

Commit

Permalink
godrv by default sets MySQL NAMES variable to utf8
Browse files Browse the repository at this point in the history
  • Loading branch information
michalderkacz committed Jun 6, 2012
1 parent a31b785 commit 49cd60b
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 1 addition & 1 deletion README.md
Expand Up @@ -438,7 +438,7 @@ This is improved part of previous example:


// Register initialisation commands // Register initialisation commands
// (workaround, see http://codereview.appspot.com/5706047) // (workaround, see http://codereview.appspot.com/5706047)
godrv.Register("SET NAMES utf8") godrv.Register("SET NAMES latin2") // Overrides default utf8
godrv.Register("CREATE TABLE IF NOT EXISTS my_table ( ... )") godrv.Register("CREATE TABLE IF NOT EXISTS my_table ( ... )")


// Create a connection handler // Create a connection handler
Expand Down
1 change: 1 addition & 0 deletions godrv/driver.go
Expand Up @@ -234,5 +234,6 @@ func Register(query string) {
} }


func init() { func init() {
Register("SET NAMES utf8")
sql.Register("mymysql", &d) sql.Register("mymysql", &d)
} }

0 comments on commit 49cd60b

Please sign in to comment.