Fix for bug #1160 : reset sql_mode

pull/1169/head
René Cannaò 9 years ago
parent b211e9903f
commit 1bb87b584d

@ -918,7 +918,7 @@ bool MySQL_Session::handler_again___verify_backend_sql_log_bin() {
bool MySQL_Session::handler_again___verify_backend_sql_mode() {
if (mybe->server_myds->myconn->options.sql_mode_int==0) {
// it is the first time we use this backend. Set sql_mode to default
if (mybe->server_myds->myconn->options.sql_mode==NULL) {
if (mybe->server_myds->myconn->options.sql_mode) {
free(mybe->server_myds->myconn->options.sql_mode);
mybe->server_myds->myconn->options.sql_mode=NULL;
}

@ -1659,6 +1659,13 @@ void MySQL_Connection::reset() {
status_flags=0;
reusable=true;
options.last_set_autocommit=-1; // never sent
{ // bug #1160
options.sql_mode_int = 0;
if (options.sql_mode) {
free(options.sql_mode);
options.sql_mode = NULL;
}
}
delete local_stmts;
#ifndef PROXYSQL_STMT_V14
local_stmts=new MySQL_STMTs_local(false);

Loading…
Cancel
Save