1
0
mirror of https://github.com/mariadb-corporation/mariadb-connector-c.git synced 2025-08-08 14:02:17 +03:00

Fixed compiler warnings

This commit is contained in:
holzboote@googlemail.com
2013-07-01 05:27:17 +02:00
parent dc16f2d32e
commit 7fd247bb3b
8 changed files with 19 additions and 18 deletions

View File

@@ -495,7 +495,7 @@ static int test_reconnect_maxpackage(MYSQL *my)
res= mysql_store_result(mysql);
row= mysql_fetch_row(res);
max_packet= atol(row[0]);
diag("max_allowed_packet=%d", max_packet);
diag("max_allowed_packet=%lu", max_packet);
mysql_free_result(res);
query= (char *)malloc(max_packet + 30);
@@ -522,7 +522,7 @@ static int test_reconnect_maxpackage(MYSQL *my)
res= mysql_store_result(mysql);
row= mysql_fetch_row(res);
max_packet= atol(row[0]);
diag("max_allowed_packet=%d", max_packet);
diag("max_allowed_packet=%lu", max_packet);
mysql_free_result(res);
@@ -535,7 +535,6 @@ static int test_compressed(MYSQL *my)
int rc;
MYSQL *mysql= mysql_init(NULL);
MYSQL_RES *res;
char *query;
mysql_options(mysql, MYSQL_OPT_COMPRESS, (void *)1);
FAIL_IF(!mysql_real_connect(mysql, hostname, username, password, schema,

View File

@@ -520,12 +520,12 @@ static int test_reconnect(MYSQL *mysql)
FAIL_UNLESS(mysql1->reconnect == 1, "reconnect != 1");
diag("Thread_id before kill: %d", mysql_thread_id(mysql1));
diag("Thread_id before kill: %lu", mysql_thread_id(mysql1));
mysql_kill(mysql, mysql_thread_id(mysql1));
rc= mysql_query(mysql1, "SELECT 1 FROM DUAL LIMIT 0");
check_mysql_rc(rc, mysql1);
diag("Thread_id after kill: %d", mysql_thread_id(mysql1));
diag("Thread_id after kill: %lu", mysql_thread_id(mysql1));
FAIL_UNLESS(mysql1->reconnect == 1, "reconnect != 1");
mysql_close(mysql1);

View File

@@ -479,7 +479,7 @@ void run_tests(struct my_tests_st *test) {
if (!mysql_default && (test[i].connection & TEST_CONNECTION_DEFAULT))
{
diag("MySQL server not running");
skip(1, test[i].name);
skip(1, "%s", test[i].name);
} else if (!test[i].skipmsg) {
mysql= mysql_default;
if (test[i].connection & TEST_CONNECTION_NEW)
@@ -491,9 +491,9 @@ void run_tests(struct my_tests_st *test) {
rc= test[i].function(mysql);
if (rc == SKIP)
skip(1, test[i].name);
skip(1, "%s", test[i].name);
else
ok(rc == OK, test[i].name);
ok(rc == OK, "%s", test[i].name);
/* if test failed, close and reopen default connection to prevent
errors for further tests */
@@ -509,7 +509,7 @@ void run_tests(struct my_tests_st *test) {
else if (mysql && !(test[i].connection & TEST_CONNECTION_DONT_CLOSE))
mysql_close(mysql);
} else {
skip(1, test[i].skipmsg);
skip(1, "%s", test[i].skipmsg);
}
}
if (mysql_default) {

View File

@@ -4733,7 +4733,9 @@ int test_notrunc(MYSQL *mysql)
my_bool trunc= 1;
MYSQL_BIND bind[1];
char buffer[5];
int rc, len= 1, error= 0;
int rc;
my_bool error= 0;
unsigned long len= 1;
char *query= "SELECT '1234567890' FROM DUAL";
@@ -4759,7 +4761,7 @@ int test_notrunc(MYSQL *mysql)
mysql_stmt_store_result(stmt);
rc= mysql_stmt_fetch(stmt);
diag("rc= %d len=%d", rc, len);
diag("rc= %d len=%lu", rc, len);
mysql_stmt_close(stmt);
return OK;

View File

@@ -376,7 +376,7 @@ int test_sp_reset2(MYSQL *mysql)
while (rc != MYSQL_NO_DATA)
{
rc= mysql_stmt_fetch(stmt);
diag("l=%d", l[0]);
diag("l=%ld", l[0]);
}
rc= mysql_stmt_next_result(stmt);
@@ -389,7 +389,7 @@ int test_sp_reset2(MYSQL *mysql)
while (rc != MYSQL_NO_DATA)
{
rc= mysql_stmt_fetch(stmt);
diag("l=%d l=%d", l[0], l[1]);
diag("l=%ld l=%ld", l[0], l[1]);
}
@@ -403,7 +403,7 @@ int test_sp_reset2(MYSQL *mysql)
while (rc != MYSQL_NO_DATA)
{
rc= mysql_stmt_fetch(stmt);
diag("l=%d l=%d l=%d", l[0], l[1], l[2]);
diag("l=%ld l=%ld l=%ld", l[0], l[1], l[2]);
}
rc= mysql_stmt_close(stmt);

View File

@@ -4,6 +4,7 @@
#include "my_test.h"
#ifdef HAVE_SQLITE
static int test1(MYSQL *mysql)
{
MYSQL_ROW row;
@@ -20,7 +21,7 @@ static int test1(MYSQL *mysql)
diag("Server name: %s", mysql_get_server_name(my));
diag("Connected to: %s (%d)", mysql_get_server_info(my), mysql_get_server_version(my));
diag("Connected to: %s (%lu)", mysql_get_server_info(my), mysql_get_server_version(my));
rc= mysql_query(my, "CREATE TABLE t1 (a int, b varchar(255))");
rc= mysql_query(my, "DELETE FROM t1");
@@ -168,6 +169,7 @@ static int test_simple_prepare(MYSQL *my)
return OK;
}
#endif
struct my_tests_st my_tests[] = {