From 847324654198a4bd72d0a25dd6fb1dede4908e2f Mon Sep 17 00:00:00 2001 From: Georg Richter Date: Mon, 4 Mar 2019 17:06:00 +0100 Subject: [PATCH] Fix authentication tests: - specify correct plugin type for checks - allow access to test schema for ed25519 user --- unittest/libmariadb/connection.c | 8 ++++++-- unittest/libmariadb/my_test.h | 1 + 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/unittest/libmariadb/connection.c b/unittest/libmariadb/connection.c index fc26e026..d7716db3 100644 --- a/unittest/libmariadb/connection.c +++ b/unittest/libmariadb/connection.c @@ -1081,7 +1081,7 @@ static int test_auth256(MYSQL *my) my_ulonglong num_rows= 0; char query[1024]; - if (!mysql_client_find_plugin(mysql, "sha256_password", 3)) + if (!mysql_client_find_plugin(mysql, "sha256_password", MYSQL_CLIENT_AUTHENTICATION_PLUGIN)) { diag("sha256_password plugin not available"); mysql_close(mysql); @@ -1615,7 +1615,7 @@ static int test_conc366(MYSQL *mysql) } /* check if ed25519 plugin is available */ - if (!mysql_client_find_plugin(mysql, "client_ed25519", 3)) + if (!mysql_client_find_plugin(mysql, "client_ed25519", MYSQL_CLIENT_AUTHENTICATION_PLUGIN)) { diag("client_ed25519 plugin not available"); return SKIP; @@ -1633,6 +1633,10 @@ static int test_conc366(MYSQL *mysql) rc= mysql_query(mysql, query); check_mysql_rc(rc, mysql); + sprintf(query, "GRANT ALL ON %s.* TO 'ede'@'%s'", schema, this_host); + rc= mysql_query(mysql, query); + check_mysql_rc(rc, mysql); + my= mysql_init(NULL); if (plugindir) mysql_options(my, MYSQL_PLUGIN_DIR, plugindir); diff --git a/unittest/libmariadb/my_test.h b/unittest/libmariadb/my_test.h index c265fa06..a5cddeed 100644 --- a/unittest/libmariadb/my_test.h +++ b/unittest/libmariadb/my_test.h @@ -31,6 +31,7 @@ with this program; if not, write to the Free Software Foundation, Inc., #include #include #include +#include #ifndef WIN32 #include