diff options
Diffstat (limited to 'tests')
-rw-r--r-- | tests/mysql_client_test.c | 40 |
1 files changed, 39 insertions, 1 deletions
diff --git a/tests/mysql_client_test.c b/tests/mysql_client_test.c index 2d238d84d54..6d17fa74005 100644 --- a/tests/mysql_client_test.c +++ b/tests/mysql_client_test.c @@ -8467,6 +8467,43 @@ static void test_list_fields_default() } +/** + Note, this test covers MDEV-18408 and MDEV-18685 +*/ + +static void test_mdev18408() +{ + MYSQL_RES *result; + int rc; + myheader("test_mdev18408s"); + + rc= mysql_query(mysql, "DROP TABLE IF EXISTS t1"); + myquery(rc); + + rc= mysql_query(mysql, "DROP VIEW IF EXISTS v1"); + myquery(rc); + + rc= mysql_query(mysql, "CREATE TABLE t1 (c1 TIMESTAMP NULL DEFAULT NULL)"); + myquery(rc); + + rc= mysql_query(mysql, "CREATE VIEW v1 AS SELECT c1 FROM t1"); + myquery(rc); + + result= mysql_list_fields(mysql, "v1", NULL); + mytest(result); + + rc= my_process_result_set(result); + DIE_UNLESS(rc == 0); + + verify_prepare_field(result, 0, "c1", "c1", MYSQL_TYPE_TIMESTAMP, + "v1", "v1", current_db, 19, 0); + + mysql_free_result(result); + myquery(mysql_query(mysql, "DROP VIEW v1")); + myquery(mysql_query(mysql, "DROP TABLE t1")); +} + + static void test_bug19671() { MYSQL_RES *result; @@ -8493,7 +8530,7 @@ static void test_bug19671() DIE_UNLESS(rc == 0); verify_prepare_field(result, 0, "f1", "f1", MYSQL_TYPE_LONG, - "v1", "v1", current_db, 11, "0"); + "v1", "v1", current_db, 11, NULL); mysql_free_result(result); myquery(mysql_query(mysql, "drop view v1")); @@ -20977,6 +21014,7 @@ static struct my_tests_st my_tests[]= { { "test_bulk_delete", test_bulk_delete }, #endif { "test_explain_meta", test_explain_meta }, + { "test_mdev18408", test_mdev18408 }, { 0, 0 } }; |