You've already forked mariadb-connector-c
mirror of
https://github.com/mariadb-corporation/mariadb-connector-c.git
synced 2025-08-07 02:42:49 +03:00
Merge branch '3.1' into 3.3
This commit is contained in:
@@ -806,7 +806,48 @@ static int test_compressed(MYSQL *unused __attribute__((unused)))
|
||||
return OK;
|
||||
}
|
||||
|
||||
static int test_conc624(MYSQL *mysql)
|
||||
{
|
||||
MYSQL_STMT *stmt= mysql_stmt_init(mysql);
|
||||
char errmsg[MYSQL_ERRMSG_SIZE];
|
||||
|
||||
SET_CLIENT_STMT_ERROR(stmt, 9000, SQLSTATE_UNKNOWN, 0);
|
||||
snprintf(errmsg, MYSQL_ERRMSG_SIZE, ER_UNKNOWN_ERROR_CODE, 9000);
|
||||
diag("stmt_error: %s", mysql_stmt_error(stmt));
|
||||
FAIL_IF(strcmp(mysql_stmt_error(stmt), errmsg), "expected undefined error 9000");
|
||||
|
||||
SET_CLIENT_STMT_ERROR(stmt, 0, SQLSTATE_UNKNOWN, 0);
|
||||
snprintf(errmsg, MYSQL_ERRMSG_SIZE, ER_UNKNOWN_ERROR_CODE, 0);
|
||||
FAIL_IF(strcmp(mysql_stmt_error(stmt), errmsg), "expected undefined error 0");
|
||||
|
||||
SET_CLIENT_STMT_ERROR(stmt, 4999, SQLSTATE_UNKNOWN, 0);
|
||||
snprintf(errmsg, MYSQL_ERRMSG_SIZE, ER_UNKNOWN_ERROR_CODE, 4999);
|
||||
FAIL_IF(strcmp(mysql_stmt_error(stmt), errmsg), "expected undefined error 4999");
|
||||
|
||||
my_set_error(mysql, 4999, SQLSTATE_UNKNOWN, 0);
|
||||
snprintf(errmsg, MYSQL_ERRMSG_SIZE, ER_UNKNOWN_ERROR_CODE, 4999);
|
||||
FAIL_IF(strcmp(mysql_error(mysql), errmsg), "expected undefined error 4999");
|
||||
|
||||
my_set_error(mysql, 0, SQLSTATE_UNKNOWN, 0);
|
||||
snprintf(errmsg, MYSQL_ERRMSG_SIZE, ER_UNKNOWN_ERROR_CODE, 0);
|
||||
FAIL_IF(strcmp(mysql_error(mysql), errmsg), "expected undefined error 0");
|
||||
|
||||
my_set_error(mysql, 9000, SQLSTATE_UNKNOWN, 0);
|
||||
snprintf(errmsg, MYSQL_ERRMSG_SIZE, ER_UNKNOWN_ERROR_CODE, 9000);
|
||||
FAIL_IF(strcmp(mysql_error(mysql), errmsg), "expected undefined error 9000");
|
||||
|
||||
/* test if SET_CLIENT_STMT_ERROR works with variadic arguments */
|
||||
SET_CLIENT_STMT_ERROR(stmt, CR_STMT_CLOSED, SQLSTATE_UNKNOWN, 0, "foobar");
|
||||
snprintf(errmsg, MYSQL_ERRMSG_SIZE, ER(CR_STMT_CLOSED), "foobar");
|
||||
FAIL_IF(strcmp(mysql_stmt_error(stmt), errmsg), "error when passing variadic arguments to prepared stmt error function");
|
||||
|
||||
mysql_stmt_close(stmt);
|
||||
|
||||
return OK;
|
||||
}
|
||||
|
||||
struct my_tests_st my_tests[] = {
|
||||
{"test_conc624", test_conc624, TEST_CONNECTION_DEFAULT, 0, NULL, NULL},
|
||||
{"test_conc75", test_conc75, TEST_CONNECTION_DEFAULT, 0, NULL, NULL},
|
||||
{"test_conc74", test_conc74, TEST_CONNECTION_DEFAULT, 0, NULL, NULL},
|
||||
{"test_conc71", test_conc71, TEST_CONNECTION_DEFAULT, 0, NULL, NULL},
|
||||
|
Reference in New Issue
Block a user