1
0
mirror of https://github.com/mariadb-corporation/mariadb-connector-c.git synced 2025-08-07 02:42:49 +03:00

Smaller test case fixes

This commit is contained in:
Georg Richter
2017-03-23 16:53:00 +01:00
parent 63e0897d43
commit 082b165c6d
3 changed files with 30 additions and 8 deletions

View File

@@ -5047,7 +5047,32 @@ static int test_reexecute(MYSQL *mysql)
return OK;
}
static int test_prepare_error(MYSQL *mysql)
{
MYSQL_STMT *stmt= mysql_stmt_init(mysql);
int rc;
rc= mysql_stmt_prepare(stmt, "SELECT 1 FROM tbl_not_exists", -1);
FAIL_IF(!rc, "Expected error");
rc= mysql_stmt_reset(stmt);
check_stmt_rc(rc, stmt);
rc= mysql_stmt_prepare(stmt, "SELECT 1 FROM tbl_not_exists", -1);
FAIL_IF(!rc, "Expected error");
rc= mysql_stmt_reset(stmt);
check_stmt_rc(rc, stmt);
rc= mysql_stmt_prepare(stmt, "SET @a:=1", -1);
check_stmt_rc(rc, stmt);
mysql_stmt_close(stmt);
return OK;
}
struct my_tests_st my_tests[] = {
{"test_prepare_error", test_prepare_error, TEST_CONNECTION_NEW, 0, NULL, NULL},
{"test_reexecute", test_reexecute, TEST_CONNECTION_NEW, 0, NULL, NULL},
{"test_bit2tiny", test_bit2tiny, TEST_CONNECTION_NEW, 0, NULL, NULL},
{"test_conc97", test_conc97, TEST_CONNECTION_NEW, 0, NULL, NULL},