When calling mysql_change_user set collation to default for the given charset if collation ID is greater or equal than 255 (utf8mb4_0900_ai_ci)

We call mysql_options with MYSQL_SET_CHARSET_NAME if collation ID >= 255 .
This to solve the problem of MySQL server returning an Access denied if the backend doesn't support a collation during mysql_change_user
pull/3286/head
René Cannaò 5 years ago
parent 702081d934
commit 598331cff9

@ -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;

@ -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);
}

Loading…
Cancel
Save