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
fix problems found by 10.0
This commit is contained in:
@@ -513,7 +513,6 @@ static int bug30472_retrieve_charset_info(MYSQL *con,
|
|||||||
|
|
||||||
static int test_bug30472(MYSQL *mysql)
|
static int test_bug30472(MYSQL *mysql)
|
||||||
{
|
{
|
||||||
SKIP_MAXSCALE;
|
|
||||||
int rc;
|
int rc;
|
||||||
|
|
||||||
char character_set_name_1[MY_CS_NAME_SIZE];
|
char character_set_name_1[MY_CS_NAME_SIZE];
|
||||||
@@ -536,6 +535,8 @@ static int test_bug30472(MYSQL *mysql)
|
|||||||
char character_set_results_4[MY_CS_NAME_SIZE];
|
char character_set_results_4[MY_CS_NAME_SIZE];
|
||||||
char collation_connnection_4[MY_CS_NAME_SIZE];
|
char collation_connnection_4[MY_CS_NAME_SIZE];
|
||||||
|
|
||||||
|
SKIP_MAXSCALE;
|
||||||
|
|
||||||
if (mysql_get_server_version(mysql) < 50100 || !is_mariadb)
|
if (mysql_get_server_version(mysql) < 50100 || !is_mariadb)
|
||||||
{
|
{
|
||||||
diag("Test requires MySQL Server version 5.1 or above");
|
diag("Test requires MySQL Server version 5.1 or above");
|
||||||
|
@@ -530,10 +530,10 @@ static int test_opt_reconnect(MYSQL *mysql)
|
|||||||
static int test_compress(MYSQL *mysql)
|
static int test_compress(MYSQL *mysql)
|
||||||
{
|
{
|
||||||
// maxscale doesn't support compression
|
// maxscale doesn't support compression
|
||||||
SKIP_MAXSCALE;
|
|
||||||
MYSQL_RES *res;
|
MYSQL_RES *res;
|
||||||
MYSQL_ROW row;
|
MYSQL_ROW row;
|
||||||
int rc;
|
int rc;
|
||||||
|
SKIP_MAXSCALE;
|
||||||
|
|
||||||
mysql= mysql_init(NULL);
|
mysql= mysql_init(NULL);
|
||||||
FAIL_IF(!mysql, "not enough memory");
|
FAIL_IF(!mysql, "not enough memory");
|
||||||
@@ -564,11 +564,11 @@ static int test_compress(MYSQL *mysql)
|
|||||||
|
|
||||||
static int test_reconnect(MYSQL *mysql)
|
static int test_reconnect(MYSQL *mysql)
|
||||||
{
|
{
|
||||||
SKIP_MAXSCALE;
|
|
||||||
my_bool my_true= TRUE;
|
my_bool my_true= TRUE;
|
||||||
MYSQL *mysql1;
|
MYSQL *mysql1;
|
||||||
int rc;
|
int rc;
|
||||||
my_bool reconnect;
|
my_bool reconnect;
|
||||||
|
SKIP_MAXSCALE;
|
||||||
|
|
||||||
mysql1= mysql_init(NULL);
|
mysql1= mysql_init(NULL);
|
||||||
FAIL_IF(!mysql1, "not enough memory");
|
FAIL_IF(!mysql1, "not enough memory");
|
||||||
@@ -610,13 +610,13 @@ static int test_reconnect(MYSQL *mysql)
|
|||||||
|
|
||||||
int test_conc21(MYSQL *mysql)
|
int test_conc21(MYSQL *mysql)
|
||||||
{
|
{
|
||||||
SKIP_MAXSCALE;
|
|
||||||
int rc;
|
int rc;
|
||||||
MYSQL_RES *res= NULL;
|
MYSQL_RES *res= NULL;
|
||||||
MYSQL_ROW row;
|
MYSQL_ROW row;
|
||||||
char tmp[256];
|
char tmp[256];
|
||||||
unsigned int check_server_version= 0;
|
unsigned int check_server_version= 0;
|
||||||
int major=0, minor= 0, patch=0;
|
int major=0, minor= 0, patch=0;
|
||||||
|
SKIP_MAXSCALE;
|
||||||
|
|
||||||
rc= mysql_query(mysql, "SELECT @@version");
|
rc= mysql_query(mysql, "SELECT @@version");
|
||||||
check_mysql_rc(rc, mysql);
|
check_mysql_rc(rc, mysql);
|
||||||
@@ -750,10 +750,10 @@ int test_connection_timeout3(MYSQL *unused __attribute__((unused)))
|
|||||||
/* test should run with valgrind */
|
/* test should run with valgrind */
|
||||||
static int test_conc118(MYSQL *mysql)
|
static int test_conc118(MYSQL *mysql)
|
||||||
{
|
{
|
||||||
SKIP_SKYSQL;
|
|
||||||
SKIP_MAXSCALE;
|
|
||||||
int rc;
|
int rc;
|
||||||
my_bool reconnect= 1;
|
my_bool reconnect= 1;
|
||||||
|
SKIP_SKYSQL;
|
||||||
|
SKIP_MAXSCALE;
|
||||||
|
|
||||||
mysql_options(mysql, MYSQL_OPT_RECONNECT, &reconnect);
|
mysql_options(mysql, MYSQL_OPT_RECONNECT, &reconnect);
|
||||||
|
|
||||||
@@ -1143,13 +1143,12 @@ static int test_reset(MYSQL *mysql)
|
|||||||
|
|
||||||
static int test_auth256(MYSQL *my)
|
static int test_auth256(MYSQL *my)
|
||||||
{
|
{
|
||||||
SKIP_MAXSCALE;
|
|
||||||
|
|
||||||
MYSQL *mysql= mysql_init(NULL);
|
MYSQL *mysql= mysql_init(NULL);
|
||||||
int rc;
|
int rc;
|
||||||
MYSQL_RES *res;
|
MYSQL_RES *res;
|
||||||
my_ulonglong num_rows= 0;
|
my_ulonglong num_rows= 0;
|
||||||
char query[1024];
|
char query[1024];
|
||||||
|
SKIP_MAXSCALE;
|
||||||
|
|
||||||
if (IS_SKYSQL(hostname))
|
if (IS_SKYSQL(hostname))
|
||||||
return SKIP;
|
return SKIP;
|
||||||
@@ -1437,11 +1436,10 @@ static int test_expired_pw(MYSQL *my)
|
|||||||
|
|
||||||
static int test_conc315(MYSQL *mysql)
|
static int test_conc315(MYSQL *mysql)
|
||||||
{
|
{
|
||||||
SKIP_SKYSQL;
|
|
||||||
SKIP_MAXSCALE;
|
|
||||||
|
|
||||||
int rc;
|
int rc;
|
||||||
const char *csname;
|
const char *csname;
|
||||||
|
SKIP_SKYSQL;
|
||||||
|
SKIP_MAXSCALE;
|
||||||
|
|
||||||
if (!is_mariadb)
|
if (!is_mariadb)
|
||||||
return SKIP;
|
return SKIP;
|
||||||
@@ -1575,12 +1573,13 @@ static int test_conc327(MYSQL *unused __attribute__((unused)))
|
|||||||
|
|
||||||
static int test_conc332(MYSQL *unused __attribute__((unused)))
|
static int test_conc332(MYSQL *unused __attribute__((unused)))
|
||||||
{
|
{
|
||||||
SKIP_SKYSQL;
|
|
||||||
SKIP_MAXSCALE;
|
|
||||||
int rc;
|
int rc;
|
||||||
MYSQL *mysql= mysql_init(NULL);
|
MYSQL *mysql= mysql_init(NULL);
|
||||||
int server_status1, server_status2;
|
int server_status1, server_status2;
|
||||||
|
|
||||||
|
SKIP_SKYSQL;
|
||||||
|
SKIP_MAXSCALE;
|
||||||
|
|
||||||
mysql_options(mysql, MYSQL_SET_CHARSET_NAME, "utf8mb4");
|
mysql_options(mysql, MYSQL_SET_CHARSET_NAME, "utf8mb4");
|
||||||
|
|
||||||
my_test_connect(mysql, hostname, username, password, schema,
|
my_test_connect(mysql, hostname, username, password, schema,
|
||||||
@@ -1771,8 +1770,6 @@ static int test_conc392(MYSQL *mysql)
|
|||||||
|
|
||||||
static int test_conc443(MYSQL *my __attribute__((unused)))
|
static int test_conc443(MYSQL *my __attribute__((unused)))
|
||||||
{
|
{
|
||||||
SKIP_MAXSCALE;
|
|
||||||
|
|
||||||
my_bool x= 1;
|
my_bool x= 1;
|
||||||
unsigned long thread_id= 0;
|
unsigned long thread_id= 0;
|
||||||
char query[128];
|
char query[128];
|
||||||
@@ -1781,6 +1778,9 @@ static int test_conc443(MYSQL *my __attribute__((unused)))
|
|||||||
int rc;
|
int rc;
|
||||||
|
|
||||||
MYSQL *mysql= mysql_init(NULL);
|
MYSQL *mysql= mysql_init(NULL);
|
||||||
|
|
||||||
|
SKIP_MAXSCALE;
|
||||||
|
|
||||||
mysql_options(mysql, MYSQL_INIT_COMMAND, "set @a:=3");
|
mysql_options(mysql, MYSQL_INIT_COMMAND, "set @a:=3");
|
||||||
mysql_options(mysql, MYSQL_OPT_RECONNECT, &x);
|
mysql_options(mysql, MYSQL_OPT_RECONNECT, &x);
|
||||||
|
|
||||||
@@ -1819,11 +1819,11 @@ static int test_conc443(MYSQL *my __attribute__((unused)))
|
|||||||
|
|
||||||
static int test_default_auth(MYSQL *my __attribute__((unused)))
|
static int test_default_auth(MYSQL *my __attribute__((unused)))
|
||||||
{
|
{
|
||||||
|
MYSQL *mysql;
|
||||||
|
|
||||||
SKIP_SKYSQL;
|
SKIP_SKYSQL;
|
||||||
SKIP_MAXSCALE;
|
SKIP_MAXSCALE;
|
||||||
|
|
||||||
MYSQL *mysql;
|
|
||||||
|
|
||||||
if (!is_mariadb)
|
if (!is_mariadb)
|
||||||
return SKIP;
|
return SKIP;
|
||||||
|
|
||||||
|
@@ -175,7 +175,7 @@ static int test_cuted_rows(MYSQL *mysql)
|
|||||||
if (!is_mariadb)
|
if (!is_mariadb)
|
||||||
return SKIP;
|
return SKIP;
|
||||||
|
|
||||||
mysql_query(mysql, "DROP TABLE if exists t1");
|
rc= mysql_query(mysql, "DROP TABLE if exists t1");
|
||||||
check_mysql_rc(rc, mysql);
|
check_mysql_rc(rc, mysql);
|
||||||
mysql_query(mysql, "DROP TABLE if exists t2");
|
mysql_query(mysql, "DROP TABLE if exists t2");
|
||||||
check_mysql_rc(rc, mysql);
|
check_mysql_rc(rc, mysql);
|
||||||
|
@@ -173,8 +173,8 @@ static int bug31418_impl()
|
|||||||
|
|
||||||
static int test_bug31418(MYSQL *unused __attribute__((unused)))
|
static int test_bug31418(MYSQL *unused __attribute__((unused)))
|
||||||
{
|
{
|
||||||
SKIP_MAXSCALE;
|
|
||||||
int i;
|
int i;
|
||||||
|
SKIP_MAXSCALE;
|
||||||
|
|
||||||
if (!is_mariadb)
|
if (!is_mariadb)
|
||||||
return SKIP;
|
return SKIP;
|
||||||
@@ -808,15 +808,14 @@ static int test_bug49694(MYSQL *mysql)
|
|||||||
|
|
||||||
static int test_conc49(MYSQL *mysql)
|
static int test_conc49(MYSQL *mysql)
|
||||||
{
|
{
|
||||||
|
|
||||||
SKIP_LOAD_INFILE_DISABLE;
|
|
||||||
SKIP_SKYSQL;
|
|
||||||
|
|
||||||
int rc;
|
int rc;
|
||||||
MYSQL_RES *res;
|
MYSQL_RES *res;
|
||||||
int i;
|
int i;
|
||||||
FILE *fp;
|
FILE *fp;
|
||||||
|
|
||||||
|
SKIP_LOAD_INFILE_DISABLE;
|
||||||
|
SKIP_SKYSQL;
|
||||||
|
|
||||||
fp= fopen("./sample.csv", "w");
|
fp= fopen("./sample.csv", "w");
|
||||||
for (i=1; i < 4; i++)
|
for (i=1; i < 4; i++)
|
||||||
fprintf(fp, "\"%d\", \"%d\", \"%d\"\r\n", i, i, i);
|
fprintf(fp, "\"%d\", \"%d\", \"%d\"\r\n", i, i, i);
|
||||||
@@ -988,9 +987,9 @@ static int test_conc_114(MYSQL *mysql)
|
|||||||
/* run with valgrind */
|
/* run with valgrind */
|
||||||
static int test_conc117(MYSQL *unused __attribute__((unused)))
|
static int test_conc117(MYSQL *unused __attribute__((unused)))
|
||||||
{
|
{
|
||||||
SKIP_MAXSCALE;
|
|
||||||
my_bool reconnect= 1;
|
my_bool reconnect= 1;
|
||||||
MYSQL *my= mysql_init(NULL);
|
MYSQL *my= mysql_init(NULL);
|
||||||
|
SKIP_MAXSCALE;
|
||||||
FAIL_IF(!my_test_connect(my, hostname, username, password, schema,
|
FAIL_IF(!my_test_connect(my, hostname, username, password, schema,
|
||||||
port, socketname, 0), mysql_error(my));
|
port, socketname, 0), mysql_error(my));
|
||||||
|
|
||||||
@@ -1006,9 +1005,9 @@ static int test_conc117(MYSQL *unused __attribute__((unused)))
|
|||||||
|
|
||||||
static int test_read_timeout(MYSQL *unused __attribute__((unused)))
|
static int test_read_timeout(MYSQL *unused __attribute__((unused)))
|
||||||
{
|
{
|
||||||
SKIP_MAXSCALE;
|
|
||||||
int timeout= 5, rc;
|
int timeout= 5, rc;
|
||||||
MYSQL *my= mysql_init(NULL);
|
MYSQL *my= mysql_init(NULL);
|
||||||
|
SKIP_MAXSCALE;
|
||||||
mysql_options(my, MYSQL_OPT_READ_TIMEOUT, &timeout);
|
mysql_options(my, MYSQL_OPT_READ_TIMEOUT, &timeout);
|
||||||
FAIL_IF(!my_test_connect(my, hostname, username, password, schema,
|
FAIL_IF(!my_test_connect(my, hostname, username, password, schema,
|
||||||
port, socketname, 0), mysql_error(my));
|
port, socketname, 0), mysql_error(my));
|
||||||
|
@@ -49,7 +49,6 @@ static int test_conc97(MYSQL *mysql)
|
|||||||
|
|
||||||
static int test_conc83(MYSQL *unused __attribute__((unused)))
|
static int test_conc83(MYSQL *unused __attribute__((unused)))
|
||||||
{
|
{
|
||||||
SKIP_MAXSCALE;
|
|
||||||
MYSQL_STMT *stmt;
|
MYSQL_STMT *stmt;
|
||||||
int rc;
|
int rc;
|
||||||
MYSQL *mysql= mysql_init(NULL);
|
MYSQL *mysql= mysql_init(NULL);
|
||||||
@@ -57,6 +56,8 @@ static int test_conc83(MYSQL *unused __attribute__((unused)))
|
|||||||
|
|
||||||
const char *query= "SELECT 1,2,3 FROM DUAL";
|
const char *query= "SELECT 1,2,3 FROM DUAL";
|
||||||
|
|
||||||
|
SKIP_MAXSCALE;
|
||||||
|
|
||||||
stmt= mysql_stmt_init(mysql);
|
stmt= mysql_stmt_init(mysql);
|
||||||
|
|
||||||
mysql_options(mysql, MYSQL_OPT_RECONNECT, &reconnect);
|
mysql_options(mysql, MYSQL_OPT_RECONNECT, &reconnect);
|
||||||
|
@@ -519,10 +519,11 @@ static int test_bug11183(MYSQL *mysql)
|
|||||||
|
|
||||||
static int test_bug12744(MYSQL *mysql)
|
static int test_bug12744(MYSQL *mysql)
|
||||||
{
|
{
|
||||||
SKIP_MAXSCALE;
|
|
||||||
MYSQL_STMT *stmt = NULL;
|
MYSQL_STMT *stmt = NULL;
|
||||||
int rc;
|
int rc;
|
||||||
|
|
||||||
|
SKIP_MAXSCALE;
|
||||||
|
|
||||||
stmt = mysql_stmt_init(mysql);
|
stmt = mysql_stmt_init(mysql);
|
||||||
FAIL_IF(!stmt, mysql_error(mysql));
|
FAIL_IF(!stmt, mysql_error(mysql));
|
||||||
rc= mysql_stmt_prepare(stmt, "SET @a:=1", 9);
|
rc= mysql_stmt_prepare(stmt, "SET @a:=1", 9);
|
||||||
@@ -2066,9 +2067,9 @@ static int test_bug3117(MYSQL *mysql)
|
|||||||
|
|
||||||
static int test_bug36004(MYSQL *mysql)
|
static int test_bug36004(MYSQL *mysql)
|
||||||
{
|
{
|
||||||
SKIP_MAXSCALE;
|
|
||||||
int rc, warning_count= 0;
|
int rc, warning_count= 0;
|
||||||
MYSQL_STMT *stmt;
|
MYSQL_STMT *stmt;
|
||||||
|
SKIP_MAXSCALE;
|
||||||
|
|
||||||
|
|
||||||
if (mysql_get_server_version(mysql) < 60000) {
|
if (mysql_get_server_version(mysql) < 60000) {
|
||||||
@@ -2728,10 +2729,10 @@ static int test_bug5194(MYSQL *mysql)
|
|||||||
|
|
||||||
static int test_bug5315(MYSQL *mysql)
|
static int test_bug5315(MYSQL *mysql)
|
||||||
{
|
{
|
||||||
SKIP_MAXSCALE;
|
|
||||||
MYSQL_STMT *stmt;
|
MYSQL_STMT *stmt;
|
||||||
const char *stmt_text;
|
const char *stmt_text;
|
||||||
int rc;
|
int rc;
|
||||||
|
SKIP_MAXSCALE;
|
||||||
|
|
||||||
if (!is_mariadb)
|
if (!is_mariadb)
|
||||||
return SKIP;
|
return SKIP;
|
||||||
@@ -3783,11 +3784,11 @@ static int test_stiny_bug(MYSQL *mysql)
|
|||||||
|
|
||||||
static int test_bug53311(MYSQL *mysql)
|
static int test_bug53311(MYSQL *mysql)
|
||||||
{
|
{
|
||||||
SKIP_MAXSCALE;
|
|
||||||
int rc;
|
int rc;
|
||||||
MYSQL_STMT *stmt;
|
MYSQL_STMT *stmt;
|
||||||
int i;
|
int i;
|
||||||
const char *query= "INSERT INTO bug53311 VALUES (1)";
|
const char *query= "INSERT INTO bug53311 VALUES (1)";
|
||||||
|
SKIP_MAXSCALE;
|
||||||
|
|
||||||
rc= mysql_options(mysql, MYSQL_OPT_RECONNECT, "1");
|
rc= mysql_options(mysql, MYSQL_OPT_RECONNECT, "1");
|
||||||
check_mysql_rc(rc, mysql);
|
check_mysql_rc(rc, mysql);
|
||||||
|
@@ -927,9 +927,6 @@ static int test_bug9992(MYSQL *mysql)
|
|||||||
|
|
||||||
static int test_multi_statements(MYSQL *mysql)
|
static int test_multi_statements(MYSQL *mysql)
|
||||||
{
|
{
|
||||||
SKIP_SKYSQL;
|
|
||||||
SKIP_MAXSCALE;
|
|
||||||
|
|
||||||
MYSQL *mysql_local;
|
MYSQL *mysql_local;
|
||||||
MYSQL_RES *result;
|
MYSQL_RES *result;
|
||||||
int rc;
|
int rc;
|
||||||
@@ -952,6 +949,9 @@ DROP TABLE IF EXISTS test_multi_tab";
|
|||||||
uint rows[]= {0, 0, 2, 1, 3, 2, 2, 1, 1, 0, 0, 1, 0};
|
uint rows[]= {0, 0, 2, 1, 3, 2, 2, 1, 1, 0, 0, 1, 0};
|
||||||
my_bool reconnect= 1;
|
my_bool reconnect= 1;
|
||||||
|
|
||||||
|
SKIP_SKYSQL;
|
||||||
|
SKIP_MAXSCALE;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
First test that we get an error for multi statements
|
First test that we get an error for multi statements
|
||||||
(Because default connection is not opened with CLIENT_MULTI_STATEMENTS)
|
(Because default connection is not opened with CLIENT_MULTI_STATEMENTS)
|
||||||
|
Reference in New Issue
Block a user