Skip to content

Commit

Permalink
Fix for bug #1160 : reset time_zone
Browse files Browse the repository at this point in the history
  • Loading branch information
renecannao committed Sep 1, 2017
1 parent 1bb87b5 commit 0598c0d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
2 changes: 1 addition & 1 deletion lib/MySQL_Session.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -961,7 +961,7 @@ bool MySQL_Session::handler_again___verify_backend_sql_mode() {
bool MySQL_Session::handler_again___verify_backend_time_zone() {
if (mybe->server_myds->myconn->options.time_zone_int==0) {
// it is the first time we use this backend. Set time_zone to default
if (mybe->server_myds->myconn->options.time_zone==NULL) {
if (mybe->server_myds->myconn->options.time_zone) {
free(mybe->server_myds->myconn->options.time_zone);
mybe->server_myds->myconn->options.time_zone=NULL;
}
Expand Down
5 changes: 5 additions & 0 deletions lib/mysql_connection.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1665,6 +1665,11 @@ void MySQL_Connection::reset() {
free(options.sql_mode);
options.sql_mode = NULL;
}
options.time_zone_int = 0;
if (options.time_zone) {
free(options.time_zone);
options.time_zone = NULL;
}
}
delete local_stmts;
#ifndef PROXYSQL_STMT_V14
Expand Down

0 comments on commit 0598c0d

Please sign in to comment.