1
0
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:
Georg Richter
2023-04-25 15:08:28 +02:00
6 changed files with 77 additions and 70 deletions

View File

@@ -811,16 +811,16 @@ 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);
stmt_set_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);
stmt_set_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);
stmt_set_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");
@@ -836,8 +836,8 @@ static int test_conc624(MYSQL *mysql)
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");
/* test if stmt_set_error works with variadic arguments */
stmt_set_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");

View File

@@ -617,6 +617,12 @@ int test_conc21(MYSQL *mysql)
int major=0, minor= 0, patch=0;
SKIP_MAXSCALE;
if (strlen(mysql_get_server_info(mysql)) > 63)
{
diag("server name is too long - skip until rpl hack was removed");
return SKIP;
}
rc= mysql_query(mysql, "SELECT @@version");
check_mysql_rc(rc, mysql);
@@ -1199,6 +1205,7 @@ static int test_auth256(MYSQL *my)
if (!my_test_connect(mysql, hostname, "sha256user", "foo", NULL, port, socketname, 0))
{
diag("error: %s", mysql_error(mysql));
diag("host: %s", this_host);
mysql_close(mysql);
return FAIL;
}
@@ -2269,7 +2276,9 @@ static int test_conc632(MYSQL *my __attribute__((unused)))
return FAIL;
}
rc= mysql_query(mysql, "CREATE OR REPLACE PROCEDURE conc632() "
rc= mysql_query(mysql, "DROP PROCEDURE conc632");
rc= mysql_query(mysql, "CREATE PROCEDURE conc632() "
"BEGIN "
" SELECT 1;"
" SELECT 2;"

View File

@@ -5639,9 +5639,13 @@ static int test_conc623(MYSQL *mysql)
static int test_conc627(MYSQL *mysql)
{
MYSQL_STMT *stmt= mysql_stmt_init(mysql);
MYSQL_STMT *stmt;
int rc;
SKIP_MYSQL(mysql);
stmt= mysql_stmt_init(mysql);
rc= mysql_stmt_prepare(stmt, SL("show grants for mysqltest_8"));
check_stmt_rc(rc, stmt);