summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorVladislav Vaintroub <wlad@mariadb.com>2018-10-04 14:24:14 +0100
committerVladislav Vaintroub <wlad@mariadb.com>2018-10-05 16:48:51 +0100
commit7fefd53f94bdb5aeab352665ae0f208b858e88f8 (patch)
tree89f0bec6c00878e033dc77bc349e4226cafd4434 /tests
parent33fadbfefcc040f0b5ae589d385468e5ba26b1cd (diff)
downloadmariadb-git-7fefd53f94bdb5aeab352665ae0f208b858e88f8.tar.gz
MDEV-14581 Server does not clear diagnostics between sessions
Amend previous patch, so it works in all cases (also for "change user" command, and for RESET CONNECTION in 10.3)
Diffstat (limited to 'tests')
-rw-r--r--tests/mysql_client_test.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/tests/mysql_client_test.c b/tests/mysql_client_test.c
index 99cee8f7ed4..bb72e8b575d 100644
--- a/tests/mysql_client_test.c
+++ b/tests/mysql_client_test.c
@@ -16348,6 +16348,7 @@ static void test_change_user()
const char *db= "mysqltest_user_test_database";
int rc;
MYSQL* conn;
+ MYSQL_RES* res;
DBUG_ENTER("test_change_user");
myheader("test_change_user");
@@ -16484,6 +16485,20 @@ static void test_change_user()
rc= mysql_change_user(conn, user_pw, pw, "");
myquery(rc);
+ /* MDEV-14581 : Check that there are no warnings after change user.*/
+ rc = mysql_query(conn,"SIGNAL SQLSTATE '01000'");
+ myquery(rc);
+
+ rc = mysql_change_user(conn, user_pw, pw, "");
+ myquery(rc);
+
+ rc = mysql_query(conn, "SHOW WARNINGS");
+ myquery(rc);
+ res = mysql_store_result(conn);
+ rc = my_process_result_set(res);
+ DIE_UNLESS(rc == 0);
+ mysql_free_result(res);
+
rc= mysql_change_user(conn, user_no_pw, pw, db);
DIE_UNLESS(rc);
if (! opt_silent)