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
Compiler warning fixes
This commit is contained in:
@@ -109,7 +109,7 @@ SET(CMAKE_C_FLAGS_RELWITHDEBINFO "${CMAKE_C_FLAGS_RELWITHDEBINFO} -DDBUG_OFF")
|
||||
SET(CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO} -DDBUG_OFF")
|
||||
|
||||
IF(CMAKE_COMPILER_IS_GNUCC)
|
||||
SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wunused -Wno-uninitialized")
|
||||
SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wunused -Wno-uninitialized -Wall -Wextra -Wformat-security -Wno-init-self -Wvla -Wwrite-strings -Wdeclaration-after-statement")
|
||||
ENDIF()
|
||||
|
||||
# If the build type isn't specified, set to Relwithdebinfo as default.
|
||||
|
@@ -54,8 +54,8 @@ my_bool _hash_init(HASH *hash,uint default_array_elements, uint key_offset,
|
||||
void (*free_element)(void*), uint flags CALLER_INFO_PROTO);
|
||||
void hash_free(HASH *tree);
|
||||
uchar *hash_element(HASH *hash,uint idx);
|
||||
gptr hash_search(HASH *info,const uchar *key,uint length);
|
||||
gptr hash_next(HASH *info,const uchar *key,uint length);
|
||||
void * hash_search(HASH *info,const uchar *key,uint length);
|
||||
void * hash_next(HASH *info,const uchar *key,uint length);
|
||||
my_bool hash_insert(HASH *info,const uchar *data);
|
||||
my_bool hash_delete(HASH *hash,uchar *record);
|
||||
my_bool hash_update(HASH *hash,uchar *record,uchar *old_key,uint old_key_length);
|
||||
|
@@ -77,7 +77,7 @@ struct st_ma_pvio {
|
||||
MYSQL *mysql;
|
||||
PVIO_METHODS *methods;
|
||||
void (*set_error)(MYSQL *mysql, unsigned int error_nr, const char *sqlstate, const char *format, ...);
|
||||
void (*callback)(MARIADB_PVIO *pvio, my_bool is_read, const char *buffer, size_t length);
|
||||
void (*callback)(MARIADB_PVIO *pvio, my_bool is_read, const uchar *buffer, size_t length);
|
||||
};
|
||||
|
||||
typedef struct st_ma_pvio_cinfo
|
||||
|
@@ -368,12 +368,12 @@ typedef struct st_ma_mem_root {
|
||||
|
||||
/* Prototypes for mysys and my_func functions */
|
||||
|
||||
extern gptr _mymalloc(size_t uSize,const char *sFile,
|
||||
extern void * _mymalloc(size_t uSize,const char *sFile,
|
||||
uint uLine, myf MyFlag);
|
||||
extern gptr _myrealloc(gptr pPtr,size_t uSize,const char *sFile,
|
||||
extern void * _myrealloc(void * pPtr,size_t uSize,const char *sFile,
|
||||
uint uLine, myf MyFlag);
|
||||
extern void *ma_multi_malloc(myf MyFlags, ...);
|
||||
extern void _myfree(gptr pPtr,const char *sFile,uint uLine, myf MyFlag);
|
||||
extern void _myfree(void * pPtr,const char *sFile,uint uLine, myf MyFlag);
|
||||
extern int _sanity(const char *sFile,unsigned int uLine);
|
||||
#ifndef TERMINATE
|
||||
extern void TERMINATE(FILE *file);
|
||||
@@ -507,11 +507,11 @@ File create_temp_file(char *to, const char *dir, const char *pfx,
|
||||
extern my_bool ma_init_dynamic_array(DYNAMIC_ARRAY *array,uint element_size,
|
||||
uint init_alloc,uint alloc_increment CALLER_INFO_PROTO);
|
||||
#define ma_init_dynamic_array_ci(A,B,C,D) ma_init_dynamic_array(A,B,C,D ORIG_CALLER_INFO)
|
||||
extern my_bool ma_insert_dynamic(DYNAMIC_ARRAY *array,gptr element);
|
||||
extern my_bool ma_insert_dynamic(DYNAMIC_ARRAY *array,void * element);
|
||||
extern unsigned char *ma_alloc_dynamic(DYNAMIC_ARRAY *array);
|
||||
extern unsigned char *ma_pop_dynamic(DYNAMIC_ARRAY*);
|
||||
extern my_bool ma_set_dynamic(DYNAMIC_ARRAY *array,gptr element,uint array_index);
|
||||
extern void ma_get_dynamic(DYNAMIC_ARRAY *array,gptr element,uint array_index);
|
||||
extern my_bool ma_set_dynamic(DYNAMIC_ARRAY *array,void * element,uint array_index);
|
||||
extern void ma_get_dynamic(DYNAMIC_ARRAY *array,void * element,uint array_index);
|
||||
extern void ma_delete_dynamic(DYNAMIC_ARRAY *array);
|
||||
extern void ma_delete_dynamic_element(DYNAMIC_ARRAY *array, uint array_index);
|
||||
extern void ma_freeze_size(DYNAMIC_ARRAY *array);
|
||||
|
@@ -127,7 +127,7 @@ const char *ma_tls_get_cipher(MARIADB_TLS *ssl);
|
||||
Returns:
|
||||
actual size of finger print
|
||||
*/
|
||||
unsigned int ma_tls_get_finger_print(MARIADB_TLS *ctls, unsigned char *fp, unsigned int fp_len);
|
||||
unsigned int ma_tls_get_finger_print(MARIADB_TLS *ctls, char *fp, unsigned int fp_len);
|
||||
|
||||
/* ma_tls_get_protocol_version
|
||||
returns protocol version in use
|
||||
|
@@ -41,11 +41,11 @@ typedef struct ma_charset_info_st
|
||||
{
|
||||
unsigned int nr; /* so far only 1 byte for charset */
|
||||
unsigned int state;
|
||||
char *csname;
|
||||
char *name;
|
||||
char *dir;
|
||||
const char *csname;
|
||||
const char *name;
|
||||
const char *dir;
|
||||
unsigned int codepage;
|
||||
char *encoding;
|
||||
const char *encoding;
|
||||
unsigned int char_minlen;
|
||||
unsigned int char_maxlen;
|
||||
unsigned int (*mb_charlen)(unsigned int c);
|
||||
@@ -64,7 +64,7 @@ MARIADB_CHARSET_INFO *find_compiled_charset_by_name(const char *name);
|
||||
|
||||
size_t mysql_cset_escape_quotes(const MARIADB_CHARSET_INFO *cset, char *newstr, const char *escapestr, size_t escapestr_len);
|
||||
size_t mysql_cset_escape_slashes(const MARIADB_CHARSET_INFO *cset, char *newstr, const char *escapestr, size_t escapestr_len);
|
||||
char* madb_get_os_character_set(void);
|
||||
const char* madb_get_os_character_set(void);
|
||||
#ifdef _WIN32
|
||||
int madb_get_windows_cp(const char *charset);
|
||||
#endif
|
||||
|
@@ -101,7 +101,7 @@ typedef struct st_mysql_bind
|
||||
my_bool *error;
|
||||
union {
|
||||
unsigned char *row_ptr; /* for the current data position */
|
||||
unsigned char *indicator; /* indicator variable */
|
||||
char *indicator; /* indicator variable */
|
||||
} u;
|
||||
void (*store_param_func)(NET *net, struct st_mysql_bind *param);
|
||||
void (*fetch_result)(struct st_mysql_bind *, MYSQL_FIELD *,
|
||||
|
@@ -55,9 +55,9 @@ my_bool ma_init_dynamic_array(DYNAMIC_ARRAY *array, uint element_size,
|
||||
}
|
||||
|
||||
|
||||
my_bool ma_insert_dynamic(DYNAMIC_ARRAY *array, gptr element)
|
||||
my_bool ma_insert_dynamic(DYNAMIC_ARRAY *array, void *element)
|
||||
{
|
||||
gptr buffer;
|
||||
void *buffer;
|
||||
if (array->elements == array->max_element)
|
||||
{ /* Call only when nessesary */
|
||||
if (!(buffer=ma_alloc_dynamic(array)))
|
||||
@@ -87,7 +87,7 @@ unsigned char *ma_alloc_dynamic(DYNAMIC_ARRAY *array)
|
||||
array->buffer=new_ptr;
|
||||
array->max_element+=array->alloc_increment;
|
||||
}
|
||||
return array->buffer+(array->elements++ * array->size_of_element);
|
||||
return (unsigned char *)array->buffer+(array->elements++ * array->size_of_element);
|
||||
}
|
||||
|
||||
|
||||
@@ -96,12 +96,12 @@ unsigned char *ma_alloc_dynamic(DYNAMIC_ARRAY *array)
|
||||
unsigned char *ma_pop_dynamic(DYNAMIC_ARRAY *array)
|
||||
{
|
||||
if (array->elements)
|
||||
return array->buffer+(--array->elements * array->size_of_element);
|
||||
return (unsigned char *)array->buffer+(--array->elements * array->size_of_element);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
my_bool ma_set_dynamic(DYNAMIC_ARRAY *array, gptr element, uint idx)
|
||||
my_bool ma_set_dynamic(DYNAMIC_ARRAY *array, void * element, uint idx)
|
||||
{
|
||||
if (idx >= array->elements)
|
||||
{
|
||||
@@ -127,7 +127,7 @@ my_bool ma_set_dynamic(DYNAMIC_ARRAY *array, gptr element, uint idx)
|
||||
}
|
||||
|
||||
|
||||
void ma_get_dynamic(DYNAMIC_ARRAY *array, gptr element, uint idx)
|
||||
void ma_get_dynamic(DYNAMIC_ARRAY *array, void * element, uint idx)
|
||||
{
|
||||
if (idx >= array->elements)
|
||||
{
|
||||
|
@@ -696,7 +696,7 @@ const MARIADB_CHARSET_INFO * mysql_find_charset_nr(unsigned int charsetnr)
|
||||
MARIADB_CHARSET_INFO * mysql_find_charset_name(const char *name)
|
||||
{
|
||||
MARIADB_CHARSET_INFO *c = (MARIADB_CHARSET_INFO *)mariadb_compiled_charsets;
|
||||
char *csname;
|
||||
const char *csname;
|
||||
|
||||
if (!strcasecmp(name, MADB_AUTODETECT_CHARSET_NAME))
|
||||
csname= madb_get_os_character_set();
|
||||
@@ -844,10 +844,10 @@ size_t mysql_cset_escape_slashes(const MARIADB_CHARSET_INFO * cset, char *newstr
|
||||
|
||||
/* {{{ MADB_OS_CHARSET */
|
||||
struct st_madb_os_charset {
|
||||
char *identifier;
|
||||
char *description;
|
||||
char *charset;
|
||||
char *iconv_cs;
|
||||
const char *identifier;
|
||||
const char *description;
|
||||
const char *charset;
|
||||
const char *iconv_cs;
|
||||
unsigned char supported;
|
||||
};
|
||||
|
||||
@@ -1086,7 +1086,7 @@ struct st_madb_os_charset MADB_OS_CHARSET[]=
|
||||
/* }}} */
|
||||
|
||||
/* {{{ madb_get_os_character_set */
|
||||
char *madb_get_os_character_set()
|
||||
const char *madb_get_os_character_set()
|
||||
{
|
||||
unsigned int i= 0;
|
||||
char *p= NULL;
|
||||
@@ -1195,7 +1195,7 @@ size_t STDCALL mariadb_convert_string(const char *from, size_t *from_len, MARIAD
|
||||
*errorcode= errno;
|
||||
goto error;
|
||||
}
|
||||
if ((rc= iconv(conv, (char **)&from, from_len, &to, to_len)) == -1)
|
||||
if ((rc= iconv(conv, (char **)&from, from_len, &to, to_len)) == (size_t)-1)
|
||||
{
|
||||
*errorcode= errno;
|
||||
goto error;
|
||||
|
@@ -97,23 +97,20 @@ static int is_not_initialized(MYSQL *mysql, const char *name)
|
||||
return 1;
|
||||
}
|
||||
|
||||
static int get_plugin_nr(int type)
|
||||
static int get_plugin_nr(uint type)
|
||||
{
|
||||
uint i= 0;
|
||||
for(; valid_plugins[i][1]; i++)
|
||||
if (valid_plugins[i][0]== type)
|
||||
if (valid_plugins[i][0] == type)
|
||||
return i;
|
||||
return -1;
|
||||
}
|
||||
|
||||
static my_bool check_plugin_version(struct st_mysql_client_plugin *plugin, unsigned int version, char *errmsg)
|
||||
static const char *check_plugin_version(struct st_mysql_client_plugin *plugin, unsigned int version)
|
||||
{
|
||||
if (plugin->interface_version < version ||
|
||||
(plugin->interface_version >> 8) > (version >> 8))
|
||||
{
|
||||
errmsg= "Incompatible client plugin interface";
|
||||
return 1;
|
||||
}
|
||||
return "Incompatible client plugin interface";
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -165,7 +162,7 @@ static struct st_mysql_client_plugin *
|
||||
add_plugin(MYSQL *mysql, struct st_mysql_client_plugin *plugin, void *dlhandle,
|
||||
int argc, va_list args)
|
||||
{
|
||||
char *errmsg;
|
||||
const char *errmsg;
|
||||
struct st_client_plugin_int plugin_int, *p;
|
||||
char errbuf[1024];
|
||||
int plugin_nr;
|
||||
@@ -180,11 +177,8 @@ add_plugin(MYSQL *mysql, struct st_mysql_client_plugin *plugin, void *dlhandle,
|
||||
errmsg= "Unknown client plugin type";
|
||||
goto err1;
|
||||
}
|
||||
if (check_plugin_version(plugin, valid_plugins[plugin_nr][1], errbuf))
|
||||
{
|
||||
errmsg= errbuf;
|
||||
if ((errmsg= check_plugin_version(plugin, valid_plugins[plugin_nr][1])))
|
||||
goto err1;
|
||||
}
|
||||
|
||||
/* Call the plugin initialization function, if any */
|
||||
if (plugin->init && plugin->init(errbuf, sizeof(errbuf), argc, args))
|
||||
@@ -250,7 +244,7 @@ static void load_env_plugins(MYSQL *mysql)
|
||||
free_env= plugs= strdup(s);
|
||||
|
||||
do {
|
||||
if (s= strchr(plugs, ';'))
|
||||
if ((s= strchr(plugs, ';')))
|
||||
*s= '\0';
|
||||
mysql_load_plugin(mysql, plugs, -1, 0);
|
||||
plugs= s + 1;
|
||||
|
@@ -95,9 +95,9 @@ static inline char*
|
||||
hash_key(HASH *hash,const uchar *record,uint *length,my_bool first)
|
||||
{
|
||||
if (hash->get_key)
|
||||
return (*hash->get_key)(record,(uint *)length,first);
|
||||
return (char *)(*hash->get_key)(record,(uint *)length,first);
|
||||
*length=hash->key_length;
|
||||
return (uchar*) record+hash->key_offset;
|
||||
return (char*) record+hash->key_offset;
|
||||
}
|
||||
|
||||
/* Calculate pos according to keys */
|
||||
@@ -202,7 +202,7 @@ unsigned int rec_hashnr(HASH *hash,const uchar *record)
|
||||
/* Search after a record based on a key */
|
||||
/* Sets info->current_ptr to found record */
|
||||
|
||||
gptr hash_search(HASH *hash,const uchar *key,uint length)
|
||||
void* hash_search(HASH *hash,const uchar *key,uint length)
|
||||
{
|
||||
HASH_LINK *pos;
|
||||
uint flag,idx;
|
||||
@@ -237,7 +237,7 @@ gptr hash_search(HASH *hash,const uchar *key,uint length)
|
||||
/* Get next record with identical key */
|
||||
/* Can only be called if previous calls was hash_search */
|
||||
|
||||
gptr hash_next(HASH *hash,const uchar *key,uint length)
|
||||
void *hash_next(HASH *hash,const uchar *key,uint length)
|
||||
{
|
||||
HASH_LINK *pos;
|
||||
uint idx;
|
||||
|
@@ -57,7 +57,7 @@ void ma_init(void)
|
||||
|
||||
|
||||
|
||||
void ma_end(int infoflag)
|
||||
void ma_end(int infoflag __attribute__((unused)))
|
||||
{
|
||||
#ifdef _WIN32
|
||||
WSACleanup( );
|
||||
|
@@ -109,7 +109,7 @@ int mysql_local_infile_read(void *ptr, char * buf, unsigned int buf_len)
|
||||
|
||||
count= ma_read((void *)buf, 1, (size_t)buf_len, info->fp);
|
||||
|
||||
if (count < 0)
|
||||
if (count == (size_t)-1)
|
||||
{
|
||||
info->error_no = errno;
|
||||
snprintf((char *)info->error_msg, sizeof(info->error_msg),
|
||||
@@ -202,7 +202,7 @@ my_bool mysql_handle_local_infile(MYSQL *conn, const char *filename)
|
||||
if (!(conn->options.client_flag & CLIENT_LOCAL_FILES)) {
|
||||
my_set_error(conn, CR_UNKNOWN_ERROR, SQLSTATE_UNKNOWN, "Load data local infile forbidden");
|
||||
/* write empty packet to server */
|
||||
ma_net_write(&conn->net, "", 0);
|
||||
ma_net_write(&conn->net, (unsigned char *)"", 0);
|
||||
ma_net_flush(&conn->net);
|
||||
goto infile_error;
|
||||
}
|
||||
@@ -219,7 +219,7 @@ my_bool mysql_handle_local_infile(MYSQL *conn, const char *filename)
|
||||
|
||||
tmp_errno= conn->options.local_infile_error(info, tmp_buf, sizeof(tmp_buf));
|
||||
my_set_error(conn, tmp_errno, SQLSTATE_UNKNOWN, tmp_buf);
|
||||
ma_net_write(&conn->net, "", 0);
|
||||
ma_net_write(&conn->net, (unsigned char *)"", 0);
|
||||
ma_net_flush(&conn->net);
|
||||
goto infile_error;
|
||||
}
|
||||
@@ -227,7 +227,7 @@ my_bool mysql_handle_local_infile(MYSQL *conn, const char *filename)
|
||||
/* read data */
|
||||
while ((bufread= conn->options.local_infile_read(info, (char *)buf, buflen)) > 0)
|
||||
{
|
||||
if (ma_net_write(&conn->net, (char *)buf, bufread))
|
||||
if (ma_net_write(&conn->net, (unsigned char *)buf, bufread))
|
||||
{
|
||||
my_set_error(conn, CR_SERVER_LOST, SQLSTATE_UNKNOWN, NULL);
|
||||
goto infile_error;
|
||||
@@ -235,7 +235,8 @@ my_bool mysql_handle_local_infile(MYSQL *conn, const char *filename)
|
||||
}
|
||||
|
||||
/* send empty packet for eof */
|
||||
if (ma_net_write(&conn->net, "", 0) || ma_net_flush(&conn->net))
|
||||
if (ma_net_write(&conn->net, (unsigned char *)"", 0) ||
|
||||
ma_net_flush(&conn->net))
|
||||
{
|
||||
my_set_error(conn, CR_SERVER_LOST, SQLSTATE_UNKNOWN, NULL);
|
||||
goto infile_error;
|
||||
|
@@ -228,7 +228,7 @@ ma_net_write(NET *net, const uchar *packet, size_t len)
|
||||
int3store(buff,max_len);
|
||||
buff[3]= (uchar)net->pkt_nr++;
|
||||
if (ma_net_write_buff(net,(char*) buff,NET_HEADER_SIZE) ||
|
||||
ma_net_write_buff(net, packet, max_len))
|
||||
ma_net_write_buff(net, (char *)packet, max_len))
|
||||
return 1;
|
||||
packet+= max_len;
|
||||
len-= max_len;
|
||||
@@ -237,7 +237,7 @@ ma_net_write(NET *net, const uchar *packet, size_t len)
|
||||
int3store(buff, len);
|
||||
buff[3]= (uchar)net->pkt_nr++;
|
||||
if (ma_net_write_buff(net,(char*) buff,NET_HEADER_SIZE) ||
|
||||
ma_net_write_buff(net, packet, len))
|
||||
ma_net_write_buff(net, (char *)packet, len))
|
||||
return 1;
|
||||
return 0;
|
||||
}
|
||||
@@ -340,7 +340,7 @@ int net_add_multi_command(NET *net, uchar command, const uchar *packet,
|
||||
if (!net->extension->mbuff)
|
||||
{
|
||||
size_t alloc_size= (required_length + IO_SIZE - 1) & ~(IO_SIZE - 1);
|
||||
if (!(net->extension->mbuff= (char *)malloc(alloc_size)))
|
||||
if (!(net->extension->mbuff= (unsigned char *)malloc(alloc_size)))
|
||||
{
|
||||
net->last_errno=ER_OUT_OF_RESOURCES;
|
||||
net->error=2;
|
||||
@@ -420,7 +420,7 @@ ma_net_real_write(NET *net,const char *packet,size_t len)
|
||||
pos=(char*) packet; end=pos+len;
|
||||
while (pos != end)
|
||||
{
|
||||
if ((ssize_t) (length=ma_pvio_write(net->pvio,pos,(size_t) (end-pos))) <= 0)
|
||||
if ((ssize_t) (length=ma_pvio_write(net->pvio,(uchar *)pos,(size_t) (end-pos))) <= 0)
|
||||
{
|
||||
net->error=2; /* Close socket */
|
||||
net->last_errno= ER_NET_ERROR_ON_WRITE;
|
||||
@@ -460,7 +460,7 @@ ma_real_read(NET *net, size_t *complen)
|
||||
while (remain > 0)
|
||||
{
|
||||
/* First read is done with non blocking mode */
|
||||
if ((ssize_t) (length=ma_pvio_cache_read(net->pvio,(char*) pos,remain)) <= 0L)
|
||||
if ((ssize_t) (length=ma_pvio_cache_read(net->pvio, pos,remain)) <= 0L)
|
||||
{
|
||||
len= packet_error;
|
||||
net->error=2; /* Close socket */
|
||||
|
@@ -70,7 +70,7 @@ MARIADB_PVIO *ma_pvio_init(MA_PVIO_CINFO *cinfo)
|
||||
* pvio_namedpipe
|
||||
* pvio_sharedmed
|
||||
*/
|
||||
char *pvio_plugins[] = {"pvio_socket", "pvio_npipe", "pvio_shmem"};
|
||||
const char *pvio_plugins[] = {"pvio_socket", "pvio_npipe", "pvio_shmem"};
|
||||
int type;
|
||||
MARIADB_PVIO_PLUGIN *pvio_plugin;
|
||||
MARIADB_PVIO *pvio= NULL;
|
||||
@@ -313,8 +313,7 @@ static size_t ma_pvio_write_async(MARIADB_PVIO *pvio, const uchar *buffer, size_
|
||||
|
||||
for (;;)
|
||||
{
|
||||
if (pvio->methods->async_write)
|
||||
res= pvio->methods->async_write(pvio, buffer, length);
|
||||
res= pvio->methods->async_write(pvio, buffer, length);
|
||||
if (res >= 0 || IS_BLOCKING_ERROR())
|
||||
return res;
|
||||
b->events_to_wait_for= MYSQL_WAIT_WRITE;
|
||||
@@ -523,8 +522,8 @@ my_bool ma_pvio_start_ssl(MARIADB_PVIO *pvio)
|
||||
return 1;
|
||||
|
||||
if (pvio->mysql->options.extension &&
|
||||
(pvio->mysql->options.extension->tls_fp && pvio->mysql->options.extension->tls_fp[0]) ||
|
||||
(pvio->mysql->options.extension->tls_fp_list && pvio->mysql->options.extension->tls_fp_list[0]))
|
||||
((pvio->mysql->options.extension->tls_fp && pvio->mysql->options.extension->tls_fp[0]) ||
|
||||
(pvio->mysql->options.extension->tls_fp_list && pvio->mysql->options.extension->tls_fp_list[0])))
|
||||
{
|
||||
|
||||
if (ma_pvio_tls_check_fp(pvio->ctls,
|
||||
|
@@ -402,7 +402,9 @@ static void convert_from_long(MYSQL_BIND *r_param, const MYSQL_FIELD *field, lon
|
||||
|
||||
/* {{{ ps_fetch_null */
|
||||
static
|
||||
void ps_fetch_null(MYSQL_BIND *r_param, const MYSQL_FIELD * field, unsigned char **row)
|
||||
void ps_fetch_null(MYSQL_BIND *r_param __attribute__((unused)),
|
||||
const MYSQL_FIELD * field __attribute__((unused)),
|
||||
unsigned char **row __attribute__((unused)))
|
||||
{
|
||||
/* do nothing */
|
||||
}
|
||||
@@ -509,7 +511,7 @@ void ps_fetch_int64(MYSQL_BIND *r_param, const MYSQL_FIELD * const field,
|
||||
default:
|
||||
{
|
||||
longlong sval= (longlong)sint8korr(*row);
|
||||
longlong lval= field->flags & UNSIGNED_FLAG ? (ulonglong) sval : (longlong)sval;
|
||||
longlong lval= field->flags & UNSIGNED_FLAG ? (longlong)(ulonglong) sval : (longlong)sval;
|
||||
convert_from_long(r_param, field, lval, field->flags & UNSIGNED_FLAG);
|
||||
(*row) += 8;
|
||||
}
|
||||
@@ -518,7 +520,7 @@ void ps_fetch_int64(MYSQL_BIND *r_param, const MYSQL_FIELD * const field,
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
static void convert_from_float(MYSQL_BIND *r_param, const MYSQL_FIELD *field, float val, int size)
|
||||
static void convert_from_float(MYSQL_BIND *r_param, const MYSQL_FIELD *field, float val, int size __attribute__((unused)))
|
||||
{
|
||||
double check_trunc_val= (val > 0) ? floor(val) : -floor(-val);
|
||||
char *buf= (char *)r_param->buffer;
|
||||
@@ -616,7 +618,7 @@ static void convert_from_float(MYSQL_BIND *r_param, const MYSQL_FIELD *field, fl
|
||||
}
|
||||
}
|
||||
|
||||
static void convert_from_double(MYSQL_BIND *r_param, const MYSQL_FIELD *field, double val, int size)
|
||||
static void convert_from_double(MYSQL_BIND *r_param, const MYSQL_FIELD *field, double val, int size __attribute__((unused)))
|
||||
{
|
||||
double check_trunc_val= (val > 0) ? floor(val) : -floor(-val);
|
||||
char *buf= (char *)r_param->buffer;
|
||||
@@ -902,8 +904,9 @@ void ps_fetch_datetime(MYSQL_BIND *r_param, const MYSQL_FIELD * field,
|
||||
|
||||
/* {{{ ps_fetch_string */
|
||||
static
|
||||
void ps_fetch_string(MYSQL_BIND *r_param, const MYSQL_FIELD *field,
|
||||
unsigned char **row)
|
||||
void ps_fetch_string(MYSQL_BIND *r_param,
|
||||
const MYSQL_FIELD *field __attribute__((unused)),
|
||||
unsigned char **row)
|
||||
{
|
||||
/* C-API differs from PHP. While PHP just converts string to string,
|
||||
C-API needs to convert the string to the defined type with in
|
||||
@@ -918,7 +921,8 @@ void ps_fetch_string(MYSQL_BIND *r_param, const MYSQL_FIELD *field,
|
||||
|
||||
/* {{{ ps_fetch_bin */
|
||||
static
|
||||
void ps_fetch_bin(MYSQL_BIND *r_param, const MYSQL_FIELD *field,
|
||||
void ps_fetch_bin(MYSQL_BIND *r_param,
|
||||
const MYSQL_FIELD *field __attribute__((unused)),
|
||||
unsigned char **row)
|
||||
{
|
||||
ulong field_length= *r_param->length= net_field_length(row);
|
||||
|
@@ -51,7 +51,7 @@
|
||||
my_bool ma_tls_initialized= FALSE;
|
||||
unsigned int mariadb_deinitialize_ssl= 1;
|
||||
|
||||
char *ssl_protocol_version[5]= {"TLS1.0", "TLS1.1", "TLS1.2"};
|
||||
const char *ssl_protocol_version[5]= {"TLS1.0", "TLS1.1", "TLS1.2"};
|
||||
|
||||
MARIADB_TLS *ma_pvio_tls_init(MYSQL *mysql)
|
||||
{
|
||||
@@ -119,11 +119,14 @@ my_bool ma_pvio_tls_get_protocol_version(MARIADB_TLS *ctls, struct st_ssl_versio
|
||||
return ma_tls_get_protocol_version(ctls, version);
|
||||
}
|
||||
|
||||
static my_bool ma_pvio_tls_compare_fp(char *fp1, unsigned int fp1_len,
|
||||
char *fp2, unsigned int fp2_len)
|
||||
static my_bool ma_pvio_tls_compare_fp(const char *fp1, unsigned int fp1_len,
|
||||
const char *fp2, unsigned int fp2_len)
|
||||
{
|
||||
char hexstr[64];
|
||||
|
||||
if (fp1_len != fp2_len)
|
||||
return 1;
|
||||
|
||||
fp1_len= (unsigned int)mysql_hex_string(hexstr, fp1, fp1_len);
|
||||
#ifdef WIN32
|
||||
if (strnicmp(hexstr, fp2, fp1_len) != 0)
|
||||
@@ -137,14 +140,14 @@ static my_bool ma_pvio_tls_compare_fp(char *fp1, unsigned int fp1_len,
|
||||
my_bool ma_pvio_tls_check_fp(MARIADB_TLS *ctls, const char *fp, const char *fp_list)
|
||||
{
|
||||
unsigned int cert_fp_len= 64;
|
||||
unsigned char cert_fp[64];
|
||||
char cert_fp[64];
|
||||
my_bool rc=1;
|
||||
MYSQL *mysql= ctls->pvio->mysql;
|
||||
|
||||
if ((cert_fp_len= ma_tls_get_finger_print(ctls, cert_fp, cert_fp_len)) < 1)
|
||||
goto end;
|
||||
if (fp)
|
||||
rc= ma_pvio_tls_compare_fp(cert_fp, cert_fp_len, (char *)fp, (unsigned int)strlen(fp));
|
||||
rc= ma_pvio_tls_compare_fp(cert_fp, cert_fp_len, fp, (unsigned int)strlen(fp));
|
||||
else if (fp_list)
|
||||
{
|
||||
MA_FILE *fp;
|
||||
|
@@ -14,6 +14,7 @@
|
||||
You should have received a copy of the GNU Library General Public
|
||||
License along with this library; if not, write to the Free
|
||||
Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
|
||||
*/
|
||||
|
||||
/*
|
||||
MySQL non-blocking client library functions.
|
||||
|
@@ -38,7 +38,7 @@ MARIADB_CHARSET_INFO * STDCALL mysql_get_charset_by_nr(uint cs_number)
|
||||
return (mariadb_compiled_charsets[i].nr) ? (MARIADB_CHARSET_INFO *)&mariadb_compiled_charsets[i] : NULL;
|
||||
}
|
||||
|
||||
my_bool set_default_charset(uint cs, myf flags)
|
||||
my_bool set_default_charset(uint cs, myf flags __attribute__((unused)))
|
||||
{
|
||||
MARIADB_CHARSET_INFO *new_charset;
|
||||
new_charset = mysql_get_charset_by_nr(cs);
|
||||
@@ -60,7 +60,7 @@ MARIADB_CHARSET_INFO * STDCALL mysql_get_charset_by_name(const char *cs_name)
|
||||
return (mariadb_compiled_charsets[i].nr) ? (MARIADB_CHARSET_INFO *)&mariadb_compiled_charsets[i] : NULL;
|
||||
}
|
||||
|
||||
my_bool set_default_charset_by_name(const char *cs_name, myf flags)
|
||||
my_bool set_default_charset_by_name(const char *cs_name, myf flags __attribute__((unused)))
|
||||
{
|
||||
MARIADB_CHARSET_INFO *new_charset;
|
||||
new_charset = mysql_get_charset_by_name(cs_name);
|
||||
|
@@ -1004,6 +1004,8 @@ dynamic_column_value_len(DYNAMIC_COLUMN_VALUE *value,
|
||||
return 3;
|
||||
case DYN_COL_DYNCOL:
|
||||
return value->x.string.value.length;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
DBUG_ASSERT(0);
|
||||
return 0;
|
||||
@@ -1592,6 +1594,8 @@ data_store(DYNAMIC_COLUMN *str, DYNAMIC_COLUMN_VALUE *value,
|
||||
return dynamic_column_dyncol_store(str, &value->x.string.value);
|
||||
case DYN_COL_NULL:
|
||||
break; /* Impossible */
|
||||
default:
|
||||
break;
|
||||
}
|
||||
DBUG_ASSERT(0);
|
||||
return ER_DYNCOL_OK; /* Impossible */
|
||||
|
@@ -362,7 +362,7 @@ mthd_my_send_cmd(MYSQL *mysql,enum enum_server_command command, const char *arg,
|
||||
if (multi == MARIADB_COM_MULTI_BEGIN)
|
||||
{
|
||||
/* todo: error handling */
|
||||
return(net_add_multi_command(&mysql->net, command, arg, length));
|
||||
return(net_add_multi_command(&mysql->net, command, (uchar *)arg, length));
|
||||
}
|
||||
|
||||
if (mysql->net.pvio == 0)
|
||||
@@ -556,7 +556,7 @@ enum enum_option_type {
|
||||
struct st_default_options {
|
||||
enum mysql_option option;
|
||||
enum enum_option_type type;
|
||||
char *conf_key;
|
||||
const char *conf_key;
|
||||
};
|
||||
|
||||
struct st_default_options mariadb_defaults[] =
|
||||
@@ -715,7 +715,7 @@ static size_t rset_field_offsets[]= {
|
||||
|
||||
MYSQL_FIELD *
|
||||
unpack_fields(MYSQL_DATA *data,MA_MEM_ROOT *alloc,uint fields,
|
||||
my_bool default_value, my_bool long_flag_protocol)
|
||||
my_bool default_value, my_bool long_flag_protocol __attribute__((unused)))
|
||||
{
|
||||
MYSQL_ROWS *row;
|
||||
MYSQL_FIELD *field,*result;
|
||||
@@ -1003,11 +1003,11 @@ mysql_get_ssl_cipher(MYSQL *mysql)
|
||||
** NB! Errors are not reported until you do mysql_real_connect.
|
||||
**************************************************************************/
|
||||
|
||||
uchar *ma_send_connect_attr(MYSQL *mysql, uchar *buffer)
|
||||
char *ma_send_connect_attr(MYSQL *mysql, unsigned char *buffer)
|
||||
{
|
||||
if (mysql->server_capabilities & CLIENT_CONNECT_ATTRS)
|
||||
{
|
||||
buffer= mysql_net_store_length((unsigned char *)buffer, (mysql->options.extension) ?
|
||||
buffer= (unsigned char *)mysql_net_store_length((unsigned char *)buffer, (mysql->options.extension) ?
|
||||
mysql->options.extension->connect_attrs_len : 0);
|
||||
if (mysql->options.extension &&
|
||||
hash_inited(&mysql->options.extension->connect_attrs))
|
||||
@@ -1023,14 +1023,14 @@ uchar *ma_send_connect_attr(MYSQL *mysql, uchar *buffer)
|
||||
memcpy(buffer, p, len);
|
||||
buffer+= (len);
|
||||
p+= (len + 1);
|
||||
len= strlen(p);
|
||||
len= strlen((char *)p);
|
||||
buffer= mysql_net_store_length(buffer, len);
|
||||
memcpy(buffer, p, len);
|
||||
buffer+= len;
|
||||
}
|
||||
}
|
||||
}
|
||||
return buffer;
|
||||
return (char *)buffer;
|
||||
}
|
||||
|
||||
/** set some default attributes */
|
||||
@@ -2100,7 +2100,7 @@ mysql_real_query(MYSQL *mysql, const char *query, size_t length)
|
||||
|
||||
if (OPT_HAS_EXT_VAL(mysql, multi_command))
|
||||
is_multi= mysql->options.extension->multi_command;
|
||||
if (length == -1)
|
||||
if (length == (size_t)-1)
|
||||
length= strlen(query);
|
||||
|
||||
free_old_query(mysql);
|
||||
@@ -2546,7 +2546,7 @@ uchar *ma_get_hash_keyval(const uchar *hash_entry,
|
||||
key_length + 1 value (\0 terminated)
|
||||
*/
|
||||
uchar *p= (uchar *)hash_entry;
|
||||
size_t len= strlen(p);
|
||||
size_t len= strlen((char *)p);
|
||||
*length= (unsigned int)len;
|
||||
return p;
|
||||
}
|
||||
@@ -2561,20 +2561,23 @@ int mariadb_flush_multi_command(MYSQL *mysql)
|
||||
int rc;
|
||||
size_t length= mysql->net.extension->mbuff_pos - mysql->net.extension->mbuff;
|
||||
|
||||
rc= ma_simple_command(mysql, COM_MULTI, mysql->net.extension->mbuff,
|
||||
rc= ma_simple_command(mysql, COM_MULTI, (char *)mysql->net.extension->mbuff,
|
||||
length, 1, 0);
|
||||
/* reset multi_buff */
|
||||
mysql->net.extension->mbuff_pos= mysql->net.extension->mbuff;
|
||||
|
||||
/* don't read result for mysql_stmt_execute_direct() */
|
||||
if (!rc)
|
||||
if (mysql->net.extension->mbuff && length > 3 &&
|
||||
(mysql->net.extension->mbuff[3] == COM_STMT_PREPARE ||
|
||||
mysql->net.extension->mbuff[3] == COM_STMT_EXECUTE ||
|
||||
mysql->net.extension->mbuff[3] == COM_STMT_CLOSE))
|
||||
{
|
||||
uchar *p= (uchar *)mysql->net.extension->mbuff;
|
||||
unsigned long len= net_field_length(&p);
|
||||
if (len && (*p == COM_STMT_PREPARE ||
|
||||
*p == COM_STMT_EXECUTE ||
|
||||
*p == COM_STMT_CLOSE))
|
||||
return rc;
|
||||
else
|
||||
return mysql->methods->db_read_query_result(mysql);
|
||||
}
|
||||
return rc;
|
||||
}
|
||||
|
||||
@@ -2742,10 +2745,10 @@ mysql_optionsv(MYSQL *mysql,enum mysql_option option, ...)
|
||||
arg1 ? (uint)strlen((char *)arg1) : 0)))
|
||||
{
|
||||
uchar *p= h;
|
||||
size_t key_len= strlen(p);
|
||||
size_t key_len= strlen((char *)p);
|
||||
mysql->options.extension->connect_attrs_len-= key_len + get_store_length(key_len);
|
||||
p+= key_len + 1;
|
||||
key_len= strlen(p);
|
||||
key_len= strlen((char *)p);
|
||||
mysql->options.extension->connect_attrs_len-= key_len + get_store_length(key_len);
|
||||
hash_delete(&mysql->options.extension->connect_attrs, h);
|
||||
}
|
||||
@@ -2818,8 +2821,10 @@ mysql_optionsv(MYSQL *mysql,enum mysql_option option, ...)
|
||||
}
|
||||
}
|
||||
/* check if key is already in buffer */
|
||||
if (p= (uchar *)hash_search(&mysql->options.extension->userdata, (uchar *)key,
|
||||
(uint)strlen((char *)key)))
|
||||
p= (uchar *)hash_search(&mysql->options.extension->userdata,
|
||||
(uchar *)key,
|
||||
(uint)strlen(key));
|
||||
if (p)
|
||||
{
|
||||
p+= strlen(key) + 1;
|
||||
memcpy(p, &data, sizeof(void *));
|
||||
@@ -2833,7 +2838,7 @@ mysql_optionsv(MYSQL *mysql,enum mysql_option option, ...)
|
||||
}
|
||||
|
||||
p= buffer;
|
||||
strcpy(p, key);
|
||||
strcpy((char *)p, key);
|
||||
p+= strlen(key) + 1;
|
||||
memcpy(p, &data, sizeof(void *));
|
||||
|
||||
@@ -2880,10 +2885,10 @@ mysql_optionsv(MYSQL *mysql,enum mysql_option option, ...)
|
||||
if ((buffer= (uchar *)malloc(key_len + value_len)))
|
||||
{
|
||||
uchar *p= buffer;
|
||||
strcpy(p, arg1);
|
||||
strcpy((char *)p, arg1);
|
||||
p+= (strlen(arg1) + 1);
|
||||
if (arg2)
|
||||
strcpy(p, arg2);
|
||||
strcpy((char *)p, arg2);
|
||||
|
||||
if (hash_insert(&mysql->options.extension->connect_attrs, buffer))
|
||||
{
|
||||
@@ -3013,7 +3018,7 @@ mysql_get_optionv(MYSQL *mysql, enum mysql_option option, void *arg, ...)
|
||||
break;
|
||||
case MYSQL_SET_CHARSET_NAME:
|
||||
if (mysql->charset)
|
||||
*((char **)arg)= mysql->charset->csname;
|
||||
*((const char **)arg)= mysql->charset->csname;
|
||||
else
|
||||
*((char **)arg)= mysql->options.charset_name;
|
||||
break;
|
||||
@@ -3084,7 +3089,7 @@ mysql_get_optionv(MYSQL *mysql, enum mysql_option option, void *arg, ...)
|
||||
case MYSQL_OPT_CONNECT_ATTRS:
|
||||
/* mysql_get_optionsv(mysql, MYSQL_OPT_CONNECT_ATTRS, keys, vals, elements) */
|
||||
{
|
||||
int i, *elements;
|
||||
unsigned int i, *elements;
|
||||
char **key= NULL;
|
||||
void *arg1;
|
||||
char **val= NULL;
|
||||
@@ -3116,10 +3121,10 @@ mysql_get_optionv(MYSQL *mysql, enum mysql_option option, void *arg, ...)
|
||||
{
|
||||
uchar *p= hash_element(&mysql->options.extension->connect_attrs, i);
|
||||
if (key)
|
||||
key[i]= p;
|
||||
p+= strlen(p) + 1;
|
||||
key[i]= (char *)p;
|
||||
p+= strlen((char *)p) + 1;
|
||||
if (val)
|
||||
val[i]= p;
|
||||
val[i]= (char *)p;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -3284,7 +3289,7 @@ uint STDCALL mysql_errno(MYSQL *mysql)
|
||||
|
||||
char * STDCALL mysql_error(MYSQL *mysql)
|
||||
{
|
||||
return mysql ? (mysql)->net.last_error : "";
|
||||
return mysql ? (mysql)->net.last_error : (char *)"";
|
||||
}
|
||||
|
||||
char *STDCALL mysql_info(MYSQL *mysql)
|
||||
@@ -3665,18 +3670,18 @@ my_bool STDCALL mariadb_get_infov(MYSQL *mysql, enum mariadb_value value, void *
|
||||
case MARIADB_TLS_LIBRARY:
|
||||
#ifdef HAVE_TLS
|
||||
#ifdef HAVE_GNUTLS
|
||||
*((char **)arg)= "GNUTLS";
|
||||
*((const char **)arg)= "GNUTLS";
|
||||
#elif HAVE_OPENSSL
|
||||
*((char **)arg)= "OPENSSL";
|
||||
*((const char **)arg)= "OPENSSL";
|
||||
#elif HAVE_SCHANNEL
|
||||
*((char **)arg)= "SCHANNEL";
|
||||
*((const char **)arg)= "SCHANNEL";
|
||||
#endif
|
||||
#else
|
||||
*((char **)arg)= "OFF";
|
||||
#endif
|
||||
break;
|
||||
case MARIADB_CLIENT_VERSION:
|
||||
*((char **)arg)= MARIADB_CLIENT_VERSION_STR;
|
||||
*((const char **)arg)= MARIADB_CLIENT_VERSION_STR;
|
||||
break;
|
||||
case MARIADB_CLIENT_VERSION_ID:
|
||||
*((size_t *)arg)= MARIADB_VERSION_ID;
|
||||
@@ -3689,7 +3694,7 @@ my_bool STDCALL mariadb_get_infov(MYSQL *mysql, enum mariadb_value value, void *
|
||||
break;
|
||||
case MARIADB_CONNECTION_SERVER_TYPE:
|
||||
if (mysql)
|
||||
*((char **)arg)= mariadb_connection(mysql) ? "MariaDB" : "MySQL";
|
||||
*((const char **)arg)= mariadb_connection(mysql) ? "MariaDB" : "MySQL";
|
||||
else
|
||||
goto error;
|
||||
break;
|
||||
|
@@ -79,6 +79,23 @@ MYSQL_FIELD * unpack_fields(MYSQL_DATA *data,MA_MEM_ROOT *alloc,uint fields, my_
|
||||
static my_bool is_not_null= 0;
|
||||
static my_bool is_null= 1;
|
||||
|
||||
void stmt_set_error(MYSQL_STMT *stmt,
|
||||
unsigned int error_nr,
|
||||
const char *sqlstate,
|
||||
const char *format,
|
||||
...)
|
||||
{
|
||||
va_list ap;
|
||||
|
||||
stmt->last_errno= error_nr;
|
||||
ma_strmake(stmt->sqlstate, sqlstate, SQLSTATE_LENGTH);
|
||||
va_start(ap, format);
|
||||
vsnprintf(stmt->last_error, MYSQL_ERRMSG_SIZE,
|
||||
format ? format : ER(error_nr), ap);
|
||||
va_end(ap);
|
||||
return;
|
||||
}
|
||||
|
||||
my_bool mthd_supported_buffer_type(enum enum_field_types type)
|
||||
{
|
||||
switch (type) {
|
||||
@@ -116,7 +133,8 @@ my_bool mthd_supported_buffer_type(enum enum_field_types type)
|
||||
|
||||
static my_bool madb_reset_stmt(MYSQL_STMT *stmt, unsigned int flags);
|
||||
static my_bool mysql_stmt_internal_reset(MYSQL_STMT *stmt, my_bool is_close);
|
||||
static int stmt_unbuffered_eof(MYSQL_STMT *stmt, uchar **row)
|
||||
static int stmt_unbuffered_eof(MYSQL_STMT *stmt __attribute__((unused)),
|
||||
uchar **row __attribute__((unused)))
|
||||
{
|
||||
return MYSQL_NO_DATA;
|
||||
}
|
||||
@@ -603,6 +621,13 @@ unsigned char* mysql_stmt_execute_generate_request(MYSQL_STMT *stmt, size_t *req
|
||||
|
||||
uchar *start= NULL, *p;
|
||||
|
||||
if (!bulk_supported && stmt->array_size > 0)
|
||||
{
|
||||
stmt_set_error(stmt, CR_FUNCTION_NOT_SUPPORTED, SQLSTATE_UNKNOWN,
|
||||
CER(CR_FUNCTION_NOT_SUPPORTED), "Bulk operation");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
||||
/* preallocate length bytes */
|
||||
/* check: gr */
|
||||
@@ -677,12 +702,12 @@ unsigned char* mysql_stmt_execute_generate_request(MYSQL_STMT *stmt, size_t *req
|
||||
{
|
||||
ulong size= 0;
|
||||
my_bool has_data= TRUE;
|
||||
uchar indicator= 0;
|
||||
char indicator= 0;
|
||||
|
||||
if (bulk_supported && stmt->params[i].u.indicator)
|
||||
{
|
||||
if (stmt->row_size)
|
||||
indicator= *(uchar *)(stmt->params[i].u.indicator + j * stmt->row_size);
|
||||
indicator= *(char *)(stmt->params[i].u.indicator + j * stmt->row_size);
|
||||
else
|
||||
indicator= stmt->params[i].u.indicator[j];
|
||||
/* check if we need to send data */
|
||||
@@ -720,8 +745,11 @@ unsigned char* mysql_stmt_execute_generate_request(MYSQL_STMT *stmt, size_t *req
|
||||
case MYSQL_TYPE_BIT:
|
||||
case MYSQL_TYPE_SET:
|
||||
size+= 5; /* max 8 bytes for size */
|
||||
if (indicator == STMT_INDICATOR_NTS || (!stmt->row_size && stmt->params[i].length[j] == -1))
|
||||
size+= strlen(ma_get_buffer_offset(stmt, stmt->params[i].buffer_type, stmt->params[i].buffer,j));
|
||||
if (indicator == STMT_INDICATOR_NTS ||
|
||||
(!stmt->row_size && stmt->params[i].length[j] == (unsigned long)-1))
|
||||
size+= strlen(ma_get_buffer_offset(stmt,
|
||||
stmt->params[i].buffer_type,
|
||||
stmt->params[i].buffer,j));
|
||||
else
|
||||
if (!stmt->row_size)
|
||||
size+= (size_t)stmt->params[i].length[j];
|
||||
@@ -1327,7 +1355,7 @@ int STDCALL mysql_stmt_prepare(MYSQL_STMT *stmt, const char *query, size_t lengt
|
||||
return(1);
|
||||
}
|
||||
|
||||
if (length == -1)
|
||||
if (length == (size_t) -1)
|
||||
length= strlen(query);
|
||||
|
||||
mysql_get_optionv(mysql, MARIADB_OPT_COM_MULTI, &multi);
|
||||
@@ -1718,6 +1746,9 @@ int STDCALL mysql_stmt_execute(MYSQL_STMT *stmt)
|
||||
}
|
||||
request= (char *)mysql_stmt_execute_generate_request(stmt, &request_len);
|
||||
|
||||
if (!request)
|
||||
return 1;
|
||||
|
||||
ret= stmt->mysql->methods->db_command(mysql, COM_STMT_EXECUTE, request,
|
||||
request_len, 1, stmt);
|
||||
|
||||
@@ -1967,7 +1998,7 @@ unsigned long long STDCALL mysql_stmt_num_rows(MYSQL_STMT *stmt)
|
||||
return stmt->result.rows;
|
||||
}
|
||||
|
||||
MYSQL_RES* STDCALL mysql_stmt_param_metadata(MYSQL_STMT *stmt)
|
||||
MYSQL_RES* STDCALL mysql_stmt_param_metadata(MYSQL_STMT *stmt __attribute__((unused)))
|
||||
{
|
||||
/* server doesn't deliver any information yet,
|
||||
so we just return NULL
|
||||
@@ -2061,7 +2092,7 @@ int STDCALL mariadb_stmt_execute_direct(MYSQL_STMT *stmt,
|
||||
return(1);
|
||||
}
|
||||
|
||||
if (length == -1)
|
||||
if (length == (size_t) -1)
|
||||
length= strlen(stmt_str);
|
||||
|
||||
mysql_get_optionv(mysql, MARIADB_OPT_COM_MULTI, &multi);
|
||||
|
@@ -58,7 +58,7 @@ static void ma_tls_set_error(MYSQL *mysql, int ssl_errno)
|
||||
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=%d", ssl_errno);
|
||||
pvio->set_error(mysql, CR_SSL_CONNECTION_ERROR, SQLSTATE_UNKNOWN,
|
||||
ssl_error);
|
||||
}
|
||||
@@ -78,7 +78,7 @@ static void ma_tls_get_error(char *errmsg, size_t length, int ssl_errno)
|
||||
strncpy(errmsg, ssl_error_reason, length);
|
||||
return;
|
||||
}
|
||||
snprintf(errmsg, length, "SSL errno=%lu", ssl_errno);
|
||||
snprintf(errmsg, length, "SSL errno=%d", ssl_errno);
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -304,7 +304,7 @@ my_bool ma_tls_close(MARIADB_TLS *ctls)
|
||||
return 0;
|
||||
}
|
||||
|
||||
int ma_tls_verify_server_cert(MARIADB_TLS *ctls)
|
||||
int ma_tls_verify_server_cert(MARIADB_TLS *ctls __attribute__((unused)))
|
||||
{
|
||||
/* server verification is already handled before */
|
||||
return 0;
|
||||
@@ -388,7 +388,7 @@ static int my_verify_callback(gnutls_session_t ssl)
|
||||
return 0;
|
||||
}
|
||||
|
||||
unsigned int ma_tls_get_finger_print(MARIADB_TLS *ctls, unsigned char *fp, unsigned int len)
|
||||
unsigned int ma_tls_get_finger_print(MARIADB_TLS *ctls, char *fp, unsigned int len)
|
||||
{
|
||||
MYSQL *mysql;
|
||||
size_t fp_len= len;
|
||||
|
@@ -127,14 +127,14 @@ typedef struct st_ma_tls_session {
|
||||
} MA_SSL_SESSION;
|
||||
|
||||
MA_SSL_SESSION *ma_tls_sessions= NULL;
|
||||
unsigned int ma_tls_session_cache_size= 128;
|
||||
int ma_tls_session_cache_size= 128;
|
||||
|
||||
static char *ma_md4_hash(const char *host, const char *user, unsigned int port, char *md4)
|
||||
{
|
||||
char buffer[195]; /* MAX_USERNAME_LEN + MAX_HOST_NAME_LEN + 2 + 5 */
|
||||
snprintf(buffer, 194, "%s@%s:%d", user ? user : "", host, port);
|
||||
buffer[194]= 0;
|
||||
MD4(buffer, strlen(buffer), md4);
|
||||
MD4((unsigned char *)buffer, strlen(buffer), (unsigned char *)md4);
|
||||
return md4;
|
||||
}
|
||||
|
||||
@@ -209,7 +209,8 @@ static int ma_tls_session_cb(SSL *ssl, SSL_SESSION *session)
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void ma_tls_remove_session_cb(SSL_CTX* ctx, SSL_SESSION* session)
|
||||
static void ma_tls_remove_session_cb(SSL_CTX* ctx __attribute__((unused)),
|
||||
SSL_SESSION* session)
|
||||
{
|
||||
int i;
|
||||
for (i=0; i < ma_tls_session_cache_size; i++)
|
||||
@@ -223,7 +224,9 @@ static void ma_tls_remove_session_cb(SSL_CTX* ctx, SSL_SESSION* session)
|
||||
#endif
|
||||
|
||||
#if OPENSSL_VERSION_NUMBER < 0x10100000L
|
||||
static void my_cb_locking(int mode, int n, const char *file, int line)
|
||||
static void my_cb_locking(int mode, int n,
|
||||
const char *file __attribute__((unused)),
|
||||
int line __attribute__((unused)))
|
||||
{
|
||||
if (mode & CRYPTO_LOCK)
|
||||
pthread_mutex_lock(&LOCK_crypto[n]);
|
||||
@@ -397,7 +400,9 @@ void ma_tls_end()
|
||||
return;
|
||||
}
|
||||
|
||||
int ma_tls_get_password(char *buf, int size, int rwflag, void *userdata)
|
||||
int ma_tls_get_password(char *buf, int size,
|
||||
int rwflag __attribute__((unused)),
|
||||
void *userdata)
|
||||
{
|
||||
memset(buf, 0, size);
|
||||
if (userdata)
|
||||
@@ -696,7 +701,7 @@ const char *ma_tls_get_cipher(MARIADB_TLS *ctls)
|
||||
return SSL_get_cipher_name(ctls->ssl);
|
||||
}
|
||||
|
||||
unsigned int ma_tls_get_finger_print(MARIADB_TLS *ctls, unsigned char *fp, unsigned int len)
|
||||
unsigned int ma_tls_get_finger_print(MARIADB_TLS *ctls, char *fp, unsigned int len)
|
||||
{
|
||||
EVP_MD *digest= (EVP_MD *)EVP_sha1();
|
||||
X509 *cert;
|
||||
@@ -724,7 +729,7 @@ unsigned int ma_tls_get_finger_print(MARIADB_TLS *ctls, unsigned char *fp, unsig
|
||||
return 0;
|
||||
}
|
||||
fp_len= len;
|
||||
if (!X509_digest(cert, digest, fp, &fp_len))
|
||||
if (!X509_digest(cert, digest, (unsigned char *)fp, &fp_len))
|
||||
{
|
||||
ma_free(fp);
|
||||
my_set_error(mysql, CR_SSL_CONNECTION_ERROR, SQLSTATE_UNKNOWN,
|
||||
|
@@ -536,7 +536,7 @@ const char *ma_tls_get_cipher(MARIADB_TLS *ctls)
|
||||
return NULL;
|
||||
}
|
||||
|
||||
unsigned int ma_tls_get_finger_print(MARIADB_TLS *ctls, unsigned char *fp, unsigned int len)
|
||||
unsigned int ma_tls_get_finger_print(MARIADB_TLS *ctls, char *fp, unsigned int len)
|
||||
{
|
||||
SC_CTX *sctx= (SC_CTX *)ctls->ssl;
|
||||
PCCERT_CONTEXT pRemoteCertContext = NULL;
|
||||
|
@@ -31,7 +31,7 @@ static struct option long_options[]=
|
||||
{NULL, 0, 0, 0}
|
||||
};
|
||||
|
||||
static char *values[]=
|
||||
static const char *values[]=
|
||||
{
|
||||
CFLAGS,
|
||||
NULL,
|
||||
|
@@ -79,7 +79,7 @@ struct st_mysql_client_plugin_AUTHENTICATION _mysql_client_plugin_declaration_ =
|
||||
RETURNS
|
||||
Input buffer
|
||||
*/
|
||||
static char *auth_dialog_native_prompt(MYSQL *mysql,
|
||||
static char *auth_dialog_native_prompt(MYSQL *mysql __attribute__((unused)),
|
||||
int type,
|
||||
const char *prompt,
|
||||
char *buffer,
|
||||
@@ -103,7 +103,7 @@ static char *auth_dialog_native_prompt(MYSQL *mysql,
|
||||
}
|
||||
else
|
||||
{
|
||||
get_tty_password("", buffer, buffer_len - 1);
|
||||
get_tty_password((char *)"", buffer, buffer_len - 1);
|
||||
}
|
||||
return buffer;
|
||||
}
|
||||
@@ -138,7 +138,7 @@ static int auth_dialog_open(MYSQL_PLUGIN_VIO *vio, MYSQL *mysql)
|
||||
my_bool first_loop= TRUE;
|
||||
|
||||
do {
|
||||
if ((packet_length= vio->read_packet(vio, &packet)) < 0)
|
||||
if ((packet_length= vio->read_packet(vio, &packet)) == (size_t)-1)
|
||||
/* read error */
|
||||
return CR_ERROR;
|
||||
|
||||
@@ -170,7 +170,7 @@ static int auth_dialog_open(MYSQL_PLUGIN_VIO *vio, MYSQL *mysql)
|
||||
response= mysql->passwd;
|
||||
}
|
||||
if (!response ||
|
||||
vio->write_packet(vio, response, (int)strlen(response) + 1))
|
||||
vio->write_packet(vio, (uchar *)response, (int)strlen(response) + 1))
|
||||
return CR_ERROR;
|
||||
|
||||
first_loop= FALSE;
|
||||
|
@@ -9,7 +9,7 @@ typedef struct st_mysql_client_plugin_AUTHENTICATION auth_plugin_t;
|
||||
static int client_mpvio_write_packet(struct st_plugin_vio*, const uchar*, size_t);
|
||||
static int native_password_auth_client(MYSQL_PLUGIN_VIO *vio, MYSQL *mysql);
|
||||
extern void read_user_name(char *name);
|
||||
extern uchar *ma_send_connect_attr(MYSQL *mysql, uchar *buffer);
|
||||
extern char *ma_send_connect_attr(MYSQL *mysql, unsigned char *buffer);
|
||||
|
||||
typedef struct {
|
||||
int (*read_packet)(struct st_plugin_vio *vio, uchar **buf);
|
||||
@@ -141,7 +141,7 @@ static int send_change_user_packet(MCPVIO_EXT *mpvio,
|
||||
if (mysql->server_capabilities & CLIENT_PLUGIN_AUTH)
|
||||
end= ma_strmake(end, mpvio->plugin->name, NAME_LEN) + 1;
|
||||
|
||||
end= ma_send_connect_attr(mysql, end);
|
||||
end= ma_send_connect_attr(mysql, (unsigned char *)end);
|
||||
|
||||
res= ma_simple_command(mysql, COM_CHANGE_USER,
|
||||
buff, (ulong)(end-buff), 1, NULL);
|
||||
@@ -249,7 +249,7 @@ static int send_client_reply_packet(MCPVIO_EXT *mpvio,
|
||||
Send mysql->client_flag, max_packet_size - unencrypted otherwise
|
||||
the server does not know we want to do SSL
|
||||
*/
|
||||
if (ma_net_write(net, (char*)buff, (size_t) (end-buff)) || ma_net_flush(net))
|
||||
if (ma_net_write(net, (unsigned char *)buff, (size_t) (end-buff)) || ma_net_flush(net))
|
||||
{
|
||||
my_set_error(mysql, CR_SERVER_LOST, SQLSTATE_UNKNOWN,
|
||||
ER(CR_SERVER_LOST_EXTENDED),
|
||||
@@ -298,10 +298,10 @@ static int send_client_reply_packet(MCPVIO_EXT *mpvio,
|
||||
if (mysql->server_capabilities & CLIENT_PLUGIN_AUTH)
|
||||
end= ma_strmake(end, mpvio->plugin->name, NAME_LEN) + 1;
|
||||
|
||||
end= ma_send_connect_attr(mysql, end);
|
||||
end= ma_send_connect_attr(mysql, (unsigned char *)end);
|
||||
|
||||
/* Write authentication package */
|
||||
if (ma_net_write(net, buff, (size_t) (end-buff)) || ma_net_flush(net))
|
||||
if (ma_net_write(net, (unsigned char *)buff, (size_t) (end-buff)) || ma_net_flush(net))
|
||||
{
|
||||
my_set_error(mysql, CR_SERVER_LOST, SQLSTATE_UNKNOWN,
|
||||
ER(CR_SERVER_LOST_EXTENDED),
|
||||
@@ -405,7 +405,7 @@ static int client_mpvio_write_packet(struct st_plugin_vio *mpv,
|
||||
if (mpvio->mysql->thd)
|
||||
res= 1; /* no chit-chat in embedded */
|
||||
else
|
||||
res= ma_net_write(net, (char *)pkt, pkt_len) || ma_net_flush(net);
|
||||
res= ma_net_write(net, (unsigned char *)pkt, pkt_len) || ma_net_flush(net);
|
||||
if (res)
|
||||
my_set_error(mpvio->mysql, CR_SERVER_LOST, SQLSTATE_UNKNOWN,
|
||||
ER(CR_SERVER_LOST_EXTENDED),
|
||||
|
@@ -36,7 +36,8 @@
|
||||
#endif
|
||||
|
||||
/* function prototypes */
|
||||
int aurora_init(char *errormsg, size_t errormsg_size,
|
||||
int aurora_init(char *errormsg __attribute__((unused)),
|
||||
size_t errormsg_size __attribute__((unused)),
|
||||
int unused __attribute__((unused)),
|
||||
va_list unused1 __attribute__((unused)));
|
||||
|
||||
@@ -82,7 +83,7 @@ struct st_mariadb_api *mariadb_api= NULL;
|
||||
|
||||
typedef struct st_aurora_instance {
|
||||
char *host;
|
||||
int port;
|
||||
unsigned int port;
|
||||
time_t blacklisted;
|
||||
int type;
|
||||
} AURORA_INSTANCE;
|
||||
@@ -132,7 +133,8 @@ my_bool aurora_switch_connection(MYSQL *mysql, AURORA *aurora, int type)
|
||||
*
|
||||
* plugin initialization function
|
||||
*/
|
||||
int aurora_init(char *errormsg, size_t errormsg_size,
|
||||
int aurora_init(char *errormsg __attribute__((unused)),
|
||||
size_t errormsg_size __attribute__((unused)),
|
||||
int unused __attribute__((unused)),
|
||||
va_list unused1 __attribute__((unused)))
|
||||
{
|
||||
@@ -247,7 +249,7 @@ int aurora_get_instance_type(MYSQL *mysql)
|
||||
int rc= -1;
|
||||
MA_CONNECTION_HANDLER *save_hdlr= mysql->extension->conn_hdlr;
|
||||
|
||||
char *query= "select variable_value from information_schema.global_variables where variable_name='INNODB_READ_ONLY' AND variable_value='OFF'";
|
||||
const char *query= "select variable_value from information_schema.global_variables where variable_name='INNODB_READ_ONLY' AND variable_value='OFF'";
|
||||
|
||||
if (!mysql)
|
||||
return -1;
|
||||
@@ -519,7 +521,7 @@ my_bool aurora_find_primary(AURORA *aurora)
|
||||
|
||||
/* {{{ MYSQL *aurora_connect */
|
||||
MYSQL *aurora_connect(MYSQL *mysql, const char *host, const char *user, const char *passwd,
|
||||
const char *db, unsigned int port, const char *unix_socket, unsigned long client_flag)
|
||||
const char *db, unsigned int port, const char *unix_socket __attribute__((unused)), unsigned long client_flag)
|
||||
{
|
||||
AURORA *aurora= NULL;
|
||||
MA_CONNECTION_HANDLER *save_hdlr= mysql->extension->conn_hdlr;
|
||||
@@ -595,7 +597,7 @@ my_bool aurora_reconnect(MYSQL *mysql)
|
||||
{
|
||||
AURORA *aurora;
|
||||
MA_CONNECTION_HANDLER *save_hdlr= mysql->extension->conn_hdlr;
|
||||
int i;
|
||||
unsigned int i;
|
||||
|
||||
/* We can't determine if a new primary was promotoed, or if
|
||||
* line just dropped - we will close both primary and replica
|
||||
@@ -716,7 +718,7 @@ my_bool is_replica_stmt(MYSQL *mysql, const char *buffer)
|
||||
|
||||
/* {{{ int aurora_command */
|
||||
int aurora_command(MYSQL *mysql,enum enum_server_command command, const char *arg,
|
||||
size_t length, my_bool skipp_check, void *opt_arg)
|
||||
size_t length __attribute__((unused)), my_bool skipp_check __attribute__((unused)), void *opt_arg __attribute__((unused)))
|
||||
{
|
||||
MA_CONNECTION_HANDLER *save_hdlr= mysql->extension->conn_hdlr;
|
||||
AURORA *aurora= (AURORA *)save_hdlr->data;
|
||||
|
@@ -79,7 +79,7 @@ typedef struct st_conn_repl {
|
||||
my_bool round_robin;
|
||||
char *url;
|
||||
char *host[2];
|
||||
int port[2];
|
||||
unsigned int port[2];
|
||||
unsigned int current_type;
|
||||
} REPL_DATA;
|
||||
|
||||
@@ -298,7 +298,9 @@ static my_bool is_slave_stmt(MYSQL *mysql, const char *buffer)
|
||||
|
||||
|
||||
int repl_command(MYSQL *mysql,enum enum_server_command command, const char *arg,
|
||||
size_t length, my_bool skipp_check, void *opt_arg)
|
||||
size_t length,
|
||||
my_bool skipp_check __attribute__((unused)),
|
||||
void *opt_arg __attribute__((unused)))
|
||||
{
|
||||
REPL_DATA *data= (REPL_DATA *)mysql->extension->conn_hdlr->data;
|
||||
|
||||
|
@@ -135,10 +135,10 @@ struct st_pvio_socket {
|
||||
|
||||
static my_bool pvio_socket_initialized= FALSE;
|
||||
|
||||
static int pvio_socket_init(char *errmsg,
|
||||
size_t errmsg_length,
|
||||
int unused,
|
||||
va_list va)
|
||||
static int pvio_socket_init(char *errmsg __attribute__((unused)),
|
||||
size_t errmsg_length __attribute__((unused)),
|
||||
int unused __attribute__((unused)),
|
||||
va_list va __attribute__((unused)))
|
||||
{
|
||||
pvio_socket_initialized= TRUE;
|
||||
return 0;
|
||||
@@ -389,13 +389,13 @@ ssize_t ma_send(int socket, const uchar *buffer, size_t length, int flags)
|
||||
size_t pvio_socket_async_write(MARIADB_PVIO *pvio, const uchar *buffer, size_t length)
|
||||
{
|
||||
ssize_t r= -1;
|
||||
struct st_pvio_socket *csock= NULL;
|
||||
#ifndef _WIN32
|
||||
int write_flags= MSG_DONTWAIT;
|
||||
#ifdef MSG_NOSIGNAL
|
||||
write_flags|= MSG_NOSIGNAL;
|
||||
#endif
|
||||
#endif
|
||||
struct st_pvio_socket *csock= NULL;
|
||||
|
||||
if (!pvio || !pvio->data)
|
||||
return -1;
|
||||
@@ -438,13 +438,13 @@ size_t pvio_socket_async_write(MARIADB_PVIO *pvio, const uchar *buffer, size_t l
|
||||
size_t pvio_socket_write(MARIADB_PVIO *pvio, const uchar *buffer, size_t length)
|
||||
{
|
||||
ssize_t r= -1;
|
||||
struct st_pvio_socket *csock= NULL;
|
||||
#ifndef _WIN32
|
||||
int send_flags= MSG_DONTWAIT;
|
||||
#ifdef MSG_NOSIGNAL
|
||||
send_flags|= MSG_NOSIGNAL;
|
||||
#endif
|
||||
#endif
|
||||
struct st_pvio_socket *csock= NULL;
|
||||
if (!pvio || !pvio->data)
|
||||
return -1;
|
||||
|
||||
|
@@ -63,7 +63,7 @@ struct st_mysql_client_plugin _mysql_client_plugin_declaration_ =
|
||||
NULL
|
||||
};
|
||||
|
||||
static char *commands[]= {
|
||||
static const char *commands[]= {
|
||||
"COM_SLEEP",
|
||||
"COM_QUIT",
|
||||
"COM_INIT_DB",
|
||||
@@ -279,7 +279,7 @@ void trace_callback(int mode, MYSQL *mysql, const uchar *buffer, size_t length)
|
||||
{
|
||||
char *p= (char *)buffer;
|
||||
p+= 4; /* packet length */
|
||||
if (*p != 0xFF) /* protocol version 0xFF indicates error */
|
||||
if ((uchar)*p != 0xFF) /* protocol version 0xFF indicates error */
|
||||
{
|
||||
p+= strlen(p + 1) + 2;
|
||||
thread_id= uint4korr(p);
|
||||
@@ -329,7 +329,7 @@ void trace_callback(int mode, MYSQL *mysql, const uchar *buffer, size_t length)
|
||||
else
|
||||
{
|
||||
p++;
|
||||
if (*p == 0xFF)
|
||||
if ((uchar)*p == 0xFF)
|
||||
printf("%8lu: CONNECT_ERROR(%d)\n", info->thread_id, uint4korr(p+1));
|
||||
else
|
||||
printf("%8lu: CONNECT_SUCCESS(host=%s,user=%s,db=%s)\n", info->thread_id,
|
||||
@@ -395,7 +395,7 @@ void trace_callback(int mode, MYSQL *mysql, const uchar *buffer, size_t length)
|
||||
len= uint3korr(p);
|
||||
p+= 4;
|
||||
|
||||
is_error= ((unsigned int)len == -1);
|
||||
is_error= (len == -1);
|
||||
|
||||
switch(info->last_command) {
|
||||
case COM_STMT_EXECUTE:
|
||||
|
@@ -132,7 +132,7 @@ wait_for_mysql(MYSQL *mysql, int status)
|
||||
#endif
|
||||
}
|
||||
|
||||
static int async1(MYSQL *my)
|
||||
static int async1(MYSQL *unused __attribute__((unused)))
|
||||
{
|
||||
int err= 0, rc;
|
||||
MYSQL mysql, *ret;
|
||||
@@ -211,7 +211,7 @@ static int async1(MYSQL *my)
|
||||
return OK;
|
||||
}
|
||||
|
||||
static int test_conc131(MYSQL *my)
|
||||
static int test_conc131(MYSQL *unused __attribute__((unused)))
|
||||
{
|
||||
int rc;
|
||||
/* this test needs to run under valgrind */
|
||||
@@ -227,7 +227,7 @@ static int test_conc131(MYSQL *my)
|
||||
return OK;
|
||||
}
|
||||
|
||||
static int test_conc129(MYSQL *my)
|
||||
static int test_conc129(MYSQL *unused __attribute__((unused)))
|
||||
{
|
||||
MYSQL *mysql;
|
||||
|
||||
|
@@ -72,7 +72,7 @@ static int test_conc75(MYSQL *my)
|
||||
}
|
||||
|
||||
|
||||
static int test_conc74(MYSQL *my)
|
||||
static int test_conc74(MYSQL *unused __attribute__((unused)))
|
||||
{
|
||||
int rc;
|
||||
MYSQL *mysql;
|
||||
@@ -247,7 +247,7 @@ static int test_conc68(MYSQL *my)
|
||||
}
|
||||
|
||||
|
||||
static int basic_connect(MYSQL *mysql)
|
||||
static int basic_connect(MYSQL *unused __attribute__((unused)))
|
||||
{
|
||||
MYSQL_ROW row;
|
||||
MYSQL_RES *res;
|
||||
@@ -371,7 +371,7 @@ static int test_bug12001(MYSQL *mysql)
|
||||
|
||||
/* connection options */
|
||||
struct my_option_st opt_utf8[] = {
|
||||
{MYSQL_SET_CHARSET_NAME, "utf8"},
|
||||
{MYSQL_SET_CHARSET_NAME, (char *)"utf8"},
|
||||
{0, NULL}
|
||||
};
|
||||
|
||||
@@ -655,7 +655,7 @@ static int bug_conc1(MYSQL *mysql)
|
||||
return OK;
|
||||
}
|
||||
|
||||
static int test_options_initcmd(MYSQL *my)
|
||||
static int test_options_initcmd(MYSQL *unused __attribute__((unused)))
|
||||
{
|
||||
MYSQL *mysql= mysql_init(NULL);
|
||||
MYSQL_RES *res;
|
||||
@@ -678,7 +678,7 @@ static int test_options_initcmd(MYSQL *my)
|
||||
return OK;
|
||||
}
|
||||
|
||||
static int test_extended_init_values(MYSQL *my)
|
||||
static int test_extended_init_values(MYSQL *unused __attribute__((unused)))
|
||||
{
|
||||
MYSQL *mysql= mysql_init(NULL);
|
||||
|
||||
@@ -692,7 +692,7 @@ static int test_extended_init_values(MYSQL *my)
|
||||
return OK;
|
||||
}
|
||||
|
||||
static int test_reconnect_maxpackage(MYSQL *my)
|
||||
static int test_reconnect_maxpackage(MYSQL *unused __attribute__((unused)))
|
||||
{
|
||||
int rc;
|
||||
ulong max_packet= 0;
|
||||
@@ -752,7 +752,7 @@ static int test_reconnect_maxpackage(MYSQL *my)
|
||||
return OK;
|
||||
}
|
||||
|
||||
static int test_compressed(MYSQL *my)
|
||||
static int test_compressed(MYSQL *unused __attribute__((unused)))
|
||||
{
|
||||
int rc;
|
||||
MYSQL *mysql= mysql_init(NULL);
|
||||
|
@@ -20,7 +20,7 @@
|
||||
#define TEST_ARRAY_SIZE 1024
|
||||
|
||||
char *rand_str(size_t length) {
|
||||
char charset[] = "0123456789"
|
||||
const char charset[] = "0123456789"
|
||||
"abcdefghijklmnopqrstuvwxyz"
|
||||
"ABCDEFGHIJKLMNOPQRSTUVWXYZ";
|
||||
char *dest= (char *)malloc(length+1);
|
||||
@@ -36,17 +36,17 @@ char *rand_str(size_t length) {
|
||||
static int bulk1(MYSQL *mysql)
|
||||
{
|
||||
MYSQL_STMT *stmt= mysql_stmt_init(mysql);
|
||||
char *stmt_str= "INSERT INTO bulk1 VALUES (?,?)";
|
||||
unsigned long array_size= TEST_ARRAY_SIZE;
|
||||
const char *stmt_str= "INSERT INTO bulk1 VALUES (?,?)";
|
||||
unsigned int array_size= TEST_ARRAY_SIZE;
|
||||
int rc;
|
||||
int i;
|
||||
unsigned int i;
|
||||
char **buffer;
|
||||
unsigned long *lengths;
|
||||
unsigned int *vals;
|
||||
MYSQL_BIND bind[2];
|
||||
MYSQL_RES *res;
|
||||
MYSQL_ROW row;
|
||||
int intval;
|
||||
unsigned int intval;
|
||||
|
||||
rc= mysql_query(mysql, "DROP TABLE IF EXISTS bulk1");
|
||||
check_mysql_rc(rc, mysql);
|
||||
@@ -60,7 +60,7 @@ static int bulk1(MYSQL *mysql)
|
||||
/* allocate memory */
|
||||
buffer= calloc(TEST_ARRAY_SIZE, sizeof(char *));
|
||||
lengths= (unsigned long *)calloc(sizeof(long), TEST_ARRAY_SIZE);
|
||||
vals= (int *)calloc(sizeof(int), TEST_ARRAY_SIZE);
|
||||
vals= (unsigned int *)calloc(sizeof(int), TEST_ARRAY_SIZE);
|
||||
|
||||
for (i=0; i < TEST_ARRAY_SIZE; i++)
|
||||
{
|
||||
@@ -74,7 +74,7 @@ static int bulk1(MYSQL *mysql)
|
||||
bind[0].buffer= (int *)&vals[0];
|
||||
bind[1].buffer_type= MYSQL_TYPE_STRING;
|
||||
bind[1].buffer= (void *)buffer;
|
||||
bind[1].length= (long *)lengths;
|
||||
bind[1].length= (unsigned long *)lengths;
|
||||
|
||||
rc= mysql_stmt_attr_set(stmt, STMT_ATTR_ARRAY_SIZE, &array_size);
|
||||
check_stmt_rc(rc, stmt);
|
||||
@@ -130,9 +130,9 @@ static int bulk2(MYSQL *mysql)
|
||||
MYSQL_STMT *stmt= mysql_stmt_init(mysql);
|
||||
int rc;
|
||||
MYSQL_BIND bind;
|
||||
int i;
|
||||
unsigned long array_size=1024;
|
||||
uchar indicator[1024];
|
||||
unsigned int i;
|
||||
unsigned int array_size=1024;
|
||||
char indicator[1024];
|
||||
rc= mysql_query(mysql, "DROP TABLE IF EXISTS bulk2");
|
||||
check_mysql_rc(rc, mysql);
|
||||
|
||||
|
@@ -37,7 +37,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
|
||||
|
||||
/* set connection options */
|
||||
struct my_option_st opt_bug8378[] = {
|
||||
{MYSQL_SET_CHARSET_NAME, "gbk"},
|
||||
{MYSQL_SET_CHARSET_NAME, (char *) "gbk"},
|
||||
{0, NULL}
|
||||
};
|
||||
|
||||
@@ -120,7 +120,7 @@ int test_escaping(MYSQL *mysql)
|
||||
{
|
||||
int i= 0, rc, len;
|
||||
char out[20];
|
||||
char *escape_chars[] = {"'", "\x0", "\n", "\r", "\\", "\0", NULL};
|
||||
const char *escape_chars[] = {"'", "\x0", "\n", "\r", "\\", "\0", NULL};
|
||||
|
||||
/* reset sql_mode, mysql_change_user call doesn't reset it */
|
||||
rc= mysql_query(mysql, "SET sql_mode=''");
|
||||
@@ -659,9 +659,9 @@ static int test_bug_54100(MYSQL *mysql)
|
||||
|
||||
/* We need this internal function for the test */
|
||||
|
||||
static int test_utf16_utf32_noboms(MYSQL *mysql)
|
||||
static int test_utf16_utf32_noboms(MYSQL *mysql __attribute__((unused)))
|
||||
{
|
||||
char *csname[]= {"utf16", "utf16le", "utf32", "utf8"};
|
||||
const char *csname[]= {"utf16", "utf16le", "utf32", "utf8"};
|
||||
MARIADB_CHARSET_INFO *csinfo[sizeof(csname)/sizeof(char*)];
|
||||
|
||||
const int UTF8= sizeof(csname)/sizeof(char*) - 1;
|
||||
@@ -676,7 +676,7 @@ static int test_utf16_utf32_noboms(MYSQL *mysql)
|
||||
int i, error;
|
||||
size_t rc, in_len, out_len;
|
||||
|
||||
for (i= 0; i < sizeof(csname)/sizeof(char*); ++i)
|
||||
for (i= 0; i < (int)(sizeof(csname)/sizeof(char*)); ++i)
|
||||
{
|
||||
csinfo[i]= mariadb_get_charset_by_name(csname[i]);
|
||||
|
||||
@@ -693,9 +693,9 @@ static int test_utf16_utf32_noboms(MYSQL *mysql)
|
||||
out_len= sizeof(buffer);
|
||||
|
||||
diag("Converting %s->%s", csname[i], csname[UTF8]);
|
||||
rc= mariadb_convert_string(in_string[i], &in_len, csinfo[i], buffer, &out_len, csinfo[UTF8], &error);
|
||||
rc= mariadb_convert_string((char *)in_string[i], &in_len, csinfo[i], buffer, &out_len, csinfo[UTF8], &error);
|
||||
|
||||
FAIL_IF(rc == -1, "Conversion failed");
|
||||
FAIL_IF(rc == (size_t)-1, "Conversion failed");
|
||||
FAIL_IF(rc != in_oct_len[UTF8], "Incorrect number of written bytes");
|
||||
|
||||
if (memcmp(buffer, in_string[UTF8], rc) != 0)
|
||||
@@ -709,9 +709,9 @@ static int test_utf16_utf32_noboms(MYSQL *mysql)
|
||||
out_len= sizeof(buffer);
|
||||
|
||||
diag("Converting %s->%s", csname[UTF8], csname[i]);
|
||||
rc= mariadb_convert_string(in_string[UTF8], &in_len, csinfo[UTF8], buffer, &out_len, csinfo[i], &error);
|
||||
rc= mariadb_convert_string((char *)in_string[UTF8], &in_len, csinfo[UTF8], buffer, &out_len, csinfo[i], &error);
|
||||
|
||||
FAIL_IF(rc==-1, "Conversion failed");
|
||||
FAIL_IF(rc == (size_t)-1, "Conversion failed");
|
||||
diag("rc=%lu oct_len: %lu", rc, in_oct_len[i]);
|
||||
FAIL_IF(rc != in_oct_len[i], "Incorrect number of written bytes");
|
||||
|
||||
@@ -726,10 +726,10 @@ static int test_utf16_utf32_noboms(MYSQL *mysql)
|
||||
return OK;
|
||||
}
|
||||
|
||||
static int charset_auto(MYSQL *my)
|
||||
static int charset_auto(MYSQL *my __attribute__((unused)))
|
||||
{
|
||||
const char *csname1, *csname2;
|
||||
char *osname;
|
||||
const char *osname;
|
||||
MYSQL *mysql= mysql_init(NULL);
|
||||
int rc;
|
||||
|
||||
|
@@ -599,7 +599,7 @@ int test_conc21(MYSQL *mysql)
|
||||
MYSQL_RES *res= NULL;
|
||||
MYSQL_ROW row;
|
||||
char tmp[256];
|
||||
int check_server_version= 0;
|
||||
unsigned int check_server_version= 0;
|
||||
int major=0, minor= 0, patch=0;
|
||||
|
||||
rc= mysql_query(mysql, "SELECT @@version");
|
||||
@@ -621,7 +621,7 @@ int test_conc21(MYSQL *mysql)
|
||||
return OK;
|
||||
}
|
||||
|
||||
int test_conc26(MYSQL *my)
|
||||
int test_conc26(MYSQL *unused __attribute__((unused)))
|
||||
{
|
||||
MYSQL *mysql= mysql_init(NULL);
|
||||
mysql_options(mysql, MYSQL_SET_CHARSET_NAME, "utf8");
|
||||
@@ -642,7 +642,7 @@ int test_conc26(MYSQL *my)
|
||||
return OK;
|
||||
}
|
||||
|
||||
int test_connection_timeout(MYSQL *my)
|
||||
int test_connection_timeout(MYSQL *unused __attribute__((unused)))
|
||||
{
|
||||
unsigned int timeout= 5;
|
||||
time_t start, elapsed;
|
||||
@@ -661,7 +661,7 @@ int test_connection_timeout(MYSQL *my)
|
||||
return OK;
|
||||
}
|
||||
|
||||
int test_connection_timeout2(MYSQL *my)
|
||||
int test_connection_timeout2(MYSQL *unused __attribute__((unused)))
|
||||
{
|
||||
unsigned int timeout= 5;
|
||||
time_t start, elapsed;
|
||||
@@ -681,7 +681,7 @@ int test_connection_timeout2(MYSQL *my)
|
||||
return OK;
|
||||
}
|
||||
|
||||
int test_connection_timeout3(MYSQL *my)
|
||||
int test_connection_timeout3(MYSQL *unused __attribute__((unused)))
|
||||
{
|
||||
unsigned int timeout= 5;
|
||||
unsigned int read_write_timeout= 10;
|
||||
@@ -756,9 +756,9 @@ static int test_conc118(MYSQL *mysql)
|
||||
return OK;
|
||||
}
|
||||
|
||||
static int test_wrong_bind_address(MYSQL *my)
|
||||
static int test_wrong_bind_address(MYSQL *unused __attribute__((unused)))
|
||||
{
|
||||
char *bind_addr= "100.188.111.112";
|
||||
const char *bind_addr= "100.188.111.112";
|
||||
MYSQL *mysql;
|
||||
|
||||
if (!hostname || !strcmp(hostname, "localhost"))
|
||||
@@ -827,7 +827,7 @@ static int test_bind_address(MYSQL *my)
|
||||
return OK;
|
||||
}
|
||||
|
||||
static int test_get_options(MYSQL *my)
|
||||
static int test_get_options(MYSQL *unused __attribute__((unused)))
|
||||
{
|
||||
MYSQL *mysql= mysql_init(NULL);
|
||||
int options_int[]= {MYSQL_OPT_CONNECT_TIMEOUT, MYSQL_OPT_LOCAL_INFILE,
|
||||
@@ -843,18 +843,19 @@ static int test_get_options(MYSQL *my)
|
||||
MYSQL_OPT_SSL_CIPHER, MYSQL_OPT_BIND, MARIADB_OPT_SSL_FP, MARIADB_OPT_SSL_FP_LIST,
|
||||
MARIADB_OPT_TLS_PASSPHRASE, 0};
|
||||
|
||||
char *init_command[3]= {"SET @a:=1", "SET @b:=2", "SET @c:=3"};
|
||||
const char *init_command[3]= {"SET @a:=1", "SET @b:=2", "SET @c:=3"};
|
||||
int elements= 0;
|
||||
char **command;
|
||||
|
||||
|
||||
int intval[2]= {1, 0};
|
||||
my_bool boolval[2]= {1, 0};
|
||||
char *char1= "test", *char2;
|
||||
const char *char1= "test";
|
||||
char *char2;
|
||||
int i;
|
||||
MYSQL *userdata;
|
||||
char *attr_key[] = {"foo1", "foo2", "foo3"};
|
||||
char *attr_val[] = {"bar1", "bar2", "bar3"};
|
||||
const char *attr_key[] = {"foo1", "foo2", "foo3"};
|
||||
const char *attr_val[] = {"bar1", "bar2", "bar3"};
|
||||
char **key, **val;
|
||||
|
||||
for (i=0; options_int[i]; i++)
|
||||
@@ -906,7 +907,7 @@ static int test_get_options(MYSQL *my)
|
||||
free(val);
|
||||
|
||||
mysql_optionsv(mysql, MARIADB_OPT_USERDATA, "my_app", (void *)mysql);
|
||||
mysql_get_optionv(mysql, MARIADB_OPT_USERDATA, "my_app", &userdata);
|
||||
mysql_get_optionv(mysql, MARIADB_OPT_USERDATA, (char *)"my_app", &userdata);
|
||||
|
||||
FAIL_IF(mysql != userdata, "wrong userdata");
|
||||
mysql_close(mysql);
|
||||
@@ -943,6 +944,7 @@ static int test_sess_track_db(MYSQL *mysql)
|
||||
|
||||
rc= mysql_query(mysql, "SET NAMES utf8");
|
||||
check_mysql_rc(rc, mysql);
|
||||
diag("charset: %s", mysql->charset->csname);
|
||||
FAIL_IF(strcmp(mysql->charset->csname, "utf8"), "Expected charset 'utf8'");
|
||||
if (!mysql_session_track_get_first(mysql, SESSION_TRACK_SYSTEM_VARIABLES, &data, &len))
|
||||
do {
|
||||
|
@@ -24,11 +24,21 @@ static int create_dyncol_named(MYSQL *mysql)
|
||||
DYNAMIC_COLUMN_VALUE *vals;
|
||||
uint i, column_count= 6;
|
||||
int rc;
|
||||
char *strval[]= {"Val1", "Val2", "Val3", "Val4", "Val5", "Val6"};
|
||||
MYSQL_LEX_STRING keys1[]= {{"key1", 4}, {"key2", 4}, {"key3", 4}, {"key4", 4}, {"key5", 4}, {"key6", 4}},
|
||||
keys2[]= {{"key1", 4}, {"key1", 4}, {"key3", 4}, {"key4", 4}, {"key5", 4}, {"key6", 4}},
|
||||
keys3[]= {{"\x70\x61\x72\x61\x00\x30", 6}, {"\x70\x61\x72\x61\x00\x31", 6}, {"\x70\x61\x72\x61\x00\x32", 6},
|
||||
{"\x70\x61\x72\x61\x00\x33", 6}, {"\x70\x61\x72\x61\x00\x34", 6}, {"\x70\x61\x72\x61\x00\x35", 6}};
|
||||
const char *strval[]= {"Val1", "Val2", "Val3", "Val4", "Val5", "Val6"};
|
||||
MYSQL_LEX_STRING keys1[]= {{(char *)"key1", 4}, {(char *)"key2", 4},
|
||||
{(char *)"key3", 4}, {(char *)"key4", 4},
|
||||
{(char *)"key5", 4}, {(char *)"key6", 4}},
|
||||
|
||||
keys2[]= {{(char *)"key1", 4}, {(char *)"key1", 4},
|
||||
{(char *)"key3", 4}, {(char *)"key4", 4},
|
||||
{(char *)"key5", 4}, {(char *)"key6", 4}},
|
||||
|
||||
keys3[]= {{(char *)"\x70\x61\x72\x61\x00\x30", 6},
|
||||
{(char *)"\x70\x61\x72\x61\x00\x31", 6},
|
||||
{(char *)"\x70\x61\x72\x61\x00\x32", 6},
|
||||
{(char *)"\x70\x61\x72\x61\x00\x33", 6},
|
||||
{(char *)"\x70\x61\x72\x61\x00\x34", 6},
|
||||
{(char *)"\x70\x61\x72\x61\x00\x35", 6}};
|
||||
MYSQL_LEX_STRING *my_keys;
|
||||
uint my_count;
|
||||
|
||||
@@ -37,7 +47,7 @@ static int create_dyncol_named(MYSQL *mysql)
|
||||
for (i=0; i < column_count; i++)
|
||||
{
|
||||
vals[i].type= DYN_COL_STRING;
|
||||
vals[i].x.string.value.str= strval[i];
|
||||
vals[i].x.string.value.str= (char *)strval[i];
|
||||
vals[i].x.string.value.length= strlen(strval[i]);
|
||||
vals[i].x.string.charset= (MARIADB_CHARSET_INFO *)mysql->charset;
|
||||
diag("%s", keys3[i].str);
|
||||
@@ -87,7 +97,7 @@ static int create_dyncol_named(MYSQL *mysql)
|
||||
FAIL_IF(rc < 0, "update failed");
|
||||
mariadb_dyncol_free(&dyncol);
|
||||
|
||||
keys3[0].str= "test";
|
||||
keys3[0].str= (char *)"test";
|
||||
for (i=0; i < column_count; i++)
|
||||
diag("%s", my_keys[i].str);
|
||||
|
||||
@@ -96,7 +106,7 @@ static int create_dyncol_named(MYSQL *mysql)
|
||||
return OK;
|
||||
}
|
||||
|
||||
static int mdev_4994(MYSQL *mysql)
|
||||
static int mdev_4994(MYSQL *unused __attribute__((unused)))
|
||||
{
|
||||
DYNAMIC_COLUMN dyncol;
|
||||
uint key= 1;
|
||||
@@ -121,22 +131,22 @@ static int create_dyncol_num(MYSQL *mysql)
|
||||
MYSQL_LEX_STRING *my_keys;
|
||||
DYNAMIC_COLUMN_VALUE *my_vals;
|
||||
int rc;
|
||||
char *strval[]= {"Val1", "Val2", "Val3", "Val4", "Val5"};
|
||||
const char *strval[]= {"Val1", "Val2", "Val3", "Val4", "Val5"};
|
||||
|
||||
uint keys1[5]= {1,2,3,4,5},
|
||||
keys2[5]= {1,2,2,4,5};
|
||||
MYSQL_LEX_STRING key1= {"1",1};
|
||||
MYSQL_LEX_STRING key1= {(char *)"1",1};
|
||||
|
||||
for (i=0; i < column_count; i++)
|
||||
{
|
||||
vals[i].type= DYN_COL_STRING;
|
||||
vals[i].x.string.value.str= strval[i];
|
||||
vals[i].x.string.value.str= (char *)strval[i];
|
||||
vals[i].x.string.value.length= strlen(strval[i]);
|
||||
vals[i].x.string.charset= (MARIADB_CHARSET_INFO *)mysql->charset;
|
||||
}
|
||||
FAIL_IF(mariadb_dyncol_create_many_num(&dyncol, column_count, keys1, vals, 1) <0, "Error (keys1)");
|
||||
|
||||
vals[0].x.string.value.str= strval[1];
|
||||
vals[0].x.string.value.str= (char *)strval[1];
|
||||
rc= mariadb_dyncol_update_many_named(&dyncol,1, &key1, vals);
|
||||
diag("update: %d", rc);
|
||||
|
||||
@@ -163,10 +173,10 @@ static int mdev_x1(MYSQL *mysql)
|
||||
int rc;
|
||||
uint i;
|
||||
uint num_keys[5]= {1,2,3,4,5};
|
||||
char *strval[]= {"Val1", "Val2", "Val3", "Val4", "Val5"};
|
||||
const char *strval[]= {"Val1", "Val2", "Val3", "Val4", "Val5"};
|
||||
DYNAMIC_COLUMN_VALUE vals[5];
|
||||
DYNAMIC_COLUMN dynstr;
|
||||
MYSQL_LEX_STRING my_key= {"1", 2};
|
||||
MYSQL_LEX_STRING my_key= {(char *)"1", 2};
|
||||
uint unpack_columns;
|
||||
MYSQL_LEX_STRING *unpack_keys;
|
||||
DYNAMIC_COLUMN_VALUE *unpack_vals;
|
||||
@@ -174,7 +184,7 @@ static int mdev_x1(MYSQL *mysql)
|
||||
for (i=0; i < 5; i++)
|
||||
{
|
||||
vals[i].type= DYN_COL_STRING;
|
||||
vals[i].x.string.value.str= strval[i];
|
||||
vals[i].x.string.value.str= (char *)strval[i];
|
||||
vals[i].x.string.value.length= strlen(strval[i]);
|
||||
vals[i].x.string.charset= (MARIADB_CHARSET_INFO *)mysql->charset;
|
||||
}
|
||||
@@ -233,7 +243,7 @@ static int mdev_x1(MYSQL *mysql)
|
||||
return OK;
|
||||
}
|
||||
|
||||
static int dyncol_column_count(MYSQL *mysql)
|
||||
static int dyncol_column_count(MYSQL *unused __attribute__((unused)))
|
||||
{
|
||||
DYNAMIC_COLUMN dyncol;
|
||||
uint column_count= 5;
|
||||
|
@@ -44,7 +44,7 @@ static int test_ps_client_warnings(MYSQL *mysql)
|
||||
{
|
||||
int rc;
|
||||
MYSQL_STMT *stmt;
|
||||
char *query= "DROP TABLE IF EXISTS test_non_exists";
|
||||
const char *query= "DROP TABLE IF EXISTS test_non_exists";
|
||||
|
||||
rc= mysql_query(mysql, "DROP TABLE if exists test_non_exists");
|
||||
check_mysql_rc(rc, mysql);
|
||||
@@ -109,7 +109,7 @@ static int test_ps_client_errors(MYSQL *mysql)
|
||||
{
|
||||
int rc;
|
||||
MYSQL_STMT *stmt;
|
||||
char *query= "DROP TABLE test_non_exists";
|
||||
const char *query= "DROP TABLE test_non_exists";
|
||||
|
||||
rc= mysql_query(mysql, "DROP TABLE if exists test_non_exists");
|
||||
check_mysql_rc(rc, mysql);
|
||||
|
@@ -175,7 +175,7 @@ static int com_multi_ps2(MYSQL *mysql)
|
||||
MYSQL_BIND bind[2];
|
||||
int intval= 3, rc;
|
||||
int i;
|
||||
char *varval= "com_multi_ps2";
|
||||
const char *varval= "com_multi_ps2";
|
||||
unsigned int param_count= 2;
|
||||
|
||||
if (!have_com_multi)
|
||||
@@ -189,7 +189,7 @@ static int com_multi_ps2(MYSQL *mysql)
|
||||
bind[0].buffer_type= MYSQL_TYPE_SHORT;
|
||||
bind[0].buffer= &intval;
|
||||
bind[1].buffer_type= MYSQL_TYPE_STRING;
|
||||
bind[1].buffer= varval;
|
||||
bind[1].buffer= (char *)varval;
|
||||
bind[1].buffer_length= strlen(varval);
|
||||
|
||||
stmt= mysql_stmt_init(mysql);
|
||||
@@ -271,7 +271,7 @@ static int execute_direct_example(MYSQL *mysql)
|
||||
MYSQL_BIND bind[2];
|
||||
int intval= 1;
|
||||
int param_count= 2;
|
||||
char *strval= "execute_direct_example";
|
||||
const char *strval= "execute_direct_example";
|
||||
|
||||
/* Direct execution without parameters */
|
||||
if (mariadb_stmt_execute_direct(stmt, "DROP TABLE IF EXISTS execute_direct", -1))
|
||||
@@ -283,7 +283,7 @@ static int execute_direct_example(MYSQL *mysql)
|
||||
bind[0].buffer_type= MYSQL_TYPE_SHORT;
|
||||
bind[0].buffer= &intval;
|
||||
bind[1].buffer_type= MYSQL_TYPE_STRING;
|
||||
bind[1].buffer= strval;
|
||||
bind[1].buffer= (char *)strval;
|
||||
bind[1].buffer_length= strlen(strval);
|
||||
|
||||
/* set number of parameters */
|
||||
|
@@ -187,7 +187,7 @@ static int test_fetch_seek(MYSQL *mysql)
|
||||
int rc;
|
||||
int32 c1;
|
||||
char c2[11], c3[20];
|
||||
char *query = "SELECT * FROM t1";
|
||||
const char *query = "SELECT * FROM t1";
|
||||
|
||||
rc= mysql_query(mysql, "drop table if exists t1");
|
||||
check_mysql_rc(rc, mysql);
|
||||
@@ -273,7 +273,7 @@ static int test_fetch_offset(MYSQL *mysql)
|
||||
ulong length[2];
|
||||
int rc;
|
||||
my_bool is_null[2];
|
||||
char *query = "SELECT * FROM t1";
|
||||
const char *query = "SELECT * FROM t1";
|
||||
|
||||
|
||||
rc= mysql_query(mysql, "drop table if exists t1");
|
||||
@@ -396,7 +396,7 @@ static int test_fetch_column(MYSQL *mysql)
|
||||
char c2[20], bc2[20];
|
||||
ulong l1, l2, bl1, bl2;
|
||||
int rc, c1, bc1;
|
||||
char *query= "SELECT * FROM t1 ORDER BY c2 DESC";
|
||||
const char *query= "SELECT * FROM t1 ORDER BY c2 DESC";
|
||||
|
||||
rc= mysql_query(mysql, "drop table if exists t1");
|
||||
check_mysql_rc(rc, mysql);
|
||||
@@ -516,7 +516,7 @@ static int test_fetch_nobuffs(MYSQL *mysql)
|
||||
MYSQL_BIND my_bind[4];
|
||||
char str[4][50];
|
||||
int rc;
|
||||
char *query = "SELECT DATABASE(), CURRENT_USER(), \
|
||||
const char *query = "SELECT DATABASE(), CURRENT_USER(), \
|
||||
CURRENT_DATE(), CURRENT_TIME()";
|
||||
|
||||
stmt = mysql_stmt_init(mysql);
|
||||
@@ -653,7 +653,7 @@ static int test_fetch_date(MYSQL *mysql)
|
||||
MYSQL_BIND my_bind[8];
|
||||
my_bool is_null[8];
|
||||
ulong length[8];
|
||||
char *query= "SELECT * FROM test_bind_result";
|
||||
const char *query= "SELECT * FROM test_bind_result";
|
||||
|
||||
rc= mysql_query(mysql, "DROP TABLE IF EXISTS test_bind_result");
|
||||
check_mysql_rc(rc, mysql);
|
||||
|
@@ -164,7 +164,7 @@ static int bug31418_impl()
|
||||
return OK;
|
||||
}
|
||||
|
||||
static int test_bug31418(MYSQL *mysql)
|
||||
static int test_bug31418(MYSQL *unused __attribute__((unused)))
|
||||
{
|
||||
int i;
|
||||
/* Run test case for BUG#31418 for three different connections. */
|
||||
@@ -312,7 +312,7 @@ static int test_wl4166_1(MYSQL *mysql)
|
||||
ulong length[7];
|
||||
my_bool is_null[7];
|
||||
MYSQL_BIND my_bind[7];
|
||||
static char *query;
|
||||
const char *query;
|
||||
int rc;
|
||||
int i;
|
||||
|
||||
@@ -955,7 +955,7 @@ static int test_conc_114(MYSQL *mysql)
|
||||
}
|
||||
|
||||
/* run with valgrind */
|
||||
static int test_conc117(MYSQL *mysql)
|
||||
static int test_conc117(MYSQL *unused __attribute__((unused)))
|
||||
{
|
||||
my_bool reconnect= 1;
|
||||
MYSQL *my= mysql_init(NULL);
|
||||
@@ -973,7 +973,7 @@ static int test_conc117(MYSQL *mysql)
|
||||
return OK;
|
||||
}
|
||||
|
||||
static int test_read_timeout(MYSQL *mysql)
|
||||
static int test_read_timeout(MYSQL *unused __attribute__((unused)))
|
||||
{
|
||||
int timeout= 5, rc;
|
||||
MYSQL *my= mysql_init(NULL);
|
||||
@@ -1122,7 +1122,7 @@ static int test_zerofill(MYSQL *mysql)
|
||||
rc= mysql_query(mysql, "SELECT a FROM t1");
|
||||
check_mysql_rc(rc, mysql);
|
||||
|
||||
if (res= mysql_store_result(mysql))
|
||||
if ((res= mysql_store_result(mysql)))
|
||||
{
|
||||
row= mysql_fetch_row(res);
|
||||
diag("zerofill: %s", row[0]);
|
||||
|
@@ -113,10 +113,10 @@ struct my_tests_st
|
||||
int connection;
|
||||
ulong connect_flags;
|
||||
struct my_option_st *options;
|
||||
char *skipmsg;
|
||||
const char *skipmsg;
|
||||
};
|
||||
|
||||
static char *schema = 0;
|
||||
static const char *schema = 0;
|
||||
static char *hostname = 0;
|
||||
static char *password = 0;
|
||||
static unsigned int port = 0;
|
||||
@@ -159,11 +159,13 @@ static struct my_option test_options[] =
|
||||
int do_verify_prepare_field(MYSQL_RES *result,
|
||||
unsigned int no, const char *name,
|
||||
const char *org_name,
|
||||
enum enum_field_types type,
|
||||
enum enum_field_types type __attribute__((unused)),
|
||||
const char *table,
|
||||
const char *org_table, const char *db,
|
||||
unsigned long length, const char *def,
|
||||
const char *file, int line)
|
||||
unsigned long length __attribute__((unused)),
|
||||
const char *def __attribute__((unused)),
|
||||
const char *file __attribute__((unused)),
|
||||
int line __attribute__((unused)))
|
||||
{
|
||||
MYSQL_FIELD *field;
|
||||
/* MARIADB_CHARSET_INFO *cs; */
|
||||
@@ -353,7 +355,7 @@ void get_options(int argc, char **argv)
|
||||
}
|
||||
|
||||
|
||||
int check_variable(MYSQL *mysql, char *variable, char *value)
|
||||
int check_variable(MYSQL *mysql, const char *variable, const char *value)
|
||||
{
|
||||
char query[MAX_TEST_QUERY_LENGTH];
|
||||
MYSQL_RES *result;
|
||||
|
@@ -27,7 +27,7 @@ static int perf1(MYSQL *mysql)
|
||||
{
|
||||
int rc;
|
||||
MYSQL_STMT *stmt;
|
||||
char *stmtstr= "SELECT s.emp_no, s.salary, e.emp_no, e.first_name, e.last_name, e.gender FROM salaries s, employees e WHERE s.emp_no = e.emp_no";
|
||||
const char *stmtstr= "SELECT s.emp_no, s.salary, e.emp_no, e.first_name, e.last_name, e.gender FROM salaries s, employees e WHERE s.emp_no = e.emp_no";
|
||||
|
||||
rc= mysql_select_db(mysql, "employees");
|
||||
if (rc)
|
||||
|
@@ -47,14 +47,14 @@ static int test_conc97(MYSQL *mysql)
|
||||
return OK;
|
||||
}
|
||||
|
||||
static int test_conc83(MYSQL *my)
|
||||
static int test_conc83(MYSQL *unused __attribute__((unused)))
|
||||
{
|
||||
MYSQL_STMT *stmt;
|
||||
int rc;
|
||||
MYSQL *mysql= mysql_init(NULL);
|
||||
my_bool reconnect= 1;
|
||||
|
||||
char *query= "SELECT 1,2,3 FROM DUAL";
|
||||
const char *query= "SELECT 1,2,3 FROM DUAL";
|
||||
|
||||
stmt= mysql_stmt_init(mysql);
|
||||
|
||||
@@ -91,7 +91,7 @@ static int test_conc60(MYSQL *mysql)
|
||||
{
|
||||
MYSQL_STMT *stmt;
|
||||
int rc;
|
||||
char *query= "SELECT * FROM agendas";
|
||||
const char *query= "SELECT * FROM agendas";
|
||||
my_bool x= 1;
|
||||
|
||||
stmt= mysql_stmt_init(mysql);
|
||||
@@ -3558,7 +3558,7 @@ static int test_multi_stmt(MYSQL *mysql)
|
||||
MYSQL_BIND my_bind[2];
|
||||
ulong length[2];
|
||||
my_bool is_null[2];
|
||||
static char *query;
|
||||
const char *query;
|
||||
|
||||
rc= mysql_query(mysql, "DROP TABLE IF EXISTS test_multi_table");
|
||||
check_mysql_rc(rc, mysql);
|
||||
@@ -3847,7 +3847,7 @@ static int test_order_param(MYSQL *mysql)
|
||||
{
|
||||
MYSQL_STMT *stmt;
|
||||
int rc;
|
||||
static char *query;
|
||||
const char *query;
|
||||
|
||||
rc= mysql_query(mysql, "DROP TABLE IF EXISTS t1");
|
||||
check_mysql_rc(rc, mysql);
|
||||
@@ -4677,7 +4677,7 @@ static int test_long_data1(MYSQL *mysql)
|
||||
int rc;
|
||||
MYSQL_BIND bind[1];
|
||||
char query[MAX_TEST_QUERY_LENGTH];
|
||||
char *data= "12345";
|
||||
const char *data= "12345";
|
||||
|
||||
rc= mysql_autocommit(mysql, TRUE);
|
||||
check_mysql_rc(rc, mysql);
|
||||
@@ -4715,7 +4715,7 @@ int test_blob_9000(MYSQL *mysql)
|
||||
MYSQL_STMT *stmt;
|
||||
int rc;
|
||||
char buffer[9200];
|
||||
char *query= "INSERT INTO tb9000 VALUES (?)";
|
||||
const char *query= "INSERT INTO tb9000 VALUES (?)";
|
||||
|
||||
rc= mysql_query(mysql, "DROP TABLE IF EXISTS tb9000");
|
||||
check_mysql_rc(rc, mysql);
|
||||
@@ -4743,7 +4743,7 @@ int test_fracseconds(MYSQL *mysql)
|
||||
{
|
||||
MYSQL_STMT *stmt;
|
||||
int rc;
|
||||
char *str= "SELECT NOW(6)";
|
||||
const char *str= "SELECT NOW(6)";
|
||||
char buffer[60], buffer1[60];
|
||||
MYSQL_BIND bind[2];
|
||||
|
||||
@@ -4818,7 +4818,7 @@ int test_notrunc(MYSQL *mysql)
|
||||
my_bool error= 0;
|
||||
unsigned long len= 1;
|
||||
|
||||
char *query= "SELECT '1234567890', 'foo' FROM DUAL";
|
||||
const char *query= "SELECT '1234567890', 'foo' FROM DUAL";
|
||||
|
||||
mysql_options(mysql, MYSQL_REPORT_DATA_TRUNCATION, &trunc);
|
||||
|
||||
@@ -4863,7 +4863,7 @@ static int test_bit2tiny(MYSQL *mysql)
|
||||
char data[11];
|
||||
unsigned long length[2];
|
||||
my_bool is_null[2], error[2];
|
||||
char *query = "SELECT val FROM justbit";
|
||||
const char *query = "SELECT val FROM justbit";
|
||||
MYSQL_STMT *stmt;
|
||||
int rc;
|
||||
|
||||
|
@@ -39,7 +39,7 @@ static int cmp_double(double *a, double *b)
|
||||
static int test_conc67(MYSQL *mysql)
|
||||
{
|
||||
MYSQL_STMT *stmt= mysql_stmt_init(mysql);
|
||||
char *query= "SELECT a,b FROM conc67 WHERE a=?";
|
||||
const char *query= "SELECT a,b FROM conc67 WHERE a=?";
|
||||
int rc, i;
|
||||
MYSQL_BIND bind[2];
|
||||
char val[20];
|
||||
@@ -545,8 +545,8 @@ static int test_bug1500(MYSQL *mysql)
|
||||
MYSQL_BIND my_bind[3];
|
||||
int rc= 0;
|
||||
int32 int_data[3]= {2, 3, 4};
|
||||
char *data;
|
||||
char *query;
|
||||
const char *data;
|
||||
const char *query;
|
||||
|
||||
|
||||
rc= mysql_query(mysql, "DROP TABLE IF EXISTS test_bg1500");
|
||||
@@ -3749,7 +3749,7 @@ static int test_bug53311(MYSQL *mysql)
|
||||
int rc;
|
||||
MYSQL_STMT *stmt;
|
||||
int i;
|
||||
char *query= "INSERT INTO bug53311 VALUES (1)";
|
||||
const char *query= "INSERT INTO bug53311 VALUES (1)";
|
||||
|
||||
rc= mysql_options(mysql, MYSQL_OPT_RECONNECT, "1");
|
||||
check_mysql_rc(rc, mysql);
|
||||
@@ -3837,7 +3837,7 @@ end:
|
||||
|
||||
static int test_conc_5(MYSQL *mysql)
|
||||
{
|
||||
char *query= "SELECT a FROM t1";
|
||||
const char *query= "SELECT a FROM t1";
|
||||
MYSQL_RES *res;
|
||||
MYSQL_STMT *stmt;
|
||||
MYSQL_FIELD *fields;
|
||||
@@ -3874,7 +3874,7 @@ static int test_conc_5(MYSQL *mysql)
|
||||
static int test_conc141(MYSQL *mysql)
|
||||
{
|
||||
int rc;
|
||||
char *query= "CALL p_conc141";
|
||||
const char *query= "CALL p_conc141";
|
||||
MYSQL_STMT *stmt= mysql_stmt_init(mysql);
|
||||
|
||||
rc= mysql_query(mysql, "DROP TABLE IF EXISTS conc141");
|
||||
@@ -4108,7 +4108,7 @@ static int test_conc167(MYSQL *mysql)
|
||||
char buffer[100];
|
||||
int bit1=0, bit2=0;
|
||||
int rc;
|
||||
char *stmt_str= "SELECT a,b,c FROM conc168";
|
||||
const char *stmt_str= "SELECT a,b,c FROM conc168";
|
||||
|
||||
rc= mysql_query(mysql, "DROP TABLE IF EXISTS conc168");
|
||||
check_mysql_rc(rc, mysql);
|
||||
@@ -4154,7 +4154,7 @@ static int test_conc177(MYSQL *mysql)
|
||||
MYSQL_STMT *stmt;
|
||||
int rc;
|
||||
MYSQL_BIND bind[2];
|
||||
char *stmt_str= "SELECT a,b FROM t1";
|
||||
const char *stmt_str= "SELECT a,b FROM t1";
|
||||
char buf1[128], buf2[128];
|
||||
|
||||
rc= mysql_query(mysql, "DROP TABLE IF EXISTS t1");
|
||||
@@ -4229,7 +4229,7 @@ static int test_conc179(MYSQL *mysql)
|
||||
{
|
||||
MYSQL_STMT *stmt;
|
||||
int rc;
|
||||
char *stmtstr= "CREATE TABLE t1 (`blurb_id` int NOT NULL DEFAULT 0, `blurb` text default '', PRIMARY KEY (blurb_id)) ENGINE='FEDERATED' DEFAULT CHARSET=latin1 CONNECTION='mysql://root@127.0.0.1:$SLAVE_MYPORT/test/t1'";
|
||||
const char *stmtstr= "CREATE TABLE t1 (`blurb_id` int NOT NULL DEFAULT 0, `blurb` text default '', PRIMARY KEY (blurb_id)) ENGINE='FEDERATED' DEFAULT CHARSET=latin1 CONNECTION='mysql://root@127.0.0.1:$SLAVE_MYPORT/test/t1'";
|
||||
|
||||
rc= mysql_query(mysql, "set sql_mode=''");
|
||||
check_mysql_rc(rc, mysql);
|
||||
@@ -4301,7 +4301,7 @@ static int test_conc181(MYSQL *mysql)
|
||||
MYSQL_STMT *stmt;
|
||||
int rc;
|
||||
MYSQL_BIND bind;
|
||||
char *stmt_str= "SELECT a FROM t1";
|
||||
const char *stmt_str= "SELECT a FROM t1";
|
||||
float f=1;
|
||||
my_bool err= 0;
|
||||
|
||||
|
@@ -135,7 +135,7 @@ int test_sp_params(MYSQL *mysql)
|
||||
MYSQL_STMT *stmt;
|
||||
int a[] = {10,20,30};
|
||||
MYSQL_BIND bind[3];
|
||||
char *stmtstr= "CALL P1(?,?,?)";
|
||||
const char *stmtstr= "CALL P1(?,?,?)";
|
||||
char res[3][20];
|
||||
|
||||
rc= mysql_query(mysql, "DROP PROCEDURE IF EXISTS p1");
|
||||
@@ -219,7 +219,7 @@ int test_sp_reset(MYSQL *mysql)
|
||||
MYSQL_STMT *stmt;
|
||||
int a[] = {10,20,30};
|
||||
MYSQL_BIND bind[3];
|
||||
char *stmtstr= "CALL P1(?,?,?)";
|
||||
const char *stmtstr= "CALL P1(?,?,?)";
|
||||
|
||||
rc= mysql_query(mysql, "DROP PROCEDURE IF EXISTS p1");
|
||||
check_mysql_rc(rc, mysql);
|
||||
@@ -274,7 +274,7 @@ int test_sp_reset1(MYSQL *mysql)
|
||||
MYSQL_BIND bind[1];
|
||||
|
||||
char tmp[20];
|
||||
char *stmtstr= "CALL P1(?)";
|
||||
const char *stmtstr= "CALL P1(?)";
|
||||
|
||||
rc= mysql_query(mysql, "DROP PROCEDURE IF EXISTS p1");
|
||||
check_mysql_rc(rc, mysql);
|
||||
@@ -332,7 +332,7 @@ int test_sp_reset2(MYSQL *mysql)
|
||||
MYSQL_STMT *stmt;
|
||||
MYSQL_BIND bind[4];
|
||||
long l[4];
|
||||
char *stmtstr= "CALL P1()";
|
||||
const char *stmtstr= "CALL P1()";
|
||||
|
||||
memset(l, 0, sizeof(l));
|
||||
|
||||
@@ -425,7 +425,7 @@ int test_query(MYSQL *mysql)
|
||||
MYSQL_BIND bind[1];
|
||||
|
||||
char tmp[20];
|
||||
char *stmtstr= "CALL P1(?)";
|
||||
const char *stmtstr= "CALL P1(?)";
|
||||
|
||||
rc= mysql_query(mysql, "DROP PROCEDURE IF EXISTS p1");
|
||||
check_mysql_rc(rc, mysql);
|
||||
|
@@ -123,7 +123,7 @@ static int test_ssl(MYSQL *mysql)
|
||||
res= mysql_store_result(mysql);
|
||||
row= mysql_fetch_row(res);
|
||||
diag("user: %s", row[0]);
|
||||
if (p= strchr(row[0], '@'))
|
||||
if ((p= strchr(row[0], '@')))
|
||||
strcpy(sslhost, p+1);
|
||||
mysql_free_result(res);
|
||||
}
|
||||
@@ -131,7 +131,7 @@ static int test_ssl(MYSQL *mysql)
|
||||
return OK;
|
||||
}
|
||||
|
||||
static int test_ssl_cipher(MYSQL *unused)
|
||||
static int test_ssl_cipher(MYSQL *unused __attribute__((unused)))
|
||||
{
|
||||
MYSQL *my;
|
||||
MYSQL_RES *res;
|
||||
@@ -162,7 +162,7 @@ static int test_ssl_cipher(MYSQL *unused)
|
||||
return OK;
|
||||
}
|
||||
|
||||
static int test_conc95(MYSQL *my)
|
||||
static int test_conc95(MYSQL *unused __attribute__((unused)))
|
||||
{
|
||||
MYSQL *mysql;
|
||||
|
||||
@@ -190,7 +190,7 @@ static int test_conc95(MYSQL *my)
|
||||
return OK;
|
||||
}
|
||||
|
||||
static int test_multi_ssl_connections(MYSQL *unused)
|
||||
static int test_multi_ssl_connections(MYSQL *unused __attribute__((unused)))
|
||||
{
|
||||
MYSQL *mysql[50], *my;
|
||||
int i, rc;
|
||||
@@ -255,7 +255,7 @@ static int test_multi_ssl_connections(MYSQL *unused)
|
||||
}
|
||||
|
||||
#ifndef WIN32
|
||||
static void ssl_thread(void *dummy)
|
||||
static void ssl_thread(void *unused __attribute__((unused)))
|
||||
#else
|
||||
DWORD WINAPI ssl_thread(void *dummy)
|
||||
#endif
|
||||
@@ -343,7 +343,7 @@ static int test_ssl_threads(MYSQL *mysql)
|
||||
return OK;
|
||||
}
|
||||
|
||||
static int test_phpbug51647(MYSQL *my)
|
||||
static int test_phpbug51647(MYSQL *unused __attribute__((unused)))
|
||||
{
|
||||
MYSQL* mysql;
|
||||
|
||||
@@ -365,7 +365,7 @@ static int test_phpbug51647(MYSQL *my)
|
||||
return OK;
|
||||
}
|
||||
|
||||
static int test_password_protected(MYSQL *my)
|
||||
static int test_password_protected(MYSQL *unused __attribute__((unused)))
|
||||
{
|
||||
MYSQL* mysql;
|
||||
|
||||
@@ -390,7 +390,7 @@ static int test_password_protected(MYSQL *my)
|
||||
}
|
||||
|
||||
|
||||
static int test_conc50(MYSQL *my)
|
||||
static int test_conc50(MYSQL *unused __attribute__((unused)))
|
||||
{
|
||||
MYSQL *mysql;
|
||||
|
||||
@@ -411,7 +411,7 @@ static int test_conc50(MYSQL *my)
|
||||
return OK;
|
||||
}
|
||||
|
||||
static int test_conc50_1(MYSQL *my)
|
||||
static int test_conc50_1(MYSQL *unused __attribute__((unused)))
|
||||
{
|
||||
MYSQL *mysql;
|
||||
|
||||
@@ -433,7 +433,7 @@ static int test_conc50_1(MYSQL *my)
|
||||
return OK;
|
||||
}
|
||||
|
||||
static int test_conc50_2(MYSQL *my)
|
||||
static int test_conc50_2(MYSQL *unused __attribute__((unused)))
|
||||
{
|
||||
MYSQL *mysql;
|
||||
|
||||
@@ -453,10 +453,13 @@ static int test_conc50_2(MYSQL *my)
|
||||
return OK;
|
||||
}
|
||||
|
||||
static int test_conc127(MYSQL *my)
|
||||
static int test_conc127(MYSQL *unused __attribute__((unused)))
|
||||
{
|
||||
MYSQL *mysql;
|
||||
|
||||
diag("test disabled - for testing disable other tests or run this test as first test");
|
||||
return SKIP;
|
||||
|
||||
if (check_skip_ssl())
|
||||
return SKIP;
|
||||
|
||||
@@ -474,7 +477,7 @@ static int test_conc127(MYSQL *my)
|
||||
return OK;
|
||||
}
|
||||
|
||||
static int test_conc50_3(MYSQL *my)
|
||||
static int test_conc50_3(MYSQL *unused __attribute__((unused)))
|
||||
{
|
||||
MYSQL *mysql;
|
||||
|
||||
@@ -507,7 +510,7 @@ static int test_conc50_3(MYSQL *my)
|
||||
return OK;
|
||||
}
|
||||
|
||||
static int test_conc50_4(MYSQL *my)
|
||||
static int test_conc50_4(MYSQL *unused __attribute__((unused)))
|
||||
{
|
||||
MYSQL *mysql;
|
||||
|
||||
@@ -527,7 +530,7 @@ static int test_conc50_4(MYSQL *my)
|
||||
return OK;
|
||||
}
|
||||
|
||||
static int verify_ssl_server_cert(MYSQL *my)
|
||||
static int verify_ssl_server_cert(MYSQL *unused __attribute__((unused)))
|
||||
{
|
||||
MYSQL *mysql;
|
||||
uint verify= 1;
|
||||
@@ -550,7 +553,7 @@ static int verify_ssl_server_cert(MYSQL *my)
|
||||
return OK;
|
||||
}
|
||||
|
||||
static int test_bug62743(MYSQL *my)
|
||||
static int test_bug62743(MYSQL *unused __attribute__((unused)))
|
||||
{
|
||||
MYSQL *mysql;
|
||||
|
||||
@@ -638,7 +641,7 @@ DWORD WINAPI thread_conc102(void)
|
||||
check_mysql_rc(rc, mysql);
|
||||
pthread_mutex_unlock(&LOCK_test);
|
||||
check_mysql_rc(rc, mysql);
|
||||
if (res= mysql_store_result(mysql))
|
||||
if ((res= mysql_store_result(mysql)))
|
||||
mysql_free_result(res);
|
||||
end:
|
||||
mysql_close(mysql);
|
||||
@@ -702,7 +705,7 @@ static int test_conc_102(MYSQL *mysql)
|
||||
|
||||
const char *ssl_cert_finger_print= "@SSL_CERT_FINGER_PRINT@";
|
||||
|
||||
static int test_ssl_fp(MYSQL *unused)
|
||||
static int test_ssl_fp(MYSQL *unused __attribute__((unused)))
|
||||
{
|
||||
MYSQL *my;
|
||||
MYSQL_RES *res;
|
||||
@@ -741,7 +744,7 @@ static int test_ssl_fp(MYSQL *unused)
|
||||
return OK;
|
||||
}
|
||||
|
||||
static int test_ssl_fp_list(MYSQL *unused)
|
||||
static int test_ssl_fp_list(MYSQL *unused __attribute__((unused)))
|
||||
{
|
||||
MYSQL *my;
|
||||
|
||||
@@ -763,7 +766,7 @@ static int test_ssl_fp_list(MYSQL *unused)
|
||||
return OK;
|
||||
}
|
||||
|
||||
static int test_ssl_version(MYSQL *mysql)
|
||||
static int test_ssl_version(MYSQL *unused __attribute__((unused)))
|
||||
{
|
||||
unsigned int iversion;
|
||||
const char *version, *library;
|
||||
@@ -794,7 +797,7 @@ static int test_ssl_version(MYSQL *mysql)
|
||||
}
|
||||
|
||||
#ifdef HAVE_SCHANNEL
|
||||
static int test_schannel_cipher(MYSQL *mysql)
|
||||
static int test_schannel_cipher(MYSQL *unused __attribute__((unused)))
|
||||
{
|
||||
MYSQL *my;
|
||||
unsigned int cipher_strength= 256;
|
||||
@@ -823,7 +826,7 @@ static int test_schannel_cipher(MYSQL *mysql)
|
||||
|
||||
struct my_tests_st my_tests[] = {
|
||||
{"test_ssl", test_ssl, TEST_CONNECTION_NEW, 0, NULL, NULL},
|
||||
// {"test_conc127", test_conc127, TEST_CONNECTION_NEW, 0, NULL, NULL},
|
||||
{"test_conc127", test_conc127, TEST_CONNECTION_NEW, 0, NULL, NULL},
|
||||
{"test_ssl_fp", test_ssl_fp, TEST_CONNECTION_NEW, 0, NULL, NULL},
|
||||
{"test_ssl_fp_list", test_ssl_fp_list, TEST_CONNECTION_NEW, 0, NULL, NULL},
|
||||
{"test_conc50", test_conc50, TEST_CONNECTION_NEW, 0, NULL, NULL},
|
||||
|
@@ -4,7 +4,7 @@
|
||||
#include "my_test.h"
|
||||
#include "ma_pvio.h"
|
||||
|
||||
static int aurora1(MYSQL *my)
|
||||
static int aurora1(MYSQL *unused __attribute__((unused)))
|
||||
{
|
||||
int rc;
|
||||
my_bool read_only= 1;
|
||||
@@ -54,7 +54,7 @@ static int aurora1(MYSQL *my)
|
||||
return OK;
|
||||
}
|
||||
|
||||
static int test_wrong_user(MYSQL *my)
|
||||
static int test_wrong_user(MYSQL *unused __attribute__((unused)))
|
||||
{
|
||||
MYSQL *mysql= mysql_init(NULL);
|
||||
|
||||
@@ -68,7 +68,7 @@ static int test_wrong_user(MYSQL *my)
|
||||
return OK;
|
||||
}
|
||||
|
||||
static int test_reconnect(MYSQL *my)
|
||||
static int test_reconnect(MYSQL *unused __attribute__((unused)))
|
||||
{
|
||||
MYSQL *mysql= mysql_init(NULL);
|
||||
MYSQL_RES *res;
|
||||
|
@@ -27,7 +27,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
|
||||
|
||||
#include "my_test.h"
|
||||
|
||||
static int test_conc_173(MYSQL *my)
|
||||
static int test_conc_173(MYSQL *unused __attribute__((unused)))
|
||||
{
|
||||
MYSQL mysql;
|
||||
int arg;
|
||||
|
@@ -4,7 +4,7 @@
|
||||
#include "my_test.h"
|
||||
#include <ma_pthread.h>
|
||||
|
||||
static int basic_connect(MYSQL *mysql)
|
||||
static int basic_connect(MYSQL *unused __attribute__((unused)))
|
||||
{
|
||||
MYSQL_ROW row;
|
||||
MYSQL_RES *res;
|
||||
|
Reference in New Issue
Block a user