summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorpappa@c-450ae253.1238-1-64736c10.cust.bredbandsbolaget.se <>2005-07-21 01:29:57 -0400
committerpappa@c-450ae253.1238-1-64736c10.cust.bredbandsbolaget.se <>2005-07-21 01:29:57 -0400
commit6026054ead01bb2f733529b1a3aa4382a2ced2c0 (patch)
treef28d036bdc60c31c38b1d066b2d9e02fa4e980e6 /tests
parent69a3209275369e799588a52b3fa748413932e3dc (diff)
parentac6623f08fe059e4ee49c4f3eaa73198b8ca9d82 (diff)
downloadmariadb-git-6026054ead01bb2f733529b1a3aa4382a2ced2c0.tar.gz
Merge mronstrom@bk-internal.mysql.com:/home/bk/mysql-4.1
into c-450ae253.1238-1-64736c10.cust.bredbandsbolaget.se:/home/pappa/mysql-5.0
Diffstat (limited to 'tests')
-rw-r--r--tests/mysql_client_test.c45
1 files changed, 45 insertions, 0 deletions
diff --git a/tests/mysql_client_test.c b/tests/mysql_client_test.c
index 78948548716..53708a7a741 100644
--- a/tests/mysql_client_test.c
+++ b/tests/mysql_client_test.c
@@ -13888,6 +13888,50 @@ static void test_bug10760()
mysql_autocommit(mysql, TRUE); /* restore default */
}
+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
*/
@@ -14133,6 +14177,7 @@ static struct my_tests_st my_tests[]= {
{ "test_bug11183", test_bug11183 },
{ "test_bug11037", test_bug11037 },
{ "test_bug10760", test_bug10760 },
+ { "test_bug12001", test_bug12001 },
{ 0, 0 }
};