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
Fix ASAN issues in the tests
This commit is contained in:
@@ -401,7 +401,7 @@ static int test_bad_union(MYSQL *mysql)
|
||||
rc= mysql_stmt_prepare(stmt, SL(query));
|
||||
FAIL_UNLESS(rc && mysql_errno(mysql) == 1222, "Error expected");
|
||||
|
||||
free(stmt);
|
||||
mysql_stmt_close(stmt);
|
||||
return OK;
|
||||
}
|
||||
|
||||
|
@@ -161,7 +161,7 @@ static int test_bug16143(MYSQL *mysql)
|
||||
FAIL_IF(!stmt, mysql_error(mysql));
|
||||
/* Check mysql_stmt_sqlstate return "no error" */
|
||||
FAIL_UNLESS(strcmp(mysql_stmt_sqlstate(stmt), "00000") == 0, "Expected SQLstate 000000");
|
||||
free(stmt);
|
||||
mysql_stmt_close(stmt);
|
||||
return OK;
|
||||
}
|
||||
|
||||
|
@@ -101,7 +101,7 @@ static int test_conc60(MYSQL *mysql)
|
||||
rc= mysql_stmt_prepare(stmt, SL(query));
|
||||
if (rc && mysql_stmt_errno(stmt) == 1146) {
|
||||
diag("Internal test - customer data not available");
|
||||
free(stmt);
|
||||
mysql_stmt_close(stmt);
|
||||
return SKIP;
|
||||
}
|
||||
check_stmt_rc(rc, stmt);
|
||||
@@ -481,7 +481,7 @@ static int test_prepare_syntax(MYSQL *mysql)
|
||||
rc= mysql_commit(mysql);
|
||||
check_mysql_rc(rc, mysql);
|
||||
|
||||
free(stmt);
|
||||
mysql_stmt_close(stmt);
|
||||
rc= mysql_query(mysql, "DROP TABLE IF EXISTS test_prepare_syntax");
|
||||
check_mysql_rc(rc, mysql);
|
||||
|
||||
@@ -1204,8 +1204,8 @@ static int test_long_data(MYSQL *mysql)
|
||||
FAIL_IF(!stmt, mysql_error(mysql));
|
||||
rc= mysql_stmt_prepare(stmt, SL(query));
|
||||
FAIL_IF(!rc, "Error expected");
|
||||
// rc= mysql_stmt_close(stmt);
|
||||
// check_stmt_rc(rc, stmt);
|
||||
rc= mysql_stmt_close(stmt);
|
||||
check_stmt_rc(rc, stmt);
|
||||
|
||||
strcpy(query, "INSERT INTO test_long_data(col1, col2, col3) VALUES(?, ?, ?)");
|
||||
stmt= mysql_stmt_init(mysql);
|
||||
|
@@ -819,7 +819,7 @@ static int test_bug16144(MYSQL *mysql)
|
||||
mysql_stmt_attr_get(stmt, STMT_ATTR_UPDATE_MAX_LENGTH, (void*) &flag);
|
||||
FAIL_UNLESS(flag == flag_orig, "flag != flag_orig");
|
||||
|
||||
free(stmt);
|
||||
mysql_stmt_close(stmt);
|
||||
|
||||
return OK;
|
||||
}
|
||||
@@ -3040,7 +3040,7 @@ static int test_bug7990(MYSQL *mysql)
|
||||
MYSQL is not documented and is subject to change in 5.0
|
||||
*/
|
||||
FAIL_UNLESS(rc && mysql_stmt_errno(stmt) && mysql_errno(mysql), "Error expected");
|
||||
free(stmt);
|
||||
mysql_stmt_close(stmt);
|
||||
return OK;
|
||||
}
|
||||
|
||||
@@ -4551,7 +4551,7 @@ static int test_conc217(MYSQL *mysql)
|
||||
FAIL_IF(rc==0, "Expected error\n");
|
||||
rc= mysql_query(mysql, "drop table if exists t_count");
|
||||
check_mysql_rc(rc, mysql);
|
||||
free(stmt);
|
||||
mysql_stmt_close(stmt);
|
||||
check_mysql_rc(rc, mysql);
|
||||
return OK;
|
||||
}
|
||||
@@ -5210,7 +5210,7 @@ static int test_returning(MYSQL *mysql)
|
||||
int rc;
|
||||
|
||||
diag("MDEV-23768 not fixed yet");
|
||||
free(stmt);
|
||||
mysql_stmt_close(stmt);
|
||||
return SKIP;
|
||||
|
||||
rc= mysql_query(mysql, "CREATE TEMPORARY TABLE t1 (a int not null auto_increment primary key, b json)");
|
||||
|
Reference in New Issue
Block a user