MXS-1319: Set SQL_MODE for all internal connections

When an internal connection is created, the SQL_MODE of the connection
should be set to a known default. The empty SQL_MODE allows consistent
functionality for all backend server versions.
This commit is contained in:
Markus Mäkelä
2017-07-18 11:21:33 +03:00
parent 9752068444
commit 07a5cba2de
3 changed files with 32 additions and 0 deletions

View File

@ -174,6 +174,11 @@ MYSQL *mxs_mysql_real_connect(MYSQL *con, SERVER *server, const char *user, cons
MY_CHARSET_INFO cs_info;
mysql_get_character_set_info(mysql, &cs_info);
server->charset = cs_info.number;
if (mysql_query(mysql, "SET SQL_MODE=''"))
{
MXS_ERROR("Failed to change SQL_MODE: %s", mysql_error(mysql));
}
}
return mysql;