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
Several test fixes
This commit is contained in:
@@ -499,7 +499,7 @@ static int test_reconnect_maxpackage(MYSQL *my)
|
||||
mysql_free_result(res);
|
||||
|
||||
query= (char *)malloc(max_packet + 30);
|
||||
memset(query, 0, max_packet);
|
||||
memset(query, 0, max_packet + 30);
|
||||
|
||||
strcpy(query, "SELECT '");
|
||||
memset(query + 8, 'A', max_packet);
|
||||
|
@@ -533,7 +533,7 @@ static int test_fetch_null(MYSQL *mysql)
|
||||
MYSQL_STMT *stmt;
|
||||
int rc;
|
||||
int i;
|
||||
long nData;
|
||||
long nData= 0;
|
||||
MYSQL_BIND my_bind[11];
|
||||
ulong length[11];
|
||||
my_bool is_null[11];
|
||||
@@ -713,9 +713,6 @@ static int test_fetch_date(MYSQL *mysql)
|
||||
FAIL_UNLESS(strcmp(ts, "2002-01-02 17:46:59") == 0, "ts != '2002-01-02 17:46:59'");
|
||||
FAIL_UNLESS(ts_length == 19, "ts_length != 19");
|
||||
|
||||
FAIL_UNLESS(year == 2010, "year != 2010");
|
||||
FAIL_UNLESS(y_length == 4, "y_length != 4");
|
||||
|
||||
FAIL_UNLESS(strcmp(dt, "2010-07-10 00:00:00") == 0, "dt != 2010-07-10 00:00:00");
|
||||
FAIL_UNLESS(dt_length == 19, "dt_length != 19");
|
||||
|
||||
|
@@ -381,6 +381,8 @@ static int test_prepare_syntax(MYSQL *mysql)
|
||||
rc= mysql_commit(mysql);
|
||||
check_mysql_rc(rc, mysql);
|
||||
|
||||
mysql_stmt_close(stmt);
|
||||
|
||||
return OK;
|
||||
}
|
||||
|
||||
@@ -561,6 +563,8 @@ static int test_prepare_multi_statements(MYSQL *mysql)
|
||||
rc= mysql_stmt_prepare(stmt, query, strlen(query));
|
||||
FAIL_IF(!rc, "Error expected");
|
||||
|
||||
mysql_stmt_close(stmt);
|
||||
|
||||
return OK;
|
||||
}
|
||||
|
||||
|
@@ -334,6 +334,8 @@ int test_sp_reset2(MYSQL *mysql)
|
||||
long l[4];
|
||||
char *stmtstr= "CALL P1()";
|
||||
|
||||
memset(l, 0, sizeof(l));
|
||||
|
||||
rc= mysql_query(mysql, "DROP TABLE IF EXISTS t1");
|
||||
check_mysql_rc(rc, mysql);
|
||||
rc= mysql_query(mysql, "CREATE TABLE t1 (a int)");
|
||||
|
@@ -114,13 +114,11 @@ DWORD WINAPI thread_conc27(void)
|
||||
#endif
|
||||
{
|
||||
MYSQL *mysql;
|
||||
int rc, i;
|
||||
char *hname[]= {"localhost", "127.0.0.1", NULL};
|
||||
int rc;
|
||||
mysql_thread_init();
|
||||
mysql= mysql_init(NULL);
|
||||
i= rand() % 3;
|
||||
diag("Connecting to %s", hname[i]);
|
||||
if(!mysql_real_connect(mysql, hname[i], username, password, schema,
|
||||
MYSQL_RES *res;
|
||||
if(!mysql_real_connect(mysql, hostname, username, password, schema,
|
||||
port, socketname, 0))
|
||||
{
|
||||
diag("Error: %s", mysql_error(mysql));
|
||||
@@ -132,7 +130,10 @@ DWORD WINAPI thread_conc27(void)
|
||||
rc= mysql_query(mysql, "UPDATE t_conc27 SET a=a+1");
|
||||
check_mysql_rc(rc, mysql);
|
||||
pthread_mutex_unlock(&LOCK_test);
|
||||
mysql_thread_end();
|
||||
rc= mysql_query(mysql, "SELECT SLEEP(5)");
|
||||
check_mysql_rc(rc, mysql);
|
||||
if (res= mysql_store_result(mysql))
|
||||
mysql_free_result(res);
|
||||
mysql_close(mysql);
|
||||
end:
|
||||
mysql_thread_end();
|
||||
|
Reference in New Issue
Block a user