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

Fixed compiler warnings

removed latest test for ssl threads (test.c)
This commit is contained in:
Georg Richter
2016-06-29 15:22:01 +02:00
parent 26d31929d4
commit 45a635dead
6 changed files with 12 additions and 15 deletions

View File

@@ -867,7 +867,7 @@ void ps_fetch_datetime(MYSQL_BIND *r_param, const MYSQL_FIELD * field,
if (field->decimals && field->decimals <= 6)
{
char ms[8];
sprintf(ms, ".%06u", tm.second_part);
sprintf(ms, ".%06lu", tm.second_part);
if (field->decimals < 6)
ms[field->decimals + 1]= 0;
length+= strlen(ms);
@@ -880,7 +880,7 @@ void ps_fetch_datetime(MYSQL_BIND *r_param, const MYSQL_FIELD * field,
if (field->decimals && field->decimals <= 6)
{
char ms[8];
sprintf(ms, ".%06u", tm.second_part);
sprintf(ms, ".%06lu", tm.second_part);
if (field->decimals < 6)
ms[field->decimals + 1]= 0;
length+= strlen(ms);

View File

@@ -70,7 +70,7 @@ static void ma_tls_set_error(MYSQL *mysql)
0, ssl_error_reason);
return;
}
snprintf(ssl_error, MAX_SSL_ERR_LEN, "SSL errno=%lu", ssl_errno, mysql->charset);
snprintf(ssl_error, MAX_SSL_ERR_LEN, "SSL errno=%lu", ssl_errno);
pvio->set_error(mysql, CR_SSL_CONNECTION_ERROR, SQLSTATE_UNKNOWN, 0, ssl_error);
return;
}

View File

@@ -1028,15 +1028,14 @@ my_bool pvio_socket_has_data(MARIADB_PVIO *pvio, ssize_t *data_len)
int pvio_socket_shutdown(MARIADB_PVIO *pvio)
{
int rc = 0;
if (pvio && pvio->data)
{
my_socket s = ((struct st_pvio_socket *)pvio->data)->socket;
#ifdef _WIN32
rc = shutdown(s, SD_BOTH);
shutdown(s, SD_BOTH);
CancelIoEx((HANDLE)s, NULL);
#else
rc = shutdown(s, SHUT_RDWR);
shutdown(s, SHUT_RDWR);
#endif
}
return -1;

View File

@@ -254,7 +254,7 @@ static void dump_reference(TRACE_INFO *info, my_bool is_error)
static void dump_command(TRACE_INFO *info, my_bool is_error)
{
size_t i;
printf("%8d: %s(", info->thread_id, commands[info->last_command]);
printf("%8lu: %s(", info->thread_id, commands[info->last_command]);
for (i= 0; info->command && i < strlen(info->command); i++)
if (info->command[i] == '\n')
printf("\\n");
@@ -360,11 +360,11 @@ void trace_callback(int mode, MYSQL *mysql, const uchar *buffer, size_t length)
info->refid= uint4korr(p);
break;
case COM_QUIT:
printf("%8d: COM_QUIT\n", info->thread_id);
printf("%8lu: COM_QUIT\n", info->thread_id);
delete_trace_info(info->thread_id);
break;
case COM_PING:
printf("%8d: COM_PING\n", info->thread_id);
printf("%8lu: COM_PING\n", info->thread_id);
break;
case COM_STMT_EXECUTE:
case COM_STMT_RESET:
@@ -376,7 +376,7 @@ void trace_callback(int mode, MYSQL *mysql, const uchar *buffer, size_t length)
default:
if (info->local_infile == 1)
{
printf("%8d: SEND_LOCAL_INFILE(%s) ", info->thread_id, info->filename);
printf("%8lu: SEND_LOCAL_INFILE(%s) ", info->thread_id, info->filename);
if (len)
printf("sent %d bytes\n", len);
else
@@ -432,7 +432,7 @@ void trace_callback(int mode, MYSQL *mysql, const uchar *buffer, size_t length)
}
break;
case COM_STMT_PREPARE:
printf("%8d: COM_STMT_PREPARE(%s) ", info->thread_id, info->command);
printf("%8lu: COM_STMT_PREPARE(%s) ", info->thread_id, info->command);
if (!*p)
{
unsigned long stmt_id= uint4korr(p+1);

View File

@@ -70,8 +70,6 @@ ENDIF()
ADD_LIBRARY(ma_getopt ma_getopt.c)
ADD_EXECUTABLE(my_test test.c)
TARGET_LINK_LIBRARIES(my_test mariadbclient)
FOREACH(API_TEST ${API_TESTS})
ADD_EXECUTABLE(${API_TEST} ${API_TEST}.c)
TARGET_LINK_LIBRARIES(${API_TEST} mytap ma_getopt mariadbclient)

View File

@@ -62,7 +62,7 @@ static int test_conc75(MYSQL *my)
mysql_ping(mysql);
rc= mysql_query(mysql, "load data local infile './nonexistingfile.csv' into table a (`a`)");
FAIL_IF(!test(mysql->options.client_flag | CLIENT_LOCAL_FILES), "client_flags not correct");
diag("thread1: %d %d", thread_id, mysql_thread_id(mysql));
diag("thread1: %ld %ld", thread_id, mysql_thread_id(mysql));
FAIL_IF(thread_id == mysql_thread_id(mysql), "new thread id expected");
//diag("cs: %s", mysql->charset->csname);
//FAIL_IF(strcmp(mysql->charset->csname, "utf8"), "wrong character set");
@@ -534,7 +534,7 @@ static int test_mysql_insert_id(MYSQL *mysql)
according to the manual, this might be 20 or 300, but it looks like
auto_increment column takes priority over last_insert_id().
*/
diag("res: %d", res);
diag("res: %ld", res);
FAIL_UNLESS(res == 20, "");
/* If first autogenerated number fails and 2nd works: */
rc= mysql_query(mysql, "drop table t2");