Skip to content

Commit

Permalink
Merge bb-10.2-ext into 10.3
Browse files Browse the repository at this point in the history
  • Loading branch information
dr-m committed Oct 4, 2017
2 parents 2cf3e2e + 61b2618 commit 2c10671
Show file tree
Hide file tree
Showing 334 changed files with 5,235 additions and 3,076 deletions.
2 changes: 1 addition & 1 deletion client/mysql_upgrade.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion client/mysqlbinlog.cc
Original file line number Diff line number Diff line change
Expand Up @@ -607,7 +607,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);
Expand Down
10 changes: 5 additions & 5 deletions client/mysqldump.c
Original file line number Diff line number Diff line change
Expand Up @@ -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},
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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);
Expand Down
6 changes: 3 additions & 3 deletions client/mysqlslap.c
Original file line number Diff line number Diff line change
Expand Up @@ -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},
Expand Down Expand Up @@ -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));
}


Expand Down
26 changes: 14 additions & 12 deletions client/mysqltest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -767,7 +767,7 @@ class LogFile {
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));
Expand Down Expand Up @@ -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 */
Expand Down Expand Up @@ -6530,7 +6530,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;
Expand Down Expand Up @@ -7016,7 +7016,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);
}
Expand Down Expand Up @@ -7561,7 +7561,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
}
Expand All @@ -7573,7 +7573,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";

Expand Down Expand Up @@ -8569,7 +8569,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);
Expand Down Expand Up @@ -10266,7 +10266,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; \
Expand All @@ -10291,13 +10291,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;

Expand Down Expand Up @@ -10440,7 +10442,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);
Expand Down
4 changes: 2 additions & 2 deletions cmake/os/Windows.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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()

Expand Down
4 changes: 2 additions & 2 deletions cmake/os/WindowsCache.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,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 "")
Expand Down Expand Up @@ -140,7 +140,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 "")
Expand Down
4 changes: 2 additions & 2 deletions dbug/dbug.c
Original file line number Diff line number Diff line change
Expand Up @@ -1369,8 +1369,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)
Expand Down
8 changes: 4 additions & 4 deletions extra/innochecksum.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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. */
Expand Down Expand Up @@ -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;
}
Expand Down Expand Up @@ -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 */
Expand Down Expand Up @@ -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) {
Expand Down
6 changes: 3 additions & 3 deletions extra/mariabackup/xbstream.c
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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;
}
Expand Down
8 changes: 4 additions & 4 deletions extra/mariabackup/xtrabackup.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1857,9 +1857,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,
Expand Down Expand Up @@ -4172,7 +4172,7 @@ xb_delta_open_matching_space(

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",
Expand Down
4 changes: 2 additions & 2 deletions extra/yassl/taocrypt/src/algebra.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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))
{
Expand Down Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion include/my_compiler.h
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,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 */
Expand Down
20 changes: 10 additions & 10 deletions include/mysql/plugin_audit.h.pp
Original file line number Diff line number Diff line change
Expand Up @@ -277,23 +277,23 @@
};
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,
Expand Down
20 changes: 10 additions & 10 deletions include/mysql/plugin_auth.h.pp
Original file line number Diff line number Diff line change
Expand Up @@ -277,23 +277,23 @@
};
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,
Expand Down
Loading

0 comments on commit 2c10671

Please sign in to comment.