summaryrefslogtreecommitdiff
path: root/tests/mysql_client_test.c
diff options
context:
space:
mode:
authorMonty <monty@mariadb.org>2019-05-16 18:30:31 +0300
committerMonty <monty@mariadb.org>2019-05-16 18:33:17 +0300
commitef04a7123a7beed5bf20736a191785be8210e242 (patch)
tree1771a5494284472d983921e38e8a08fcc738296d /tests/mysql_client_test.c
parent5f66c58f6d7131c64667a06d67b6b6df02e2c47c (diff)
downloadmariadb-git-ef04a7123a7beed5bf20736a191785be8210e242.tar.gz
MDEV-19490 show tables fails when selecting the information_schema database
The bug was that when using mysql_list_fields, then table_list->schema_table_name was not filled in. Fixed by using table_list->schema_table instead, which is always filled in.
Diffstat (limited to 'tests/mysql_client_test.c')
-rw-r--r--tests/mysql_client_test.c21
1 files changed, 21 insertions, 0 deletions
diff --git a/tests/mysql_client_test.c b/tests/mysql_client_test.c
index b668c1ab6a2..04717f1946b 100644
--- a/tests/mysql_client_test.c
+++ b/tests/mysql_client_test.c
@@ -8390,6 +8390,26 @@ static void test_list_fields()
}
+/* Test mysql_list_fields() with information_schema */
+
+static void test_list_information_schema_fields()
+{
+ MYSQL_RES *result;
+ int rc;
+ myheader("test_list_information_schema_fields");
+
+ rc= mysql_select_db(mysql, "information_schema");
+ myquery(rc);
+ result= mysql_list_fields(mysql, "all_plugins", NULL);
+ mytest(result);
+ rc= my_process_result_set(result);
+ DIE_UNLESS(rc == 0);
+ mysql_free_result(result);
+ rc= mysql_select_db(mysql, current_db);
+ myquery(rc);
+}
+
+
static void test_bug19671()
{
MYSQL_RES *result;
@@ -19903,6 +19923,7 @@ static struct my_tests_st my_tests[]= {
{ "test_fetch_column", test_fetch_column },
{ "test_mem_overun", test_mem_overun },
{ "test_list_fields", test_list_fields },
+ { "test_list_fields", test_list_information_schema_fields },
{ "test_free_result", test_free_result },
{ "test_free_store_result", test_free_store_result },
{ "test_sqlmode", test_sqlmode },