Merge remote-tracking branch 'origin/10.2' into bb-10.2-ext

This commit is contained in:
Alexander Barkov 2017-10-02 22:35:13 +04:00
commit 8ae8cd6348
288 changed files with 1987 additions and 2427 deletions

View File

@ -501,7 +501,7 @@ static void find_tool(char *tool_executable_name, const char *tool_name,
last_fn_libchar -= 6;
}
len= last_fn_libchar - self_name;
len= (int)(last_fn_libchar - self_name);
my_snprintf(tool_executable_name, FN_REFLEN, "%.*s%c%s",
len, self_name, FN_LIBCHAR, tool_name);

View File

@ -604,7 +604,7 @@ Exit_status Load_log_processor::process_first_event(const char *bname,
Exit_status Load_log_processor::process(Create_file_log_event *ce)
{
const char *bname= ce->fname + dirname_length(ce->fname);
uint blen= ce->fname_len - (bname-ce->fname);
size_t blen= ce->fname_len - (bname-ce->fname);
return process_first_event(bname, blen, ce->block, ce->block_len,
ce->file_id, ce);

View File

@ -247,8 +247,8 @@ static struct my_option my_long_options[] =
&opt_slave_apply, &opt_slave_apply, 0, GET_BOOL, NO_ARG,
0, 0, 0, 0, 0, 0},
{"character-sets-dir", OPT_CHARSETS_DIR,
"Directory for character set files.", &charsets_dir,
&charsets_dir, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
"Directory for character set files.", (char **)&charsets_dir,
(char **)&charsets_dir, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{"comments", 'i', "Write additional information.",
&opt_comments, &opt_comments, 0, GET_BOOL, NO_ARG,
1, 0, 0, 0, 0, 0},
@ -285,8 +285,8 @@ static struct my_option my_long_options[] =
{"debug", '#', "This is a non-debug version. Catch this and exit.",
0,0, 0, GET_DISABLED, OPT_ARG, 0, 0, 0, 0, 0, 0},
#else
{"debug", '#', "Output debug log.", &default_dbug_option,
&default_dbug_option, 0, GET_STR, OPT_ARG, 0, 0, 0, 0, 0, 0},
{"debug", '#', "Output debug log.", (char *)&default_dbug_option,
(char *)&default_dbug_option, 0, GET_STR, OPT_ARG, 0, 0, 0, 0, 0, 0},
#endif
{"debug-check", OPT_DEBUG_CHECK, "Check memory and open file usage at exit.",
&debug_check_flag, &debug_check_flag, 0,
@ -5733,7 +5733,7 @@ static int replace(DYNAMIC_STRING *ds_str,
return 1;
init_dynamic_string_checked(&ds_tmp, "",
ds_str->length + replace_len, 256);
dynstr_append_mem_checked(&ds_tmp, ds_str->str, start - ds_str->str);
dynstr_append_mem_checked(&ds_tmp, ds_str->str, (uint)(start - ds_str->str));
dynstr_append_mem_checked(&ds_tmp, replace_str, replace_len);
dynstr_append_checked(&ds_tmp, start + search_len);
dynstr_set_checked(ds_str, ds_tmp.str);

View File

@ -587,8 +587,8 @@ static struct my_option my_long_options[] =
&auto_generate_sql_number, &auto_generate_sql_number,
0, GET_ULL, REQUIRED_ARG, 100, 0, 0, 0, 0, 0},
{"character-sets-dir", OPT_CHARSETS_DIR,
"Directory for character set files.", &charsets_dir,
&charsets_dir, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
"Directory for character set files.", (char **)&charsets_dir,
(char **)&charsets_dir, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{"commit", OPT_SLAP_COMMIT, "Commit records every X number of statements.",
&commit_rate, &commit_rate, 0, GET_UINT, REQUIRED_ARG,
0, 0, 0, 0, 0, 0},
@ -817,7 +817,7 @@ get_random_string(char *buf)
DBUG_ENTER("get_random_string");
for (x= RAND_STRING_SIZE; x > 0; x--)
*buf_ptr++= ALPHANUMERICS[random() % ALPHANUMERICS_SIZE];
DBUG_RETURN(buf_ptr - buf);
DBUG_RETURN((uint)(buf_ptr - buf));
}

View File

@ -767,7 +767,7 @@ public:
if (show_from != buf)
{
// The last new line was found in this buf, adjust offset
show_offset+= (show_from - buf) + 1;
show_offset+= (int)(show_from - buf) + 1;
DBUG_PRINT("info", ("adjusted offset to %d", show_offset));
}
DBUG_PRINT("info", ("show_offset: %d", show_offset));
@ -2700,7 +2700,7 @@ void var_query_set(VAR *var, const char *query, const char** query_end)
DBUG_ASSERT(query_end);
memset(&command, 0, sizeof(command));
command.query= (char*)query;
command.first_word_len= (*query_end - query);
command.first_word_len= (int)(*query_end - query);
command.first_argument= command.query + command.first_word_len;
command.end= (char*)*query_end;
command.abort_on_error= 1; /* avoid uninitialized variables */
@ -6501,7 +6501,7 @@ void do_delimiter(struct st_command* command)
if (!(*p))
die("Can't set empty delimiter");
delimiter_length= strmake_buf(delimiter, p) - delimiter;
delimiter_length= (uint)(strmake_buf(delimiter, p) - delimiter);
DBUG_PRINT("exit", ("delimiter: %s", delimiter));
command->last_argument= p + delimiter_length;
@ -6987,7 +6987,7 @@ int read_command(struct st_command** command_ptr)
command->first_argument= p;
command->end= strend(command->query);
command->query_len= (command->end - command->query);
command->query_len= (int)(command->end - command->query);
parser.read_lines++;
DBUG_RETURN(0);
}
@ -7532,7 +7532,7 @@ void fix_win_paths(char *val, size_t len)
DBUG_PRINT("info", ("Converted \\ to /, p: %s", p));
}
}
DBUG_PRINT("exit", (" val: %s, len: %d", val, len));
DBUG_PRINT("exit", (" val: %s, len: %zu", val, len));
DBUG_VOID_RETURN;
#endif
}
@ -7544,7 +7544,7 @@ void fix_win_paths(char *val, size_t len)
*/
void append_field(DYNAMIC_STRING *ds, uint col_idx, MYSQL_FIELD* field,
char* val, ulonglong len, my_bool is_null)
char* val, size_t len, my_bool is_null)
{
char null[]= "NULL";
@ -8540,7 +8540,7 @@ void run_query(struct st_connection *cn, struct st_command *command, int flags)
if (flags & QUERY_PRINT_ORIGINAL_FLAG)
{
print_query= command->query;
print_len= command->end - command->query;
print_len= (int)(command->end - command->query);
}
replace_dynstr_append_mem(ds, print_query, print_len);
dynstr_append_mem(ds, delimiter, delimiter_length);
@ -10237,7 +10237,7 @@ void free_replace_regex()
*/
#define SECURE_REG_BUF if (buf_len < need_buf_len) \
{ \
int off= res_p - buf; \
ssize_t off= res_p - buf; \
buf= (char*)my_realloc(buf,need_buf_len,MYF(MY_WME+MY_FAE)); \
res_p= buf + off; \
buf_len= need_buf_len; \
@ -10262,13 +10262,15 @@ int reg_replace(char** buf_p, int* buf_len_p, char *pattern,
regmatch_t *subs;
char *replace_end;
char *buf= *buf_p;
int len;
int buf_len, need_buf_len;
size_t len;
size_t buf_len, need_buf_len;
int cflags= REG_EXTENDED | REG_DOTALL;
int err_code;
char *res_p,*str_p,*str_end;
buf_len= *buf_len_p;
DBUG_ASSERT(*buf_len_p > 0);
buf_len= (size_t)*buf_len_p;
len= strlen(string);
str_end= string + len;
@ -10411,7 +10413,7 @@ int reg_replace(char** buf_p, int* buf_len_p, char *pattern,
}
else /* no match this time, just copy the string as is */
{
int left_in_str= str_end-str_p;
size_t left_in_str= str_end-str_p;
need_buf_len= (res_p-buf) + left_in_str;
SECURE_REG_BUF
memcpy(res_p,str_p,left_in_str);

View File

@ -139,8 +139,8 @@ IF(MSVC)
ENDIF()
#TODO: update the code and remove the disabled warnings
SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /wd4800 /wd4805 /wd4996 /we4700")
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /wd4800 /wd4805 /wd4996 /wd4291 /wd4577 /we4099 /we4700")
SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /wd4800 /wd4805 /wd4996 /we4700 /we4311 /we4477 /we4302 /we4090 /wd4267 ")
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /wd4800 /wd4805 /wd4996 /wd4291 /wd4577 /we4099 /we4700 /we4311 /we4477 /we4302 /we4090 /wd4267")
ENDIF()

View File

@ -90,7 +90,7 @@ SET(HAVE_LDIV 1 CACHE INTERNAL "")
SET(HAVE_LIMITS_H 1 CACHE INTERNAL "")
SET(HAVE_LOCALE_H 1 CACHE INTERNAL "")
SET(HAVE_LOCALTIME_R 1 CACHE INTERNAL "")
SET(HAVE_LOG2 CACHE INTERNAL "")
#SET(HAVE_LOG2 CACHE INTERNAL "")
SET(HAVE_LRAND48 CACHE INTERNAL "")
SET(HAVE_LSTAT CACHE INTERNAL "")
SET(HAVE_MADVISE CACHE INTERNAL "")
@ -141,7 +141,7 @@ SET(HAVE_READLINK CACHE INTERNAL "")
SET(HAVE_READ_REAL_TIME CACHE INTERNAL "")
SET(HAVE_REALPATH CACHE INTERNAL "")
SET(HAVE_RENAME 1 CACHE INTERNAL "")
SET(HAVE_RINT CACHE INTERNAL "")
#SET(HAVE_RINT CACHE INTERNAL "")
SET(HAVE_RWLOCK_INIT CACHE INTERNAL "")
SET(HAVE_SCHED_H CACHE INTERNAL "")
SET(HAVE_SCHED_YIELD CACHE INTERNAL "")

View File

@ -1341,8 +1341,8 @@ void _db_dump_(uint _line_, const char *keyword,
{
fprintf(cs->stack->out_file->file, "%s: ", cs->func);
}
(void) fprintf(cs->stack->out_file->file, "%s: Memory: 0x%lx Bytes: (%ld)\n",
keyword, (ulong) memory, (long) length);
(void) fprintf(cs->stack->out_file->file, "%s: Memory: %p Bytes: (%ld)\n",
keyword, memory, (long) length);
pos=0;
while (length-- > 0)

View File

@ -93,7 +93,7 @@ static bool use_end_page;
static bool do_one_page;
static my_bool do_leaf;
static my_bool per_page_details;
static ulong n_merge;
static ulint n_merge;
extern ulong srv_checksum_algorithm;
static ulong physical_page_size; /* Page size in bytes on disk. */
static ulong logical_page_size; /* Page size when uncompressed. */
@ -524,7 +524,7 @@ is_page_corrupted(
normal method. */
if (is_encrypted && key_version != 0) {
is_corrupted = !fil_space_verify_crypt_checksum(buf,
page_size, space_id, cur_page_num);
page_size, space_id, (ulint)cur_page_num);
} else {
is_corrupted = true;
}
@ -1538,7 +1538,7 @@ int main(
byte* buf = NULL;
byte* xdes = NULL;
/* bytes read count */
ulong bytes;
ulint bytes;
/* current time */
time_t now;
/* last time */
@ -1675,7 +1675,7 @@ int main(
}
/* Read the minimum page size. */
bytes = ulong(fread(buf, 1, UNIV_ZIP_SIZE_MIN, fil_in));
bytes = fread(buf, 1, UNIV_ZIP_SIZE_MIN, fil_in);
partial_page_read = true;
if (bytes != UNIV_ZIP_SIZE_MIN) {

View File

@ -531,8 +531,8 @@ mode_extract(int n_threads, int argc __attribute__((unused)),
ctxt.ds_ctxt = ds_ctxt;
ctxt.mutex = &mutex;
tids = malloc(sizeof(pthread_t) * n_threads);
retvals = malloc(sizeof(void*) * n_threads);
tids = calloc(n_threads, sizeof(pthread_t));
retvals = calloc(n_threads, sizeof(void*));
for (i = 0; i < n_threads; i++)
pthread_create(tids + i, NULL, extract_worker_thread_func,
@ -542,7 +542,7 @@ mode_extract(int n_threads, int argc __attribute__((unused)),
pthread_join(tids[i], retvals + i);
for (i = 0; i < n_threads; i++) {
if ((ulong)retvals[i] == XB_STREAM_READ_ERROR) {
if ((size_t)retvals[i] == XB_STREAM_READ_ERROR) {
ret = 1;
goto exit;
}

View File

@ -1859,9 +1859,9 @@ xb_write_delta_metadata(const char *filename, const xb_delta_info_t *info)
MY_STAT mystat;
snprintf(buf, sizeof(buf),
"page_size = %lu\n"
"zip_size = %lu\n"
"space_id = %lu\n",
"page_size = " ULINTPF "\n"
"zip_size = " ULINTPF " \n"
"space_id = " ULINTPF "\n",
info->page_size.logical(),
info->page_size.is_compressed()
? info->page_size.physical() : 0,
@ -4174,7 +4174,7 @@ exit:
char tmpname[FN_REFLEN];
snprintf(tmpname, FN_REFLEN, "%s/xtrabackup_tmp_#%lu",
snprintf(tmpname, FN_REFLEN, "%s/xtrabackup_tmp_#" ULINTPF,
dbname, fil_space->id);
msg("xtrabackup: Renaming %s to %s.ibd\n",

View File

@ -218,7 +218,7 @@ struct WindowSlider
exp >>= skipCount;
windowBegin += skipCount;
expWindow = exp % (1 << windowSize);
expWindow = (unsigned int)(exp % (1LL << windowSize));
if (fastNegate && exp.GetBit(windowSize))
{
@ -248,7 +248,7 @@ void AbstractGroup::SimultaneousMultiply(Integer *results, const Integer &base,
{
exponents.push_back(WindowSlider(*expBegin++, InversionIsFast(), 0));
exponents[i].FindNextWindow();
buckets[i].resize(1<<(exponents[i].windowSize-1), Identity());
buckets[i].resize(size_t(1)<<(exponents[i].windowSize-1), Identity());
}
unsigned int expBitPosition = 0;

View File

@ -161,7 +161,7 @@ marked as unlikely by the branch prediction mechanism. optimize a
rarely invoked function for size instead for speed. */
# define ATTRIBUTE_COLD __attribute__((cold))
# endif
#elif defined _WIN32
#elif defined _MSC_VER
# define ATTRIBUTE_NORETURN __declspec(noreturn)
#else
# define ATTRIBUTE_NORETURN /* empty */

View File

@ -278,23 +278,23 @@ struct st_mysql_const_lex_string
};
typedef struct st_mysql_const_lex_string MYSQL_CONST_LEX_STRING;
extern struct thd_alloc_service_st {
void *(*thd_alloc_func)(void*, unsigned int);
void *(*thd_calloc_func)(void*, unsigned int);
void *(*thd_alloc_func)(void*, size_t);
void *(*thd_calloc_func)(void*, size_t);
char *(*thd_strdup_func)(void*, const char *);
char *(*thd_strmake_func)(void*, const char *, unsigned int);
void *(*thd_memdup_func)(void*, const void*, unsigned int);
char *(*thd_strmake_func)(void*, const char *, size_t);
void *(*thd_memdup_func)(void*, const void*, size_t);
MYSQL_CONST_LEX_STRING *(*thd_make_lex_string_func)(void*,
MYSQL_CONST_LEX_STRING *,
const char *, unsigned int, int);
const char *, size_t, int);
} *thd_alloc_service;
void *thd_alloc(void* thd, unsigned int size);
void *thd_calloc(void* thd, unsigned int size);
void *thd_alloc(void* thd, size_t size);
void *thd_calloc(void* thd, size_t size);
char *thd_strdup(void* thd, const char *str);
char *thd_strmake(void* thd, const char *str, unsigned int size);
void *thd_memdup(void* thd, const void* str, unsigned int size);
char *thd_strmake(void* thd, const char *str, size_t size);
void *thd_memdup(void* thd, const void* str, size_t size);
MYSQL_CONST_LEX_STRING
*thd_make_lex_string(void* thd, MYSQL_CONST_LEX_STRING *lex_str,
const char *str, unsigned int size,
const char *str, size_t size,
int allocate_lex_string);
extern struct thd_autoinc_service_st {
void (*thd_get_autoinc_func)(const void* thd,

View File

@ -278,23 +278,23 @@ struct st_mysql_const_lex_string
};
typedef struct st_mysql_const_lex_string MYSQL_CONST_LEX_STRING;
extern struct thd_alloc_service_st {
void *(*thd_alloc_func)(void*, unsigned int);
void *(*thd_calloc_func)(void*, unsigned int);
void *(*thd_alloc_func)(void*, size_t);
void *(*thd_calloc_func)(void*, size_t);
char *(*thd_strdup_func)(void*, const char *);
char *(*thd_strmake_func)(void*, const char *, unsigned int);
void *(*thd_memdup_func)(void*, const void*, unsigned int);
char *(*thd_strmake_func)(void*, const char *, size_t);
void *(*thd_memdup_func)(void*, const void*, size_t);
MYSQL_CONST_LEX_STRING *(*thd_make_lex_string_func)(void*,
MYSQL_CONST_LEX_STRING *,
const char *, unsigned int, int);
const char *, size_t, int);
} *thd_alloc_service;
void *thd_alloc(void* thd, unsigned int size);
void *thd_calloc(void* thd, unsigned int size);
void *thd_alloc(void* thd, size_t size);
void *thd_calloc(void* thd, size_t size);
char *thd_strdup(void* thd, const char *str);
char *thd_strmake(void* thd, const char *str, unsigned int size);
void *thd_memdup(void* thd, const void* str, unsigned int size);
char *thd_strmake(void* thd, const char *str, size_t size);
void *thd_memdup(void* thd, const void* str, size_t size);
MYSQL_CONST_LEX_STRING
*thd_make_lex_string(void* thd, MYSQL_CONST_LEX_STRING *lex_str,
const char *str, unsigned int size,
const char *str, size_t size,
int allocate_lex_string);
extern struct thd_autoinc_service_st {
void (*thd_get_autoinc_func)(const void* thd,

View File

@ -278,23 +278,23 @@ struct st_mysql_const_lex_string
};
typedef struct st_mysql_const_lex_string MYSQL_CONST_LEX_STRING;
extern struct thd_alloc_service_st {
void *(*thd_alloc_func)(void*, unsigned int);
void *(*thd_calloc_func)(void*, unsigned int);
void *(*thd_alloc_func)(void*, size_t);
void *(*thd_calloc_func)(void*, size_t);
char *(*thd_strdup_func)(void*, const char *);
char *(*thd_strmake_func)(void*, const char *, unsigned int);
void *(*thd_memdup_func)(void*, const void*, unsigned int);
char *(*thd_strmake_func)(void*, const char *, size_t);
void *(*thd_memdup_func)(void*, const void*, size_t);
MYSQL_CONST_LEX_STRING *(*thd_make_lex_string_func)(void*,
MYSQL_CONST_LEX_STRING *,
const char *, unsigned int, int);
const char *, size_t, int);
} *thd_alloc_service;
void *thd_alloc(void* thd, unsigned int size);
void *thd_calloc(void* thd, unsigned int size);
void *thd_alloc(void* thd, size_t size);
void *thd_calloc(void* thd, size_t size);
char *thd_strdup(void* thd, const char *str);
char *thd_strmake(void* thd, const char *str, unsigned int size);
void *thd_memdup(void* thd, const void* str, unsigned int size);
char *thd_strmake(void* thd, const char *str, size_t size);
void *thd_memdup(void* thd, const void* str, size_t size);
MYSQL_CONST_LEX_STRING
*thd_make_lex_string(void* thd, MYSQL_CONST_LEX_STRING *lex_str,
const char *str, unsigned int size,
const char *str, size_t size,
int allocate_lex_string);
extern struct thd_autoinc_service_st {
void (*thd_get_autoinc_func)(const void* thd,

View File

@ -278,23 +278,23 @@ struct st_mysql_const_lex_string
};
typedef struct st_mysql_const_lex_string MYSQL_CONST_LEX_STRING;
extern struct thd_alloc_service_st {
void *(*thd_alloc_func)(void*, unsigned int);
void *(*thd_calloc_func)(void*, unsigned int);
void *(*thd_alloc_func)(void*, size_t);
void *(*thd_calloc_func)(void*, size_t);
char *(*thd_strdup_func)(void*, const char *);
char *(*thd_strmake_func)(void*, const char *, unsigned int);
void *(*thd_memdup_func)(void*, const void*, unsigned int);
char *(*thd_strmake_func)(void*, const char *, size_t);
void *(*thd_memdup_func)(void*, const void*, size_t);
MYSQL_CONST_LEX_STRING *(*thd_make_lex_string_func)(void*,
MYSQL_CONST_LEX_STRING *,
const char *, unsigned int, int);
const char *, size_t, int);
} *thd_alloc_service;
void *thd_alloc(void* thd, unsigned int size);
void *thd_calloc(void* thd, unsigned int size);
void *thd_alloc(void* thd, size_t size);
void *thd_calloc(void* thd, size_t size);
char *thd_strdup(void* thd, const char *str);
char *thd_strmake(void* thd, const char *str, unsigned int size);
void *thd_memdup(void* thd, const void* str, unsigned int size);
char *thd_strmake(void* thd, const char *str, size_t size);
void *thd_memdup(void* thd, const void* str, size_t size);
MYSQL_CONST_LEX_STRING
*thd_make_lex_string(void* thd, MYSQL_CONST_LEX_STRING *lex_str,
const char *str, unsigned int size,
const char *str, size_t size,
int allocate_lex_string);
extern struct thd_autoinc_service_st {
void (*thd_get_autoinc_func)(const void* thd,

View File

@ -278,23 +278,23 @@ struct st_mysql_const_lex_string
};
typedef struct st_mysql_const_lex_string MYSQL_CONST_LEX_STRING;
extern struct thd_alloc_service_st {
void *(*thd_alloc_func)(void*, unsigned int);
void *(*thd_calloc_func)(void*, unsigned int);
void *(*thd_alloc_func)(void*, size_t);
void *(*thd_calloc_func)(void*, size_t);
char *(*thd_strdup_func)(void*, const char *);
char *(*thd_strmake_func)(void*, const char *, unsigned int);
void *(*thd_memdup_func)(void*, const void*, unsigned int);
char *(*thd_strmake_func)(void*, const char *, size_t);
void *(*thd_memdup_func)(void*, const void*, size_t);
MYSQL_CONST_LEX_STRING *(*thd_make_lex_string_func)(void*,
MYSQL_CONST_LEX_STRING *,
const char *, unsigned int, int);
const char *, size_t, int);
} *thd_alloc_service;
void *thd_alloc(void* thd, unsigned int size);
void *thd_calloc(void* thd, unsigned int size);
void *thd_alloc(void* thd, size_t size);
void *thd_calloc(void* thd, size_t size);
char *thd_strdup(void* thd, const char *str);
char *thd_strmake(void* thd, const char *str, unsigned int size);
void *thd_memdup(void* thd, const void* str, unsigned int size);
char *thd_strmake(void* thd, const char *str, size_t size);
void *thd_memdup(void* thd, const void* str, size_t size);
MYSQL_CONST_LEX_STRING
*thd_make_lex_string(void* thd, MYSQL_CONST_LEX_STRING *lex_str,
const char *str, unsigned int size,
const char *str, size_t size,
int allocate_lex_string);
extern struct thd_autoinc_service_st {
void (*thd_get_autoinc_func)(const void* thd,

View File

@ -50,14 +50,14 @@ struct st_mysql_const_lex_string
typedef struct st_mysql_const_lex_string MYSQL_CONST_LEX_STRING;
extern struct thd_alloc_service_st {
void *(*thd_alloc_func)(MYSQL_THD, unsigned int);
void *(*thd_calloc_func)(MYSQL_THD, unsigned int);
void *(*thd_alloc_func)(MYSQL_THD, size_t);
void *(*thd_calloc_func)(MYSQL_THD, size_t);
char *(*thd_strdup_func)(MYSQL_THD, const char *);
char *(*thd_strmake_func)(MYSQL_THD, const char *, unsigned int);
void *(*thd_memdup_func)(MYSQL_THD, const void*, unsigned int);
char *(*thd_strmake_func)(MYSQL_THD, const char *, size_t);
void *(*thd_memdup_func)(MYSQL_THD, const void*, size_t);
MYSQL_CONST_LEX_STRING *(*thd_make_lex_string_func)(MYSQL_THD,
MYSQL_CONST_LEX_STRING *,
const char *, unsigned int, int);
const char *, size_t, int);
} *thd_alloc_service;
#ifdef MYSQL_DYNAMIC_PLUGIN
@ -92,11 +92,11 @@ extern struct thd_alloc_service_st {
@see alloc_root()
*/
void *thd_alloc(MYSQL_THD thd, unsigned int size);
void *thd_alloc(MYSQL_THD thd, size_t size);
/**
@see thd_alloc()
*/
void *thd_calloc(MYSQL_THD thd, unsigned int size);
void *thd_calloc(MYSQL_THD thd, size_t size);
/**
@see thd_alloc()
*/
@ -104,11 +104,11 @@ char *thd_strdup(MYSQL_THD thd, const char *str);
/**
@see thd_alloc()
*/
char *thd_strmake(MYSQL_THD thd, const char *str, unsigned int size);
char *thd_strmake(MYSQL_THD thd, const char *str, size_t size);
/**
@see thd_alloc()
*/
void *thd_memdup(MYSQL_THD thd, const void* str, unsigned int size);
void *thd_memdup(MYSQL_THD thd, const void* str, size_t size);
/**
Create a LEX_STRING in this connection's local memory pool
@ -125,7 +125,7 @@ void *thd_memdup(MYSQL_THD thd, const void* str, unsigned int size);
*/
MYSQL_CONST_LEX_STRING
*thd_make_lex_string(MYSQL_THD thd, MYSQL_CONST_LEX_STRING *lex_str,
const char *str, unsigned int size,
const char *str, size_t size,
int allocate_lex_string);
#endif

View File

@ -21,9 +21,9 @@
extern int my_connect_async(struct mysql_async_context *b, my_socket fd,
const struct sockaddr *name, uint namelen,
int vio_timeout);
extern ssize_t my_recv_async(struct mysql_async_context *b, int fd,
extern ssize_t my_recv_async(struct mysql_async_context *b, my_socket fd,
unsigned char *buf, size_t size, int timeout);
extern ssize_t my_send_async(struct mysql_async_context *b, int fd,
extern ssize_t my_send_async(struct mysql_async_context *b, my_socket fd,
const unsigned char *buf, size_t size,
int timeout);
extern my_bool my_io_wait_async(struct mysql_async_context *b,

View File

@ -34,7 +34,7 @@
#define VERSION_my_sha2 0x0100
#define VERSION_my_snprintf 0x0100
#define VERSION_progress_report 0x0100
#define VERSION_thd_alloc 0x0100
#define VERSION_thd_alloc 0x0200
#define VERSION_thd_autoinc 0x0100
#define VERSION_thd_error_context 0x0200
#define VERSION_thd_rnd 0x0100

View File

@ -2053,9 +2053,9 @@ static my_bool store_param(MYSQL_STMT *stmt, MYSQL_BIND *param)
{
NET *net= &stmt->mysql->net;
DBUG_ENTER("store_param");
DBUG_PRINT("enter",("type: %d buffer: 0x%lx length: %lu is_null: %d",
DBUG_PRINT("enter",("type: %d buffer:%p length: %lu is_null: %d",
param->buffer_type,
(long) (param->buffer ? param->buffer : NullS),
param->buffer,
*param->length, *param->is_null));
if (*param->is_null)
@ -2979,8 +2979,8 @@ mysql_stmt_send_long_data(MYSQL_STMT *stmt, uint param_number,
MYSQL_BIND *param;
DBUG_ENTER("mysql_stmt_send_long_data");
DBUG_ASSERT(stmt != 0);
DBUG_PRINT("enter",("param no: %d data: 0x%lx, length : %ld",
param_number, (long) data, length));
DBUG_PRINT("enter",("param no: %d data: %p, length : %ld",
param_number, data, length));
/*
We only need to check for stmt->param_count, if it's not null
@ -3249,7 +3249,7 @@ static void fetch_string_with_conversion(MYSQL_BIND *param, char *value,
ulong copy_length;
if (start < end)
{
copy_length= end - start;
copy_length= (ulong)(end - start);
/* We've got some data beyond offset: copy up to buffer_length bytes */
if (param->buffer_length)
memcpy(buffer, start, MY_MIN(copy_length, param->buffer_length));

View File

@ -205,7 +205,7 @@ mysql_real_connect(MYSQL *mysql,const char *host, const char *user,
}
}
DBUG_PRINT("exit",("Mysql handler: 0x%lx", (long) mysql));
DBUG_PRINT("exit",("Mysql handler: %p", mysql));
DBUG_RETURN(mysql);
error:

View File

@ -5883,7 +5883,7 @@ where c1 = c2-0 and c2 <= (select max(c3) from t3 where c3 = 2 and @counter:=@co
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t1 ALL NULL NULL NULL NULL 2
1 PRIMARY t2 ALL NULL NULL NULL NULL 2 Using where; Using join buffer (flat, BNL join)
2 UNCACHEABLE SUBQUERY t3 system NULL NULL NULL NULL 1
2 UNCACHEABLE SUBQUERY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE
set @counter=0;
select count(*) from t1 straight_join t2
where c1 = c2-0 and c2 <= (select max(c3) from t3 where c3 = 2 and @counter:=@counter+1);

View File

@ -1,4 +1,3 @@
drop table if exists t1,t2;
set @a := foo;
ERROR 42S22: Unknown column 'foo' in 'field list'
set @a := connection_id() + 3;
@ -126,14 +125,14 @@ select @a+0, @a:=@a+0+count(*), count(*), @a+0 from t1 group by i;
set @a=0;
select @a,@a:="hello",@a,@a:=3,@a,@a:="hello again" from t1 group by i;
@a @a:="hello" @a @a:=3 @a @a:="hello again"
0 hello 0 3 3 hello again
0 hello 0 3 3 hello again
0 hello 0 3 3 hello again
0 hello 0 3 0 hello again
0 hello 0 3 0 hello again
0 hello 0 3 0 hello again
select @a,@a:="hello",@a,@a:=3,@a,@a:="hello again" from t1 group by i;
@a @a:="hello" @a @a:=3 @a @a:="hello again"
hello again hello hello 3 3 hello again
hello again hello hello 3 3 hello again
hello again hello hello 3 3 hello again
hello again hello hello again 3 hello again hello again
hello again hello hello again 3 hello again hello again
hello again hello hello again 3 hello again hello again
drop table t1;
set @a=_latin2'test';
select charset(@a),collation(@a),coercibility(@a);
@ -570,6 +569,9 @@ End of 5.5 tests
#
set @var= repeat('a',20000);
1
explain select @a:=max(seq) from seq_1_to_1000000;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Select tables optimized away
#
# Start of 10.3 tests
#

View File

@ -1548,7 +1548,7 @@ one
1
explain SELECT 1 as 'one' FROM t1 GROUP BY @a:= (SELECT ROUND(f1) FROM t1 WHERE f1 = 0);
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t1 ALL NULL NULL NULL NULL 2 Using temporary; Using filesort
1 PRIMARY t1 ALL NULL NULL NULL NULL 2
2 SUBQUERY t1 ALL NULL NULL NULL NULL 2 Using where
SELECT 1 as 'one' FROM t1 GROUP BY @a:= (SELECT ROUND(f1) FROM t1 WHERE f1 = 0);
one
@ -1559,7 +1559,7 @@ one
set sql_buffer_result=1;
explain SELECT 1 as 'one' FROM t1 GROUP BY @a:= (SELECT ROUND(f1) FROM t1 WHERE f1 = 0);
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t1 ALL NULL NULL NULL NULL 2 Using temporary; Using filesort
1 PRIMARY t1 ALL NULL NULL NULL NULL 2 Using temporary
2 SUBQUERY t1 ALL NULL NULL NULL NULL 2 Using where
SELECT 1 as 'one' FROM t1 GROUP BY @a:= (SELECT ROUND(f1) FROM t1 WHERE f1 = 0);
one

View File

@ -0,0 +1,4 @@
connection node_1;
create table t(a int);
insert into t select 1;
DROP TABLE t;

View File

@ -0,0 +1 @@
--innodb-stats-persistent=1

View File

@ -0,0 +1,6 @@
--source include/galera_cluster.inc
--source include/have_innodb.inc
--connection node_1
create table t(a int);
insert into t select 1;
DROP TABLE t;

View File

@ -1222,7 +1222,7 @@
VARIABLE_NAME INNODB_VERSION
SESSION_VALUE NULL
-GLOBAL_VALUE 5.6.37
+GLOBAL_VALUE 5.6.36-82.1
+GLOBAL_VALUE 5.6.36-82.2
GLOBAL_VALUE_ORIGIN COMPILE-TIME
DEFAULT_VALUE NULL
VARIABLE_SCOPE GLOBAL

View File

@ -1,7 +1,5 @@
# Initialise
--disable_warnings
drop table if exists t1,t2;
--enable_warnings
source include/have_sequence.inc;
--error 1054
set @a := foo;
@ -501,6 +499,13 @@ eval select $tmp < $tmp2;
--enable_column_names
--enable_query_log
#
# MDEV-13897 SELECT @a := MAX(col) FROM t requires full index scan
#
explain select @a:=max(seq) from seq_1_to_1000000;
# End of 10.1 tests
--echo #
--echo # Start of 10.3 tests
--echo #

View File

@ -84,7 +84,7 @@ my_hash_init2(HASH *hash, uint growth_size, CHARSET_INFO *charset,
{
my_bool res;
DBUG_ENTER("my_hash_init");
DBUG_PRINT("enter",("hash: 0x%lx size: %u", (long) hash, (uint) size));
DBUG_PRINT("enter",("hash:%p size: %u", hash, (uint) size));
hash->records=0;
hash->key_offset=key_offset;
@ -144,8 +144,8 @@ static inline void my_hash_free_elements(HASH *hash)
void my_hash_free(HASH *hash)
{
DBUG_ENTER("my_hash_free");
DBUG_PRINT("enter",("hash: 0x%lx elements: %ld",
(long) hash, hash->records));
DBUG_PRINT("enter",("hash:%p elements: %ld",
hash, hash->records));
my_hash_free_elements(hash);
hash->free= 0;
@ -166,7 +166,7 @@ void my_hash_free(HASH *hash)
void my_hash_reset(HASH *hash)
{
DBUG_ENTER("my_hash_reset");
DBUG_PRINT("enter",("hash: 0x%lxd", (long) hash));
DBUG_PRINT("enter",("hash:%p", hash));
my_hash_free_elements(hash);
reset_dynamic(&hash->array);
@ -844,8 +844,8 @@ my_bool my_hash_check(HASH *hash)
blength, records)) != i)
{
DBUG_PRINT("error", ("Record in wrong link at %d: Start %d "
"Record: 0x%lx Record-link %d",
idx, i, (long) hash_info->data, rec_link));
"Record:%p Record-link %d",
idx, i, hash_info->data, rec_link));
error=1;
}
else

View File

@ -355,7 +355,7 @@ static void lf_pinbox_real_free(LF_PINS *pins)
lf_dynarray_iterate(&pinbox->pinarray,
(lf_dynarray_func)harvest_pins, &hv);
npins= hv.granary-addr;
npins= (int)(hv.granary-addr);
/* and sort them */
if (npins)
qsort(addr, npins, sizeof(void *), (qsort_cmp)ptr_cmp);

View File

@ -27,7 +27,7 @@
LIST *list_add(LIST *root, LIST *element)
{
DBUG_ENTER("list_add");
DBUG_PRINT("enter",("root: 0x%lx element: 0x%lx", (long) root, (long) element));
DBUG_PRINT("enter",("root: %p element: %p", root, element));
if (root)
{
if (root->prev) /* If add in mid of list */

View File

@ -154,8 +154,8 @@ int init_io_cache(IO_CACHE *info, File file, size_t cachesize,
my_off_t pos;
my_off_t end_of_file= ~(my_off_t) 0;
DBUG_ENTER("init_io_cache");
DBUG_PRINT("enter",("cache: 0x%lx type: %d pos: %ld",
(ulong) info, (int) type, (ulong) seek_offset));
DBUG_PRINT("enter",("cache:%p type: %d pos: %llu",
info, (int) type, (ulonglong) seek_offset));
info->file= file;
info->type= TYPE_NOT_SET; /* Don't set it until mutex are created */
@ -437,8 +437,8 @@ my_bool reinit_io_cache(IO_CACHE *info, enum cache_type type,
my_bool clear_cache)
{
DBUG_ENTER("reinit_io_cache");
DBUG_PRINT("enter",("cache: 0x%lx type: %d seek_offset: %lu clear_cache: %d",
(ulong) info, type, (ulong) seek_offset,
DBUG_PRINT("enter",("cache:%p type: %d seek_offset: %llu clear_cache: %d",
info, type, (ulonglong) seek_offset,
(int) clear_cache));
DBUG_ASSERT(type == READ_CACHE || type == WRITE_CACHE);
@ -865,10 +865,10 @@ void init_io_cache_share(IO_CACHE *read_cache, IO_CACHE_SHARE *cshare,
IO_CACHE *write_cache, uint num_threads)
{
DBUG_ENTER("init_io_cache_share");
DBUG_PRINT("io_cache_share", ("read_cache: 0x%lx share: 0x%lx "
"write_cache: 0x%lx threads: %u",
(long) read_cache, (long) cshare,
(long) write_cache, num_threads));
DBUG_PRINT("io_cache_share", ("read_cache: %p share: %p "
"write_cache: %p threads: %u",
read_cache, cshare,
write_cache, num_threads));
DBUG_ASSERT(num_threads > 1);
DBUG_ASSERT(read_cache->type == READ_CACHE);
@ -930,9 +930,9 @@ void remove_io_thread(IO_CACHE *cache)
flush_io_cache(cache);
mysql_mutex_lock(&cshare->mutex);
DBUG_PRINT("io_cache_share", ("%s: 0x%lx",
DBUG_PRINT("io_cache_share", ("%s: %p",
(cache == cshare->source_cache) ?
"writer" : "reader", (long) cache));
"writer" : "reader", cache));
/* Remove from share. */
total= --cshare->total_threads;
@ -1006,9 +1006,9 @@ static int lock_io_cache(IO_CACHE *cache, my_off_t pos)
/* Enter the lock. */
mysql_mutex_lock(&cshare->mutex);
cshare->running_threads--;
DBUG_PRINT("io_cache_share", ("%s: 0x%lx pos: %lu running: %u",
DBUG_PRINT("io_cache_share", ("%s: %p pos: %lu running: %u",
(cache == cshare->source_cache) ?
"writer" : "reader", (long) cache, (ulong) pos,
"writer" : "reader", cache, (ulong) pos,
cshare->running_threads));
if (cshare->source_cache)
@ -1145,10 +1145,10 @@ static void unlock_io_cache(IO_CACHE *cache)
{
IO_CACHE_SHARE *cshare= cache->share;
DBUG_ENTER("unlock_io_cache");
DBUG_PRINT("io_cache_share", ("%s: 0x%lx pos: %lu running: %u",
DBUG_PRINT("io_cache_share", ("%s: %p pos: %lu running: %u",
(cache == cshare->source_cache) ?
"writer" : "reader",
(long) cache, (ulong) cshare->pos_in_file,
cache, (ulong) cshare->pos_in_file,
cshare->total_threads));
cshare->running_threads= cshare->total_threads;
@ -1899,7 +1899,7 @@ int my_b_flush_io_cache(IO_CACHE *info, int need_append_buffer_lock)
size_t length;
my_bool append_cache= (info->type == SEQ_READ_APPEND);
DBUG_ENTER("my_b_flush_io_cache");
DBUG_PRINT("enter", ("cache: 0x%lx", (long) info));
DBUG_PRINT("enter", ("cache: %p", info));
if (!append_cache)
need_append_buffer_lock= 0;
@ -1977,7 +1977,7 @@ int end_io_cache(IO_CACHE *info)
{
int error=0;
DBUG_ENTER("end_io_cache");
DBUG_PRINT("enter",("cache: 0x%lx", (ulong) info));
DBUG_PRINT("enter",("cache: %p", info));
/*
Every thread must call remove_io_thread(). The last one destroys

View File

@ -609,11 +609,11 @@ int init_simple_key_cache(SIMPLE_KEY_CACHE_CB *keycache,
keycache->waiting_for_hash_link.last_thread= NULL;
keycache->waiting_for_block.last_thread= NULL;
DBUG_PRINT("exit",
("disk_blocks: %d block_root: 0x%lx hash_entries: %d\
hash_root: 0x%lx hash_links: %d hash_link_root: 0x%lx",
keycache->disk_blocks, (long) keycache->block_root,
keycache->hash_entries, (long) keycache->hash_root,
keycache->hash_links, (long) keycache->hash_link_root));
("disk_blocks: %d block_root: %p hash_entries: %d\
hash_root: %p hash_links: %d hash_link_root: %p",
keycache->disk_blocks, keycache->block_root,
keycache->hash_entries, keycache->hash_root,
keycache->hash_links, keycache->hash_link_root));
}
else
{
@ -963,7 +963,7 @@ static
void end_simple_key_cache(SIMPLE_KEY_CACHE_CB *keycache, my_bool cleanup)
{
DBUG_ENTER("end_simple_key_cache");
DBUG_PRINT("enter", ("key_cache: 0x%lx", (long) keycache));
DBUG_PRINT("enter", ("key_cache: %p", keycache));
if (!keycache->key_cache_inited)
DBUG_VOID_RETURN;
@ -4366,7 +4366,7 @@ int flush_simple_key_cache_blocks(SIMPLE_KEY_CACHE_CB *keycache,
{
int res= 0;
DBUG_ENTER("flush_key_blocks");
DBUG_PRINT("enter", ("keycache: 0x%lx", (long) keycache));
DBUG_PRINT("enter", ("keycache: %p", keycache));
if (!keycache->key_cache_inited)
DBUG_RETURN(0);
@ -4795,11 +4795,11 @@ void keycache_debug_log_close(void)
static int fail_block(BLOCK_LINK *block)
{
F_B_PRT("block->next_used: %lx\n", (ulong) block->next_used);
F_B_PRT("block->prev_used: %lx\n", (ulong) block->prev_used);
F_B_PRT("block->next_changed: %lx\n", (ulong) block->next_changed);
F_B_PRT("block->prev_changed: %lx\n", (ulong) block->prev_changed);
F_B_PRT("block->hash_link: %lx\n", (ulong) block->hash_link);
F_B_PRT("block->next_used: %p\n", block->next_used);
F_B_PRT("block->prev_used: %p\n", block->prev_used);
F_B_PRT("block->next_changed: %p\n", block->next_changed);
F_B_PRT("block->prev_changed: %p\n", block->prev_changed);
F_B_PRT("block->hash_link: %p\n", block->hash_link);
F_B_PRT("block->status: %u\n", block->status);
F_B_PRT("block->length: %u\n", block->length);
F_B_PRT("block->offset: %u\n", block->offset);
@ -4810,9 +4810,9 @@ static int fail_block(BLOCK_LINK *block)
static int fail_hlink(HASH_LINK *hlink)
{
F_B_PRT("hlink->next: %lx\n", (ulong) hlink->next);
F_B_PRT("hlink->prev: %lx\n", (ulong) hlink->prev);
F_B_PRT("hlink->block: %lx\n", (ulong) hlink->block);
F_B_PRT("hlink->next: %p\n", hlink->next);
F_B_PRT("hlink->prev: %p\n", hlink->prev);
F_B_PRT("hlink->block: %p\n", hlink->block);
F_B_PRT("hlink->diskpos: %lu\n", (ulong) hlink->diskpos);
F_B_PRT("hlink->file: %d\n", hlink->file);
return 0; /* Let the assert fail. */
@ -5190,7 +5190,7 @@ int init_partitioned_key_cache(PARTITIONED_KEY_CACHE_CB *keycache,
}
}
keycache->partitions= partitions= partition_ptr-keycache->partition_array;
keycache->partitions= partitions= (uint) (partition_ptr-keycache->partition_array);
keycache->key_cache_mem_size= mem_per_cache * partitions;
for (i= 0; i < (int) partitions; i++)
keycache->partition_array[i]->hash_factor= partitions;
@ -5358,7 +5358,7 @@ void end_partitioned_key_cache(PARTITIONED_KEY_CACHE_CB *keycache,
uint i;
uint partitions= keycache->partitions;
DBUG_ENTER("partitioned_end_key_cache");
DBUG_PRINT("enter", ("key_cache: 0x%lx", (long) keycache));
DBUG_PRINT("enter", ("key_cache: %p", keycache));
for (i= 0; i < partitions; i++)
{
@ -5672,7 +5672,7 @@ int flush_partitioned_key_cache_blocks(PARTITIONED_KEY_CACHE_CB *keycache,
int err= 0;
ulonglong *dirty_part_map= (ulonglong *) file_extra;
DBUG_ENTER("partitioned_flush_key_blocks");
DBUG_PRINT("enter", ("keycache: 0x%lx", (long) keycache));
DBUG_PRINT("enter", ("keycache: %p", keycache));
for (i= 0; i < partitions; i++)
{

View File

@ -173,8 +173,8 @@ fn_expand(const char *filename, char *result_buf)
char dir[FN_REFLEN];
const int flags= MY_UNPACK_FILENAME | MY_SAFE_PATH | MY_RELATIVE_PATH;
DBUG_ENTER("fn_expand");
DBUG_PRINT("enter", ("filename: %s, result_buf: 0x%lx",
filename, (unsigned long) result_buf));
DBUG_PRINT("enter", ("filename: %s, result_buf: %p",
filename, result_buf));
if (my_getwd(dir, sizeof(dir), MYF(0)))
DBUG_RETURN(3);
DBUG_PRINT("debug", ("dir: %s", dir));

View File

@ -74,7 +74,7 @@ FILE *my_fopen(const char *filename, int flags, myf MyFlags)
my_file_total_opened++;
my_file_info[filedesc].type= STREAM_BY_FOPEN;
mysql_mutex_unlock(&THR_LOCK_open);
DBUG_PRINT("exit",("stream: 0x%lx", (long) fd));
DBUG_PRINT("exit",("stream: %p", fd));
DBUG_RETURN(fd);
}
else
@ -222,7 +222,7 @@ int my_fclose(FILE *fd, myf MyFlags)
{
int err,file;
DBUG_ENTER("my_fclose");
DBUG_PRINT("my",("stream: 0x%lx MyFlags: %lu", (long) fd, MyFlags));
DBUG_PRINT("my",("stream: %p MyFlags: %lu", fd, MyFlags));
mysql_mutex_lock(&THR_LOCK_open);
file= my_fileno(fd);
@ -292,7 +292,7 @@ FILE *my_fdopen(File Filedes, const char *name, int Flags, myf MyFlags)
mysql_mutex_unlock(&THR_LOCK_open);
}
DBUG_PRINT("exit",("stream: 0x%lx", (long) fd));
DBUG_PRINT("exit",("stream: %p", fd));
DBUG_RETURN(fd);
} /* my_fdopen */

View File

@ -46,8 +46,8 @@ size_t my_fread(FILE *stream, uchar *Buffer, size_t Count, myf MyFlags)
{
size_t readbytes;
DBUG_ENTER("my_fread");
DBUG_PRINT("my",("stream: 0x%lx Buffer: 0x%lx Count: %u MyFlags: %lu",
(long) stream, (long) Buffer, (uint) Count, MyFlags));
DBUG_PRINT("my",("stream: %p Buffer %p Count: %u MyFlags: %lu",
stream, Buffer, (uint) Count, MyFlags));
if ((readbytes= fread(Buffer, sizeof(char), Count, stream)) != Count)
{
@ -94,8 +94,8 @@ size_t my_fwrite(FILE *stream, const uchar *Buffer, size_t Count, myf MyFlags)
uint errors;
#endif
DBUG_ENTER("my_fwrite");
DBUG_PRINT("my",("stream: 0x%lx Buffer: 0x%lx Count: %u MyFlags: %lu",
(long) stream, (long) Buffer, (uint) Count, MyFlags));
DBUG_PRINT("my",("stream:%p Buffer:%p Count: %u MyFlags: %lu",
stream, Buffer, (uint) Count, MyFlags));
#if !defined(NO_BACKGROUND) && defined(USE_MY_STREAM)
errors=0;
@ -163,8 +163,8 @@ my_off_t my_fseek(FILE *stream, my_off_t pos, int whence,
myf MyFlags __attribute__((unused)))
{
DBUG_ENTER("my_fseek");
DBUG_PRINT("my",("stream: 0x%lx pos: %lu whence: %d MyFlags: %lu",
(long) stream, (long) pos, whence, MyFlags));
DBUG_PRINT("my",("stream:%p pos: %llu whence: %d MyFlags: %lu",
stream, (ulonglong) pos, whence, MyFlags));
DBUG_RETURN(fseek(stream, (off_t) pos, whence) ?
MY_FILEPOS_ERROR : (my_off_t) ftell(stream));
} /* my_seek */
@ -174,11 +174,11 @@ my_off_t my_fseek(FILE *stream, my_off_t pos, int whence,
my_off_t my_ftell(FILE *stream, myf MyFlags __attribute__((unused)))
{
off_t pos;
long long pos;
DBUG_ENTER("my_ftell");
DBUG_PRINT("my",("stream: 0x%lx MyFlags: %lu", (long) stream, MyFlags));
pos=ftell(stream);
DBUG_PRINT("exit",("ftell: %lu",(ulong) pos));
DBUG_PRINT("my",("stream:%p MyFlags: %lu", stream, MyFlags));
pos=IF_WIN(_ftelli64(stream),ftell(stream));
DBUG_PRINT("exit",("ftell: %lld",pos));
DBUG_RETURN((my_off_t) pos);
} /* my_ftell */

View File

@ -1400,7 +1400,7 @@ static uint print_name(const struct my_option *optp)
for (;*s;s++)
putchar(*s == '_' ? '-' : *s);
return s - optp->name;
return (uint)(s - optp->name);
}
/** prints option comment with indentation and wrapping.
@ -1441,7 +1441,7 @@ static uint print_comment(const char *comment,
putchar(' ');
}
printf("%s", comment);
return curpos + (end - comment);
return curpos + (int)(end - comment);
}

View File

@ -48,8 +48,8 @@ int my_getwd(char * buf, size_t size, myf MyFlags)
{
char * pos;
DBUG_ENTER("my_getwd");
DBUG_PRINT("my",("buf: 0x%lx size: %u MyFlags %lu",
(long) buf, (uint) size, MyFlags));
DBUG_PRINT("my",("buf:%p size: %u MyFlags %lu",
buf, (uint) size, MyFlags));
if (size < 1)
DBUG_RETURN(-1);

View File

@ -253,8 +253,6 @@ void my_parameter_handler(const wchar_t * expression, const wchar_t * function,
const wchar_t * file, unsigned int line,
uintptr_t pReserved)
{
DBUG_PRINT("my",("Expression: %s function: %s file: %s, line: %d",
expression, function, file, line));
__debugbreak();
}

View File

@ -221,7 +221,7 @@ MY_DIR *my_dir(const char *path, myf MyFlags)
long handle;
#endif
DBUG_ENTER("my_dir");
DBUG_PRINT("my",("path: '%s' stat: %d MyFlags: %d",path,MyFlags));
DBUG_PRINT("my",("path: '%s' MyFlags: %d",path,MyFlags));
/* Put LIB-CHAR as last path-character if not there */
tmp_file=tmp_path;
@ -347,8 +347,8 @@ MY_STAT *my_stat(const char *path, MY_STAT *stat_area, myf my_flags)
{
int m_used;
DBUG_ENTER("my_stat");
DBUG_PRINT("my", ("path: '%s' stat_area: 0x%lx MyFlags: %lu", path,
(long) stat_area, my_flags));
DBUG_PRINT("my", ("path: '%s' stat_area: %p MyFlags: %lu", path,
stat_area, my_flags));
if ((m_used= (stat_area == NULL)))
if (!(stat_area= (MY_STAT *) my_malloc(sizeof(MY_STAT), my_flags)))

View File

@ -166,7 +166,7 @@ uchar *safe_hash_search(SAFE_HASH *hash, const uchar *key, uint length,
result= def;
else
result= ((SAFE_HASH_ENTRY*) result)->data;
DBUG_PRINT("exit",("data: 0x%lx", (long) result));
DBUG_PRINT("exit",("data: %p", result));
DBUG_RETURN(result);
}
@ -197,7 +197,7 @@ my_bool safe_hash_set(SAFE_HASH *hash, const uchar *key, uint length,
SAFE_HASH_ENTRY *entry;
my_bool error= 0;
DBUG_ENTER("safe_hash_set");
DBUG_PRINT("enter",("key: %.*s data: 0x%lx", length, key, (long) data));
DBUG_PRINT("enter",("key: %.*s data: %p", length, key, data));
mysql_rwlock_wrlock(&hash->mutex);
entry= (SAFE_HASH_ENTRY*) my_hash_search(&hash->hash, key, length);

View File

@ -121,6 +121,15 @@ int pthread_join(pthread_t thread, void **value_ptr)
goto error_return;
}
if (!GetExitCodeThread(handle, &ret))
{
errno= EINVAL;
goto error_return;
}
if (value_ptr)
*value_ptr= (void *)(size_t)ret;
CloseHandle(handle);
return 0;

View File

@ -761,9 +761,9 @@ thr_lock(THR_LOCK_DATA *data, THR_LOCK_INFO *owner, ulong lock_wait_timeout)
PSI_TABLE_LOCK, lock_type);
mysql_mutex_lock(&lock->mutex);
DBUG_PRINT("lock",("data: 0x%lx thread: 0x%lx lock: 0x%lx type: %d",
(long) data, (ulong) data->owner->thread_id,
(long) lock, (int) lock_type));
DBUG_PRINT("lock",("data:%p thread:%lu lock:%p type: %d",
data, (ulong) data->owner->thread_id,
lock, (int) lock_type));
check_locks(lock,(uint) lock_type <= (uint) TL_READ_NO_INSERT ?
"enter read_lock" : "enter write_lock", lock_type, 0);
if ((int) lock_type <= (int) TL_READ_NO_INSERT)
@ -798,7 +798,7 @@ thr_lock(THR_LOCK_DATA *data, THR_LOCK_INFO *owner, ulong lock_wait_timeout)
See Bug#42147 for more information.
*/
DBUG_PRINT("lock",("write locked 1 by thread: 0x%lx",
DBUG_PRINT("lock",("write locked 1 by thread:%lu",
(ulong) lock->write.data->owner->thread_id));
if (thr_lock_owner_equal(data->owner, lock->write.data->owner) ||
(lock->write.data->type <= TL_WRITE_DELAYED &&
@ -943,8 +943,8 @@ thr_lock(THR_LOCK_DATA *data, THR_LOCK_INFO *owner, ulong lock_wait_timeout)
! lock->read_no_write_count) ||
has_old_lock(lock->write.data, data->owner))
{
DBUG_PRINT("info", ("write_wait.data: 0x%lx old_type: %d",
(ulong) lock->write_wait.data,
DBUG_PRINT("info", ("write_wait.data: %p old_type: %d",
lock->write_wait.data,
lock->write.data->type));
(*lock->write.last)=data; /* Add to running fifo */
@ -957,13 +957,13 @@ thr_lock(THR_LOCK_DATA *data, THR_LOCK_INFO *owner, ulong lock_wait_timeout)
statistic_increment(locks_immediate,&THR_LOCK_lock);
goto end;
}
DBUG_PRINT("lock",("write locked 2 by thread: 0x%lx",
DBUG_PRINT("lock",("write locked 2 by thread: %lu",
(ulong) lock->write.data->owner->thread_id));
}
else
{
DBUG_PRINT("info", ("write_wait.data: 0x%lx",
(ulong) lock->write_wait.data));
DBUG_PRINT("info", ("write_wait.data:%p",
lock->write_wait.data));
if (!lock->write_wait.data)
{ /* no scheduled write locks */
my_bool concurrent_insert= 0;
@ -993,7 +993,7 @@ thr_lock(THR_LOCK_DATA *data, THR_LOCK_INFO *owner, ulong lock_wait_timeout)
goto end;
}
}
DBUG_PRINT("lock",("write locked 3 by thread: 0x%lx type: %d",
DBUG_PRINT("lock",("write locked 3 by thread:%lu type: %d",
(ulong) lock->read.data->owner->thread_id,
data->type));
}
@ -1059,7 +1059,7 @@ static inline void free_all_read_locks(THR_LOCK *lock,
lock->read_no_write_count++;
}
/* purecov: begin inspected */
DBUG_PRINT("lock",("giving read lock to thread: 0x%lx",
DBUG_PRINT("lock",("giving read lock to thread: %lu",
(ulong)data->owner->thread_id));
/* purecov: end */
data->cond=0; /* Mark thread free */
@ -1078,7 +1078,7 @@ void thr_unlock(THR_LOCK_DATA *data, uint unlock_flags)
THR_LOCK *lock=data->lock;
enum thr_lock_type lock_type=data->type;
DBUG_ENTER("thr_unlock");
DBUG_PRINT("lock",("data: %p thread: 0x%lx lock: %p",
DBUG_PRINT("lock",("data: %p thread: %lu lock: %p",
data, (ulong) data->owner->thread_id,
lock));
mysql_mutex_lock(&lock->mutex);
@ -1172,7 +1172,7 @@ static void wake_up_waiters(THR_LOCK *lock)
(*lock->check_status)(data->status_param))
data->type=TL_WRITE; /* Upgrade lock */
/* purecov: begin inspected */
DBUG_PRINT("lock",("giving write lock of type %d to thread: 0x%lx",
DBUG_PRINT("lock",("giving write lock of type %d to thread: %lu",
data->type, (ulong) data->owner->thread_id));
/* purecov: end */
{
@ -1281,7 +1281,7 @@ thr_multi_lock(THR_LOCK_DATA **data, uint count, THR_LOCK_INFO *owner,
{
THR_LOCK_DATA **pos, **end, **first_lock;
DBUG_ENTER("thr_multi_lock");
DBUG_PRINT("lock",("data: 0x%lx count: %d", (long) data, count));
DBUG_PRINT("lock",("data: %p count: %d", data, count));
if (count > 1)
sort_locks(data,count);
@ -1302,8 +1302,8 @@ thr_multi_lock(THR_LOCK_DATA **data, uint count, THR_LOCK_INFO *owner,
DBUG_RETURN(result);
}
#ifdef MAIN
printf("Thread: %s Got lock: 0x%lx type: %d\n",my_thread_name(),
(long) pos[0]->lock, pos[0]->type); fflush(stdout);
printf("Thread: %s Got lock:%p type: %d\n",my_thread_name(),
pos[0]->lock, pos[0]->type); fflush(stdout);
#endif
}
DEBUG_SYNC_C("thr_multi_lock_after_thr_lock");
@ -1402,21 +1402,21 @@ void thr_multi_unlock(THR_LOCK_DATA **data,uint count, uint unlock_flags)
{
THR_LOCK_DATA **pos,**end;
DBUG_ENTER("thr_multi_unlock");
DBUG_PRINT("lock",("data: 0x%lx count: %d flags: %u", (long) data, count,
DBUG_PRINT("lock",("data: %p count: %d flags: %u", data, count,
unlock_flags));
for (pos=data,end=data+count; pos < end ; pos++)
{
#ifdef MAIN
printf("Thread: %s Rel lock: 0x%lx type: %d\n",
my_thread_name(), (long) pos[0]->lock, pos[0]->type);
printf("Thread: %s Rel lock: %p type: %d\n",
my_thread_name(), pos[0]->lock, pos[0]->type);
fflush(stdout);
#endif
if ((*pos)->type != TL_UNLOCK)
thr_unlock(*pos, unlock_flags);
else
{
DBUG_PRINT("lock",("Free lock: data: %p thread: 0x%lx lock: %p",
DBUG_PRINT("lock",("Free lock: data: %p thread:%lu lock: %p",
*pos, (ulong) (*pos)->owner->thread_id,
(*pos)->lock));
}
@ -1690,7 +1690,7 @@ void thr_print_locks(void)
{
THR_LOCK *lock=(THR_LOCK*) list->data;
mysql_mutex_lock(&lock->mutex);
printf("lock: 0x%lx:",(ulong) lock);
printf("lock:%p:", lock);
if ((lock->write_wait.data || lock->read_wait.data) &&
(! lock->read.data && ! lock->write.data))
printf(" WARNING: ");

View File

@ -90,7 +90,7 @@ void init_tree(TREE *tree, size_t default_alloc_size, size_t memory_limit,
myf my_flags)
{
DBUG_ENTER("init_tree");
DBUG_PRINT("enter",("tree: 0x%lx size: %d", (long) tree, size));
DBUG_PRINT("enter",("tree: %p size: %d", tree, size));
if (default_alloc_size < DEFAULT_ALLOC_SIZE)
default_alloc_size= DEFAULT_ALLOC_SIZE;
@ -139,7 +139,7 @@ void init_tree(TREE *tree, size_t default_alloc_size, size_t memory_limit,
static void free_tree(TREE *tree, myf free_flags)
{
DBUG_ENTER("free_tree");
DBUG_PRINT("enter",("tree: 0x%lx", (long) tree));
DBUG_PRINT("enter",("tree: %p", tree));
if (tree->root) /* If initialized */
{

View File

@ -88,7 +88,7 @@ static int find_type_eol(const char **x, const TYPELIB *typelib, uint flags,
const char *j;
CHARSET_INFO *cs= &my_charset_latin1;
DBUG_ENTER("find_type_eol");
DBUG_PRINT("enter",("x: '%s' lib: 0x%lx", *x, (long) typelib));
DBUG_PRINT("enter",("x: '%s' lib: %p", *x, typelib));
DBUG_ASSERT(!(flags & ~(FIND_TYPE_NO_PREFIX | FIND_TYPE_COMMA_TERM)));
@ -200,7 +200,7 @@ my_ulonglong find_typeset(char *x, TYPELIB *lib, int *err)
int find;
char *i;
DBUG_ENTER("find_set");
DBUG_PRINT("enter",("x: '%s' lib: 0x%lx", x, (long) lib));
DBUG_PRINT("enter",("x: '%s' lib: %p", x, lib));
if (!lib->count)
{
@ -399,7 +399,7 @@ my_ulonglong find_set_from_flags(const TYPELIB *lib, uint default_name,
continue;
err:
*err_pos= (char*)start;
*err_len= end - start;
*err_len= (uint)(end - start);
break;
}
}

View File

@ -224,17 +224,17 @@ void wqueue_add_and_wait(WQUEUE *wqueue,
{
DBUG_ENTER("wqueue_add_and_wait");
DBUG_PRINT("enter",
("thread: 0x%lx cond: 0x%lx mutex: 0x%lx",
(ulong) thread, (ulong) &thread->suspend, (ulong) lock));
("thread: %p cond: %p mutex: %p",
thread, &thread->suspend, lock));
wqueue_add_to_queue(wqueue, thread);
do
{
DBUG_PRINT("info", ("wait... cond: 0x%lx mutex: 0x%lx",
(ulong) &thread->suspend, (ulong) lock));
DBUG_PRINT("info", ("wait... cond: %p mutex: %p",
&thread->suspend, lock));
mysql_cond_wait(&thread->suspend, lock);
DBUG_PRINT("info", ("wait done cond: 0x%lx mutex: 0x%lx next: 0x%lx",
(ulong) &thread->suspend, (ulong) lock,
(ulong) thread->next));
DBUG_PRINT("info", ("wait done cond: %p mutex: %p next: %p",
&thread->suspend, lock,
thread->next));
}
while (thread->next);
DBUG_VOID_RETURN;

View File

@ -90,7 +90,7 @@ void my_md5(uchar *digest, const char *buf, size_t len)
char ctx_buf[EVP_MD_CTX_SIZE];
EVP_MD_CTX * const ctx= (EVP_MD_CTX*)ctx_buf;
md5_init(ctx);
md5_input(ctx, (const uchar *)buf, len);
md5_input(ctx, (const uchar *)buf, (uint) len);
md5_result(ctx, digest);
}
@ -117,7 +117,7 @@ void my_md5_multi(uchar *digest, ...)
md5_init(ctx);
for (str= va_arg(args, const uchar*); str; str= va_arg(args, const uchar*))
md5_input(ctx, str, va_arg(args, size_t));
md5_input(ctx, str, (uint) va_arg(args, size_t));
md5_result(ctx, digest);
va_end(args);
@ -135,7 +135,7 @@ void my_md5_init(void *context)
void my_md5_input(void *context, const uchar *buf, size_t len)
{
md5_input((EVP_MD_CTX *)context, buf, len);
md5_input((EVP_MD_CTX *)context, buf, (uint) len);
}
void my_md5_result(void *context, uchar *digest)

View File

@ -134,7 +134,7 @@ void my_sha(uchar *digest, const char *buf, size_t len)
CONTEXT context;
sha_init_fast(&context);
sha_input(&context, (const uchar *)buf, len);
sha_input(&context, (const uchar *)buf, (unsigned int)len);
sha_result(&context, digest);
}
@ -161,7 +161,7 @@ void my_sha_multi(uchar *digest, ...)
sha_init_fast(&context);
for (str= va_arg(args, const uchar*); str; str= va_arg(args, const uchar*))
sha_input(&context, str, va_arg(args, size_t));
sha_input(&context, str, (uint) va_arg(args, size_t));
sha_result(&context, digest);
va_end(args);
@ -179,7 +179,7 @@ void my_sha_init(void *context)
void my_sha_input(void *context, const uchar *buf, size_t len)
{
sha_input((CONTEXT *)context, buf, len);
sha_input((CONTEXT *)context, buf, (uint) len);
}
void my_sha_result(void *context, uchar *digest)

View File

@ -33,7 +33,6 @@ static int loaded= 0;
static int auth(MYSQL_PLUGIN_VIO *vio, MYSQL_SERVER_AUTH_INFO *info)
{
unsigned int i;
int pkt_len;
unsigned long nonce[CRYPTO_LONGS + NONCE_LONGS];
unsigned char *pkt, *reply= (unsigned char*)nonce;
@ -51,8 +50,8 @@ static int auth(MYSQL_PLUGIN_VIO *vio, MYSQL_SERVER_AUTH_INFO *info)
info->password_used= PASSWORD_USED_YES;
/* prepare random nonce */
for (i=CRYPTO_LONGS; i < CRYPTO_LONGS + NONCE_LONGS; i++)
nonce[i]= thd_rnd(info->thd) * ~0UL;
if (my_random_bytes((unsigned char *)nonce, (int)sizeof(nonce)))
return CR_AUTH_USER_CREDENTIALS;
/* send it */
if (vio->write_packet(vio, reply + CRYPTO_BYTES, NONCE_BYTES))

View File

@ -36,7 +36,7 @@ static int pipe_auth(MYSQL_PLUGIN_VIO *vio, MYSQL_SERVER_AUTH_INFO *info)
unsigned char *pkt;
MYSQL_PLUGIN_VIO_INFO vio_info;
char username[UNLEN + 1];
size_t username_length;
DWORD username_length;
int ret;
/* no user name yet ? read the client handshake packet with the user name */
@ -54,7 +54,7 @@ static int pipe_auth(MYSQL_PLUGIN_VIO *vio, MYSQL_SERVER_AUTH_INFO *info)
if (!ImpersonateNamedPipeClient(vio_info.handle))
return CR_ERROR;
username_length= sizeof(username) - 1;
username_length=UNLEN;
ret= CR_ERROR;
if (GetUserName(username, &username_length))
{

View File

@ -112,7 +112,7 @@ static COND* make_cond(THD *thd, TABLE_LIST *tables, LEX_STRING *filter)
Item_field *fld= new (thd->mem_root) Item_field(thd, &nrc, db, table,
field);
Item_string *pattern= new (thd->mem_root) Item_string(thd, filter->str,
filter->length, cs);
(uint) filter->length, cs);
Item_string *escape= new (thd->mem_root) Item_string(thd, "\\", 1, cs);
if (!fld || !pattern || !escape)

View File

@ -238,7 +238,7 @@ static void send_report(const char *when)
Url *url= todo[i];
if (thd) // for nicer SHOW PROCESSLIST
thd->set_query(const_cast<char*>(url->url()), url->url_length());
thd->set_query(const_cast<char*>(url->url()), (uint) url->url_length());
if (url->send(str.ptr(), str.length()))
i++;

View File

@ -151,7 +151,7 @@ namespace feedback {
*/
#define INSERT2(NAME,LEN,VALUE) \
do { \
table->field[0]->store(NAME, LEN, system_charset_info); \
table->field[0]->store(NAME, (uint) LEN, system_charset_info); \
table->field[1]->store VALUE; \
if (schema_table_store_record(thd, table)) \
return 1; \
@ -159,7 +159,7 @@ namespace feedback {
#define INSERT1(NAME,VALUE) \
do { \
table->field[0]->store(NAME, sizeof(NAME)-1, system_charset_info); \
table->field[0]->store(NAME, (uint) sizeof(NAME)-1, system_charset_info); \
table->field[1]->store VALUE; \
if (schema_table_store_record(thd, table)) \
return 1; \
@ -186,7 +186,7 @@ static my_bool show_plugins(THD *thd, plugin_ref plugin, void *arg)
(plugin_decl(plugin)->version) & 0xff);
INSERT2(name, name_len,
(version, version_len, system_charset_info));
(version, (uint)version_len, system_charset_info));
name_len= my_snprintf(name, sizeof(name), "%s used",
plugin_name(plugin)->str);
@ -358,10 +358,10 @@ int fill_linux_info(THD *thd, TABLE_LIST *tables)
#ifdef HAVE_SYS_UTSNAME_H
if (have_ubuf)
{
INSERT1("Uname_sysname", (ubuf.sysname, strlen(ubuf.sysname), cs));
INSERT1("Uname_release", (ubuf.release, strlen(ubuf.release), cs));
INSERT1("Uname_version", (ubuf.version, strlen(ubuf.version), cs));
INSERT1("Uname_machine", (ubuf.machine, strlen(ubuf.machine), cs));
INSERT1("Uname_sysname", (ubuf.sysname, (uint) strlen(ubuf.sysname), cs));
INSERT1("Uname_release", (ubuf.release, (uint) strlen(ubuf.release), cs));
INSERT1("Uname_version", (ubuf.version, (uint) strlen(ubuf.version), cs));
INSERT1("Uname_machine", (ubuf.machine, (uint) strlen(ubuf.machine), cs));
}
#endif

View File

@ -230,9 +230,9 @@ bool Parser::parse_file(std::map<uint,keyentry> *keys, const char *secret)
return 0;
}
void Parser::report_error(const char *reason, uint position)
void Parser::report_error(const char *reason, size_t position)
{
my_printf_error(EE_READ, "%s at %s line %u, column %u",
my_printf_error(EE_READ, "%s at %s line %u, column %zu",
ME_ERROR_LOG, reason, filename, line_number, position + 1);
}

View File

@ -23,6 +23,7 @@ Created 09/15/2014
#include <my_crypt.h>
#include <ctype.h>
#include <map>
#include <stdlib.h> /* size_t */
struct keyentry {
unsigned int id;
@ -43,7 +44,7 @@ class Parser
unsigned char *key, unsigned char *iv);
bool read_filekey(const char *filekey, char *secret);
bool parse_file(std::map<unsigned int ,keyentry> *keys, const char *secret);
void report_error(const char *reason, unsigned int position);
void report_error(const char *reason, size_t position);
int parse_line(char **line_ptr, keyentry *key);
char* read_and_decrypt_file(const char *secret);

View File

@ -221,7 +221,7 @@ public:
print_time(total, sizeof(total), TOTAL_STRING_FORMAT, this->total(i));
}
fields[0]->store(time,strlen(time),system_charset_info);
fields[1]->store(this->count(i));
fields[1]->store((longlong)this->count(i),true);
fields[2]->store(total,strlen(total),system_charset_info);
if (schema_table_store_record(thd, table))
{

View File

@ -1423,7 +1423,7 @@ static size_t escape_string_hide_passwords(const char *str, unsigned int len,
}
next_s++;
}
len-= next_s - str;
len-= (uint)(next_s - str);
str= next_s;
continue;
}

View File

@ -35,11 +35,11 @@ static int index_stats_fill(THD *thd, TABLE_LIST *tables, COND *cond)
index_name_length= (index_stats->index_name_length - schema_name_length -
table_name_length - 3);
table->field[0]->store(tmp_table.db, schema_name_length,
table->field[0]->store(tmp_table.db, (uint)schema_name_length,
system_charset_info);
table->field[1]->store(tmp_table.table_name, table_name_length,
table->field[1]->store(tmp_table.table_name, (uint) table_name_length,
system_charset_info);
table->field[2]->store(index_name, index_name_length, system_charset_info);
table->field[2]->store(index_name, (uint) index_name_length, system_charset_info);
table->field[3]->store((longlong)index_stats->rows_read, TRUE);
if (schema_table_store_record(thd, table))

View File

@ -68,7 +68,7 @@ static void die(const char *fmt, ...)
char *fgets_fn(char *buffer, size_t size, fgets_input_t input, int *error)
{
char *line= fgets(buffer, size, (FILE*) input);
char *line= fgets(buffer, (int)size, (FILE*) input);
if (error)
*error= (line == NULL) ? ferror((FILE*)input) : 0;
return line;

View File

@ -952,7 +952,7 @@ void STDCALL
mysql_free_result(MYSQL_RES *result)
{
DBUG_ENTER("mysql_free_result");
DBUG_PRINT("enter",("mysql_res: 0x%lx", (long) result));
DBUG_PRINT("enter",("mysql_res: %p", result));
if (result)
{
MYSQL *mysql= result->handle;
@ -1653,7 +1653,7 @@ mysql_init(MYSQL *mysql)
*/
mysql->reconnect= 0;
DBUG_PRINT("mysql",("mysql: 0x%lx", (long) mysql));
DBUG_PRINT("mysql",("mysql: %p", mysql));
return mysql;
}
@ -2807,11 +2807,11 @@ void mpvio_info(Vio *vio, MYSQL_PLUGIN_VIO_INFO *info)
switch (vio->type) {
case VIO_TYPE_TCPIP:
info->protocol= MYSQL_VIO_TCP;
info->socket= vio_fd(vio);
info->socket= (int)vio_fd(vio);
return;
case VIO_TYPE_SOCKET:
info->protocol= MYSQL_VIO_SOCKET;
info->socket= vio_fd(vio);
info->socket= (int)vio_fd(vio);
return;
case VIO_TYPE_SSL:
{
@ -2821,7 +2821,7 @@ void mpvio_info(Vio *vio, MYSQL_PLUGIN_VIO_INFO *info)
return;
info->protocol= addr.sa_family == AF_UNIX ?
MYSQL_VIO_SOCKET : MYSQL_VIO_TCP;
info->socket= vio_fd(vio);
info->socket= (int)vio_fd(vio);
return;
}
#ifdef _WIN32
@ -3379,7 +3379,7 @@ CLI_MYSQL_REAL_CONNECT(MYSQL *mysql,const char *host, const char *user,
}
DBUG_PRINT("info",
("End of connect attempts, sock: %d status: %d error: %d",
sock, status, saved_error));
(int)sock, status, saved_error));
freeaddrinfo(res_lst);
@ -3558,11 +3558,11 @@ CLI_MYSQL_REAL_CONNECT(MYSQL *mysql,const char *host, const char *user,
scramble_data_len= pkt_scramble_len;
scramble_plugin= scramble_data + scramble_data_len;
if (scramble_data + scramble_data_len > pkt_end)
scramble_data_len= pkt_end - scramble_data;
scramble_data_len= (int)(pkt_end - scramble_data);
}
else
{
scramble_data_len= pkt_end - scramble_data;
scramble_data_len= (int)(pkt_end - scramble_data);
scramble_plugin= native_password_plugin_name;
}
}
@ -3633,7 +3633,7 @@ CLI_MYSQL_REAL_CONNECT(MYSQL *mysql,const char *host, const char *user,
}
#endif
DBUG_PRINT("exit", ("Mysql handler: 0x%lx", (long) mysql));
DBUG_PRINT("exit", ("Mysql handler: %p",mysql));
DBUG_RETURN(mysql);
error:
@ -3955,7 +3955,7 @@ void STDCALL mysql_close_slow_part(MYSQL *mysql)
void STDCALL mysql_close(MYSQL *mysql)
{
DBUG_ENTER("mysql_close");
DBUG_PRINT("enter", ("mysql: 0x%lx", (long) mysql));
DBUG_PRINT("enter", ("mysql: %p", mysql));
if (mysql) /* Some simple safety */
{
@ -4066,7 +4066,7 @@ int STDCALL
mysql_real_query(MYSQL *mysql, const char *query, ulong length)
{
DBUG_ENTER("mysql_real_query");
DBUG_PRINT("enter",("handle: 0x%lx", (long) mysql));
DBUG_PRINT("enter",("handle: %p", mysql));
DBUG_PRINT("query",("Query = '%-.4096s'",query));
if (mysql_send_query(mysql,query,length))

View File

@ -202,7 +202,7 @@ static uint skip_digits(const char **str, const char *end)
while (s < end && my_isdigit(&my_charset_latin1, *s))
s++;
*str= s;
return s - start;
return (uint)(s - start);
}
@ -236,7 +236,7 @@ static void get_microseconds(ulong *val, MYSQL_TIME_STATUS *status,
uint tmp= 0; /* For the case '10:10:10.' */
if (get_digits(&tmp, number_of_fields, str, end, 6))
status->warnings|= MYSQL_TIME_WARN_TRUNCATED;
if ((status->precision= (*str - start)) < 6)
if ((status->precision= (uint)(*str - start)) < 6)
*val= (ulong) (tmp * log_10_int[6 - (*str - start)]);
else
*val= tmp;
@ -358,7 +358,7 @@ str_to_datetime(const char *str, uint length, MYSQL_TIME *l_time,
const char *start= str;
if (get_number(&l_time->year, &number_of_fields, &str, end))
status->warnings|= MYSQL_TIME_WARN_TRUNCATED;
year_length= str - start;
year_length= (uint)(str - start);
if (!status->warnings &&
(get_punct(&str, end)

View File

@ -128,7 +128,7 @@ my_connect_async(struct mysql_async_context *b, my_socket fd,
#endif
ssize_t
my_recv_async(struct mysql_async_context *b, int fd,
my_recv_async(struct mysql_async_context *b, my_socket fd,
unsigned char *buf, size_t size, int timeout)
{
ssize_t res;
@ -156,7 +156,7 @@ my_recv_async(struct mysql_async_context *b, int fd,
ssize_t
my_send_async(struct mysql_async_context *b, int fd,
my_send_async(struct mysql_async_context *b, my_socket fd,
const unsigned char *buf, size_t size, int timeout)
{
ssize_t res;

View File

@ -245,6 +245,7 @@ IF(MSVC AND NOT WITHOUT_DYNAMIC_PLUGINS)
SET(CMAKE_CONFIGURABLE_FILE_CONTENT "
IF ((mysqld_lib.def IS_NEWER_THAN mysqld_lib.lib) OR
(mysqld_lib.def IS_NEWER_THAN mysqld_lib.exp))
FILE(REMOVE mysqld_lib.lib mysqld_lib.exp)
SET(ENV{VS_UNICODE_OUTPUT})
EXECUTE_PROCESS (
COMMAND \"${CMAKE_LINKER}\" /lib /NAME:mysqld.exe \"/DEF:${MYSQLD_DEF}\" /MACHINE:${_PLATFORM}

View File

@ -124,8 +124,8 @@ static bool set_one_value(ha_create_table_option *opt,
MEM_ROOT *root)
{
DBUG_ENTER("set_one_value");
DBUG_PRINT("enter", ("opt: 0x%lx type: %u name '%s' value: '%s'",
(ulong) opt,
DBUG_PRINT("enter", ("opt: %p type: %u name '%s' value: '%s'",
opt,
opt->type, opt->name,
(value->str ? value->str : "<DEFAULT>")));
switch (opt->type)

View File

@ -549,7 +549,7 @@ static void debug_sync_reset(THD *thd)
static void debug_sync_remove_action(st_debug_sync_control *ds_control,
st_debug_sync_action *action)
{
uint dsp_idx= action - ds_control->ds_action;
uint dsp_idx= (uint)(action - ds_control->ds_action);
DBUG_ENTER("debug_sync_remove_action");
DBUG_ASSERT(ds_control);
DBUG_ASSERT(ds_control == current_thd->debug_sync_control);
@ -681,8 +681,8 @@ static st_debug_sync_action *debug_sync_get_action(THD *thd,
}
DBUG_ASSERT(action >= ds_control->ds_action);
DBUG_ASSERT(action < ds_control->ds_action + ds_control->ds_active);
DBUG_PRINT("debug_sync", ("action: 0x%lx array: 0x%lx count: %u",
(long) action, (long) ds_control->ds_action,
DBUG_PRINT("debug_sync", ("action: %p array: %p count: %u",
action, ds_control->ds_action,
ds_control->ds_active));
DBUG_RETURN(action);
@ -871,7 +871,7 @@ static char *debug_sync_token(char **token_p, uint *token_length_p,
ptr, ptrend, MY_SEQ_NONSPACES);
/* Get token length. */
*token_length_p= ptr - *token_p;
*token_length_p= (uint)(ptr - *token_p);
/* If necessary, terminate token. */
if (*ptr)

View File

@ -229,7 +229,7 @@ int extension_based_table_discovery(MY_DIR *dirp, const char *ext_meta,
cur++;
}
advance(from, to, cur, skip);
dirp->number_of_files= to - dirp->dir_entry;
dirp->number_of_files= (uint)(to - dirp->dir_entry);
return 0;
}

View File

@ -561,7 +561,7 @@ Event_queue_element::load_from_row(THD *thd, TABLE *table)
}
if ((ptr= get_field(&mem_root, table->field[ET_FIELD_ORIGINATOR])) == NullS)
DBUG_RETURN(TRUE);
originator = table->field[ET_FIELD_ORIGINATOR]->val_int();
originator = (uint32) table->field[ET_FIELD_ORIGINATOR]->val_int();
/* ToDo : Andrey . Find a way not to allocate ptr on event_mem_root */
if ((ptr= get_field(&mem_root,
@ -911,9 +911,9 @@ Event_queue_element::compute_next_execution_time()
{
my_time_t time_now;
DBUG_ENTER("Event_queue_element::compute_next_execution_time");
DBUG_PRINT("enter", ("starts: %lu ends: %lu last_executed: %lu this: 0x%lx",
DBUG_PRINT("enter", ("starts: %lu ends: %lu last_executed: %lu this: %p",
(long) starts, (long) ends, (long) last_executed,
(long) this));
this));
if (status != Event_parse_data::ENABLED)
{

View File

@ -1063,7 +1063,7 @@ Event_db_repository::load_named_event(THD *thd, const LEX_CSTRING *dbname,
TABLE_LIST event_table;
DBUG_ENTER("Event_db_repository::load_named_event");
DBUG_PRINT("enter",("thd: 0x%lx name: %*s", (long) thd,
DBUG_PRINT("enter",("thd: %p name: %*s", thd,
(int) name->length, name->str));
event_table.init_one_table("mysql", 5, "event", 5, "event", TL_READ);
@ -1186,7 +1186,7 @@ Event_db_repository::check_system_tables(THD *thd)
const unsigned int event_priv_column_position= 29;
DBUG_ENTER("Event_db_repository::check_system_tables");
DBUG_PRINT("enter", ("thd: 0x%lx", (long) thd));
DBUG_PRINT("enter", ("thd: %p", thd));
/* Check mysql.db */
tables.init_one_table("mysql", 5, "db", 2, "db", TL_READ);

View File

@ -494,9 +494,9 @@ Event_parse_data::check_parse_data(THD *thd)
{
bool ret;
DBUG_ENTER("Event_parse_data::check_parse_data");
DBUG_PRINT("info", ("execute_at: 0x%lx expr=0x%lx starts=0x%lx ends=0x%lx",
(long) item_execute_at, (long) item_expression,
(long) item_starts, (long) item_ends));
DBUG_PRINT("info", ("execute_at: %p expr=%p starts=%p ends=%p",
item_execute_at, item_expression,
item_starts, item_ends));
init_name(thd, identifier);
@ -529,9 +529,9 @@ Event_parse_data::init_definer(THD *thd)
size_t definer_user_len= thd->lex->definer->user.length;
size_t definer_host_len= thd->lex->definer->host.length;
char *tmp;
DBUG_PRINT("info",("init definer_user thd->mem_root: 0x%lx "
"definer_user: 0x%lx", (long) thd->mem_root,
(long) definer_user));
DBUG_PRINT("info",("init definer_user thd->mem_root: %p "
"definer_user: %p", thd->mem_root,
definer_user));
/* + 1 for @ */
DBUG_PRINT("info",("init definer as whole"));

View File

@ -135,7 +135,7 @@ bool
Event_queue::init_queue(THD *thd)
{
DBUG_ENTER("Event_queue::init_queue");
DBUG_PRINT("enter", ("this: 0x%lx", (long) this));
DBUG_PRINT("enter", ("this: %p", this));
LOCK_QUEUE_DATA();
@ -201,7 +201,7 @@ Event_queue::create_event(THD *thd, Event_queue_element *new_element,
bool *created)
{
DBUG_ENTER("Event_queue::create_event");
DBUG_PRINT("enter", ("thd: 0x%lx et=%s.%s", (long) thd,
DBUG_PRINT("enter", ("thd: %p et=%s.%s", thd,
new_element->dbname.str, new_element->name.str));
/* Will do nothing if the event is disabled */
@ -213,7 +213,7 @@ Event_queue::create_event(THD *thd, Event_queue_element *new_element,
DBUG_RETURN(FALSE);
}
DBUG_PRINT("info", ("new event in the queue: 0x%lx", (long) new_element));
DBUG_PRINT("info", ("new event in the queue: %p", new_element));
LOCK_QUEUE_DATA();
*created= (queue_insert_safe(&queue, (uchar *) new_element) == FALSE);
@ -266,7 +266,7 @@ Event_queue::update_event(THD *thd, const LEX_CSTRING *dbname,
/* If not disabled event */
if (new_element)
{
DBUG_PRINT("info", ("new event in the queue: 0x%lx", (long) new_element));
DBUG_PRINT("info", ("new event in the queue: %p", new_element));
queue_insert_safe(&queue, (uchar *) new_element);
mysql_cond_broadcast(&COND_queue_state);
}
@ -549,7 +549,7 @@ Event_queue::dbug_dump_queue(my_time_t when)
i++)
{
et= ((Event_queue_element*)queue_element(&queue, i));
DBUG_PRINT("info", ("et: 0x%lx name: %s.%s", (long) et,
DBUG_PRINT("info", ("et: %p name: %s.%s", et,
et->dbname.str, et->name.str));
DBUG_PRINT("info", ("exec_at: %lu starts: %lu ends: %lu execs_so_far: %u "
"expr: %ld et.exec_at: %ld now: %ld "
@ -677,8 +677,8 @@ Event_queue::get_top_for_execution_if_time(THD *thd,
end:
UNLOCK_QUEUE_DATA();
DBUG_PRINT("info", ("returning %d et_new: 0x%lx ",
ret, (long) *event_name));
DBUG_PRINT("info", ("returning %d et_new: %p ",
ret, *event_name));
if (*event_name)
{

View File

@ -295,7 +295,7 @@ Event_worker_thread::run(THD *thd, Event_queue_element_for_exec *event)
res= post_init_event_thread(thd);
DBUG_ENTER("Event_worker_thread::run");
DBUG_PRINT("info", ("Time is %ld, THD: 0x%lx", (long) my_time(0), (long) thd));
DBUG_PRINT("info", ("Time is %u, THD: %p", (uint)my_time(0), thd));
inc_thread_running();
if (res)
@ -420,7 +420,7 @@ Event_scheduler::start(int *err_no)
scheduler_thd= new_thd;
DBUG_PRINT("info", ("Setting state go RUNNING"));
state= RUNNING;
DBUG_PRINT("info", ("Forking new thread for scheduler. THD: 0x%lx", (long) new_thd));
DBUG_PRINT("info", ("Forking new thread for scheduler. THD: %p", new_thd));
if ((*err_no= mysql_thread_create(key_thread_event_scheduler,
&th, &connection_attrib,
event_scheduler_thread,
@ -485,7 +485,7 @@ Event_scheduler::run(THD *thd)
}
DBUG_PRINT("info", ("get_top_for_execution_if_time returned "
"event_name=0x%lx", (long) event_name));
"event_name=%p", event_name));
if (event_name)
{
if ((res= execute_top(event_name)))
@ -566,7 +566,7 @@ Event_scheduler::execute_top(Event_queue_element_for_exec *event_name)
started_events++;
executed_events++; // For SHOW STATUS
DBUG_PRINT("info", ("Event is in THD: 0x%lx", (long) new_thd));
DBUG_PRINT("info", ("Event is in THD: %p", new_thd));
DBUG_RETURN(FALSE);
error:
@ -617,7 +617,7 @@ Event_scheduler::stop()
{
THD *thd= current_thd;
DBUG_ENTER("Event_scheduler::stop");
DBUG_PRINT("enter", ("thd: 0x%lx", (long) thd));
DBUG_PRINT("enter", ("thd: %p", thd));
LOCK_DATA();
DBUG_PRINT("info", ("state before action %s", scheduler_states_names[state].str));

View File

@ -1121,7 +1121,7 @@ Events::load_events_from_db(THD *thd)
uint count= 0;
ulong saved_master_access;
DBUG_ENTER("Events::load_events_from_db");
DBUG_PRINT("enter", ("thd: 0x%lx", (long) thd));
DBUG_PRINT("enter", ("thd: %p", thd));
/*
NOTE: even if we run in read-only mode, we should be able to lock the

View File

@ -5434,7 +5434,7 @@ int Field_temporal_with_date::store(double nr)
ErrConvDouble str(nr);
longlong tmp= double_to_datetime(nr, &ltime,
sql_mode_for_dates(thd), &error);
(uint) sql_mode_for_dates(thd), &error);
return store_TIME_with_warning(&ltime, &str, error, tmp != -1);
}
@ -7813,7 +7813,7 @@ int Field_blob::store(const char *from,uint length,CHARSET_INFO *cs)
DBUG_ASSERT(length <= max_data_length());
new_length= length;
copy_length= table->in_use->variables.group_concat_max_len;
copy_length= (uint)MY_MIN(UINT_MAX,table->in_use->variables.group_concat_max_len);
if (new_length > copy_length)
{
new_length= Well_formed_prefix(cs,
@ -8243,8 +8243,8 @@ const uchar *Field_blob::unpack(uchar *to, const uchar *from,
const uchar *from_end, uint param_data)
{
DBUG_ENTER("Field_blob::unpack");
DBUG_PRINT("enter", ("to: 0x%lx; from: 0x%lx; param_data: %u",
(ulong) to, (ulong) from, param_data));
DBUG_PRINT("enter", ("to: %p; from: %p; param_data: %u",
to, from, param_data));
uint const master_packlength=
param_data > 0 ? param_data & 0xFF : packlength;
if (from + master_packlength > from_end)
@ -8378,7 +8378,7 @@ uint gis_field_options_read(const uchar *buf, uint buf_len,
}
end_of_record:
return cbuf - buf;
return (uint)(cbuf - buf);
}
@ -9109,8 +9109,8 @@ Field_bit::do_last_null_byte() const
bits. On systems with CHAR_BIT > 8 (not very common), the storage
will lose the extra bits.
*/
DBUG_PRINT("test", ("bit_ofs: %d, bit_len: %d bit_ptr: 0x%lx",
bit_ofs, bit_len, (long) bit_ptr));
DBUG_PRINT("test", ("bit_ofs: %d, bit_len: %d bit_ptr: %p",
bit_ofs, bit_len, bit_ptr));
uchar *result;
if (bit_len == 0)
result= null_ptr;
@ -9794,7 +9794,7 @@ void Column_definition::create_length_to_internal_length_bit()
}
else
{
pack_length= length / 8;
pack_length= (uint) length / 8;
/* We need one extra byte to store the bits we save among the null bits */
key_length= pack_length + MY_TEST(length & 7);
}
@ -9804,7 +9804,7 @@ void Column_definition::create_length_to_internal_length_bit()
void Column_definition::create_length_to_internal_length_newdecimal()
{
key_length= pack_length=
my_decimal_get_binary_size(my_decimal_length_to_precision(length,
my_decimal_get_binary_size(my_decimal_length_to_precision((uint) length,
decimals,
flags &
UNSIGNED_FLAG),
@ -9911,9 +9911,9 @@ bool Column_definition::fix_attributes_decimal()
my_error(ER_M_BIGGER_THAN_D, MYF(0), field_name.str);
return true;
}
length= my_decimal_precision_to_length(length, decimals,
length= my_decimal_precision_to_length((uint) length, decimals,
flags & UNSIGNED_FLAG);
pack_length= my_decimal_get_binary_size(length, decimals);
pack_length= my_decimal_get_binary_size((uint) length, decimals);
return false;
}
@ -9922,7 +9922,7 @@ bool Column_definition::fix_attributes_bit()
{
if (!length)
length= 1;
pack_length= (length + 7) / 8;
pack_length= ((uint) length + 7) / 8;
return check_length(ER_TOO_BIG_DISPLAYWIDTH, MAX_BIT_FIELD_LENGTH);
}
@ -10020,7 +10020,7 @@ bool Column_definition::check(THD *thd)
DBUG_RETURN(true);
/* Remember the value of length */
char_length= length;
char_length= (uint)length;
/*
Set NO_DEFAULT_VALUE_FLAG if this field doesn't have a default value and
@ -10410,7 +10410,7 @@ Column_definition::Column_definition(THD *thd, Field *old_field,
interval_list.empty(); // prepare_interval_field() needs this
char_length= length;
char_length= (uint)length;
/*
Copy the default (constant/function) from the column object orig_field, if
@ -10730,7 +10730,7 @@ bool Field::save_in_field_default_value(bool view_error_processing)
{
my_message(ER_CANT_CREATE_GEOMETRY_OBJECT,
ER_THD(thd, ER_CANT_CREATE_GEOMETRY_OBJECT), MYF(0));
return -1;
return true;
}
if (view_error_processing)
@ -10749,13 +10749,13 @@ bool Field::save_in_field_default_value(bool view_error_processing)
ER_THD(thd, ER_NO_DEFAULT_FOR_FIELD),
field_name.str);
}
return 1;
return true;
}
set_default();
return
!is_null() &&
validate_value_in_record_with_warn(thd, table->record[0]) &&
thd->is_error() ? -1 : 0;
thd->is_error();
}

View File

@ -3929,13 +3929,14 @@ public:
}
void create_length_to_internal_length_simple()
{
key_length= pack_length= type_handler()->calc_pack_length(length);
key_length= pack_length= type_handler()->calc_pack_length((uint32) length);
}
void create_length_to_internal_length_string()
{
length*= charset->mbmaxlen;
key_length= length;
pack_length= type_handler()->calc_pack_length(length);
DBUG_ASSERT(length <= UINT_MAX32);
key_length= (uint) length;
pack_length= type_handler()->calc_pack_length((uint32) length);
}
void create_length_to_internal_length_typelib()
{

View File

@ -141,7 +141,8 @@ SORT_INFO *filesort(THD *thd, TABLE *table, Filesort *filesort,
table_map first_table_bit)
{
int error;
size_t memory_available= thd->variables.sortbuff_size;
DBUG_ASSERT(thd->variables.sortbuff_size <= SIZE_T_MAX);
size_t memory_available= (size_t)thd->variables.sortbuff_size;
uint maxbuffer;
BUFFPEK *buffpek;
ha_rows num_rows= HA_POS_ERROR;
@ -1806,7 +1807,7 @@ int merge_buffers(Sort_param *param, IO_CACHE *from_file,
if (flag == 0)
{
if (my_b_write(to_file, (uchar*) buffpek->key,
(rec_length*buffpek->mem_count)))
(size_t)(rec_length*buffpek->mem_count)))
{
error= 1; goto err; /* purecov: inspected */
}

View File

@ -79,7 +79,7 @@ void set_token(int tok, const char *str)
}
compiled_token_array[tok].m_token_string= str;
compiled_token_array[tok].m_token_length= strlen(str);
compiled_token_array[tok].m_token_length= (int)strlen(str);
compiled_token_array[tok].m_append_space= true;
compiled_token_array[tok].m_start_expr= false;
}

View File

@ -2510,7 +2510,7 @@ register_query_cache_dependant_tables(THD *thd,
part= i * num_subparts + j;
/* we store the end \0 as part of the key */
end= strmov(engine_pos, sub_elem->partition_name);
length= end - engine_key;
length= (uint)(end - engine_key);
/* Copy the suffix also to query cache key */
memcpy(query_cache_key_end, engine_key_end, (end - engine_key_end));
if (reg_query_cache_dependant_table(thd, engine_key, length,
@ -2526,7 +2526,7 @@ register_query_cache_dependant_tables(THD *thd,
else
{
char *end= engine_pos+1; // copy end \0
uint length= end - engine_key;
uint length= (uint)(end - engine_key);
/* Copy the suffix also to query cache key */
memcpy(query_cache_key_end, engine_key_end, (end - engine_key_end));
if (reg_query_cache_dependant_table(thd, engine_key, length,
@ -4807,8 +4807,8 @@ int ha_partition::rnd_init(bool scan)
}
/* Now we see what the index of our first important partition is */
DBUG_PRINT("info", ("m_part_info->read_partitions: 0x%lx",
(long) m_part_info->read_partitions.bitmap));
DBUG_PRINT("info", ("m_part_info->read_partitions: %p",
m_part_info->read_partitions.bitmap));
part_id= bitmap_get_first_set(&(m_part_info->read_partitions));
DBUG_PRINT("info", ("m_part_spec.start_part %d", part_id));
@ -6742,7 +6742,7 @@ int ha_partition::info(uint flag)
/* Get variables if not already done */
if (!(flag & HA_STATUS_VARIABLE) ||
!bitmap_is_set(&(m_part_info->read_partitions),
(file_array - m_file)))
(uint)(file_array - m_file)))
file->info(HA_STATUS_VARIABLE | no_lock_flag | extra_var_flag);
if (file->stats.records > max_records)
{
@ -7709,7 +7709,7 @@ ha_rows ha_partition::estimate_rows_upper_bound()
do
{
if (bitmap_is_set(&(m_part_info->read_partitions), (file - m_file)))
if (bitmap_is_set(&(m_part_info->read_partitions), (uint)(file - m_file)))
{
rows= (*file)->estimate_rows_upper_bound();
if (rows == HA_POS_ERROR)

View File

@ -259,7 +259,7 @@ handler *get_new_handler(TABLE_SHARE *share, MEM_ROOT *alloc,
{
handler *file;
DBUG_ENTER("get_new_handler");
DBUG_PRINT("enter", ("alloc: 0x%lx", (long) alloc));
DBUG_PRINT("enter", ("alloc: %p", alloc));
if (db_type && db_type->state == SHOW_OPTION_YES && db_type->create)
{
@ -1376,7 +1376,7 @@ int ha_commit_trans(THD *thd, bool all)
uint rw_ha_count= ha_check_and_coalesce_trx_read_only(thd, ha_info, all);
/* rw_trans is TRUE when we in a transaction changing data */
bool rw_trans= is_real_trans &&
(rw_ha_count > !thd->is_current_stmt_binlog_disabled());
(rw_ha_count > (thd->is_current_stmt_binlog_disabled()?0U:1U));
MDL_request mdl_request;
DBUG_PRINT("info", ("is_real_trans: %d rw_trans: %d rw_ha_count: %d",
is_real_trans, rw_trans, rw_ha_count));
@ -3202,8 +3202,8 @@ void handler::column_bitmaps_signal()
{
DBUG_ENTER("column_bitmaps_signal");
if (table)
DBUG_PRINT("info", ("read_set: 0x%lx write_set: 0x%lx",
(long) table->read_set, (long) table->write_set));
DBUG_PRINT("info", ("read_set: %p write_set: %p",
table->read_set, table->write_set));
DBUG_VOID_RETURN;
}
@ -5574,9 +5574,9 @@ TYPELIB *ha_known_exts(void)
}
static bool stat_print(THD *thd, const char *type, uint type_len,
const char *file, uint file_len,
const char *status, uint status_len)
static bool stat_print(THD *thd, const char *type, size_t type_len,
const char *file, size_t file_len,
const char *status, size_t status_len)
{
Protocol *protocol= thd->protocol;
protocol->prepare_for_resend();
@ -5758,9 +5758,9 @@ bool handler::check_table_binlog_row_based_internal(bool binlog_row)
static int write_locked_table_maps(THD *thd)
{
DBUG_ENTER("write_locked_table_maps");
DBUG_PRINT("enter", ("thd: 0x%lx thd->lock: 0x%lx "
"thd->extra_lock: 0x%lx",
(long) thd, (long) thd->lock, (long) thd->extra_lock));
DBUG_PRINT("enter", ("thd:%p thd->lock:%p "
"thd->extra_lock: %p",
thd, thd->lock, thd->extra_lock));
DBUG_PRINT("debug", ("get_binlog_table_maps(): %d", thd->get_binlog_table_maps()));

View File

@ -790,9 +790,9 @@ struct TABLE_SHARE;
struct HA_CREATE_INFO;
struct st_foreign_key_info;
typedef struct st_foreign_key_info FOREIGN_KEY_INFO;
typedef bool (stat_print_fn)(THD *thd, const char *type, uint type_len,
const char *file, uint file_len,
const char *status, uint status_len);
typedef bool (stat_print_fn)(THD *thd, const char *type, size_t type_len,
const char *file, size_t file_len,
const char *status, size_t status_len);
enum ha_stat_type { HA_ENGINE_STATUS, HA_ENGINE_LOGS, HA_ENGINE_MUTEX };
extern st_plugin_int *hton2plugin[MAX_HA];

View File

@ -1164,7 +1164,7 @@ void Item::set_name(THD *thd, const char *str, uint length, CHARSET_INFO *cs)
if (!cs->ctype || cs->mbminlen > 1)
{
str+= cs->cset->scan(cs, str, str + length, MY_SEQ_SPACES);
length-= str - str_start;
length-= (uint)(str - str_start);
}
else
{
@ -6454,8 +6454,8 @@ void Item_field::save_org_in_field(Field *to,
fast_field_copier fast_field_copier_func)
{
DBUG_ENTER("Item_field::save_org_in_field");
DBUG_PRINT("enter", ("setup: 0x%lx data: 0x%lx",
(ulong) to, (ulong) fast_field_copier_func));
DBUG_PRINT("enter", ("setup: %p data: %p",
to, fast_field_copier_func));
if (fast_field_copier_func)
{
if (field->is_null())

View File

@ -3601,7 +3601,7 @@ uchar *in_row::get_value(Item *item)
void in_row::set(uint pos, Item *item)
{
DBUG_ENTER("in_row::set");
DBUG_PRINT("enter", ("pos: %u item: 0x%lx", pos, (ulong) item));
DBUG_PRINT("enter", ("pos: %u item: %p", pos,item));
((cmp_item_row*) base)[pos].store_value_by_template(current_thd, &tmp, item);
DBUG_VOID_RETURN;
}
@ -3842,7 +3842,7 @@ cmp_item* cmp_item_row::make_same()
cmp_item_row::~cmp_item_row()
{
DBUG_ENTER("~cmp_item_row");
DBUG_PRINT("enter",("this: 0x%lx", (long) this));
DBUG_PRINT("enter",("this: %p", this));
if (comparators)
{
for (uint i= 0; i < n; i++)
@ -5374,7 +5374,7 @@ void Regexp_processor_pcre::set_recursion_limit(THD *thd)
DBUG_ASSERT(thd == current_thd);
stack_used= available_stack_size(thd->thread_stack, &stack_used);
m_pcre_extra.match_limit_recursion=
(my_thread_stack_size - STACK_MIN_SIZE - stack_used)/my_pcre_frame_size;
(ulong)((my_thread_stack_size - STACK_MIN_SIZE - stack_used)/my_pcre_frame_size);
}

View File

@ -3302,7 +3302,7 @@ Create_udf_func Create_udf_func::s_singleton;
Item*
Create_udf_func::create_func(THD *thd, LEX_CSTRING *name, List<Item> *item_list)
{
udf_func *udf= find_udf(name->str, name->length);
udf_func *udf= find_udf(name->str, (uint) name->length);
DBUG_ASSERT(udf);
return create(thd, udf, item_list);
}

View File

@ -2385,12 +2385,6 @@ public:
bool update();
bool fix_fields(THD *thd, Item **ref);
void fix_length_and_dec();
table_map used_tables() const
{
return used_tables_cache | RAND_TABLE_BIT;
}
bool const_item() const { return 0; }
bool is_expensive() { return 1; }
void print(String *str, enum_query_type query_type);
enum precedence precedence() const { return ASSIGN_PRECEDENCE; }
void print_as_stmt(String *str, enum_query_type query_type);

View File

@ -211,13 +211,13 @@ String *Item_func_inet_str_base::val_str_ascii(String *buffer)
IPv4-part differently on different platforms.
*/
static bool str_to_ipv4(const char *str, int str_length, in_addr *ipv4_address)
static bool str_to_ipv4(const char *str, size_t str_length, in_addr *ipv4_address)
{
if (str_length < 7)
{
DBUG_PRINT("error", ("str_to_ipv4(%.*s): "
"invalid IPv4 address: too short.",
str_length, str));
(int) str_length, str));
return false;
}
@ -225,7 +225,7 @@ static bool str_to_ipv4(const char *str, int str_length, in_addr *ipv4_address)
{
DBUG_PRINT("error", ("str_to_ipv4(%.*s): "
"invalid IPv4 address: too long.",
str_length, str));
(int) str_length, str));
return false;
}
@ -236,7 +236,7 @@ static bool str_to_ipv4(const char *str, int str_length, in_addr *ipv4_address)
int dot_count= 0;
char c= 0;
while (((p - str) < str_length) && *p)
while (((p - str) < (int)str_length) && *p)
{
c= *p++;
@ -248,7 +248,7 @@ static bool str_to_ipv4(const char *str, int str_length, in_addr *ipv4_address)
{
DBUG_PRINT("error", ("str_to_ipv4(%.*s): invalid IPv4 address: "
"too many characters in a group.",
str_length, str));
(int) str_length, str));
return false;
}
@ -258,7 +258,7 @@ static bool str_to_ipv4(const char *str, int str_length, in_addr *ipv4_address)
{
DBUG_PRINT("error", ("str_to_ipv4(%.*s): invalid IPv4 address: "
"invalid byte value.",
str_length, str));
(int) str_length, str));
return false;
}
}
@ -268,7 +268,7 @@ static bool str_to_ipv4(const char *str, int str_length, in_addr *ipv4_address)
{
DBUG_PRINT("error", ("str_to_ipv4(%.*s): invalid IPv4 address: "
"too few characters in a group.",
str_length, str));
(int) str_length, str));
return false;
}
@ -281,7 +281,7 @@ static bool str_to_ipv4(const char *str, int str_length, in_addr *ipv4_address)
if (dot_count > 3)
{
DBUG_PRINT("error", ("str_to_ipv4(%.*s): invalid IPv4 address: "
"too many dots.", str_length, str));
"too many dots.", (int) str_length, str));
return false;
}
}
@ -289,7 +289,7 @@ static bool str_to_ipv4(const char *str, int str_length, in_addr *ipv4_address)
{
DBUG_PRINT("error", ("str_to_ipv4(%.*s): invalid IPv4 address: "
"invalid character at pos %d.",
str_length, str, (int) (p - str)));
(int) str_length, str, (int) (p - str)));
return false;
}
}
@ -297,7 +297,7 @@ static bool str_to_ipv4(const char *str, int str_length, in_addr *ipv4_address)
if (c == '.')
{
DBUG_PRINT("error", ("str_to_ipv4(%.*s): invalid IPv4 address: "
"ending at '.'.", str_length, str));
"ending at '.'.", (int) str_length, str));
return false;
}
@ -305,14 +305,14 @@ static bool str_to_ipv4(const char *str, int str_length, in_addr *ipv4_address)
{
DBUG_PRINT("error", ("str_to_ipv4(%.*s): invalid IPv4 address: "
"too few groups.",
str_length, str));
(int) str_length, str));
return false;
}
ipv4_bytes[3]= (unsigned char) byte_value;
DBUG_PRINT("info", ("str_to_ipv4(%.*s): valid IPv4 address: %d.%d.%d.%d",
str_length, str,
(int) str_length, str,
ipv4_bytes[0], ipv4_bytes[1],
ipv4_bytes[2], ipv4_bytes[3]));
return true;
@ -493,7 +493,7 @@ static bool str_to_ipv6(const char *str, int str_length, in6_addr *ipv6_address)
return false;
}
int bytes_to_move= dst - gap_ptr;
int bytes_to_move= (int)(dst - gap_ptr);
for (int i= 1; i <= bytes_to_move; ++i)
{

View File

@ -48,7 +48,7 @@ static bool eq_ascii_string(const CHARSET_INFO *cs,
}
static bool append_simple(String *s, const char *a, uint a_len)
static bool append_simple(String *s, const char *a, size_t a_len)
{
if (!s->realloc_with_extra_if_needed(s->length() + a_len))
{
@ -60,7 +60,7 @@ static bool append_simple(String *s, const char *a, uint a_len)
}
static inline bool append_simple(String *s, const uchar *a, uint a_len)
static inline bool append_simple(String *s, const uchar *a, size_t a_len)
{
return append_simple(s, (const char *) a, a_len);
}
@ -255,7 +255,7 @@ void report_json_error_ex(String *js, json_engine_t *je,
Sql_condition::enum_warning_level lv)
{
THD *thd= current_thd;
int position= (const char *) je->s.c_str - js->ptr();
int position= (int)((const char *) je->s.c_str - js->ptr());
uint code;
n_param++;
@ -312,7 +312,7 @@ static void report_path_error_ex(String *ps, json_path_t *p,
Sql_condition::enum_warning_level lv)
{
THD *thd= current_thd;
int position= (const char *) p->s.c_str - ps->ptr() + 1;
int position= (int)((const char *) p->s.c_str - ps->ptr() + 1);
uint code;
n_param++;
@ -539,7 +539,7 @@ bool Item_func_json_query::check_and_get_value(json_engine_t *je, String *res,
return true;
}
res->set((const char *) je->value, je->s.c_str - value, je->s.cs);
res->set((const char *) je->value, (uint32)(je->s.c_str - value), je->s.cs);
return false;
}
@ -742,7 +742,8 @@ String *Item_func_json_extract::read_json(String *str,
json_path_t p;
const uchar *value;
int not_first_value= 0;
uint n_arg, v_len;
uint n_arg;
size_t v_len;
int possible_multiple_values;
if ((null_value= args[0]->null_value))
@ -1530,7 +1531,8 @@ String *Item_func_json_array_append::val_str(String *str)
{
json_engine_t je;
String *js= args[0]->val_json(&tmp_js);
uint n_arg, n_path, str_rest_len;
uint n_arg, n_path;
size_t str_rest_len;
const uchar *ar_end;
DBUG_ASSERT(fixed == 1);
@ -2863,7 +2865,7 @@ skip_search:
} while (json_read_keyname_chr(&je) == 0);
if (je.s.error)
goto err_return;
key_len= key_end - key_start;
key_len= (int)(key_end - key_start);
if (!check_key_in_list(str, key_start, key_len))
{
@ -3137,7 +3139,7 @@ String *Item_func_json_format::val_str(String *str)
{
if (arg_count > 1)
{
tab_size= args[1]->val_int();
tab_size= (int)args[1]->val_int();
if (args[1]->null_value)
{
null_value= 1;

View File

@ -257,7 +257,7 @@ String *Item_func_sha2::val_str_ascii(String *str)
str->realloc((uint) digest_length*2 + 1); /* Each byte as two nybbles */
/* Convert the large number to a string-hex representation. */
array_to_hex((char *) str->ptr(), digest_buf, digest_length);
array_to_hex((char *) str->ptr(), digest_buf, (uint)digest_length);
/* We poked raw bytes in. We must inform the the String of its length. */
str->length((uint) digest_length*2); /* Each byte as two nybbles */
@ -272,7 +272,7 @@ void Item_func_sha2::fix_length_and_dec()
maybe_null= 1;
max_length = 0;
int sha_variant= args[1]->const_item() ? args[1]->val_int() : 512;
int sha_variant= (int)(args[1]->const_item() ? args[1]->val_int() : 512);
switch (sha_variant) {
case 0: // SHA-256 is the default
@ -3796,12 +3796,12 @@ String *Item_func_like_range::val_str(String *str)
if (!res || args[0]->null_value || args[1]->null_value ||
nbytes < 0 || nbytes > MAX_BLOB_WIDTH ||
min_str.alloc(nbytes) || max_str.alloc(nbytes))
min_str.alloc((size_t)nbytes) || max_str.alloc((size_t)nbytes))
goto err;
null_value=0;
if (cs->coll->like_range(cs, res->ptr(), res->length(),
'\\', '_', '%', nbytes,
'\\', '_', '%', (size_t)nbytes,
(char*) min_str.ptr(), (char*) max_str.ptr(),
&min_len, &max_len))
goto err;
@ -3878,7 +3878,7 @@ String *Item_load_file::val_str(String *str)
if ((file= mysql_file_open(key_file_loadfile,
file_name->ptr(), O_RDONLY, MYF(0))) < 0)
goto err;
if (mysql_file_read(file, (uchar*) tmp_value.ptr(), stat_info.st_size,
if (mysql_file_read(file, (uchar*) tmp_value.ptr(), (size_t)stat_info.st_size,
MYF(MY_NABP)))
{
mysql_file_close(file, MYF(0));
@ -4104,7 +4104,7 @@ String *Item_func_quote::val_str(String *str)
if ((mblen= cs->cset->wc_mb(cs, '\'', (uchar *) to, to_end)) <= 0)
goto toolong;
to+= mblen;
new_length= to - str->ptr();
new_length= (uint)(to - str->ptr());
goto ret;
}

View File

@ -58,7 +58,7 @@ Item_subselect::Item_subselect(THD *thd_arg):
changed(0), is_correlated(FALSE), with_recursive_reference(0)
{
DBUG_ENTER("Item_subselect::Item_subselect");
DBUG_PRINT("enter", ("this: 0x%lx", (ulong) this));
DBUG_PRINT("enter", ("this: %p", this));
sortbuffer.str= 0;
#ifndef DBUG_OFF
@ -84,8 +84,8 @@ void Item_subselect::init(st_select_lex *select_lex,
*/
DBUG_ENTER("Item_subselect::init");
DBUG_PRINT("enter", ("select_lex: 0x%lx this: 0x%lx",
(ulong) select_lex, (ulong) this));
DBUG_PRINT("enter", ("select_lex: %p this: %p",
select_lex, this));
unit= select_lex->master_unit();
if (unit->item)
@ -130,7 +130,7 @@ void Item_subselect::init(st_select_lex *select_lex,
/* The subquery is an expression cache candidate */
upper->expr_cache_may_be_used[upper->parsing_place]= TRUE;
}
DBUG_PRINT("info", ("engine: 0x%lx", (ulong)engine));
DBUG_PRINT("info", ("engine: %p", engine));
DBUG_VOID_RETURN;
}
@ -215,7 +215,7 @@ void Item_allany_subselect::cleanup()
Item_subselect::~Item_subselect()
{
DBUG_ENTER("Item_subselect::~Item_subselect");
DBUG_PRINT("enter", ("this: 0x%lx", (ulong) this));
DBUG_PRINT("enter", ("this: %p", this));
if (own_engine)
delete engine;
else

View File

@ -36,9 +36,9 @@
used in Item_sum_*
*/
ulonglong Item_sum::ram_limitation(THD *thd)
size_t Item_sum::ram_limitation(THD *thd)
{
return MY_MIN(thd->variables.tmp_memory_table_size,
return (size_t)MY_MIN(thd->variables.tmp_memory_table_size,
thd->variables.max_heap_table_size);
}

View File

@ -382,7 +382,7 @@ protected:
*/
Item **orig_args, *tmp_orig_args[2];
static ulonglong ram_limitation(THD *thd);
static size_t ram_limitation(THD *thd);
public:

View File

@ -715,7 +715,7 @@ static bool get_interval_info(const char *str,uint length,CHARSET_INFO *cs,
{
const char *end=str+length;
uint i;
long msec_length= 0;
int msec_length= 0;
while (str != end && !my_isdigit(cs,*str))
str++;
@ -726,7 +726,7 @@ static bool get_interval_info(const char *str,uint length,CHARSET_INFO *cs,
const char *start= str;
for (value= 0; str != end && my_isdigit(cs, *str); str++)
value= value*10 + *str - '0';
msec_length= 6 - (str - start);
msec_length= 6 - (int)(str - start);
values[i]= value;
while (str != end && !my_isdigit(cs,*str))
str++;
@ -1062,7 +1062,7 @@ longlong Item_func_week::val_int()
if (get_arg0_date(&ltime, TIME_NO_ZERO_DATE | TIME_NO_ZERO_IN_DATE))
return 0;
if (arg_count > 1)
week_format= args[1]->val_int();
week_format= (uint)args[1]->val_int();
else
week_format= current_thd->variables.default_week_format;
return (longlong) calc_week(&ltime, week_mode(week_format), &year);
@ -2457,7 +2457,7 @@ String *Item_char_typecast::copy(String *str, CHARSET_INFO *strcs)
null_value= 1; // EOM
return 0;
}
check_truncation_with_warn(str, copier.source_end_pos() - str->ptr());
check_truncation_with_warn(str, (uint)(copier.source_end_pos() - str->ptr()));
return &tmp_value;
}

View File

@ -374,7 +374,7 @@ void field_unpack(String *to, Field *field, const uchar *rec, uint max_length,
{
const char *tmp_end= tmp.ptr() + tmp.length();
while (tmp_end > tmp.ptr() && !*--tmp_end) ;
tmp.length(tmp_end - tmp.ptr() + 1);
tmp.length((uint32)(tmp_end - tmp.ptr() + 1));
}
if (cs->mbmaxlen > 1 && prefix_key)
{

View File

@ -5292,7 +5292,7 @@ bool MYSQL_BIN_LOG::write_event_buffer(uchar* buf, uint len)
if (!ebuf)
goto err;
crypto.set_iv(iv, my_b_append_tell(&log_file));
crypto.set_iv(iv, (uint32)my_b_append_tell(&log_file));
/*
we want to encrypt everything, excluding the event length:
@ -5518,9 +5518,9 @@ binlog_cache_mngr *THD::binlog_setup_trx_data()
cache_mngr= (binlog_cache_mngr*) my_malloc(sizeof(binlog_cache_mngr), MYF(MY_ZEROFILL));
if (!cache_mngr ||
open_cached_file(&cache_mngr->stmt_cache.cache_log, mysql_tmpdir,
LOG_PREFIX, binlog_stmt_cache_size, MYF(MY_WME)) ||
LOG_PREFIX, (size_t)binlog_stmt_cache_size, MYF(MY_WME)) ||
open_cached_file(&cache_mngr->trx_cache.cache_log, mysql_tmpdir,
LOG_PREFIX, binlog_cache_size, MYF(MY_WME)))
LOG_PREFIX, (size_t)binlog_cache_size, MYF(MY_WME)))
{
my_free(cache_mngr);
DBUG_RETURN(0); // Didn't manage to set it up
@ -5649,8 +5649,8 @@ int THD::binlog_write_table_map(TABLE *table, bool is_transactional,
{
int error;
DBUG_ENTER("THD::binlog_write_table_map");
DBUG_PRINT("enter", ("table: 0x%lx (%s: #%lu)",
(long) table, table->s->table_name.str,
DBUG_PRINT("enter", ("table: %p (%s: #%lu)",
table, table->s->table_name.str,
table->s->table_map_id));
/* Ensure that all events in a GTID group are in the same cache */
@ -5799,7 +5799,7 @@ MYSQL_BIN_LOG::flush_and_set_pending_rows_event(THD *thd,
{
DBUG_ENTER("MYSQL_BIN_LOG::flush_and_set_pending_rows_event(event)");
DBUG_ASSERT(WSREP_EMULATE_BINLOG(thd) || mysql_bin_log.is_open());
DBUG_PRINT("enter", ("event: 0x%lx", (long) event));
DBUG_PRINT("enter", ("event: %p", event));
int error= 0;
binlog_cache_mngr *const cache_mngr=
@ -5810,7 +5810,7 @@ MYSQL_BIN_LOG::flush_and_set_pending_rows_event(THD *thd,
binlog_cache_data *cache_data=
cache_mngr->get_binlog_cache_data(use_trans_cache(thd, is_transactional));
DBUG_PRINT("info", ("cache_mngr->pending(): 0x%lx", (long) cache_data->pending()));
DBUG_PRINT("info", ("cache_mngr->pending(): %p", cache_data->pending()));
if (Rows_log_event* pending= cache_data->pending())
{

View File

@ -838,19 +838,19 @@ query_event_uncompress(const Format_description_log_event *description_event,
if (end <= tmp)
return 1;
int32 comp_len = len - (tmp - src) -
(contain_checksum ? BINLOG_CHECKSUM_LEN : 0);
int32 comp_len = (int32)(len - (tmp - src) -
(contain_checksum ? BINLOG_CHECKSUM_LEN : 0));
uint32 un_len = binlog_get_uncompress_len(tmp);
// bad event
if (comp_len < 0 || un_len == 0)
return 1;
*newlen = (tmp - src) + un_len;
*newlen = (ulong)(tmp - src) + un_len;
if(contain_checksum)
*newlen += BINLOG_CHECKSUM_LEN;
uint32 alloc_size = ALIGN_SIZE(*newlen);
uint32 alloc_size = (uint32)ALIGN_SIZE(*newlen);
char *new_dst = NULL;
@ -963,17 +963,17 @@ row_log_event_uncompress(const Format_description_log_event *description_event,
if (un_len == 0)
return 1;
long comp_len = len - (tmp - src) -
(contain_checksum ? BINLOG_CHECKSUM_LEN : 0);
int32 comp_len = (int32)(len - (tmp - src) -
(contain_checksum ? BINLOG_CHECKSUM_LEN : 0));
//bad event
if (comp_len <=0)
return 1;
*newlen = (tmp - src) + un_len;
*newlen = ulong(tmp - src) + un_len;
if(contain_checksum)
*newlen += BINLOG_CHECKSUM_LEN;
uint32 alloc_size = ALIGN_SIZE(*newlen);
size_t alloc_size = ALIGN_SIZE(*newlen);
*is_malloc = false;
if (alloc_size <= buf_size)
@ -1626,7 +1626,7 @@ int Log_event_writer::write_header(uchar *pos, size_t len)
if (ctx)
{
uchar iv[BINLOG_IV_LENGTH];
crypto->set_iv(iv, my_b_safe_tell(file));
crypto->set_iv(iv, (uint32)my_b_safe_tell(file));
if (encryption_ctx_init(ctx, crypto->key, crypto->key_length,
iv, sizeof(iv), ENCRYPTION_FLAG_ENCRYPT | ENCRYPTION_FLAG_NOPAD,
ENCRYPTION_KEY_SYSTEM_DATA, crypto->key_version))
@ -2427,9 +2427,9 @@ void Log_event::print_header(IO_CACHE* file,
if (checksum_alg != BINLOG_CHECKSUM_ALG_OFF &&
checksum_alg != BINLOG_CHECKSUM_ALG_UNDEF)
{
char checksum_buf[BINLOG_CHECKSUM_LEN * 2 + 4]; // to fit to "0x%lx "
char checksum_buf[BINLOG_CHECKSUM_LEN * 2 + 4]; // to fit to "%p "
size_t const bytes_written=
my_snprintf(checksum_buf, sizeof(checksum_buf), "0x%08lx ", (ulong) crc);
my_snprintf(checksum_buf, sizeof(checksum_buf), "0x%08x ", crc);
my_b_printf(file, "%s ", get_type(&binlog_checksum_typelib, checksum_alg));
my_b_printf(file, checksum_buf, bytes_written);
}
@ -3968,7 +3968,7 @@ Query_log_event::Query_log_event(THD* thd_arg, const char* query_arg,
db(thd_arg->db), q_len((uint32) query_length),
thread_id(thd_arg->thread_id),
/* save the original thread id; we already know the server id */
slave_proxy_id(thd_arg->variables.pseudo_thread_id),
slave_proxy_id((ulong)thd_arg->variables.pseudo_thread_id),
flags2_inited(1), sql_mode_inited(1), charset_inited(1),
sql_mode(thd_arg->variables.sql_mode),
auto_increment_increment(thd_arg->variables.auto_increment_increment),
@ -4172,7 +4172,7 @@ get_str_len_and_pointer(const Log_event::Byte **src,
if (length > 0)
{
if (*src + length >= end)
return *src + length - end + 1; // Number of bytes missing
return (int)(*src + length - end + 1); // Number of bytes missing
*dst= (char *)*src + 1; // Will be copied later
}
*len= length;
@ -4273,7 +4273,7 @@ Query_log_event::Query_log_event(const char* buf, uint event_len,
data_len = event_len - (common_header_len + post_header_len);
buf+= common_header_len;
slave_proxy_id= thread_id = uint4korr(buf + Q_THREAD_ID_OFFSET);
thread_id = slave_proxy_id = uint4korr(buf + Q_THREAD_ID_OFFSET);
exec_time = uint4korr(buf + Q_EXEC_TIME_OFFSET);
db_len = (uchar)buf[Q_DB_LEN_OFFSET]; // TODO: add a check of all *_len vars
error_code = uint2korr(buf + Q_ERR_CODE_OFFSET);
@ -4347,8 +4347,8 @@ Query_log_event::Query_log_event(const char* buf, uint event_len,
break;
}
case Q_CATALOG_NZ_CODE:
DBUG_PRINT("info", ("case Q_CATALOG_NZ_CODE; pos: 0x%lx; end: 0x%lx",
(ulong) pos, (ulong) end));
DBUG_PRINT("info", ("case Q_CATALOG_NZ_CODE; pos:%p; end:%p",
pos, end));
if (get_str_len_and_pointer(&pos, &catalog, &catalog_len, end))
{
DBUG_PRINT("info", ("query= 0"));
@ -6488,7 +6488,7 @@ Load_log_event::Load_log_event(THD *thd_arg, sql_exchange *ex,
thd_arg->thread_specific_used ? LOG_EVENT_THREAD_SPECIFIC_F : 0,
using_trans),
thread_id(thd_arg->thread_id),
slave_proxy_id(thd_arg->variables.pseudo_thread_id),
slave_proxy_id((ulong)thd_arg->variables.pseudo_thread_id),
num_fields(0),fields(0),
field_lens(0),field_block_len(0),
table_name(table_name_arg ? table_name_arg : ""),
@ -6612,7 +6612,7 @@ int Load_log_event::copy_log_event(const char *buf, ulong event_len,
char* buf_end = (char*)buf + event_len;
/* this is the beginning of the post-header */
const char* data_head = buf + description_event->common_header_len;
slave_proxy_id= thread_id= uint4korr(data_head + L_THREAD_ID_OFFSET);
thread_id= slave_proxy_id= uint4korr(data_head + L_THREAD_ID_OFFSET);
exec_time = uint4korr(data_head + L_EXEC_TIME_OFFSET);
skip_lines = uint4korr(data_head + L_SKIP_LINES_OFFSET);
table_name_len = (uint)data_head[L_TBL_LEN_OFFSET];
@ -8675,7 +8675,7 @@ User_var_log_event(const char* buf, uint event_len,
Old events will not have this extra byte, thence,
we keep the flags set to UNDEF_F.
*/
uint bytes_read= ((val + val_len) - buf_start);
size_t bytes_read= ((val + val_len) - buf_start);
#ifndef DBUG_OFF
bool old_pre_checksum_fd= description_event->is_version_before_checksum(
&description_event->server_version_split);
@ -10384,7 +10384,7 @@ void Rows_log_event::uncompress_buf()
if (new_buf)
{
if(!binlog_buf_uncompress((char *)m_rows_buf, (char *)new_buf,
m_rows_cur - m_rows_buf, &un_len))
(uint32)(m_rows_cur - m_rows_buf), &un_len))
{
my_free(m_rows_buf);
m_rows_buf = new_buf;
@ -10420,9 +10420,9 @@ int Rows_log_event::get_data_size()
uchar *end= net_store_length(buf, m_width);
DBUG_EXECUTE_IF("old_row_based_repl_4_byte_map_id_master",
return 6 + no_bytes_in_map(&m_cols) + (end - buf) +
return (int)(6 + no_bytes_in_map(&m_cols) + (end - buf) +
(general_type_code == UPDATE_ROWS_EVENT ? no_bytes_in_map(&m_cols_ai) : 0) +
(m_rows_cur - m_rows_buf););
m_rows_cur - m_rows_buf););
int data_size= 0;
Log_event_type type = get_type_code();
@ -10458,7 +10458,7 @@ int Rows_log_event::do_add_row_data(uchar *row_data, size_t length)
would save binlog space. TODO
*/
DBUG_ENTER("Rows_log_event::do_add_row_data");
DBUG_PRINT("enter", ("row_data: 0x%lx length: %lu", (ulong) row_data,
DBUG_PRINT("enter", ("row_data:%p length: %lu", row_data,
(ulong) length));
/*
@ -10838,8 +10838,8 @@ int Rows_log_event::do_apply_event(rpl_group_info *rgi)
table= m_table= rgi->m_table_map.get_table(m_table_id);
DBUG_PRINT("debug", ("m_table: 0x%lx, m_table_id: %lu%s",
(ulong) m_table, m_table_id,
DBUG_PRINT("debug", ("m_table:%p, m_table_id: %lu%s",
m_table, m_table_id,
table && master_had_triggers ?
" (master had triggers)" : ""));
if (table)
@ -10959,8 +10959,8 @@ int Rows_log_event::do_apply_event(rpl_group_info *rgi)
m_curr_row_end.
*/
DBUG_PRINT("info", ("curr_row: 0x%lu; curr_row_end: 0x%lu; rows_end: 0x%lu",
(ulong) m_curr_row, (ulong) m_curr_row_end, (ulong) m_rows_end));
DBUG_PRINT("info", ("curr_row: %p; curr_row_end: %p; rows_end:%p",
m_curr_row, m_curr_row_end, m_rows_end));
if (!m_curr_row_end && !error)
error= unpack_current_row(rgi);

View File

@ -5127,7 +5127,7 @@ static inline bool copy_event_cache_to_string_and_reinit(IO_CACHE *cache, LEX_ST
String tmp;
reinit_io_cache(cache, READ_CACHE, 0L, FALSE, FALSE);
if (tmp.append(cache, cache->end_of_file))
if (tmp.append(cache, (uint32)cache->end_of_file))
goto err;
reinit_io_cache(cache, WRITE_CACHE, 0, FALSE, TRUE);

View File

@ -364,10 +364,10 @@ copy_extra_record_fields(TABLE *table,
my_ptrdiff_t master_fields)
{
DBUG_ENTER("copy_extra_record_fields(table, master_reclen, master_fields)");
DBUG_PRINT("info", ("Copying to 0x%lx "
DBUG_PRINT("info", ("Copying to %p "
"from field %lu at offset %lu "
"to field %d at offset %lu",
(long) table->record[0],
table->record[0],
(ulong) master_fields, (ulong) master_reclength,
table->s->fields, table->s->reclength));
/*
@ -625,8 +625,8 @@ replace_record(THD *thd, TABLE *table,
static int find_and_fetch_row(TABLE *table, uchar *key)
{
DBUG_ENTER("find_and_fetch_row(TABLE *table, uchar *key, uchar *record)");
DBUG_PRINT("enter", ("table: 0x%lx, key: 0x%lx record: 0x%lx",
(long) table, (long) key, (long) table->record[1]));
DBUG_PRINT("enter", ("table: %p, key: %p record: %p",
table, key, table->record[1]));
DBUG_ASSERT(table->in_use != NULL);
@ -1254,8 +1254,8 @@ Old_rows_log_event::Old_rows_log_event(const char *buf, uint event_len,
const uchar* const ptr_rows_data= (const uchar*) ptr_after_width;
size_t const data_size= event_len - (ptr_rows_data - (const uchar *) buf);
DBUG_PRINT("info",("m_table_id: %lu m_flags: %d m_width: %lu data_size: %lu",
m_table_id, m_flags, m_width, (ulong) data_size));
DBUG_PRINT("info",("m_table_id: %lu m_flags: %d m_width: %lu data_size: %zu",
m_table_id, m_flags, m_width, data_size));
DBUG_DUMP("rows_data", (uchar*) ptr_rows_data, data_size);
m_rows_buf= (uchar*) my_malloc(data_size, MYF(MY_WME));
@ -1290,8 +1290,8 @@ int Old_rows_log_event::get_data_size()
uchar *end= net_store_length(buf, (m_width + 7) / 8);
DBUG_EXECUTE_IF("old_row_based_repl_4_byte_map_id_master",
return 6 + no_bytes_in_map(&m_cols) + (end - buf) +
(m_rows_cur - m_rows_buf););
return (int)(6 + no_bytes_in_map(&m_cols) + (end - buf) +
m_rows_cur - m_rows_buf););
int data_size= ROWS_HEADER_LEN;
data_size+= no_bytes_in_map(&m_cols);
data_size+= (uint) (end - buf);
@ -1310,8 +1310,8 @@ int Old_rows_log_event::do_add_row_data(uchar *row_data, size_t length)
would save binlog space. TODO
*/
DBUG_ENTER("Old_rows_log_event::do_add_row_data");
DBUG_PRINT("enter", ("row_data: 0x%lx length: %lu", (ulong) row_data,
(ulong) length));
DBUG_PRINT("enter", ("row_data: %p length: %zu",row_data,
length));
/*
Don't print debug messages when running valgrind since they can
trigger false warnings.
@ -1599,8 +1599,8 @@ int Old_rows_log_event::do_apply_event(rpl_group_info *rgi)
*/
DBUG_PRINT("info", ("error: %d", error));
DBUG_PRINT("info", ("curr_row: 0x%lu; curr_row_end: 0x%lu; rows_end: 0x%lu",
(ulong) m_curr_row, (ulong) m_curr_row_end, (ulong) m_rows_end));
DBUG_PRINT("info", ("curr_row: %p; curr_row_end:%p; rows_end: %p",
m_curr_row, m_curr_row_end, m_rows_end));
if (!m_curr_row_end && !error)
unpack_current_row(rgi);

View File

@ -57,7 +57,7 @@ static int my_b_encr_read(IO_CACHE *info, uchar *Buffer, size_t Count)
if (info->seek_not_done)
{
size_t wpos;
my_off_t wpos;
pos_offset= pos_in_file % info->buffer_length;
pos_in_file-= pos_offset;
@ -106,7 +106,7 @@ static int my_b_encr_read(IO_CACHE *info, uchar *Buffer, size_t Count)
DBUG_ASSERT(length <= info->buffer_length);
copied= MY_MIN(Count, length - pos_offset);
copied= MY_MIN(Count, (size_t)(length - pos_offset));
memcpy(Buffer, info->buffer + pos_offset, copied);
Count-= copied;
@ -120,7 +120,7 @@ static int my_b_encr_read(IO_CACHE *info, uchar *Buffer, size_t Count)
if (wlength < crypt_data->block_length && pos_in_file < info->end_of_file)
{
info->error= pos_in_file - old_pos_in_file;
info->error= (int)(pos_in_file - old_pos_in_file);
DBUG_RETURN(1);
}
} while (Count);

View File

@ -1590,7 +1590,7 @@ static void close_connections(void)
/* kill connection thread */
#if !defined(__WIN__)
DBUG_PRINT("quit", ("waiting for select thread: 0x%lx",
DBUG_PRINT("quit", ("waiting for select thread: %lu",
(ulong)select_thread));
mysql_mutex_lock(&LOCK_start_thread);
@ -2890,7 +2890,7 @@ void signal_thd_deleted()
void unlink_thd(THD *thd)
{
DBUG_ENTER("unlink_thd");
DBUG_PRINT("enter", ("thd: 0x%lx", (long) thd));
DBUG_PRINT("enter", ("thd: %p", thd));
/*
Do not decrement when its wsrep system thread. wsrep_applier is set for
@ -4855,7 +4855,7 @@ static void init_ssl()
opt_ssl_ca, opt_ssl_capath,
opt_ssl_cipher, &error,
opt_ssl_crl, opt_ssl_crlpath);
DBUG_PRINT("info",("ssl_acceptor_fd: 0x%lx", (long) ssl_acceptor_fd));
DBUG_PRINT("info",("ssl_acceptor_fd: %p", ssl_acceptor_fd));
if (!ssl_acceptor_fd)
{
sql_print_warning("Failed to setup SSL");
@ -4978,7 +4978,8 @@ static int init_server_components()
global_system_variables.query_cache_type= 1;
}
query_cache_init();
query_cache_resize(query_cache_size);
DBUG_ASSERT(query_cache_size < ULONG_MAX);
query_cache_resize((ulong)query_cache_size);
my_rnd_init(&sql_rand,(ulong) server_start_time,(ulong) server_start_time/2);
setup_fpu();
init_thr_lock();
@ -5822,7 +5823,7 @@ int mysqld_main(int argc, char **argv)
ulonglong new_thread_stack_size;
new_thread_stack_size= my_setstacksize(&connection_attrib,
my_thread_stack_size);
(size_t)my_thread_stack_size);
if (new_thread_stack_size != my_thread_stack_size)
SYSVAR_AUTOSIZE(my_thread_stack_size, new_thread_stack_size);
@ -7870,9 +7871,9 @@ static int show_table_definitions(THD *thd, SHOW_VAR *var, char *buff,
static int show_flush_commands(THD *thd, SHOW_VAR *var, char *buff,
enum enum_var_type scope)
{
var->type= SHOW_LONG;
var->type= SHOW_LONGLONG;
var->value= buff;
*((long *) buff)= (long) tdc_refresh_version();
*((longlong *) buff)= (longlong)tdc_refresh_version();
return 0;
}

Some files were not shown because too many files have changed in this diff Show More