If I exec a db.exec("set time_zone = "+00:00"")
, the status time_zone of connection to exec the SQL will change and will the connection be put back to the pool?
If so, will it be reused by another processor who doesn't know the status of connection has been changed?
The correct way is to set a timezone in the connection string:
sql.Open("mysql", "root@tcp(127.0.0.1:3306)/dbname?charset=utf8&parseTime=true&time_zone=%2B00%3A00")
Note that time_zone value must be urlencoded. Also you can set other system variables in conn string.