1
0
mirror of https://github.com/mariadb-corporation/mariadb-connector-c.git synced 2025-08-08 14:02:17 +03:00
This commit is contained in:
Georg Richter
2018-05-29 11:43:47 +02:00
7 changed files with 66 additions and 13 deletions

View File

@@ -1365,12 +1365,13 @@ static int test_conc315(MYSQL *mysql)
return SKIP;
mysql_get_optionv(mysql, MYSQL_SET_CHARSET_NAME, (void *)&csname);
FAIL_UNLESS(strcmp(csname, "utf8") == 0, "Wrong default character set");
diag("csname=%s", csname);
FAIL_UNLESS(strcmp(csname, MARIADB_DEFAULT_CHARSET) == 0, "Wrong default character set");
rc= mysql_change_user(mysql, username, password, schema);
check_mysql_rc(rc, mysql);
mysql_get_optionv(mysql, MYSQL_SET_CHARSET_NAME, (void *)&csname);
FAIL_UNLESS(strcmp(csname, "utf8") == 0, "Wrong default character set");
FAIL_UNLESS(strcmp(csname, MARIADB_DEFAULT_CHARSET) == 0, "Wrong default character set");
return OK;
}
#ifndef WIN32
@@ -1491,7 +1492,7 @@ struct my_tests_st my_tests[] = {
{"test_conc327", test_conc327, TEST_CONNECTION_DEFAULT, 0, NULL, NULL},
{"test_conc317", test_conc317, TEST_CONNECTION_DEFAULT, 0, NULL, NULL},
#endif
{"test_conc315", test_conc315, TEST_CONNECTION_DEFAULT, 0, NULL, NULL},
{"test_conc315", test_conc315, TEST_CONNECTION_NEW, 0, NULL, NULL},
{"test_expired_pw", test_expired_pw, TEST_CONNECTION_DEFAULT, 0, NULL, NULL},
{"test_conc276", test_conc276, TEST_CONNECTION_NONE, 0, NULL, NULL},
{"test_mdev13100", test_mdev13100, TEST_CONNECTION_DEFAULT, 0, NULL, NULL},

View File

@@ -4719,7 +4719,43 @@ static int test_codbc138(MYSQL *mysql)
return OK;
}
static int test_conc334(MYSQL *mysql)
{
MYSQL_STMT *stmt= mysql_stmt_init(mysql);
MYSQL_RES *result;
MYSQL_FIELD *field;
int rc;
rc= mysql_stmt_prepare(stmt, SL("SHOW ENGINES"));
check_stmt_rc(rc, stmt);
rc= mysql_stmt_execute(stmt);
check_stmt_rc(rc, stmt);
result= mysql_stmt_result_metadata(stmt);
if (!result)
{
diag("Coudn't retrieve result set");
mysql_stmt_close(stmt);
return FAIL;
}
mysql_field_seek(result, 0);
while ((field= mysql_fetch_field(result)))
{
FAIL_IF(field->name_length == 0, "Invalid name length (0)");
FAIL_IF(field->table_length == 0, "Invalid name length (0)");
}
mysql_free_result(result);
mysql_stmt_close(stmt);
return OK;
}
struct my_tests_st my_tests[] = {
{"test_conc334", test_conc334, TEST_CONNECTION_NEW, 0, NULL, NULL},
{"test_compress", test_compress, TEST_CONNECTION_NEW, CLIENT_COMPRESS, NULL, NULL},
{"test_codbc138", test_codbc138, TEST_CONNECTION_DEFAULT, 0, NULL, NULL},
{"test_conc208", test_conc208, TEST_CONNECTION_DEFAULT, 0, NULL, NULL},