Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
MXS-3064: Use latin1 charset
This prevents the server from selecting the charset under which the
queries are processed which can result in conflicts if the tables used are
not compatible with the charset of the string literals used in the query.
  • Loading branch information
markus456 committed Jul 7, 2020
1 parent 4fe71b4 commit 6c92491
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions server/core/mysql_utils.cc
Expand Up @@ -102,6 +102,12 @@ MYSQL* mxs_mysql_real_connect(MYSQL* con, SERVER* server, const char* user, cons
}
}

if (mysql && mysql_query(mysql, "SET NAMES latin1") != 0)
{
MXS_ERROR("Failed to set latin1 character set: %s", mysql_error(mysql));
mysql = NULL;
}

if (mysql)
{
/** Copy the server charset */
Expand Down

0 comments on commit 6c92491

Please sign in to comment.