summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorVladislav Vaintroub <vvaintroub@mysql.com>2009-11-25 15:20:14 +0100
committerVladislav Vaintroub <vvaintroub@mysql.com>2009-11-25 15:20:14 +0100
commit68cfabcc10b194e651aa681d804fc15754744204 (patch)
treee06536a82dab9f0549416006195fc1371ff528db /tests
parent39a158221ddac1c83766fe0b4635d854a664f262 (diff)
parentbe0add42f53b23d8a5e279cb3041a3fc93e375a0 (diff)
downloadmariadb-git-68cfabcc10b194e651aa681d804fc15754744204.tar.gz
merge
Diffstat (limited to 'tests')
-rw-r--r--tests/mysql_client_test.c45
-rw-r--r--tests/thread_test.c2
2 files changed, 45 insertions, 2 deletions
diff --git a/tests/mysql_client_test.c b/tests/mysql_client_test.c
index cfe401c75f3..86906660d4c 100644
--- a/tests/mysql_client_test.c
+++ b/tests/mysql_client_test.c
@@ -18392,9 +18392,51 @@ static void test_wl4166_4()
}
/**
- Bug#38486 Crash when using cursor protocol
+ Bug#36004 mysql_stmt_prepare resets the list of warnings
*/
+static void test_bug36004()
+{
+ int rc, warning_count= 0;
+ MYSQL_STMT *stmt;
+
+ DBUG_ENTER("test_bug36004");
+ myheader("test_bug36004");
+
+ rc= mysql_query(mysql, "drop table if exists inexistant");
+ myquery(rc);
+
+ DIE_UNLESS(mysql_warning_count(mysql) == 1);
+ query_int_variable(mysql, "@@warning_count", &warning_count);
+ DIE_UNLESS(warning_count);
+
+ stmt= mysql_simple_prepare(mysql, "select 1");
+ check_stmt(stmt);
+
+ DIE_UNLESS(mysql_warning_count(mysql) == 0);
+ query_int_variable(mysql, "@@warning_count", &warning_count);
+ DIE_UNLESS(warning_count);
+
+ rc= mysql_stmt_execute(stmt);
+ check_execute(stmt, rc);
+
+ DIE_UNLESS(mysql_warning_count(mysql) == 0);
+ mysql_stmt_close(stmt);
+
+ query_int_variable(mysql, "@@warning_count", &warning_count);
+ DIE_UNLESS(warning_count);
+
+ stmt= mysql_simple_prepare(mysql, "drop table if exists inexistant");
+ check_stmt(stmt);
+
+ query_int_variable(mysql, "@@warning_count", &warning_count);
+ DIE_UNLESS(warning_count == 0);
+ mysql_stmt_close(stmt);
+
+ DBUG_VOID_RETURN;
+}
+
+
static void test_bug38486(void)
{
MYSQL_STMT *stmt;
@@ -19154,6 +19196,7 @@ static struct my_tests_st my_tests[]= {
{ "test_wl4166_2", test_wl4166_2 },
{ "test_wl4166_3", test_wl4166_3 },
{ "test_wl4166_4", test_wl4166_4 },
+ { "test_bug36004", test_bug36004 },
{ "test_wl4435", test_wl4435 },
{ "test_wl4435_2", test_wl4435_2 },
{ "test_bug38486", test_bug38486 },
diff --git a/tests/thread_test.c b/tests/thread_test.c
index 8e1c58ebbec..760b72fc5d1 100644
--- a/tests/thread_test.c
+++ b/tests/thread_test.c
@@ -77,7 +77,7 @@ end:
mysql_close(mysql);
pthread_mutex_lock(&LOCK_thread_count);
thread_count--;
- VOID(pthread_cond_signal(&COND_thread_count)); /* Tell main we are ready */
+ pthread_cond_signal(&COND_thread_count); /* Tell main we are ready */
pthread_mutex_unlock(&LOCK_thread_count);
pthread_exit(0);
return 0;