diff options
author | ingo@mysql.com <> | 2005-12-08 07:56:07 +0100 |
---|---|---|
committer | ingo@mysql.com <> | 2005-12-08 07:56:07 +0100 |
commit | 8482de4381cc4db9b9e13748a62b9d9ceceba184 (patch) | |
tree | cd2dfcfc03cb247866f22054b083cfad86f25c50 /tests | |
parent | 270cad2f63fbe48d91d7f81454f1e273e09f5178 (diff) | |
parent | 886ac06c9b34a982ede8c343a557a9b1ce01d077 (diff) | |
download | mariadb-git-8482de4381cc4db9b9e13748a62b9d9ceceba184.tar.gz |
Merge mysql.com:/home/mydev/mysql-5.0
into mysql.com:/home/mydev/mysql-5.0-bug10932
Diffstat (limited to 'tests')
-rw-r--r-- | tests/mysql_client_test.c | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/tests/mysql_client_test.c b/tests/mysql_client_test.c index 36ab8094e5b..216961b3a80 100644 --- a/tests/mysql_client_test.c +++ b/tests/mysql_client_test.c @@ -14590,6 +14590,40 @@ static void test_bug14845() myquery(rc); } + +/* + Bug #15510: mysql_warning_count returns 0 after mysql_stmt_fetch which + should warn +*/ +static void test_bug15510() +{ + MYSQL_STMT *stmt; + MYSQL_RES *res; + int rc; + const char *query= "select 1 from dual where 1/0"; + + myheader("test_bug15510"); + + rc= mysql_query(mysql, "set @@sql_mode='ERROR_FOR_DIVISION_BY_ZERO'"); + myquery(rc); + + stmt= mysql_stmt_init(mysql); + + rc= mysql_stmt_prepare(stmt, query, strlen(query)); + check_execute(stmt, rc); + + rc= mysql_stmt_execute(stmt); + check_execute(stmt, rc); + + rc= mysql_stmt_fetch(stmt); + DIE_UNLESS(mysql_warning_count(mysql)); + + /* Cleanup */ + mysql_stmt_close(stmt); + rc= mysql_query(mysql, "set @@sql_mode=''"); + myquery(rc); +} + /* Read and parse arguments and MySQL options from my.cnf */ @@ -14849,6 +14883,7 @@ static struct my_tests_st my_tests[]= { { "test_bug13488", test_bug13488 }, { "test_bug13524", test_bug13524 }, { "test_bug14845", test_bug14845 }, + { "test_bug15510", test_bug15510}, { 0, 0 } }; |