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
Fixed compiler warnings
removed latest test for ssl threads (test.c)
This commit is contained in:
@@ -867,7 +867,7 @@ void ps_fetch_datetime(MYSQL_BIND *r_param, const MYSQL_FIELD * field,
|
|||||||
if (field->decimals && field->decimals <= 6)
|
if (field->decimals && field->decimals <= 6)
|
||||||
{
|
{
|
||||||
char ms[8];
|
char ms[8];
|
||||||
sprintf(ms, ".%06u", tm.second_part);
|
sprintf(ms, ".%06lu", tm.second_part);
|
||||||
if (field->decimals < 6)
|
if (field->decimals < 6)
|
||||||
ms[field->decimals + 1]= 0;
|
ms[field->decimals + 1]= 0;
|
||||||
length+= strlen(ms);
|
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)
|
if (field->decimals && field->decimals <= 6)
|
||||||
{
|
{
|
||||||
char ms[8];
|
char ms[8];
|
||||||
sprintf(ms, ".%06u", tm.second_part);
|
sprintf(ms, ".%06lu", tm.second_part);
|
||||||
if (field->decimals < 6)
|
if (field->decimals < 6)
|
||||||
ms[field->decimals + 1]= 0;
|
ms[field->decimals + 1]= 0;
|
||||||
length+= strlen(ms);
|
length+= strlen(ms);
|
||||||
|
@@ -70,7 +70,7 @@ static void ma_tls_set_error(MYSQL *mysql)
|
|||||||
0, ssl_error_reason);
|
0, ssl_error_reason);
|
||||||
return;
|
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);
|
pvio->set_error(mysql, CR_SSL_CONNECTION_ERROR, SQLSTATE_UNKNOWN, 0, ssl_error);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@@ -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 pvio_socket_shutdown(MARIADB_PVIO *pvio)
|
||||||
{
|
{
|
||||||
int rc = 0;
|
|
||||||
if (pvio && pvio->data)
|
if (pvio && pvio->data)
|
||||||
{
|
{
|
||||||
my_socket s = ((struct st_pvio_socket *)pvio->data)->socket;
|
my_socket s = ((struct st_pvio_socket *)pvio->data)->socket;
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
rc = shutdown(s, SD_BOTH);
|
shutdown(s, SD_BOTH);
|
||||||
CancelIoEx((HANDLE)s, NULL);
|
CancelIoEx((HANDLE)s, NULL);
|
||||||
#else
|
#else
|
||||||
rc = shutdown(s, SHUT_RDWR);
|
shutdown(s, SHUT_RDWR);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
return -1;
|
return -1;
|
||||||
|
@@ -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)
|
static void dump_command(TRACE_INFO *info, my_bool is_error)
|
||||||
{
|
{
|
||||||
size_t i;
|
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++)
|
for (i= 0; info->command && i < strlen(info->command); i++)
|
||||||
if (info->command[i] == '\n')
|
if (info->command[i] == '\n')
|
||||||
printf("\\n");
|
printf("\\n");
|
||||||
@@ -360,11 +360,11 @@ void trace_callback(int mode, MYSQL *mysql, const uchar *buffer, size_t length)
|
|||||||
info->refid= uint4korr(p);
|
info->refid= uint4korr(p);
|
||||||
break;
|
break;
|
||||||
case COM_QUIT:
|
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);
|
delete_trace_info(info->thread_id);
|
||||||
break;
|
break;
|
||||||
case COM_PING:
|
case COM_PING:
|
||||||
printf("%8d: COM_PING\n", info->thread_id);
|
printf("%8lu: COM_PING\n", info->thread_id);
|
||||||
break;
|
break;
|
||||||
case COM_STMT_EXECUTE:
|
case COM_STMT_EXECUTE:
|
||||||
case COM_STMT_RESET:
|
case COM_STMT_RESET:
|
||||||
@@ -376,7 +376,7 @@ void trace_callback(int mode, MYSQL *mysql, const uchar *buffer, size_t length)
|
|||||||
default:
|
default:
|
||||||
if (info->local_infile == 1)
|
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)
|
if (len)
|
||||||
printf("sent %d bytes\n", len);
|
printf("sent %d bytes\n", len);
|
||||||
else
|
else
|
||||||
@@ -432,7 +432,7 @@ void trace_callback(int mode, MYSQL *mysql, const uchar *buffer, size_t length)
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case COM_STMT_PREPARE:
|
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)
|
if (!*p)
|
||||||
{
|
{
|
||||||
unsigned long stmt_id= uint4korr(p+1);
|
unsigned long stmt_id= uint4korr(p+1);
|
||||||
|
@@ -70,8 +70,6 @@ ENDIF()
|
|||||||
|
|
||||||
ADD_LIBRARY(ma_getopt ma_getopt.c)
|
ADD_LIBRARY(ma_getopt ma_getopt.c)
|
||||||
|
|
||||||
ADD_EXECUTABLE(my_test test.c)
|
|
||||||
TARGET_LINK_LIBRARIES(my_test mariadbclient)
|
|
||||||
FOREACH(API_TEST ${API_TESTS})
|
FOREACH(API_TEST ${API_TESTS})
|
||||||
ADD_EXECUTABLE(${API_TEST} ${API_TEST}.c)
|
ADD_EXECUTABLE(${API_TEST} ${API_TEST}.c)
|
||||||
TARGET_LINK_LIBRARIES(${API_TEST} mytap ma_getopt mariadbclient)
|
TARGET_LINK_LIBRARIES(${API_TEST} mytap ma_getopt mariadbclient)
|
||||||
|
@@ -62,7 +62,7 @@ static int test_conc75(MYSQL *my)
|
|||||||
mysql_ping(mysql);
|
mysql_ping(mysql);
|
||||||
rc= mysql_query(mysql, "load data local infile './nonexistingfile.csv' into table a (`a`)");
|
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");
|
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");
|
FAIL_IF(thread_id == mysql_thread_id(mysql), "new thread id expected");
|
||||||
//diag("cs: %s", mysql->charset->csname);
|
//diag("cs: %s", mysql->charset->csname);
|
||||||
//FAIL_IF(strcmp(mysql->charset->csname, "utf8"), "wrong character set");
|
//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
|
according to the manual, this might be 20 or 300, but it looks like
|
||||||
auto_increment column takes priority over last_insert_id().
|
auto_increment column takes priority over last_insert_id().
|
||||||
*/
|
*/
|
||||||
diag("res: %d", res);
|
diag("res: %ld", res);
|
||||||
FAIL_UNLESS(res == 20, "");
|
FAIL_UNLESS(res == 20, "");
|
||||||
/* If first autogenerated number fails and 2nd works: */
|
/* If first autogenerated number fails and 2nd works: */
|
||||||
rc= mysql_query(mysql, "drop table t2");
|
rc= mysql_query(mysql, "drop table t2");
|
||||||
|
Reference in New Issue
Block a user