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
Test and travis modification for testing against SkySQL
This commit is contained in:
@@ -28,6 +28,7 @@ matrix:
|
|||||||
# - env: SERVER_BRANCH=10.5 TEST_OPTION=--ps-protocol
|
# - env: SERVER_BRANCH=10.5 TEST_OPTION=--ps-protocol
|
||||||
include:
|
include:
|
||||||
- env: DB=build
|
- env: DB=build
|
||||||
|
- env: SKYSQL=true
|
||||||
# disable for now - env: DB=mysql:8.0
|
# disable for now - env: DB=mysql:8.0
|
||||||
- env: DB=mariadb:10.1
|
- env: DB=mariadb:10.1
|
||||||
- env: DB=mariadb:10.2
|
- env: DB=mariadb:10.2
|
||||||
|
@@ -7,52 +7,69 @@ set -e
|
|||||||
# test different type of configuration
|
# test different type of configuration
|
||||||
###################################################################################################################
|
###################################################################################################################
|
||||||
mysql=( mysql --protocol=tcp -ubob -h127.0.0.1 --port=3305 )
|
mysql=( mysql --protocol=tcp -ubob -h127.0.0.1 --port=3305 )
|
||||||
export COMPOSE_FILE=.travis/docker-compose.yml
|
|
||||||
|
if [ -n "$SKYSQL" ] ; then
|
||||||
|
|
||||||
|
if [ -z "$SKYSQL_TEST_HOST" ] ; then
|
||||||
|
echo "No SkySQL configuration found !"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
export MYSQL_TEST_USER=$SKYSQL_TEST_USER
|
||||||
|
export MYSQL_TEST_HOST=$SKYSQL_TEST_HOST
|
||||||
|
export MYSQL_TEST_PASSWD=$SKYSQL_TEST_PASSWORD
|
||||||
|
export MYSQL_TEST_PORT=$SKYSQL_TEST_PORT
|
||||||
|
export MYSQL_TEST_DATABASE=$SKYSQL_TEST_DATABASE
|
||||||
|
export MYSQL_TEST_TLS=1
|
||||||
|
else
|
||||||
|
export COMPOSE_FILE=.travis/docker-compose.yml
|
||||||
|
|
||||||
|
|
||||||
###################################################################################################################
|
###################################################################################################################
|
||||||
# launch docker server and maxscale
|
# launch docker server and maxscale
|
||||||
###################################################################################################################
|
###################################################################################################################
|
||||||
export INNODB_LOG_FILE_SIZE=$(echo ${PACKET}| cut -d'M' -f 1)0M
|
export INNODB_LOG_FILE_SIZE=$(echo ${PACKET}| cut -d'M' -f 1)0M
|
||||||
docker-compose -f ${COMPOSE_FILE} build
|
docker-compose -f ${COMPOSE_FILE} build
|
||||||
docker-compose -f ${COMPOSE_FILE} up -d
|
docker-compose -f ${COMPOSE_FILE} up -d
|
||||||
|
|
||||||
|
|
||||||
###################################################################################################################
|
###################################################################################################################
|
||||||
# wait for docker initialisation
|
# wait for docker initialisation
|
||||||
###################################################################################################################
|
###################################################################################################################
|
||||||
|
|
||||||
for i in {60..0}; do
|
for i in {60..0}; do
|
||||||
if echo 'SELECT 1' | "${mysql[@]}" &> /dev/null; then
|
if echo 'SELECT 1' | "${mysql[@]}" &> /dev/null; then
|
||||||
break
|
break
|
||||||
fi
|
fi
|
||||||
echo 'data server still not active'
|
echo 'data server still not active'
|
||||||
sleep 1
|
sleep 1
|
||||||
done
|
done
|
||||||
|
|
||||||
docker-compose -f ${COMPOSE_FILE} logs
|
docker-compose -f ${COMPOSE_FILE} logs
|
||||||
|
|
||||||
if [ "$i" = 0 ]; then
|
if [ "$i" = 0 ]; then
|
||||||
echo 'SELECT 1' | "${mysql[@]}"
|
echo 'SELECT 1' | "${mysql[@]}"
|
||||||
echo >&2 'data server init process failed.'
|
echo >&2 'data server init process failed.'
|
||||||
exit 1
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
#list ssl certificates
|
||||||
|
ls -lrt ${SSLCERT}
|
||||||
|
|
||||||
|
|
||||||
|
export MYSQL_TEST_HOST=mariadb.example.com
|
||||||
|
export MYSQL_TEST_DB=ctest
|
||||||
|
export MYSQL_TEST_USER=bob
|
||||||
|
export MYSQL_TEST_PORT=3305
|
||||||
|
export MYSQL_TEST_TRAVIS=1
|
||||||
|
export MARIADB_PLUGIN_DIR=$PWD
|
||||||
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
#list ssl certificates
|
|
||||||
ls -lrt ${SSLCERT}
|
|
||||||
|
|
||||||
|
|
||||||
#build C connector
|
#build C connector
|
||||||
cmake -DCMAKE_BUILD_TYPE=RelWithDebInfo -DWITH_SSL=OPENSSL -DCERT_PATH=${SSLCERT}
|
cmake -DCMAKE_BUILD_TYPE=RelWithDebInfo -DWITH_SSL=OPENSSL -DCERT_PATH=${SSLCERT}
|
||||||
make
|
make
|
||||||
|
|
||||||
export MYSQL_TEST_HOST=mariadb.example.com
|
|
||||||
export MYSQL_TEST_DB=ctest
|
|
||||||
export MYSQL_TEST_USER=bob
|
|
||||||
export MYSQL_TEST_PORT=3305
|
|
||||||
export MYSQL_TEST_TRAVIS=1
|
|
||||||
export MARIADB_PLUGIN_DIR=$PWD
|
|
||||||
|
|
||||||
## list ciphers
|
## list ciphers
|
||||||
openssl ciphers -v
|
openssl ciphers -v
|
||||||
|
|
||||||
|
@@ -37,6 +37,8 @@ static int test_conc75(MYSQL *my)
|
|||||||
int i;
|
int i;
|
||||||
my_bool reconnect= 1;
|
my_bool reconnect= 1;
|
||||||
|
|
||||||
|
SKIP_SKYSQL;
|
||||||
|
|
||||||
mysql= mysql_init(NULL);
|
mysql= mysql_init(NULL);
|
||||||
|
|
||||||
mysql_options(mysql, MYSQL_OPT_RECONNECT, &reconnect);
|
mysql_options(mysql, MYSQL_OPT_RECONNECT, &reconnect);
|
||||||
@@ -144,6 +146,8 @@ static int test_conc70(MYSQL *my)
|
|||||||
|
|
||||||
SKIP_CONNECTION_HANDLER;
|
SKIP_CONNECTION_HANDLER;
|
||||||
|
|
||||||
|
SKIP_SKYSQL;
|
||||||
|
|
||||||
mysql= mysql_init(NULL);
|
mysql= mysql_init(NULL);
|
||||||
|
|
||||||
rc= mysql_query(my, "SET @a:=@@max_allowed_packet");
|
rc= mysql_query(my, "SET @a:=@@max_allowed_packet");
|
||||||
@@ -205,6 +209,8 @@ static int test_conc68(MYSQL *my)
|
|||||||
MYSQL *mysql;
|
MYSQL *mysql;
|
||||||
|
|
||||||
SKIP_CONNECTION_HANDLER;
|
SKIP_CONNECTION_HANDLER;
|
||||||
|
SKIP_SKYSQL;
|
||||||
|
|
||||||
|
|
||||||
mysql= mysql_init(NULL);
|
mysql= mysql_init(NULL);
|
||||||
|
|
||||||
@@ -259,8 +265,9 @@ static int basic_connect(MYSQL *unused __attribute__((unused)))
|
|||||||
MYSQL_RES *res;
|
MYSQL_RES *res;
|
||||||
MYSQL_FIELD *field;
|
MYSQL_FIELD *field;
|
||||||
int rc;
|
int rc;
|
||||||
|
MYSQL *my;
|
||||||
|
|
||||||
MYSQL *my= mysql_init(NULL);
|
my= mysql_init(NULL);
|
||||||
FAIL_IF(!my, "mysql_init() failed");
|
FAIL_IF(!my, "mysql_init() failed");
|
||||||
|
|
||||||
FAIL_IF(!my_test_connect(my, hostname, username, password, schema,
|
FAIL_IF(!my_test_connect(my, hostname, username, password, schema,
|
||||||
|
@@ -12,6 +12,11 @@ int main(int argc, char *argv[]) {
|
|||||||
|
|
||||||
get_envvars();
|
get_envvars();
|
||||||
|
|
||||||
|
if (IS_SKYSQL(hostname))
|
||||||
|
return 0;
|
||||||
|
|
||||||
|
diag("hostname: %s", hostname);
|
||||||
|
|
||||||
for (i = 0; i < MAX_COUNT; ++i) {
|
for (i = 0; i < MAX_COUNT; ++i) {
|
||||||
|
|
||||||
if (mysql_library_init(-1, NULL, NULL) != 0) {
|
if (mysql_library_init(-1, NULL, NULL) != 0) {
|
||||||
@@ -25,6 +30,9 @@ int main(int argc, char *argv[]) {
|
|||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (force_tls)
|
||||||
|
mysql_options(mysql, MYSQL_OPT_SSL_ENFORCE, &force_tls);
|
||||||
|
|
||||||
if (!mysql_real_connect(mysql, hostname, username, password, schema, port, socketname, 0)) {
|
if (!mysql_real_connect(mysql, hostname, username, password, schema, port, socketname, 0)) {
|
||||||
diag("mysql_real_connect failed: %s", mysql_error(mysql));
|
diag("mysql_real_connect failed: %s", mysql_error(mysql));
|
||||||
return 1;
|
return 1;
|
||||||
|
@@ -34,6 +34,8 @@ static int test_conc66(MYSQL *my)
|
|||||||
FILE *fp;
|
FILE *fp;
|
||||||
char query[1024];
|
char query[1024];
|
||||||
|
|
||||||
|
SKIP_SKYSQL;
|
||||||
|
|
||||||
if (!(fp= fopen("./my-conc66-test.cnf", "w")))
|
if (!(fp= fopen("./my-conc66-test.cnf", "w")))
|
||||||
return FAIL;
|
return FAIL;
|
||||||
|
|
||||||
@@ -85,6 +87,8 @@ static int test_bug20023(MYSQL *mysql)
|
|||||||
int sql_big_selects_5;
|
int sql_big_selects_5;
|
||||||
int rc;
|
int rc;
|
||||||
|
|
||||||
|
SKIP_SKYSQL;
|
||||||
|
|
||||||
if (!is_mariadb)
|
if (!is_mariadb)
|
||||||
return SKIP;
|
return SKIP;
|
||||||
|
|
||||||
@@ -669,7 +673,11 @@ int test_connection_timeout2(MYSQL *unused __attribute__((unused)))
|
|||||||
{
|
{
|
||||||
unsigned int timeout= 5;
|
unsigned int timeout= 5;
|
||||||
time_t start, elapsed;
|
time_t start, elapsed;
|
||||||
MYSQL *mysql= mysql_init(NULL);
|
MYSQL *mysql;
|
||||||
|
|
||||||
|
SKIP_SKYSQL;
|
||||||
|
|
||||||
|
mysql= mysql_init(NULL);
|
||||||
mysql_options(mysql, MYSQL_OPT_CONNECT_TIMEOUT, (unsigned int *)&timeout);
|
mysql_options(mysql, MYSQL_OPT_CONNECT_TIMEOUT, (unsigned int *)&timeout);
|
||||||
mysql_options(mysql, MYSQL_INIT_COMMAND, "set @a:=SLEEP(6)");
|
mysql_options(mysql, MYSQL_INIT_COMMAND, "set @a:=SLEEP(6)");
|
||||||
start= time(NULL);
|
start= time(NULL);
|
||||||
@@ -791,6 +799,8 @@ static int test_bind_address(MYSQL *my)
|
|||||||
char query[128];
|
char query[128];
|
||||||
int rc;
|
int rc;
|
||||||
|
|
||||||
|
SKIP_SKYSQL;
|
||||||
|
|
||||||
if (!hostname || !strcmp(hostname, "localhost"))
|
if (!hostname || !strcmp(hostname, "localhost"))
|
||||||
{
|
{
|
||||||
diag("test doesn't work with unix sockets");
|
diag("test doesn't work with unix sockets");
|
||||||
@@ -994,6 +1004,8 @@ static int test_unix_socket_close(MYSQL *unused __attribute__((unused)))
|
|||||||
FILE *fp;
|
FILE *fp;
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
|
SKIP_SKYSQL;
|
||||||
|
|
||||||
if (!(fp= fopen("./dummy_sock", "w")))
|
if (!(fp= fopen("./dummy_sock", "w")))
|
||||||
{
|
{
|
||||||
diag("couldn't create dummy socket");
|
diag("couldn't create dummy socket");
|
||||||
@@ -1003,7 +1015,7 @@ static int test_unix_socket_close(MYSQL *unused __attribute__((unused)))
|
|||||||
|
|
||||||
for (i=0; i < 10000; i++)
|
for (i=0; i < 10000; i++)
|
||||||
{
|
{
|
||||||
mysql_real_connect(mysql, "localhost", "user", "passwd", NULL, 0, "./dummy_sock", 0);
|
my_test_connect(mysql, "localhost", "user", "passwd", NULL, 0, "./dummy_sock", 0);
|
||||||
/* check if we run out of sockets */
|
/* check if we run out of sockets */
|
||||||
if (mysql_errno(mysql) == 2001)
|
if (mysql_errno(mysql) == 2001)
|
||||||
{
|
{
|
||||||
@@ -1081,6 +1093,9 @@ static int test_auth256(MYSQL *my)
|
|||||||
my_ulonglong num_rows= 0;
|
my_ulonglong num_rows= 0;
|
||||||
char query[1024];
|
char query[1024];
|
||||||
|
|
||||||
|
if (IS_SKYSQL(hostname))
|
||||||
|
return SKIP;
|
||||||
|
|
||||||
if (!mysql_client_find_plugin(mysql, "sha256_password", MYSQL_CLIENT_AUTHENTICATION_PLUGIN))
|
if (!mysql_client_find_plugin(mysql, "sha256_password", MYSQL_CLIENT_AUTHENTICATION_PLUGIN))
|
||||||
{
|
{
|
||||||
diag("sha256_password plugin not available");
|
diag("sha256_password plugin not available");
|
||||||
@@ -1109,7 +1124,7 @@ static int test_auth256(MYSQL *my)
|
|||||||
rc= mysql_query(my, query);
|
rc= mysql_query(my, query);
|
||||||
check_mysql_rc(rc, my);
|
check_mysql_rc(rc, my);
|
||||||
|
|
||||||
if (!mysql_real_connect(mysql, hostname, "sha256user", "foo", NULL, port, socketname, 0))
|
if (!my_test_connect(mysql, hostname, "sha256user", "foo", NULL, port, socketname, 0))
|
||||||
{
|
{
|
||||||
diag("error: %s", mysql_error(mysql));
|
diag("error: %s", mysql_error(mysql));
|
||||||
mysql_close(mysql);
|
mysql_close(mysql);
|
||||||
@@ -1119,7 +1134,7 @@ static int test_auth256(MYSQL *my)
|
|||||||
|
|
||||||
mysql= mysql_init(NULL);
|
mysql= mysql_init(NULL);
|
||||||
mysql_options(mysql, MYSQL_SERVER_PUBLIC_KEY, "rsa_public_key.pem");
|
mysql_options(mysql, MYSQL_SERVER_PUBLIC_KEY, "rsa_public_key.pem");
|
||||||
if (!mysql_real_connect(mysql, hostname, "sha256user", "foo", NULL, port, socketname, 0))
|
if (!my_test_connect(mysql, hostname, "sha256user", "foo", NULL, port, socketname, 0))
|
||||||
{
|
{
|
||||||
diag("error: %s", mysql_error(mysql));
|
diag("error: %s", mysql_error(mysql));
|
||||||
mysql_close(mysql);
|
mysql_close(mysql);
|
||||||
@@ -1283,7 +1298,7 @@ static int test_conc276(MYSQL *unused __attribute__((unused)))
|
|||||||
mysql_options(mysql, MYSQL_OPT_SSL_ENFORCE, &val);
|
mysql_options(mysql, MYSQL_OPT_SSL_ENFORCE, &val);
|
||||||
mysql_options(mysql, MYSQL_OPT_RECONNECT, &val);
|
mysql_options(mysql, MYSQL_OPT_RECONNECT, &val);
|
||||||
|
|
||||||
if (!mysql_real_connect(mysql, hostname, username, password, schema, port, socketname, 0))
|
if (!my_test_connect(mysql, hostname, username, password, schema, port, socketname, 0))
|
||||||
{
|
{
|
||||||
diag("Connection failed. Error: %s", mysql_error(mysql));
|
diag("Connection failed. Error: %s", mysql_error(mysql));
|
||||||
mysql_close(mysql);
|
mysql_close(mysql);
|
||||||
@@ -1389,6 +1404,8 @@ static int test_conc317(MYSQL *unused __attribute__((unused)))
|
|||||||
const char *env= getenv("MYSQL_TMP_DIR");
|
const char *env= getenv("MYSQL_TMP_DIR");
|
||||||
char cnf_file1[FN_REFLEN + 1];
|
char cnf_file1[FN_REFLEN + 1];
|
||||||
|
|
||||||
|
SKIP_SKYSQL;
|
||||||
|
|
||||||
if (travis_test)
|
if (travis_test)
|
||||||
return SKIP;
|
return SKIP;
|
||||||
|
|
||||||
@@ -1430,6 +1447,8 @@ static int test_conc327(MYSQL *unused __attribute__((unused)))
|
|||||||
char cnf_file1[FN_REFLEN + 1];
|
char cnf_file1[FN_REFLEN + 1];
|
||||||
char cnf_file2[FN_REFLEN + 1];
|
char cnf_file2[FN_REFLEN + 1];
|
||||||
|
|
||||||
|
SKIP_SKYSQL;
|
||||||
|
|
||||||
if (travis_test)
|
if (travis_test)
|
||||||
return SKIP;
|
return SKIP;
|
||||||
|
|
||||||
@@ -1587,7 +1606,7 @@ static int test_conc312(MYSQL *my)
|
|||||||
check_mysql_rc(rc, my);
|
check_mysql_rc(rc, my);
|
||||||
|
|
||||||
mysql= mysql_init(NULL);
|
mysql= mysql_init(NULL);
|
||||||
if (!mysql_real_connect(mysql, hostname, "foo", "foo", schema, port, socketname, 0))
|
if (!my_test_connect(mysql, hostname, "foo", "foo", schema, port, socketname, 0))
|
||||||
{
|
{
|
||||||
diag("Error: %s", mysql_error(mysql));
|
diag("Error: %s", mysql_error(mysql));
|
||||||
return FAIL;
|
return FAIL;
|
||||||
@@ -1608,6 +1627,8 @@ static int test_conc366(MYSQL *mysql)
|
|||||||
int rc;
|
int rc;
|
||||||
MYSQL *my;
|
MYSQL *my;
|
||||||
|
|
||||||
|
SKIP_SKYSQL;
|
||||||
|
|
||||||
if (!is_mariadb)
|
if (!is_mariadb)
|
||||||
{
|
{
|
||||||
diag("feature not supported by MySQL server");
|
diag("feature not supported by MySQL server");
|
||||||
@@ -1640,7 +1661,7 @@ static int test_conc366(MYSQL *mysql)
|
|||||||
my= mysql_init(NULL);
|
my= mysql_init(NULL);
|
||||||
if (plugindir)
|
if (plugindir)
|
||||||
mysql_options(my, MYSQL_PLUGIN_DIR, plugindir);
|
mysql_options(my, MYSQL_PLUGIN_DIR, plugindir);
|
||||||
if (!mysql_real_connect(my, hostname, "ede", "foo", schema, port, socketname, 0))
|
if (!my_test_connect(my, hostname, "ede", "foo", schema, port, socketname, 0))
|
||||||
{
|
{
|
||||||
diag("Error: %s", mysql_error(my));
|
diag("Error: %s", mysql_error(my));
|
||||||
return FAIL;
|
return FAIL;
|
||||||
@@ -1697,7 +1718,7 @@ static int test_conc443(MYSQL *my __attribute__((unused)))
|
|||||||
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);
|
||||||
|
|
||||||
if (!mysql_real_connect(mysql, hostname, username, password, schema, port, socketname, CLIENT_REMEMBER_OPTIONS))
|
if (!my_test_connect(mysql, hostname, username, password, schema, port, socketname, CLIENT_REMEMBER_OPTIONS))
|
||||||
{
|
{
|
||||||
diag("Connection failed. Error: %s", mysql_error(mysql));
|
diag("Connection failed. Error: %s", mysql_error(mysql));
|
||||||
mysql_close(mysql);
|
mysql_close(mysql);
|
||||||
@@ -1740,7 +1761,7 @@ static int test_default_auth(MYSQL *my __attribute__((unused)))
|
|||||||
mysql= mysql_init(NULL);
|
mysql= mysql_init(NULL);
|
||||||
mysql_options(mysql, MYSQL_DEFAULT_AUTH, "mysql_clear_password");
|
mysql_options(mysql, MYSQL_DEFAULT_AUTH, "mysql_clear_password");
|
||||||
|
|
||||||
if (!mysql_real_connect(mysql, hostname, username, password, schema, port, socketname, CLIENT_REMEMBER_OPTIONS))
|
if (!my_test_connect(mysql, hostname, username, password, schema, port, socketname, CLIENT_REMEMBER_OPTIONS))
|
||||||
{
|
{
|
||||||
diag("Connection failed. Error: %s", mysql_error(mysql));
|
diag("Connection failed. Error: %s", mysql_error(mysql));
|
||||||
mysql_close(mysql);
|
mysql_close(mysql);
|
||||||
@@ -1751,7 +1772,7 @@ static int test_default_auth(MYSQL *my __attribute__((unused)))
|
|||||||
mysql= mysql_init(NULL);
|
mysql= mysql_init(NULL);
|
||||||
mysql_options(mysql, MYSQL_DEFAULT_AUTH, "caching_sha2_password");
|
mysql_options(mysql, MYSQL_DEFAULT_AUTH, "caching_sha2_password");
|
||||||
|
|
||||||
if (!mysql_real_connect(mysql, hostname, username, password, schema, port, socketname, CLIENT_REMEMBER_OPTIONS))
|
if (!my_test_connect(mysql, hostname, username, password, schema, port, socketname, CLIENT_REMEMBER_OPTIONS))
|
||||||
{
|
{
|
||||||
diag("Connection failed. Error: %s", mysql_error(mysql));
|
diag("Connection failed. Error: %s", mysql_error(mysql));
|
||||||
mysql_close(mysql);
|
mysql_close(mysql);
|
||||||
|
@@ -38,6 +38,8 @@ static int test_bug28075(MYSQL *mysql)
|
|||||||
{
|
{
|
||||||
int rc;
|
int rc;
|
||||||
|
|
||||||
|
SKIP_SKYSQL;
|
||||||
|
|
||||||
rc= mysql_dump_debug_info(mysql);
|
rc= mysql_dump_debug_info(mysql);
|
||||||
check_mysql_rc(rc, mysql);
|
check_mysql_rc(rc, mysql);
|
||||||
|
|
||||||
@@ -768,6 +770,8 @@ static int test_bug49694(MYSQL *mysql)
|
|||||||
int i;
|
int i;
|
||||||
FILE *fp;
|
FILE *fp;
|
||||||
|
|
||||||
|
SKIP_SKYSQL;
|
||||||
|
|
||||||
rc= mysql_query(mysql, "DROP TABLE IF EXISTS enclist");
|
rc= mysql_query(mysql, "DROP TABLE IF EXISTS enclist");
|
||||||
check_mysql_rc(rc, mysql);
|
check_mysql_rc(rc, mysql);
|
||||||
|
|
||||||
@@ -805,7 +809,10 @@ static int test_conc49(MYSQL *mysql)
|
|||||||
int rc;
|
int rc;
|
||||||
MYSQL_RES *res;
|
MYSQL_RES *res;
|
||||||
int i;
|
int i;
|
||||||
FILE *fp= fopen("./sample.csv", "w");
|
FILE *fp;
|
||||||
|
|
||||||
|
SKIP_SKYSQL;
|
||||||
|
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);
|
||||||
fclose(fp);
|
fclose(fp);
|
||||||
@@ -1014,6 +1021,7 @@ void *remote_plugin;
|
|||||||
static int test_remote1(MYSQL *mysql)
|
static int test_remote1(MYSQL *mysql)
|
||||||
{
|
{
|
||||||
int rc;
|
int rc;
|
||||||
|
SKIP_SKYSQL;
|
||||||
|
|
||||||
remote_plugin= (void *)mysql_client_find_plugin(mysql, "remote_io", MARIADB_CLIENT_REMOTEIO_PLUGIN);
|
remote_plugin= (void *)mysql_client_find_plugin(mysql, "remote_io", MARIADB_CLIENT_REMOTEIO_PLUGIN);
|
||||||
if (!remote_plugin)
|
if (!remote_plugin)
|
||||||
@@ -1069,6 +1077,7 @@ static int test_mdev12965(MYSQL *unused __attribute__((unused)))
|
|||||||
const char *env= getenv("MYSQL_TMP_DIR");
|
const char *env= getenv("MYSQL_TMP_DIR");
|
||||||
char cnf_file1[FN_REFLEN + 1];
|
char cnf_file1[FN_REFLEN + 1];
|
||||||
|
|
||||||
|
SKIP_SKYSQL;
|
||||||
if (travis_test)
|
if (travis_test)
|
||||||
return SKIP;
|
return SKIP;
|
||||||
|
|
||||||
@@ -1353,6 +1362,7 @@ static int test_conc395(MYSQL *unused __attribute__((unused)))
|
|||||||
const char *env= getenv("MYSQL_TMP_DIR");
|
const char *env= getenv("MYSQL_TMP_DIR");
|
||||||
char cnf_file1[FN_REFLEN + 1];
|
char cnf_file1[FN_REFLEN + 1];
|
||||||
|
|
||||||
|
SKIP_SKYSQL;
|
||||||
if (travis_test)
|
if (travis_test)
|
||||||
return SKIP;
|
return SKIP;
|
||||||
|
|
||||||
@@ -1391,6 +1401,8 @@ static int test_sslenforce(MYSQL *unused __attribute__((unused)))
|
|||||||
const char *env= getenv("MYSQL_TMP_DIR");
|
const char *env= getenv("MYSQL_TMP_DIR");
|
||||||
char cnf_file1[FN_REFLEN + 1];
|
char cnf_file1[FN_REFLEN + 1];
|
||||||
|
|
||||||
|
SKIP_SKYSQL;
|
||||||
|
|
||||||
if (travis_test)
|
if (travis_test)
|
||||||
return SKIP;
|
return SKIP;
|
||||||
|
|
||||||
@@ -1400,10 +1412,6 @@ static int test_sslenforce(MYSQL *unused __attribute__((unused)))
|
|||||||
|
|
||||||
snprintf(cnf_file1, FN_REFLEN, "%s%c.my.cnf", env, FN_LIBCHAR);
|
snprintf(cnf_file1, FN_REFLEN, "%s%c.my.cnf", env, FN_LIBCHAR);
|
||||||
|
|
||||||
if (travis_test)
|
|
||||||
return SKIP;
|
|
||||||
|
|
||||||
|
|
||||||
FAIL_IF(!access(cnf_file1, R_OK), "access");
|
FAIL_IF(!access(cnf_file1, R_OK), "access");
|
||||||
|
|
||||||
mysql= mysql_init(NULL);
|
mysql= mysql_init(NULL);
|
||||||
|
@@ -55,6 +55,14 @@ with this program; if not, write to the Free Software Foundation, Inc.,
|
|||||||
# define TRUE 1
|
# define TRUE 1
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#define IS_SKYSQL(a) ((a) && strstr((a), "db.skysql.net"))
|
||||||
|
#define SKIP_SKYSQL \
|
||||||
|
if (IS_SKYSQL(hostname)) \
|
||||||
|
{ \
|
||||||
|
diag("Not supported by SkySQL"); \
|
||||||
|
return SKIP; \
|
||||||
|
}
|
||||||
|
|
||||||
#define MAX_KEY MAX_INDEXES
|
#define MAX_KEY MAX_INDEXES
|
||||||
#define MAX_KEY_LENGTH_DECIMAL_WIDTH 4 /* strlen("4096") */
|
#define MAX_KEY_LENGTH_DECIMAL_WIDTH 4 /* strlen("4096") */
|
||||||
|
|
||||||
@@ -524,6 +532,8 @@ void get_envvars() {
|
|||||||
|
|
||||||
if (!hostname && (envvar= getenv("MYSQL_TEST_HOST")))
|
if (!hostname && (envvar= getenv("MYSQL_TEST_HOST")))
|
||||||
hostname= envvar;
|
hostname= envvar;
|
||||||
|
|
||||||
|
|
||||||
if (!username)
|
if (!username)
|
||||||
{
|
{
|
||||||
if ((envvar= getenv("MYSQL_TEST_USER")))
|
if ((envvar= getenv("MYSQL_TEST_USER")))
|
||||||
|
@@ -3729,6 +3729,8 @@ static int test_nstmts(MYSQL *mysql)
|
|||||||
static uint i, total_stmts= 2000;
|
static uint i, total_stmts= 2000;
|
||||||
MYSQL_BIND my_bind[1];
|
MYSQL_BIND my_bind[1];
|
||||||
|
|
||||||
|
SKIP_SKYSQL;
|
||||||
|
|
||||||
mysql_autocommit(mysql, TRUE);
|
mysql_autocommit(mysql, TRUE);
|
||||||
|
|
||||||
rc= mysql_query(mysql, "DROP TABLE IF EXISTS test_nstmts");
|
rc= mysql_query(mysql, "DROP TABLE IF EXISTS test_nstmts");
|
||||||
|
@@ -2928,6 +2928,8 @@ static int test_bug6059(MYSQL *mysql)
|
|||||||
const char *stmt_text;
|
const char *stmt_text;
|
||||||
int rc;
|
int rc;
|
||||||
|
|
||||||
|
SKIP_SKYSQL;
|
||||||
|
|
||||||
stmt_text= "SELECT 'foo' INTO OUTFILE 'x.3'";
|
stmt_text= "SELECT 'foo' INTO OUTFILE 'x.3'";
|
||||||
|
|
||||||
stmt= mysql_stmt_init(mysql);
|
stmt= mysql_stmt_init(mysql);
|
||||||
|
Reference in New Issue
Block a user