MXS-1853: Treat MySQL 8.0 as 5.7 in authenticators

Using the MySQL 5.7 syntax is required to get the authenticators to work
with 8.0.
This commit is contained in:
Markus Mäkelä 2018-05-21 08:49:25 +03:00
parent bdde3c44d9
commit 7af9a500ac
No known key found for this signature in database
GPG Key ID: 72D48FCE664F7B19

View File

@ -58,7 +58,8 @@ static bool get_hostname(DCB *dcb, char *client_hostname, size_t size);
static char* get_new_users_query(const char *server_version, bool include_root)
{
const char* password = strstr(server_version, "5.7.") ? MYSQL57_PASSWORD : MYSQL_PASSWORD;
const char* password = strstr(server_version, "5.7.") || strstr(server_version, "8.0.")
? MYSQL57_PASSWORD : MYSQL_PASSWORD;
const char *with_root = include_root ? "" : " AND u.user NOT IN ('root')";
size_t n_bytes = snprintf(NULL, 0, NEW_LOAD_DBUSERS_QUERY, password, with_root, password, with_root);