Fixed compiler warnings (for linux and win32 and win64)
Fixed a couple of usage of not initialized warnings (unlikely cases)
This commit is contained in:
parent
6946fa682f
commit
e5cc397f33
@ -2016,7 +2016,8 @@ continue_xml:
|
|||||||
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
static void dump_triggers_for_table(char *table, char *db)
|
static void dump_triggers_for_table(char *table,
|
||||||
|
char *db __attribute__((unused)))
|
||||||
{
|
{
|
||||||
char *result_table;
|
char *result_table;
|
||||||
char name_buff[NAME_LEN*4+3], table_buff[NAME_LEN*2+3];
|
char name_buff[NAME_LEN*4+3], table_buff[NAME_LEN*2+3];
|
||||||
@ -2025,7 +2026,6 @@ static void dump_triggers_for_table(char *table, char *db)
|
|||||||
FILE *sql_file= md_result_file;
|
FILE *sql_file= md_result_file;
|
||||||
MYSQL_RES *result;
|
MYSQL_RES *result;
|
||||||
MYSQL_ROW row;
|
MYSQL_ROW row;
|
||||||
|
|
||||||
DBUG_ENTER("dump_triggers_for_table");
|
DBUG_ENTER("dump_triggers_for_table");
|
||||||
DBUG_PRINT("enter", ("db: %s, table: %s", db, table));
|
DBUG_PRINT("enter", ("db: %s, table: %s", db, table));
|
||||||
|
|
||||||
|
@ -1844,7 +1844,7 @@ void do_copy_file(struct st_command *command)
|
|||||||
|
|
||||||
void do_chmod_file(struct st_command *command)
|
void do_chmod_file(struct st_command *command)
|
||||||
{
|
{
|
||||||
ulong mode= 0;
|
long mode= 0;
|
||||||
static DYNAMIC_STRING ds_mode;
|
static DYNAMIC_STRING ds_mode;
|
||||||
static DYNAMIC_STRING ds_file;
|
static DYNAMIC_STRING ds_file;
|
||||||
const struct command_arg chmod_file_args[] = {
|
const struct command_arg chmod_file_args[] = {
|
||||||
@ -1864,7 +1864,7 @@ void do_chmod_file(struct st_command *command)
|
|||||||
die("You must write a 4 digit octal number for mode");
|
die("You must write a 4 digit octal number for mode");
|
||||||
|
|
||||||
DBUG_PRINT("info", ("chmod %o %s", (uint)mode, ds_file.str));
|
DBUG_PRINT("info", ("chmod %o %s", (uint)mode, ds_file.str));
|
||||||
handle_command_error(command, chmod(ds_file.str, mode));
|
handle_command_error(command, chmod(ds_file.str, (mode_t) mode));
|
||||||
dynstr_free(&ds_mode);
|
dynstr_free(&ds_mode);
|
||||||
dynstr_free(&ds_file);
|
dynstr_free(&ds_file);
|
||||||
DBUG_VOID_RETURN;
|
DBUG_VOID_RETURN;
|
||||||
@ -6275,7 +6275,8 @@ typedef struct st_replace_found {
|
|||||||
|
|
||||||
|
|
||||||
void replace_strings_append(REPLACE *rep, DYNAMIC_STRING* ds,
|
void replace_strings_append(REPLACE *rep, DYNAMIC_STRING* ds,
|
||||||
const char *str, int len)
|
const char *str,
|
||||||
|
int len __attribute__((unused)))
|
||||||
{
|
{
|
||||||
reg1 REPLACE *rep_pos;
|
reg1 REPLACE *rep_pos;
|
||||||
reg2 REPLACE_STRING *rep_str;
|
reg2 REPLACE_STRING *rep_str;
|
||||||
@ -6666,7 +6667,7 @@ int reg_replace(char** buf_p, int* buf_len_p, char *pattern,
|
|||||||
we need at least what we have so far in the buffer + the part
|
we need at least what we have so far in the buffer + the part
|
||||||
before this match
|
before this match
|
||||||
*/
|
*/
|
||||||
need_buf_len= (res_p - buf) + subs[0].rm_so;
|
need_buf_len= (res_p - buf) + (int) subs[0].rm_so;
|
||||||
|
|
||||||
/* on this pass, calculate the memory for the result buffer */
|
/* on this pass, calculate the memory for the result buffer */
|
||||||
while (expr_p < replace_end)
|
while (expr_p < replace_end)
|
||||||
@ -6676,17 +6677,17 @@ int reg_replace(char** buf_p, int* buf_len_p, char *pattern,
|
|||||||
|
|
||||||
if (c == '\\' && expr_p + 1 < replace_end)
|
if (c == '\\' && expr_p + 1 < replace_end)
|
||||||
{
|
{
|
||||||
back_ref_num= expr_p[1] - '0';
|
back_ref_num= (int) (expr_p[1] - '0');
|
||||||
}
|
}
|
||||||
|
|
||||||
/* found a valid back_ref (eg. \1)*/
|
/* found a valid back_ref (eg. \1)*/
|
||||||
if (back_ref_num >= 0 && back_ref_num <= (int)r.re_nsub)
|
if (back_ref_num >= 0 && back_ref_num <= (int)r.re_nsub)
|
||||||
{
|
{
|
||||||
int start_off,end_off;
|
regoff_t start_off, end_off;
|
||||||
if ((start_off=subs[back_ref_num].rm_so) > -1 &&
|
if ((start_off=subs[back_ref_num].rm_so) > -1 &&
|
||||||
(end_off=subs[back_ref_num].rm_eo) > -1)
|
(end_off=subs[back_ref_num].rm_eo) > -1)
|
||||||
{
|
{
|
||||||
need_buf_len += (end_off - start_off);
|
need_buf_len += (int) (end_off - start_off);
|
||||||
}
|
}
|
||||||
expr_p += 2;
|
expr_p += 2;
|
||||||
}
|
}
|
||||||
@ -6706,7 +6707,7 @@ int reg_replace(char** buf_p, int* buf_len_p, char *pattern,
|
|||||||
/* copy the pre-match part */
|
/* copy the pre-match part */
|
||||||
if (subs[0].rm_so)
|
if (subs[0].rm_so)
|
||||||
{
|
{
|
||||||
memcpy(res_p, str_p, subs[0].rm_so);
|
memcpy(res_p, str_p, (size_t) subs[0].rm_so);
|
||||||
res_p+= subs[0].rm_so;
|
res_p+= subs[0].rm_so;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -57,7 +57,7 @@ xmalloc (bytes)
|
|||||||
|
|
||||||
temp = malloc (bytes);
|
temp = malloc (bytes);
|
||||||
if (temp == 0)
|
if (temp == 0)
|
||||||
memory_error_and_abort ("xmalloc");
|
memory_error_and_abort ((char*) "xmalloc");
|
||||||
return (temp);
|
return (temp);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -71,7 +71,7 @@ xrealloc (pointer, bytes)
|
|||||||
temp = pointer ? realloc (pointer, bytes) : malloc (bytes);
|
temp = pointer ? realloc (pointer, bytes) : malloc (bytes);
|
||||||
|
|
||||||
if (temp == 0)
|
if (temp == 0)
|
||||||
memory_error_and_abort ("xrealloc");
|
memory_error_and_abort ((char*) "xrealloc");
|
||||||
return (temp);
|
return (temp);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -41,7 +41,9 @@ static char *NAMEFILE= (char*) "mysqld_ername.h";
|
|||||||
static char *STATEFILE= (char*) "sql_state.h";
|
static char *STATEFILE= (char*) "sql_state.h";
|
||||||
static char *TXTFILE= (char*) "../sql/share/errmsg.txt";
|
static char *TXTFILE= (char*) "../sql/share/errmsg.txt";
|
||||||
static char *DATADIRECTORY= (char*) "../sql/share/";
|
static char *DATADIRECTORY= (char*) "../sql/share/";
|
||||||
|
#ifndef DBUG_OFF
|
||||||
static char *default_dbug_option= (char*) "d:t:O,/tmp/comp_err.trace";
|
static char *default_dbug_option= (char*) "d:t:O,/tmp/comp_err.trace";
|
||||||
|
#endif
|
||||||
|
|
||||||
/* Header for errmsg.sys files */
|
/* Header for errmsg.sys files */
|
||||||
uchar file_head[]= { 254, 254, 2, 1 };
|
uchar file_head[]= { 254, 254, 2, 1 };
|
||||||
@ -402,6 +404,8 @@ static int parse_input_file(const char *file_name, struct errors **top_error,
|
|||||||
int rcount= 0;
|
int rcount= 0;
|
||||||
DBUG_ENTER("parse_input_file");
|
DBUG_ENTER("parse_input_file");
|
||||||
|
|
||||||
|
*top_error= 0;
|
||||||
|
*top_lang= 0;
|
||||||
if (!(file= my_fopen(file_name, O_RDONLY | O_SHARE, MYF(MY_WME))))
|
if (!(file= my_fopen(file_name, O_RDONLY | O_SHARE, MYF(MY_WME))))
|
||||||
DBUG_RETURN(0);
|
DBUG_RETURN(0);
|
||||||
|
|
||||||
|
@ -33,7 +33,6 @@
|
|||||||
#include "opensslv.h" /* for version number */
|
#include "opensslv.h" /* for version number */
|
||||||
#include "rsa.h"
|
#include "rsa.h"
|
||||||
|
|
||||||
|
|
||||||
#define YASSL_VERSION "1.5.8"
|
#define YASSL_VERSION "1.5.8"
|
||||||
|
|
||||||
|
|
||||||
@ -190,11 +189,16 @@ enum { /* ERR Constants */
|
|||||||
EVP_R_BAD_DECRYPT = 2
|
EVP_R_BAD_DECRYPT = 2
|
||||||
};
|
};
|
||||||
|
|
||||||
|
#ifdef WIN
|
||||||
|
typedef SOCKET socket_t;
|
||||||
|
#else
|
||||||
|
typedef int socket_t;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
SSL_CTX* SSL_CTX_new(SSL_METHOD*);
|
SSL_CTX* SSL_CTX_new(SSL_METHOD*);
|
||||||
SSL* SSL_new(SSL_CTX*);
|
SSL* SSL_new(SSL_CTX*);
|
||||||
int SSL_set_fd (SSL*, int);
|
int SSL_set_fd (SSL*, socket_t);
|
||||||
int SSL_connect(SSL*);
|
int SSL_connect(SSL*);
|
||||||
int SSL_write(SSL*, const void*, int);
|
int SSL_write(SSL*, const void*, int);
|
||||||
int SSL_read(SSL*, void*, int);
|
int SSL_read(SSL*, void*, int);
|
||||||
|
@ -38,16 +38,14 @@
|
|||||||
#include <netinet/in.h>
|
#include <netinet/in.h>
|
||||||
#include <arpa/inet.h>
|
#include <arpa/inet.h>
|
||||||
#endif
|
#endif
|
||||||
|
#include "openssl/ssl.h" /* for socket_t */
|
||||||
|
|
||||||
|
|
||||||
namespace yaSSL {
|
namespace yaSSL {
|
||||||
|
|
||||||
typedef unsigned int uint;
|
typedef unsigned int uint;
|
||||||
|
|
||||||
#ifdef _WIN32
|
#ifndef _WIN32
|
||||||
typedef SOCKET socket_t;
|
|
||||||
#else
|
|
||||||
typedef int socket_t;
|
|
||||||
const socket_t INVALID_SOCKET = -1;
|
const socket_t INVALID_SOCKET = -1;
|
||||||
const int SD_RECEIVE = 0;
|
const int SD_RECEIVE = 0;
|
||||||
const int SD_SEND = 1;
|
const int SD_SEND = 1;
|
||||||
|
@ -229,7 +229,7 @@ void SSL_free(SSL* ssl)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
int SSL_set_fd(SSL* ssl, int fd)
|
int SSL_set_fd(SSL* ssl, socket_t fd)
|
||||||
{
|
{
|
||||||
ssl->useSocket().set_fd(fd);
|
ssl->useSocket().set_fd(fd);
|
||||||
return SSL_SUCCESS;
|
return SSL_SUCCESS;
|
||||||
|
@ -3390,7 +3390,7 @@ void Integer::DivideByPowerOf2(Integer &r, Integer &q, const Integer &a,
|
|||||||
CopyWords(r.reg_.get_buffer(), a.reg_.get_buffer(), wordCount);
|
CopyWords(r.reg_.get_buffer(), a.reg_.get_buffer(), wordCount);
|
||||||
SetWords(r.reg_+wordCount, 0, r.reg_.size()-wordCount);
|
SetWords(r.reg_+wordCount, 0, r.reg_.size()-wordCount);
|
||||||
if (n % WORD_BITS != 0)
|
if (n % WORD_BITS != 0)
|
||||||
r.reg_[wordCount-1] %= (1 << (n % WORD_BITS));
|
r.reg_[wordCount-1] %= ((word) 1 << (n % WORD_BITS));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -846,6 +846,21 @@ typedef long long my_ptrdiff_t;
|
|||||||
#define ADD_TO_PTR(ptr,size,type) (type) ((byte*) (ptr)+size)
|
#define ADD_TO_PTR(ptr,size,type) (type) ((byte*) (ptr)+size)
|
||||||
#define PTR_BYTE_DIFF(A,B) (my_ptrdiff_t) ((byte*) (A) - (byte*) (B))
|
#define PTR_BYTE_DIFF(A,B) (my_ptrdiff_t) ((byte*) (A) - (byte*) (B))
|
||||||
|
|
||||||
|
/*
|
||||||
|
Custom version of standard offsetof() macro which can be used to get
|
||||||
|
offsets of members in class for non-POD types (according to the current
|
||||||
|
version of C++ standard offsetof() macro can't be used in such cases and
|
||||||
|
attempt to do so causes warnings to be emitted, OTOH in many cases it is
|
||||||
|
still OK to assume that all instances of the class has the same offsets
|
||||||
|
for the same members).
|
||||||
|
|
||||||
|
This is temporary solution which should be removed once File_parser class
|
||||||
|
and related routines are refactored.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#define my_offsetof(TYPE, MEMBER) \
|
||||||
|
((size_t)((char *)&(((TYPE *)0x10)->MEMBER) - (char*)0x10))
|
||||||
|
|
||||||
#define NullS (char *) 0
|
#define NullS (char *) 0
|
||||||
/* Nowdays we do not support MessyDos */
|
/* Nowdays we do not support MessyDos */
|
||||||
#ifndef NEAR
|
#ifndef NEAR
|
||||||
|
@ -388,8 +388,8 @@ ut_bit_set_nth(
|
|||||||
ut_ad(TRUE == 1);
|
ut_ad(TRUE == 1);
|
||||||
|
|
||||||
if (val) {
|
if (val) {
|
||||||
return((1 << n) | a);
|
return(((ulint) 1 << n) | a);
|
||||||
} else {
|
} else {
|
||||||
return(~(1 << n) & a);
|
return(~((ulint) 1 << n) & a);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -170,5 +170,5 @@ ut_2_exp(
|
|||||||
/* out: 2 to power n */
|
/* out: 2 to power n */
|
||||||
ulint n) /* in: number */
|
ulint n) /* in: number */
|
||||||
{
|
{
|
||||||
return(1 << n);
|
return((ulint) 1 << n);
|
||||||
}
|
}
|
||||||
|
@ -1,5 +1,4 @@
|
|||||||
LIBRARY LIBMYSQL
|
LIBRARY LIBMYSQL
|
||||||
DESCRIPTION 'MySQL 5.0 Client Library'
|
|
||||||
VERSION 6.0
|
VERSION 6.0
|
||||||
EXPORTS
|
EXPORTS
|
||||||
_dig_vec_lower
|
_dig_vec_lower
|
||||||
|
@ -564,7 +564,7 @@ static void fill_quick_table(uint16 *table, uint bits, uint max_bits,
|
|||||||
*/
|
*/
|
||||||
value|= (max_bits - bits) << 8 | IS_CHAR;
|
value|= (max_bits - bits) << 8 | IS_CHAR;
|
||||||
|
|
||||||
for (end= table + (1 << bits); table < end; table++)
|
for (end= table + ((uint) 1 << bits); table < end; table++)
|
||||||
{
|
{
|
||||||
*table= (uint16) value;
|
*table= (uint16) value;
|
||||||
}
|
}
|
||||||
|
@ -720,6 +720,7 @@ get_one_option(int optid,
|
|||||||
case 2:
|
case 2:
|
||||||
method_conv= MI_STATS_METHOD_IGNORE_NULLS;
|
method_conv= MI_STATS_METHOD_IGNORE_NULLS;
|
||||||
break;
|
break;
|
||||||
|
default: assert(0); /* Impossible */
|
||||||
}
|
}
|
||||||
check_param.stats_method= method_conv;
|
check_param.stats_method= method_conv;
|
||||||
break;
|
break;
|
||||||
|
@ -98,10 +98,10 @@ base64_encode(const void *src, size_t src_len, char *dst)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static inline unsigned
|
static inline uint
|
||||||
pos(unsigned char c)
|
pos(unsigned char c)
|
||||||
{
|
{
|
||||||
return strchr(base64_table, c) - base64_table;
|
return (uint) (strchr(base64_table, c) - base64_table);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -167,8 +167,10 @@ static void unlink_from_queue(KEYCACHE_WQUEUE *wqueue,
|
|||||||
struct st_my_thread_var *thread);
|
struct st_my_thread_var *thread);
|
||||||
#endif
|
#endif
|
||||||
static void free_block(KEY_CACHE *keycache, BLOCK_LINK *block);
|
static void free_block(KEY_CACHE *keycache, BLOCK_LINK *block);
|
||||||
|
#ifndef DBUG_OFF
|
||||||
static void test_key_cache(KEY_CACHE *keycache,
|
static void test_key_cache(KEY_CACHE *keycache,
|
||||||
const char *where, my_bool lock);
|
const char *where, my_bool lock);
|
||||||
|
#endif
|
||||||
|
|
||||||
#define KEYCACHE_HASH(f, pos) \
|
#define KEYCACHE_HASH(f, pos) \
|
||||||
(((ulong) ((pos) >> keycache->key_cache_shift)+ \
|
(((ulong) ((pos) >> keycache->key_cache_shift)+ \
|
||||||
@ -2605,7 +2607,8 @@ static int flush_all_key_blocks(KEY_CACHE *keycache)
|
|||||||
0 on success (always because it can't fail)
|
0 on success (always because it can't fail)
|
||||||
*/
|
*/
|
||||||
|
|
||||||
int reset_key_cache_counters(const char *name, KEY_CACHE *key_cache)
|
int reset_key_cache_counters(const char *name __attribute__((unused)),
|
||||||
|
KEY_CACHE *key_cache)
|
||||||
{
|
{
|
||||||
DBUG_ENTER("reset_key_cache_counters");
|
DBUG_ENTER("reset_key_cache_counters");
|
||||||
if (!key_cache->key_cache_inited)
|
if (!key_cache->key_cache_inited)
|
||||||
|
@ -194,6 +194,7 @@ int handle_options(int *argc, char ***argv,
|
|||||||
Find first the right option. Return error in case of an ambiguous,
|
Find first the right option. Return error in case of an ambiguous,
|
||||||
or unknown option
|
or unknown option
|
||||||
*/
|
*/
|
||||||
|
LINT_INIT(prev_found);
|
||||||
optp= longopts;
|
optp= longopts;
|
||||||
if (!(opt_found= findopt(opt_str, length, &optp, &prev_found)))
|
if (!(opt_found= findopt(opt_str, length, &optp, &prev_found)))
|
||||||
{
|
{
|
||||||
|
@ -197,7 +197,9 @@ Voluntary context switches %ld, Involuntary context switches %ld\n",
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (!(infoflag & MY_DONT_FREE_DBUG))
|
if (!(infoflag & MY_DONT_FREE_DBUG))
|
||||||
|
{
|
||||||
DBUG_END(); /* Must be done before my_thread_end */
|
DBUG_END(); /* Must be done before my_thread_end */
|
||||||
|
}
|
||||||
#ifdef THREAD
|
#ifdef THREAD
|
||||||
my_thread_end();
|
my_thread_end();
|
||||||
my_thread_global_end();
|
my_thread_global_end();
|
||||||
|
@ -54,8 +54,8 @@ pthread_mutexattr_t my_errorcheck_mutexattr;
|
|||||||
race conditions in NPTL pthread_exit code.
|
race conditions in NPTL pthread_exit code.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
static
|
static pthread_handler_t
|
||||||
pthread_handler_t nptl_pthread_exit_hack_handler(void *arg)
|
nptl_pthread_exit_hack_handler(void *arg __attribute__((unused)))
|
||||||
{
|
{
|
||||||
/* Do nothing! */
|
/* Do nothing! */
|
||||||
pthread_exit(0);
|
pthread_exit(0);
|
||||||
@ -400,9 +400,9 @@ const char *my_thread_name(void)
|
|||||||
|
|
||||||
static uint get_thread_lib(void)
|
static uint get_thread_lib(void)
|
||||||
{
|
{
|
||||||
|
#ifdef _CS_GNU_LIBPTHREAD_VERSION
|
||||||
char buff[64];
|
char buff[64];
|
||||||
|
|
||||||
#ifdef _CS_GNU_LIBPTHREAD_VERSION
|
|
||||||
confstr(_CS_GNU_LIBPTHREAD_VERSION, buff, sizeof(buff));
|
confstr(_CS_GNU_LIBPTHREAD_VERSION, buff, sizeof(buff));
|
||||||
|
|
||||||
if (!strncasecmp(buff, "NPTL", 4))
|
if (!strncasecmp(buff, "NPTL", 4))
|
||||||
|
@ -185,7 +185,7 @@ my_off_t my_get_ptr(byte *ptr, uint pack_length)
|
|||||||
case 3: pos= (my_off_t) mi_uint3korr(ptr); break;
|
case 3: pos= (my_off_t) mi_uint3korr(ptr); break;
|
||||||
case 2: pos= (my_off_t) mi_uint2korr(ptr); break;
|
case 2: pos= (my_off_t) mi_uint2korr(ptr); break;
|
||||||
case 1: pos= (my_off_t) mi_uint2korr(ptr); break;
|
case 1: pos= (my_off_t) mi_uint2korr(ptr); break;
|
||||||
default: DBUG_ASSERT(0);
|
default: DBUG_ASSERT(0); return 0;
|
||||||
}
|
}
|
||||||
return pos;
|
return pos;
|
||||||
}
|
}
|
||||||
|
@ -46,17 +46,17 @@ inline int my_decimal_get_binary_size(uint precision, uint scale)
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#define DTIMAP(x, y, z) \
|
#define DTIMAP(x, y, z) \
|
||||||
{ DictTabInfo::y, offsetof(x, z), SimpleProperties::Uint32Value, 0, (~0), 0 }
|
{ DictTabInfo::y, my_offsetof(x, z), SimpleProperties::Uint32Value, 0, (~0), 0 }
|
||||||
|
|
||||||
#define DTIMAP2(x, y, z, u, v) \
|
#define DTIMAP2(x, y, z, u, v) \
|
||||||
{ DictTabInfo::y, offsetof(x, z), SimpleProperties::Uint32Value, u, v, 0 }
|
{ DictTabInfo::y, my_offsetof(x, z), SimpleProperties::Uint32Value, u, v, 0 }
|
||||||
|
|
||||||
#define DTIMAPS(x, y, z, u, v) \
|
#define DTIMAPS(x, y, z, u, v) \
|
||||||
{ DictTabInfo::y, offsetof(x, z), SimpleProperties::StringValue, u, v, 0 }
|
{ DictTabInfo::y, my_offsetof(x, z), SimpleProperties::StringValue, u, v, 0 }
|
||||||
|
|
||||||
#define DTIMAPB(x, y, z, u, v, l) \
|
#define DTIMAPB(x, y, z, u, v, l) \
|
||||||
{ DictTabInfo::y, offsetof(x, z), SimpleProperties::BinaryValue, u, v, \
|
{ DictTabInfo::y, my_offsetof(x, z), SimpleProperties::BinaryValue, u, v, \
|
||||||
offsetof(x, l) }
|
my_offsetof(x, l) }
|
||||||
|
|
||||||
#define DTIBREAK(x) \
|
#define DTIBREAK(x) \
|
||||||
{ DictTabInfo::x, 0, SimpleProperties::InvalidValue, 0, 0, 0 }
|
{ DictTabInfo::x, 0, SimpleProperties::InvalidValue, 0, 0, 0 }
|
||||||
|
@ -135,7 +135,7 @@ int Mysql_connection_thread::init()
|
|||||||
/* Initialize random number generator */
|
/* Initialize random number generator */
|
||||||
{
|
{
|
||||||
ulong seed1= (ulong) &rand_st + rand();
|
ulong seed1= (ulong) &rand_st + rand();
|
||||||
ulong seed2= rand() + time(0);
|
ulong seed2= rand() + (ulong) time(0);
|
||||||
randominit(&rand_st, seed1, seed2);
|
randominit(&rand_st, seed1, seed2);
|
||||||
}
|
}
|
||||||
/* Fill scramble - server's random message used for handshake */
|
/* Fill scramble - server's random message used for handshake */
|
||||||
|
@ -199,7 +199,7 @@ static void init_environment(char *progname)
|
|||||||
MY_INIT(progname);
|
MY_INIT(progname);
|
||||||
log_init();
|
log_init();
|
||||||
umask(0117);
|
umask(0117);
|
||||||
srand(time(0));
|
srand((uint) time(0));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -98,7 +98,7 @@ ha_rows filesort(THD *thd, TABLE *table, SORT_FIELD *sortorder, uint s_length,
|
|||||||
uint maxbuffer;
|
uint maxbuffer;
|
||||||
BUFFPEK *buffpek;
|
BUFFPEK *buffpek;
|
||||||
ha_rows records= HA_POS_ERROR;
|
ha_rows records= HA_POS_ERROR;
|
||||||
uchar **sort_keys;
|
uchar **sort_keys= 0;
|
||||||
IO_CACHE tempfile, buffpek_pointers, *selected_records_file, *outfile;
|
IO_CACHE tempfile, buffpek_pointers, *selected_records_file, *outfile;
|
||||||
SORTPARAM param;
|
SORTPARAM param;
|
||||||
bool multi_byte_charset;
|
bool multi_byte_charset;
|
||||||
|
@ -233,6 +233,7 @@ static int berkeley_close_connection(THD *thd)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
bool berkeley_flush_logs()
|
bool berkeley_flush_logs()
|
||||||
{
|
{
|
||||||
int error;
|
int error;
|
||||||
@ -439,6 +440,15 @@ ulong ha_berkeley::index_flags(uint idx, uint part, bool all_parts) const
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void ha_berkeley::get_auto_primary_key(byte *to)
|
||||||
|
{
|
||||||
|
pthread_mutex_lock(&share->mutex);
|
||||||
|
share->auto_ident++;
|
||||||
|
int5store(to,share->auto_ident);
|
||||||
|
pthread_mutex_unlock(&share->mutex);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
static int
|
static int
|
||||||
berkeley_cmp_hidden_key(DB* file, const DBT *new_key, const DBT *saved_key)
|
berkeley_cmp_hidden_key(DB* file, const DBT *new_key, const DBT *saved_key)
|
||||||
{
|
{
|
||||||
|
@ -141,13 +141,7 @@ class ha_berkeley: public handler
|
|||||||
enum thr_lock_type lock_type);
|
enum thr_lock_type lock_type);
|
||||||
|
|
||||||
void get_status();
|
void get_status();
|
||||||
inline void get_auto_primary_key(byte *to)
|
void get_auto_primary_key(byte *to);
|
||||||
{
|
|
||||||
pthread_mutex_lock(&share->mutex);
|
|
||||||
share->auto_ident++;
|
|
||||||
int5store(to,share->auto_ident);
|
|
||||||
pthread_mutex_unlock(&share->mutex);
|
|
||||||
}
|
|
||||||
ulonglong get_auto_increment();
|
ulonglong get_auto_increment();
|
||||||
void print_error(int error, myf errflag);
|
void print_error(int error, myf errflag);
|
||||||
uint8 table_cache_type() { return HA_CACHE_TBL_TRANSACT; }
|
uint8 table_cache_type() { return HA_CACHE_TBL_TRANSACT; }
|
||||||
|
@ -2711,7 +2711,8 @@ ha_innobase::store_key_val_for_row(
|
|||||||
true_len = (ulint) cs->cset->well_formed_len(cs,
|
true_len = (ulint) cs->cset->well_formed_len(cs,
|
||||||
(const char *) data,
|
(const char *) data,
|
||||||
(const char *) data + len,
|
(const char *) data + len,
|
||||||
key_len / cs->mbmaxlen,
|
(uint) (key_len /
|
||||||
|
cs->mbmaxlen),
|
||||||
&error);
|
&error);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2780,7 +2781,8 @@ ha_innobase::store_key_val_for_row(
|
|||||||
(const char *) blob_data,
|
(const char *) blob_data,
|
||||||
(const char *) blob_data
|
(const char *) blob_data
|
||||||
+ blob_len,
|
+ blob_len,
|
||||||
key_len / cs->mbmaxlen,
|
(uint) (key_len /
|
||||||
|
cs->mbmaxlen),
|
||||||
&error);
|
&error);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2852,7 +2854,8 @@ ha_innobase::store_key_val_for_row(
|
|||||||
(const char *)src_start,
|
(const char *)src_start,
|
||||||
(const char *)src_start
|
(const char *)src_start
|
||||||
+ key_len,
|
+ key_len,
|
||||||
key_len / cs->mbmaxlen,
|
(uint) (key_len /
|
||||||
|
cs->mbmaxlen),
|
||||||
&error);
|
&error);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1521,6 +1521,8 @@ bool agg_item_charsets(DTCollation &coll, const char *fname,
|
|||||||
doesn't display each argument's characteristics.
|
doesn't display each argument's characteristics.
|
||||||
- if nargs is 1, then this error cannot happen.
|
- if nargs is 1, then this error cannot happen.
|
||||||
*/
|
*/
|
||||||
|
LINT_INIT(safe_args[0]);
|
||||||
|
LINT_INIT(safe_args[1]);
|
||||||
if (nargs >=2 && nargs <= 3)
|
if (nargs >=2 && nargs <= 3)
|
||||||
{
|
{
|
||||||
safe_args[0]= args[0];
|
safe_args[0]= args[0];
|
||||||
|
@ -1608,7 +1608,7 @@ int Item_func_now::save_in_field(Field *to, bool no_conversions)
|
|||||||
void Item_func_sysdate_local::store_now_in_TIME(TIME *now_time)
|
void Item_func_sysdate_local::store_now_in_TIME(TIME *now_time)
|
||||||
{
|
{
|
||||||
THD *thd= current_thd;
|
THD *thd= current_thd;
|
||||||
thd->variables.time_zone->gmt_sec_to_TIME(now_time, time(NULL));
|
thd->variables.time_zone->gmt_sec_to_TIME(now_time, (my_time_t) time(NULL));
|
||||||
thd->time_zone_used= 1;
|
thd->time_zone_used= 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -324,6 +324,7 @@ static I_List<THD> thread_cache;
|
|||||||
#ifndef EMBEDDED_LIBRARY
|
#ifndef EMBEDDED_LIBRARY
|
||||||
static struct passwd *user_info;
|
static struct passwd *user_info;
|
||||||
static pthread_t select_thread;
|
static pthread_t select_thread;
|
||||||
|
static uint thr_kill_signal;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
static pthread_cond_t COND_thread_cache, COND_flush_thread_cache;
|
static pthread_cond_t COND_thread_cache, COND_flush_thread_cache;
|
||||||
@ -522,7 +523,6 @@ rw_lock_t LOCK_grant, LOCK_sys_init_connect, LOCK_sys_init_slave;
|
|||||||
pthread_cond_t COND_refresh,COND_thread_count, COND_global_read_lock;
|
pthread_cond_t COND_refresh,COND_thread_count, COND_global_read_lock;
|
||||||
pthread_t signal_thread;
|
pthread_t signal_thread;
|
||||||
pthread_attr_t connection_attrib;
|
pthread_attr_t connection_attrib;
|
||||||
static uint thr_kill_signal;
|
|
||||||
|
|
||||||
File_parser_dummy_hook file_parser_dummy_hook;
|
File_parser_dummy_hook file_parser_dummy_hook;
|
||||||
|
|
||||||
@ -3216,7 +3216,7 @@ server.");
|
|||||||
#ifdef HAVE_REPLICATION
|
#ifdef HAVE_REPLICATION
|
||||||
if (opt_bin_log && expire_logs_days)
|
if (opt_bin_log && expire_logs_days)
|
||||||
{
|
{
|
||||||
long purge_time= time(0) - expire_logs_days*24*60*60;
|
long purge_time= (long) (time(0) - expire_logs_days*24*60*60);
|
||||||
if (purge_time >= 0)
|
if (purge_time >= 0)
|
||||||
mysql_bin_log.purge_logs_before_date(purge_time);
|
mysql_bin_log.purge_logs_before_date(purge_time);
|
||||||
}
|
}
|
||||||
|
@ -5021,6 +5021,8 @@ static int handle_grant_struct(uint struct_no, bool drop,
|
|||||||
user= grant_name->user;
|
user= grant_name->user;
|
||||||
host= grant_name->host.hostname;
|
host= grant_name->host.hostname;
|
||||||
break;
|
break;
|
||||||
|
default:
|
||||||
|
assert(0);
|
||||||
}
|
}
|
||||||
if (! user)
|
if (! user)
|
||||||
user= "";
|
user= "";
|
||||||
|
@ -2975,6 +2975,7 @@ find_field_in_natural_join(THD *thd, TABLE_LIST *table_ref, const char *name,
|
|||||||
if (nj_col->view_field)
|
if (nj_col->view_field)
|
||||||
{
|
{
|
||||||
Item *item;
|
Item *item;
|
||||||
|
LINT_INIT(arena);
|
||||||
if (register_tree_change)
|
if (register_tree_change)
|
||||||
arena= thd->activate_stmt_arena_if_needed(&backup);
|
arena= thd->activate_stmt_arena_if_needed(&backup);
|
||||||
/*
|
/*
|
||||||
|
@ -410,6 +410,7 @@ bool mysql_insert(THD *thd,TABLE_LIST *table_list,
|
|||||||
#ifndef EMBEDDED_LIBRARY
|
#ifndef EMBEDDED_LIBRARY
|
||||||
if (lock_type == TL_WRITE_DELAYED)
|
if (lock_type == TL_WRITE_DELAYED)
|
||||||
{
|
{
|
||||||
|
res= 1;
|
||||||
if (thd->locked_tables)
|
if (thd->locked_tables)
|
||||||
{
|
{
|
||||||
DBUG_ASSERT(table_list->db); /* Must be set in the parser */
|
DBUG_ASSERT(table_list->db); /* Must be set in the parser */
|
||||||
|
@ -2015,6 +2015,7 @@ void mysql_sql_stmt_prepare(THD *thd)
|
|||||||
uint query_len;
|
uint query_len;
|
||||||
DBUG_ENTER("mysql_sql_stmt_prepare");
|
DBUG_ENTER("mysql_sql_stmt_prepare");
|
||||||
DBUG_ASSERT(thd->protocol == &thd->protocol_simple);
|
DBUG_ASSERT(thd->protocol == &thd->protocol_simple);
|
||||||
|
LINT_INIT(query_len);
|
||||||
|
|
||||||
if ((stmt= (Prepared_statement*) thd->stmt_map.find_by_name(name)))
|
if ((stmt= (Prepared_statement*) thd->stmt_map.find_by_name(name)))
|
||||||
{
|
{
|
||||||
|
@ -8081,7 +8081,7 @@ static uint build_bitmap_for_nested_joins(List<TABLE_LIST> *join_list,
|
|||||||
*/
|
*/
|
||||||
if (nested_join->join_list.elements != 1)
|
if (nested_join->join_list.elements != 1)
|
||||||
{
|
{
|
||||||
nested_join->nj_map= 1 << first_unused++;
|
nested_join->nj_map= (nested_join_map) 1 << first_unused++;
|
||||||
first_unused= build_bitmap_for_nested_joins(&nested_join->join_list,
|
first_unused= build_bitmap_for_nested_joins(&nested_join->join_list,
|
||||||
first_unused);
|
first_unused);
|
||||||
}
|
}
|
||||||
@ -10056,6 +10056,7 @@ do_select(JOIN *join,List<Item> *fields,TABLE *table,Procedure *procedure)
|
|||||||
enum_nested_loop_state error= NESTED_LOOP_OK;
|
enum_nested_loop_state error= NESTED_LOOP_OK;
|
||||||
JOIN_TAB *join_tab;
|
JOIN_TAB *join_tab;
|
||||||
DBUG_ENTER("do_select");
|
DBUG_ENTER("do_select");
|
||||||
|
LINT_INIT(join_tab);
|
||||||
|
|
||||||
join->procedure=procedure;
|
join->procedure=procedure;
|
||||||
join->tmp_table= table; /* Save for easy recursion */
|
join->tmp_table= table; /* Save for easy recursion */
|
||||||
@ -10100,7 +10101,6 @@ do_select(JOIN *join,List<Item> *fields,TABLE *table,Procedure *procedure)
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
DBUG_ASSERT(join->tables);
|
DBUG_ASSERT(join->tables);
|
||||||
DBUG_ASSERT(join_tab);
|
|
||||||
error= sub_select(join,join_tab,0);
|
error= sub_select(join,join_tab,0);
|
||||||
if (error == NESTED_LOOP_OK || error == NESTED_LOOP_NO_MORE_ROWS)
|
if (error == NESTED_LOOP_OK || error == NESTED_LOOP_NO_MORE_ROWS)
|
||||||
error= sub_select(join,join_tab,1);
|
error= sub_select(join,join_tab,1);
|
||||||
|
@ -2515,20 +2515,21 @@ static int get_schema_tables_record(THD *thd, struct st_table_list *tables,
|
|||||||
if (file->create_time)
|
if (file->create_time)
|
||||||
{
|
{
|
||||||
thd->variables.time_zone->gmt_sec_to_TIME(&time,
|
thd->variables.time_zone->gmt_sec_to_TIME(&time,
|
||||||
file->create_time);
|
(my_time_t) file->create_time);
|
||||||
table->field[14]->store_time(&time, MYSQL_TIMESTAMP_DATETIME);
|
table->field[14]->store_time(&time, MYSQL_TIMESTAMP_DATETIME);
|
||||||
table->field[14]->set_notnull();
|
table->field[14]->set_notnull();
|
||||||
}
|
}
|
||||||
if (file->update_time)
|
if (file->update_time)
|
||||||
{
|
{
|
||||||
thd->variables.time_zone->gmt_sec_to_TIME(&time,
|
thd->variables.time_zone->gmt_sec_to_TIME(&time,
|
||||||
file->update_time);
|
(my_time_t) file->update_time);
|
||||||
table->field[15]->store_time(&time, MYSQL_TIMESTAMP_DATETIME);
|
table->field[15]->store_time(&time, MYSQL_TIMESTAMP_DATETIME);
|
||||||
table->field[15]->set_notnull();
|
table->field[15]->set_notnull();
|
||||||
}
|
}
|
||||||
if (file->check_time)
|
if (file->check_time)
|
||||||
{
|
{
|
||||||
thd->variables.time_zone->gmt_sec_to_TIME(&time, file->check_time);
|
thd->variables.time_zone->gmt_sec_to_TIME(&time,
|
||||||
|
(my_time_t) file->check_time);
|
||||||
table->field[16]->store_time(&time, MYSQL_TIMESTAMP_DATETIME);
|
table->field[16]->store_time(&time, MYSQL_TIMESTAMP_DATETIME);
|
||||||
table->field[16]->set_notnull();
|
table->field[16]->set_notnull();
|
||||||
}
|
}
|
||||||
|
@ -1,5 +1,4 @@
|
|||||||
LIBRARY udf_example
|
LIBRARY udf_example
|
||||||
DESCRIPTION 'MySQL Sample for UDF'
|
|
||||||
VERSION 1.0
|
VERSION 1.0
|
||||||
EXPORTS
|
EXPORTS
|
||||||
lookup
|
lookup
|
||||||
|
@ -839,7 +839,10 @@ static bool make_empty_rec(THD *thd, File file,enum db_type table_type,
|
|||||||
field->field_name,
|
field->field_name,
|
||||||
&table);
|
&table);
|
||||||
if (!regfield)
|
if (!regfield)
|
||||||
|
{
|
||||||
|
error= 1;
|
||||||
goto err; // End of memory
|
goto err; // End of memory
|
||||||
|
}
|
||||||
|
|
||||||
if (!(field->flags & NOT_NULL_FLAG))
|
if (!(field->flags & NOT_NULL_FLAG))
|
||||||
{
|
{
|
||||||
|
@ -206,6 +206,7 @@ static int my_strnncoll_ucs2(CHARSET_INFO *cs,
|
|||||||
const uchar *se=s+slen;
|
const uchar *se=s+slen;
|
||||||
const uchar *te=t+tlen;
|
const uchar *te=t+tlen;
|
||||||
MY_UNICASE_INFO **uni_plane= cs->caseinfo;
|
MY_UNICASE_INFO **uni_plane= cs->caseinfo;
|
||||||
|
LINT_INIT(s_wc);
|
||||||
|
|
||||||
while ( s < se && t < te )
|
while ( s < se && t < te )
|
||||||
{
|
{
|
||||||
@ -320,6 +321,7 @@ static int my_strncasecmp_ucs2(CHARSET_INFO *cs,
|
|||||||
const char *se=s+len;
|
const char *se=s+len;
|
||||||
const char *te=t+len;
|
const char *te=t+len;
|
||||||
MY_UNICASE_INFO **uni_plane= cs->caseinfo;
|
MY_UNICASE_INFO **uni_plane= cs->caseinfo;
|
||||||
|
LINT_INIT(s_wc);
|
||||||
|
|
||||||
while ( s < se && t < te )
|
while ( s < se && t < te )
|
||||||
{
|
{
|
||||||
@ -1382,6 +1384,7 @@ int my_strnncoll_ucs2_bin(CHARSET_INFO *cs,
|
|||||||
my_wc_t s_wc,t_wc;
|
my_wc_t s_wc,t_wc;
|
||||||
const uchar *se=s+slen;
|
const uchar *se=s+slen;
|
||||||
const uchar *te=t+tlen;
|
const uchar *te=t+tlen;
|
||||||
|
LINT_INIT(s_wc);
|
||||||
|
|
||||||
while ( s < se && t < te )
|
while ( s < se && t < te )
|
||||||
{
|
{
|
||||||
|
@ -2310,6 +2310,7 @@ static int my_strnncoll_utf8(CHARSET_INFO *cs,
|
|||||||
const uchar *se=s+slen;
|
const uchar *se=s+slen;
|
||||||
const uchar *te=t+tlen;
|
const uchar *te=t+tlen;
|
||||||
MY_UNICASE_INFO **uni_plane= cs->caseinfo;
|
MY_UNICASE_INFO **uni_plane= cs->caseinfo;
|
||||||
|
LINT_INIT(s_wc);
|
||||||
|
|
||||||
while ( s < se && t < te )
|
while ( s < se && t < te )
|
||||||
{
|
{
|
||||||
@ -2379,6 +2380,7 @@ static int my_strnncollsp_utf8(CHARSET_INFO *cs,
|
|||||||
my_wc_t s_wc,t_wc;
|
my_wc_t s_wc,t_wc;
|
||||||
const uchar *se= s+slen, *te= t+tlen;
|
const uchar *se= s+slen, *te= t+tlen;
|
||||||
MY_UNICASE_INFO **uni_plane= cs->caseinfo;
|
MY_UNICASE_INFO **uni_plane= cs->caseinfo;
|
||||||
|
LINT_INIT(s_wc);
|
||||||
|
|
||||||
#ifndef VARCHAR_WITH_DIFF_ENDSPACE_ARE_DIFFERENT_FOR_UNIQUE
|
#ifndef VARCHAR_WITH_DIFF_ENDSPACE_ARE_DIFFERENT_FOR_UNIQUE
|
||||||
diff_if_only_endspace_difference= 0;
|
diff_if_only_endspace_difference= 0;
|
||||||
|
@ -1356,6 +1356,7 @@ int bin2decimal(char *from, decimal_t *to, int precision, int scale)
|
|||||||
{
|
{
|
||||||
int i=dig2bytes[intg0x];
|
int i=dig2bytes[intg0x];
|
||||||
dec1 x;
|
dec1 x;
|
||||||
|
LINT_INIT(x);
|
||||||
switch (i)
|
switch (i)
|
||||||
{
|
{
|
||||||
case 1: x=mi_sint1korr(from); break;
|
case 1: x=mi_sint1korr(from); break;
|
||||||
@ -1397,6 +1398,7 @@ int bin2decimal(char *from, decimal_t *to, int precision, int scale)
|
|||||||
{
|
{
|
||||||
int i=dig2bytes[frac0x];
|
int i=dig2bytes[frac0x];
|
||||||
dec1 x;
|
dec1 x;
|
||||||
|
LINT_INIT(x);
|
||||||
switch (i)
|
switch (i)
|
||||||
{
|
{
|
||||||
case 1: x=mi_sint1korr(from); break;
|
case 1: x=mi_sint1korr(from); break;
|
||||||
@ -1483,6 +1485,7 @@ decimal_round(decimal_t *from, decimal_t *to, int scale,
|
|||||||
|
|
||||||
sanity(to);
|
sanity(to);
|
||||||
|
|
||||||
|
LINT_INIT(round_digit);
|
||||||
switch (mode) {
|
switch (mode) {
|
||||||
case HALF_UP:
|
case HALF_UP:
|
||||||
case HALF_EVEN: round_digit=5; break;
|
case HALF_EVEN: round_digit=5; break;
|
||||||
|
@ -2,3 +2,11 @@ DictTabInfo.cpp : .*invalid access to non-static.*
|
|||||||
DictTabInfo.cpp : .*macro was used incorrectly.*
|
DictTabInfo.cpp : .*macro was used incorrectly.*
|
||||||
DbdihMain.cpp : .*unused variable.* : 6666-6705
|
DbdihMain.cpp : .*unused variable.* : 6666-6705
|
||||||
DbtupExecQuery.cpp : .*unused variable.* : 1448-1449
|
DbtupExecQuery.cpp : .*unused variable.* : 1448-1449
|
||||||
|
sql_yacc.cc : .*switch statement contains 'default' but no 'case' labels.*
|
||||||
|
|
||||||
|
#
|
||||||
|
# Ignore all conversion warnings on windows 64
|
||||||
|
# (Is safe as we are not yet supporting strings >= 2G)
|
||||||
|
#
|
||||||
|
.* : conversion from 'size_t' to .*int'.*
|
||||||
|
.* : conversion from '__int64' to .*int'.*
|
||||||
|
@ -1312,7 +1312,7 @@ static void usage()
|
|||||||
|
|
||||||
static my_bool
|
static my_bool
|
||||||
get_one_option(int optid, const struct my_option *opt __attribute__((unused)),
|
get_one_option(int optid, const struct my_option *opt __attribute__((unused)),
|
||||||
char *argument)
|
char *argument __attribute__((unused)))
|
||||||
{
|
{
|
||||||
switch (optid) {
|
switch (optid) {
|
||||||
case '#':
|
case '#':
|
||||||
|
Loading…
x
Reference in New Issue
Block a user