diff --git a/lib/MySQL_HostGroups_Manager.cpp b/lib/MySQL_HostGroups_Manager.cpp index 0aee6acba..e3540cb19 100644 --- a/lib/MySQL_HostGroups_Manager.cpp +++ b/lib/MySQL_HostGroups_Manager.cpp @@ -686,6 +686,11 @@ static void * HGCU_thread_run() { } } //async_exit_status = mysql_change_user_start(&ret_bool,mysql,_ui->username, auth_password, _ui->schemaname); + // we first reset the charset to a default one. + // this to solve the problem described here: + // https://github.com/sysown/proxysql/pull/3249#issuecomment-761887970 + if (myconn->mysql->charset->nr >= 255) + mysql_options(myconn->mysql, MYSQL_SET_CHARSET_NAME, myconn->mysql->charset->csname); statuses[i]=mysql_change_user_start(&ret[i], myconn->mysql, myconn->userinfo->username, auth_password, myconn->userinfo->schemaname); if (myconn->mysql->net.pvio==NULL || myconn->mysql->net.fd==0 || myconn->mysql->net.buff==NULL) { statuses[i]=0; ret[i]=1; diff --git a/lib/mysql_connection.cpp b/lib/mysql_connection.cpp index 0a6b44f87..5ab2ca4f4 100644 --- a/lib/mysql_connection.cpp +++ b/lib/mysql_connection.cpp @@ -646,6 +646,11 @@ void MySQL_Connection::change_user_start() { auth_password=userinfo->password; } } + // we first reset the charset to a default one. + // this to solve the problem described here: + // https://github.com/sysown/proxysql/pull/3249#issuecomment-761887970 + if (mysql->charset->nr >= 255) + mysql_options(mysql, MYSQL_SET_CHARSET_NAME, mysql->charset->csname); async_exit_status = mysql_change_user_start(&ret_bool,mysql,_ui->username, auth_password, _ui->schemaname); }