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
Fix for CONC-252:
All functions which are supported by libmysql use now unsigned long as length parameter instead of size_t
This commit is contained in:
@@ -637,7 +637,7 @@ int STDCALL mysql_send_query_start(int *ret, MYSQL *mysql,
|
|||||||
int STDCALL mysql_send_query_cont(int *ret, MYSQL *mysql, int status);
|
int STDCALL mysql_send_query_cont(int *ret, MYSQL *mysql, int status);
|
||||||
int STDCALL mysql_real_query_start(int *ret, MYSQL *mysql,
|
int STDCALL mysql_real_query_start(int *ret, MYSQL *mysql,
|
||||||
const char *q,
|
const char *q,
|
||||||
size_t length);
|
unsigned long length);
|
||||||
int STDCALL mysql_real_query_cont(int *ret, MYSQL *mysql,
|
int STDCALL mysql_real_query_cont(int *ret, MYSQL *mysql,
|
||||||
int status);
|
int status);
|
||||||
int STDCALL mysql_store_result_start(MYSQL_RES **ret, MYSQL *mysql);
|
int STDCALL mysql_store_result_start(MYSQL_RES **ret, MYSQL *mysql);
|
||||||
@@ -678,7 +678,7 @@ int STDCALL mysql_reset_connection_start(int *ret, MYSQL *mysql);
|
|||||||
int STDCALL mysql_reset_connection_cont(int *ret, MYSQL *mysql, int status);
|
int STDCALL mysql_reset_connection_cont(int *ret, MYSQL *mysql, int status);
|
||||||
int STDCALL mysql_session_track_get_next(MYSQL *mysql, enum enum_session_state_type type, const char **data, size_t *length);
|
int STDCALL mysql_session_track_get_next(MYSQL *mysql, enum enum_session_state_type type, const char **data, size_t *length);
|
||||||
int STDCALL mysql_session_track_get_first(MYSQL *mysql, enum enum_session_state_type type, const char **data, size_t *length);
|
int STDCALL mysql_session_track_get_first(MYSQL *mysql, enum enum_session_state_type type, const char **data, size_t *length);
|
||||||
int STDCALL mysql_stmt_prepare_start(int *ret, MYSQL_STMT *stmt,const char *query, size_t length);
|
int STDCALL mysql_stmt_prepare_start(int *ret, MYSQL_STMT *stmt,const char *query, unsigned long length);
|
||||||
int STDCALL mysql_stmt_prepare_cont(int *ret, MYSQL_STMT *stmt, int status);
|
int STDCALL mysql_stmt_prepare_cont(int *ret, MYSQL_STMT *stmt, int status);
|
||||||
int STDCALL mysql_stmt_execute_start(int *ret, MYSQL_STMT *stmt);
|
int STDCALL mysql_stmt_execute_start(int *ret, MYSQL_STMT *stmt);
|
||||||
int STDCALL mysql_stmt_execute_cont(int *ret, MYSQL_STMT *stmt, int status);
|
int STDCALL mysql_stmt_execute_cont(int *ret, MYSQL_STMT *stmt, int status);
|
||||||
@@ -696,7 +696,7 @@ int STDCALL mysql_stmt_free_result_cont(my_bool *ret, MYSQL_STMT *stmt,
|
|||||||
int STDCALL mysql_stmt_send_long_data_start(my_bool *ret, MYSQL_STMT *stmt,
|
int STDCALL mysql_stmt_send_long_data_start(my_bool *ret, MYSQL_STMT *stmt,
|
||||||
unsigned int param_number,
|
unsigned int param_number,
|
||||||
const char *data,
|
const char *data,
|
||||||
size_t len);
|
unsigned long len);
|
||||||
int STDCALL mysql_stmt_send_long_data_cont(my_bool *ret, MYSQL_STMT *stmt,
|
int STDCALL mysql_stmt_send_long_data_cont(my_bool *ret, MYSQL_STMT *stmt,
|
||||||
int status);
|
int status);
|
||||||
int STDCALL mysql_reset_connection(MYSQL *mysql);
|
int STDCALL mysql_reset_connection(MYSQL *mysql);
|
||||||
@@ -735,9 +735,9 @@ struct st_mariadb_api {
|
|||||||
void (STDCALL *mysql_close)(MYSQL *sock);
|
void (STDCALL *mysql_close)(MYSQL *sock);
|
||||||
int (STDCALL *mysql_select_db)(MYSQL *mysql, const char *db);
|
int (STDCALL *mysql_select_db)(MYSQL *mysql, const char *db);
|
||||||
int (STDCALL *mysql_query)(MYSQL *mysql, const char *q);
|
int (STDCALL *mysql_query)(MYSQL *mysql, const char *q);
|
||||||
int (STDCALL *mysql_send_query)(MYSQL *mysql, const char *q, size_t length);
|
int (STDCALL *mysql_send_query)(MYSQL *mysql, const char *q, unsigned long length);
|
||||||
my_bool (STDCALL *mysql_read_query_result)(MYSQL *mysql);
|
my_bool (STDCALL *mysql_read_query_result)(MYSQL *mysql);
|
||||||
int (STDCALL *mysql_real_query)(MYSQL *mysql, const char *q, size_t length);
|
int (STDCALL *mysql_real_query)(MYSQL *mysql, const char *q, unsigned long length);
|
||||||
int (STDCALL *mysql_shutdown)(MYSQL *mysql, enum mysql_enum_shutdown_level shutdown_level);
|
int (STDCALL *mysql_shutdown)(MYSQL *mysql, enum mysql_enum_shutdown_level shutdown_level);
|
||||||
int (STDCALL *mysql_dump_debug_info)(MYSQL *mysql);
|
int (STDCALL *mysql_dump_debug_info)(MYSQL *mysql);
|
||||||
int (STDCALL *mysql_refresh)(MYSQL *mysql, unsigned int refresh_options);
|
int (STDCALL *mysql_refresh)(MYSQL *mysql, unsigned int refresh_options);
|
||||||
@@ -782,13 +782,13 @@ struct st_mariadb_api {
|
|||||||
int (STDCALL *mysql_optionsv)(MYSQL *mysql,enum mysql_option option, ...);
|
int (STDCALL *mysql_optionsv)(MYSQL *mysql,enum mysql_option option, ...);
|
||||||
int (STDCALL *mysql_get_optionv)(MYSQL *mysql, enum mysql_option option, void *arg, ...);
|
int (STDCALL *mysql_get_optionv)(MYSQL *mysql, enum mysql_option option, void *arg, ...);
|
||||||
int (STDCALL *mysql_get_option)(MYSQL *mysql, enum mysql_option option, void *arg);
|
int (STDCALL *mysql_get_option)(MYSQL *mysql, enum mysql_option option, void *arg);
|
||||||
unsigned long (STDCALL *mysql_hex_string)(char *to, const char *from, size_t len);
|
unsigned long (STDCALL *mysql_hex_string)(char *to, const char *from, unsigned long len);
|
||||||
my_socket (STDCALL *mysql_get_socket)(MYSQL *mysql);
|
my_socket (STDCALL *mysql_get_socket)(MYSQL *mysql);
|
||||||
unsigned int (STDCALL *mysql_get_timeout_value)(const MYSQL *mysql);
|
unsigned int (STDCALL *mysql_get_timeout_value)(const MYSQL *mysql);
|
||||||
unsigned int (STDCALL *mysql_get_timeout_value_ms)(const MYSQL *mysql);
|
unsigned int (STDCALL *mysql_get_timeout_value_ms)(const MYSQL *mysql);
|
||||||
my_bool (STDCALL *mariadb_reconnect)(MYSQL *mysql);
|
my_bool (STDCALL *mariadb_reconnect)(MYSQL *mysql);
|
||||||
MYSQL_STMT * (STDCALL *mysql_stmt_init)(MYSQL *mysql);
|
MYSQL_STMT * (STDCALL *mysql_stmt_init)(MYSQL *mysql);
|
||||||
int (STDCALL *mysql_stmt_prepare)(MYSQL_STMT *stmt, const char *query, size_t length);
|
int (STDCALL *mysql_stmt_prepare)(MYSQL_STMT *stmt, const char *query, unsigned long length);
|
||||||
int (STDCALL *mysql_stmt_execute)(MYSQL_STMT *stmt);
|
int (STDCALL *mysql_stmt_execute)(MYSQL_STMT *stmt);
|
||||||
int (STDCALL *mysql_stmt_fetch)(MYSQL_STMT *stmt);
|
int (STDCALL *mysql_stmt_fetch)(MYSQL_STMT *stmt);
|
||||||
int (STDCALL *mysql_stmt_fetch_column)(MYSQL_STMT *stmt, MYSQL_BIND *bind_arg, unsigned int column, unsigned long offset);
|
int (STDCALL *mysql_stmt_fetch_column)(MYSQL_STMT *stmt, MYSQL_BIND *bind_arg, unsigned int column, unsigned long offset);
|
||||||
@@ -801,7 +801,7 @@ struct st_mariadb_api {
|
|||||||
my_bool (STDCALL *mysql_stmt_close)(MYSQL_STMT * stmt);
|
my_bool (STDCALL *mysql_stmt_close)(MYSQL_STMT * stmt);
|
||||||
my_bool (STDCALL *mysql_stmt_reset)(MYSQL_STMT * stmt);
|
my_bool (STDCALL *mysql_stmt_reset)(MYSQL_STMT * stmt);
|
||||||
my_bool (STDCALL *mysql_stmt_free_result)(MYSQL_STMT *stmt);
|
my_bool (STDCALL *mysql_stmt_free_result)(MYSQL_STMT *stmt);
|
||||||
my_bool (STDCALL *mysql_stmt_send_long_data)(MYSQL_STMT *stmt, unsigned int param_number, const char *data, size_t length);
|
my_bool (STDCALL *mysql_stmt_send_long_data)(MYSQL_STMT *stmt, unsigned int param_number, const char *data, unsigned long length);
|
||||||
MYSQL_RES *(STDCALL *mysql_stmt_result_metadata)(MYSQL_STMT *stmt);
|
MYSQL_RES *(STDCALL *mysql_stmt_result_metadata)(MYSQL_STMT *stmt);
|
||||||
MYSQL_RES *(STDCALL *mysql_stmt_param_metadata)(MYSQL_STMT *stmt);
|
MYSQL_RES *(STDCALL *mysql_stmt_param_metadata)(MYSQL_STMT *stmt);
|
||||||
unsigned int (STDCALL *mysql_stmt_errno)(MYSQL_STMT * stmt);
|
unsigned int (STDCALL *mysql_stmt_errno)(MYSQL_STMT * stmt);
|
||||||
|
@@ -373,7 +373,7 @@ MK_ASYNC_CONT_BODY(
|
|||||||
struct mysql_real_query_params {
|
struct mysql_real_query_params {
|
||||||
MYSQL *mysql;
|
MYSQL *mysql;
|
||||||
const char *stmt_str;
|
const char *stmt_str;
|
||||||
size_t length;
|
unsigned long length;
|
||||||
};
|
};
|
||||||
static void
|
static void
|
||||||
mysql_real_query_start_internal(void *d)
|
mysql_real_query_start_internal(void *d)
|
||||||
@@ -386,7 +386,7 @@ MK_ASYNC_INTERNAL_BODY(
|
|||||||
r_int)
|
r_int)
|
||||||
}
|
}
|
||||||
int STDCALL
|
int STDCALL
|
||||||
mysql_real_query_start(int *ret, MYSQL *mysql, const char *stmt_str, size_t length)
|
mysql_real_query_start(int *ret, MYSQL *mysql, const char *stmt_str, unsigned long length)
|
||||||
{
|
{
|
||||||
int res;
|
int res;
|
||||||
struct mysql_async_context *b;
|
struct mysql_async_context *b;
|
||||||
@@ -557,7 +557,7 @@ MK_ASYNC_CONT_BODY(
|
|||||||
struct mysql_send_query_params {
|
struct mysql_send_query_params {
|
||||||
MYSQL *mysql;
|
MYSQL *mysql;
|
||||||
const char *q;
|
const char *q;
|
||||||
size_t length;
|
unsigned long length;
|
||||||
};
|
};
|
||||||
static void
|
static void
|
||||||
mysql_send_query_start_internal(void *d)
|
mysql_send_query_start_internal(void *d)
|
||||||
@@ -1327,7 +1327,7 @@ MK_ASYNC_CONT_BODY(
|
|||||||
struct mysql_stmt_prepare_params {
|
struct mysql_stmt_prepare_params {
|
||||||
MYSQL_STMT *stmt;
|
MYSQL_STMT *stmt;
|
||||||
const char *query;
|
const char *query;
|
||||||
size_t length;
|
unsigned long length;
|
||||||
};
|
};
|
||||||
static void
|
static void
|
||||||
mysql_stmt_prepare_start_internal(void *d)
|
mysql_stmt_prepare_start_internal(void *d)
|
||||||
@@ -1341,7 +1341,7 @@ MK_ASYNC_INTERNAL_BODY(
|
|||||||
}
|
}
|
||||||
int STDCALL
|
int STDCALL
|
||||||
mysql_stmt_prepare_start(int *ret, MYSQL_STMT *stmt, const char *query,
|
mysql_stmt_prepare_start(int *ret, MYSQL_STMT *stmt, const char *query,
|
||||||
size_t length)
|
unsigned long length)
|
||||||
{
|
{
|
||||||
MK_ASYNC_START_BODY(
|
MK_ASYNC_START_BODY(
|
||||||
mysql_stmt_prepare,
|
mysql_stmt_prepare,
|
||||||
@@ -1630,7 +1630,7 @@ struct mysql_stmt_send_long_data_params {
|
|||||||
MYSQL_STMT *stmt;
|
MYSQL_STMT *stmt;
|
||||||
unsigned int param_number;
|
unsigned int param_number;
|
||||||
const char *data;
|
const char *data;
|
||||||
size_t length;
|
unsigned long length;
|
||||||
};
|
};
|
||||||
static void
|
static void
|
||||||
mysql_stmt_send_long_data_start_internal(void *d)
|
mysql_stmt_send_long_data_start_internal(void *d)
|
||||||
@@ -1645,7 +1645,7 @@ MK_ASYNC_INTERNAL_BODY(
|
|||||||
int STDCALL
|
int STDCALL
|
||||||
mysql_stmt_send_long_data_start(my_bool *ret, MYSQL_STMT *stmt,
|
mysql_stmt_send_long_data_start(my_bool *ret, MYSQL_STMT *stmt,
|
||||||
unsigned int param_number,
|
unsigned int param_number,
|
||||||
const char *data, size_t length)
|
const char *data, unsigned long length)
|
||||||
{
|
{
|
||||||
MK_ASYNC_START_BODY(
|
MK_ASYNC_START_BODY(
|
||||||
mysql_stmt_send_long_data,
|
mysql_stmt_send_long_data,
|
||||||
|
@@ -3586,7 +3586,7 @@ ulong STDCALL mysql_get_client_version(void)
|
|||||||
return MARIADB_VERSION_ID;
|
return MARIADB_VERSION_ID;
|
||||||
}
|
}
|
||||||
|
|
||||||
ulong STDCALL mysql_hex_string(char *to, const char *from, size_t len)
|
ulong STDCALL mysql_hex_string(char *to, const char *from, unsigned long len)
|
||||||
{
|
{
|
||||||
char *start= to;
|
char *start= to;
|
||||||
char hexdigits[]= "0123456789ABCDEF";
|
char hexdigits[]= "0123456789ABCDEF";
|
||||||
|
@@ -2150,7 +2150,7 @@ MYSQL_ROW_OFFSET STDCALL mysql_stmt_row_seek(MYSQL_STMT *stmt, MYSQL_ROW_OFFSET
|
|||||||
}
|
}
|
||||||
|
|
||||||
my_bool STDCALL mysql_stmt_send_long_data(MYSQL_STMT *stmt, uint param_number,
|
my_bool STDCALL mysql_stmt_send_long_data(MYSQL_STMT *stmt, uint param_number,
|
||||||
const char *data, size_t length)
|
const char *data, unsigned long length)
|
||||||
{
|
{
|
||||||
CLEAR_CLIENT_ERROR(stmt->mysql);
|
CLEAR_CLIENT_ERROR(stmt->mysql);
|
||||||
CLEAR_CLIENT_STMT_ERROR(stmt);
|
CLEAR_CLIENT_STMT_ERROR(stmt);
|
||||||
|
Reference in New Issue
Block a user