You've already forked mariadb-connector-c
mirror of
https://github.com/mariadb-corporation/mariadb-connector-c.git
synced 2025-08-08 14:02:17 +03:00
Smaller test case fixes
This commit is contained in:
@@ -988,7 +988,7 @@ static int test_sess_track_db(MYSQL *mysql)
|
||||
|
||||
return OK;
|
||||
}
|
||||
|
||||
#ifndef WIN32
|
||||
static int test_unix_socket_close(MYSQL *unused __attribute__((unused)))
|
||||
{
|
||||
MYSQL *mysql= mysql_init(NULL);
|
||||
@@ -1016,6 +1016,7 @@ static int test_unix_socket_close(MYSQL *unused __attribute__((unused)))
|
||||
mysql_close(mysql);
|
||||
return OK;
|
||||
}
|
||||
#endif
|
||||
|
||||
static int test_reset(MYSQL *mysql)
|
||||
{
|
||||
@@ -1092,7 +1093,9 @@ static int test_mdev12446(MYSQL *my __attribute__((unused)))
|
||||
struct my_tests_st my_tests[] = {
|
||||
{"test_mdev12446", test_mdev12446, TEST_CONNECTION_DEFAULT, 0, NULL, NULL},
|
||||
{"test_reset", test_reset, TEST_CONNECTION_DEFAULT, 0, NULL, NULL},
|
||||
#ifndef WIN32
|
||||
{"test_unix_socket_close", test_unix_socket_close, TEST_CONNECTION_NONE, 0, NULL, NULL},
|
||||
#endif
|
||||
{"test_sess_track_db", test_sess_track_db, TEST_CONNECTION_DEFAULT, 0, NULL, NULL},
|
||||
{"test_get_options", test_get_options, TEST_CONNECTION_DEFAULT, 0, NULL, NULL},
|
||||
{"test_wrong_bind_address", test_wrong_bind_address, TEST_CONNECTION_DEFAULT, 0, NULL, NULL},
|
||||
|
@@ -265,7 +265,7 @@ static int test_frm_bug(MYSQL *mysql)
|
||||
sprintf(test_frm, "%s/%s/test_frm_bug.frm", data_dir, schema);
|
||||
|
||||
|
||||
if (!(test_file= fopen(test_frm, "rw")))
|
||||
if (!(test_file= fopen(test_frm, "w")))
|
||||
{
|
||||
mysql_stmt_close(stmt);
|
||||
diag("Can't write to file %s -> SKIP", test_frm);
|
||||
@@ -704,12 +704,6 @@ static int test_wl4284_1(MYSQL *mysql)
|
||||
return SKIP;
|
||||
}
|
||||
|
||||
if (!rc)
|
||||
{
|
||||
diag("InnoDB Storage engine not available");
|
||||
return SKIP;
|
||||
}
|
||||
|
||||
/* set AUTOCOMMIT to OFF */
|
||||
rc= mysql_autocommit(mysql, FALSE);
|
||||
check_mysql_rc(rc, mysql);
|
||||
|
@@ -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},
|
||||
|
Reference in New Issue
Block a user