summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorDavi Arnaut <Davi.Arnaut@Sun.COM>2009-01-15 08:28:10 -0200
committerDavi Arnaut <Davi.Arnaut@Sun.COM>2009-01-15 08:28:10 -0200
commite48c7178f7fb1a64558027e1574e3008368030c6 (patch)
tree13477e1822c17bda5ef63ff3207a8246f83eafd2 /tests
parent91e5423c642c23ba393f005c844c6ee37093e1a8 (diff)
parent852d1d66f6c75535bbe2d74da83dc2d8d7a23f33 (diff)
downloadmariadb-git-e48c7178f7fb1a64558027e1574e3008368030c6.tar.gz
Merge from 5.0-bugteam
Diffstat (limited to 'tests')
-rw-r--r--tests/mysql_client_test.c60
1 files changed, 60 insertions, 0 deletions
diff --git a/tests/mysql_client_test.c b/tests/mysql_client_test.c
index 5f04dc48b4c..4f30d43f53f 100644
--- a/tests/mysql_client_test.c
+++ b/tests/mysql_client_test.c
@@ -17712,6 +17712,63 @@ static void test_bug40365(void)
DBUG_VOID_RETURN;
}
+
+
+/**
+ Bug#36326: nested transaction and select
+*/
+
+#ifdef HAVE_QUERY_CACHE
+
+static void test_bug36326()
+{
+ int rc;
+
+ DBUG_ENTER("test_bug36326");
+ myheader("test_bug36326");
+
+ rc= mysql_autocommit(mysql, TRUE);
+ myquery(rc);
+ rc= mysql_query(mysql, "DROP TABLE IF EXISTS t1");
+ myquery(rc);
+ rc= mysql_query(mysql, "CREATE TABLE t1 (a INTEGER)");
+ myquery(rc);
+ rc= mysql_query(mysql, "INSERT INTO t1 VALUES (1)");
+ myquery(rc);
+ rc= mysql_query(mysql, "SET GLOBAL query_cache_type = 1");
+ myquery(rc);
+ rc= mysql_query(mysql, "SET GLOBAL query_cache_size = 1048576");
+ myquery(rc);
+ DIE_UNLESS(!(mysql->server_status & SERVER_STATUS_IN_TRANS));
+ DIE_UNLESS(mysql->server_status & SERVER_STATUS_AUTOCOMMIT);
+ rc= mysql_query(mysql, "BEGIN");
+ myquery(rc);
+ DIE_UNLESS(mysql->server_status & SERVER_STATUS_IN_TRANS);
+ rc= mysql_query(mysql, "SELECT * FROM t1");
+ myquery(rc);
+ rc= my_process_result(mysql);
+ DIE_UNLESS(rc == 1);
+ rc= mysql_rollback(mysql);
+ myquery(rc);
+ rc= mysql_query(mysql, "ROLLBACK");
+ myquery(rc);
+ DIE_UNLESS(!(mysql->server_status & SERVER_STATUS_IN_TRANS));
+ rc= mysql_query(mysql, "SELECT * FROM t1");
+ myquery(rc);
+ DIE_UNLESS(!(mysql->server_status & SERVER_STATUS_IN_TRANS));
+ rc= my_process_result(mysql);
+ DIE_UNLESS(rc == 1);
+ rc= mysql_query(mysql, "DROP TABLE t1");
+ myquery(rc);
+ rc= mysql_query(mysql, "SET GLOBAL query_cache_size = 0");
+ myquery(rc);
+
+ DBUG_VOID_RETURN;
+}
+
+#endif
+
+
/*
Read and parse arguments and MySQL options from my.cnf
*/
@@ -18025,6 +18082,9 @@ static struct my_tests_st my_tests[]= {
#ifdef HAVE_SPATIAL
{ "test_bug37956", test_bug37956 },
#endif
+#ifdef HAVE_QUERY_CACHE
+ { "test_bug36326", test_bug36326 },
+#endif
{ 0, 0 }
};