diff options
author | georg@lmy002.wdf.sap.corp <> | 2005-07-19 17:31:18 +0200 |
---|---|---|
committer | georg@lmy002.wdf.sap.corp <> | 2005-07-19 17:31:18 +0200 |
commit | 3e1ae2633af9e2c89ddeed3224900030bf36e0f8 (patch) | |
tree | a79e68d1b20aa4b976ece98b51991eebacbd25ea /tests | |
parent | 21a88afeeda475a243b55878c956c7c0886837c5 (diff) | |
download | mariadb-git-3e1ae2633af9e2c89ddeed3224900030bf36e0f8.tar.gz |
fix for bug#12001
Diffstat (limited to 'tests')
-rw-r--r-- | tests/mysql_client_test.c | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/tests/mysql_client_test.c b/tests/mysql_client_test.c index d3adbd8d601..1af9e82fde3 100644 --- a/tests/mysql_client_test.c +++ b/tests/mysql_client_test.c @@ -11751,6 +11751,49 @@ static void test_bug11183() myquery(rc); } +static void test_bug12001() +{ + MYSQL *mysql_local; + MYSQL_RES *result; + const char *query = "DROP TABLE IF EXISTS test_table;" + "CREATE TABLE test_table(id INT);" + "INSERT INTO test_table VALUES(10);" + "UPDATE test_table SET id=20 WHERE id=10;" + "SELECT * FROM test_table;" + "INSERT INTO non_existent_table VALUES(11);"; + int rc, res; + + myheader("test_bug12001"); + + if (!(mysql_local= mysql_init(NULL))) + { + fprintf(stdout, "\n mysql_init() failed"); + exit(1); + } + + /* Create connection that supports multi statements */ + if (!mysql_real_connect(mysql_local, opt_host, opt_user, + opt_password, current_db, opt_port, + opt_unix_socket, CLIENT_MULTI_STATEMENTS | CLIENT_MULTI_RESULTS)) { + fprintf(stdout, "\n mysql_real_connect() failed"); + exit(1); + } + + rc = mysql_query(mysql_local, query); + myquery(rc); + + do { + if (mysql_field_count(mysql_local) && (result = mysql_use_result(mysql_local))) { + mysql_free_result(result); + } + } while (!(res = mysql_next_result(mysql_local))); + + rc = mysql_query(mysql_local, "DROP TABLE IF EXISTS test_table"); + myquery(rc); + + mysql_close(mysql_local); + DIE_UNLESS(res==1); +} /* Read and parse arguments and MySQL options from my.cnf @@ -11968,6 +12011,7 @@ static struct my_tests_st my_tests[]= { { "test_bug8378", test_bug8378 }, { "test_bug9735", test_bug9735 }, { "test_bug11183", test_bug11183 }, + { "test_bug12001", test_bug12001 }, { 0, 0 } }; |