mirror of
https://github.com/MariaDB/server.git
synced 2025-01-15 19:42:28 +01:00
MDEV-13384 - misc Windows warnings fixed
This commit is contained in:
parent
509928718d
commit
7354dc6773
147 changed files with 545 additions and 491 deletions
|
@ -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);
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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));
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
@ -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);
|
||||
|
|
|
@ -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 /we4311 /we4477 /we4302")
|
||||
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /wd4800 /wd4805 /wd4996 /wd4291 /wd4577 /we4099 /we4700 /we4311 /we4477 /we4302")
|
||||
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()
|
||||
|
||||
|
|
|
@ -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 "")
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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,
|
||||
|
|
|
@ -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));
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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))
|
||||
|
|
|
@ -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))
|
||||
{
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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++;
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
||||
|
|
|
@ -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);
|
||||
|
||||
|
|
|
@ -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))
|
||||
{
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -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))
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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
|
||||
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -240,6 +240,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}
|
||||
|
|
|
@ -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);
|
||||
|
@ -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)
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
@ -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,
|
||||
|
|
33
sql/field.cc
33
sql/field.cc
|
@ -5595,7 +5595,7 @@ int Field_temporal_with_date::store(double nr)
|
|||
ErrConvDouble str(nr);
|
||||
|
||||
longlong tmp= double_to_datetime(nr, <ime,
|
||||
sql_mode_for_dates(thd), &error);
|
||||
(uint) sql_mode_for_dates(thd), &error);
|
||||
return store_TIME_with_warning(<ime, &str, error, tmp != -1);
|
||||
}
|
||||
|
||||
|
@ -7949,7 +7949,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,
|
||||
|
@ -8496,7 +8496,7 @@ uint gis_field_options_read(const uchar *buf, uint buf_len,
|
|||
}
|
||||
|
||||
end_of_record:
|
||||
return cbuf - buf;
|
||||
return (uint)(cbuf - buf);
|
||||
}
|
||||
|
||||
|
||||
|
@ -9750,8 +9750,9 @@ void Column_definition::create_length_to_internal_length(void)
|
|||
case MYSQL_TYPE_STRING:
|
||||
case MYSQL_TYPE_VARCHAR:
|
||||
length*= charset->mbmaxlen;
|
||||
key_length= length;
|
||||
pack_length= calc_pack_length(sql_type, length);
|
||||
DBUG_ASSERT(length <= UINT_MAX32);
|
||||
key_length= (uint32)length;
|
||||
pack_length= calc_pack_length(sql_type, key_length);
|
||||
break;
|
||||
case MYSQL_TYPE_ENUM:
|
||||
case MYSQL_TYPE_SET:
|
||||
|
@ -9766,21 +9767,21 @@ void Column_definition::create_length_to_internal_length(void)
|
|||
}
|
||||
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);
|
||||
}
|
||||
break;
|
||||
case MYSQL_TYPE_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),
|
||||
decimals);
|
||||
break;
|
||||
default:
|
||||
key_length= pack_length= calc_pack_length(sql_type, length);
|
||||
key_length= pack_length= calc_pack_length(sql_type, (uint)length);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
@ -9953,9 +9954,9 @@ bool Column_definition::check(THD *thd)
|
|||
DBUG_RETURN(TRUE);
|
||||
}
|
||||
length=
|
||||
my_decimal_precision_to_length(length, decimals, flags & UNSIGNED_FLAG);
|
||||
my_decimal_precision_to_length((uint)length, decimals, flags & UNSIGNED_FLAG);
|
||||
pack_length=
|
||||
my_decimal_get_binary_size(length, decimals);
|
||||
my_decimal_get_binary_size((uint)length, decimals);
|
||||
break;
|
||||
case MYSQL_TYPE_VARCHAR:
|
||||
/*
|
||||
|
@ -10077,14 +10078,14 @@ bool Column_definition::check(THD *thd)
|
|||
static_cast<ulong>(MAX_BIT_FIELD_LENGTH));
|
||||
DBUG_RETURN(TRUE);
|
||||
}
|
||||
pack_length= (length + 7) / 8;
|
||||
pack_length= ((uint)length + 7) / 8;
|
||||
break;
|
||||
}
|
||||
case MYSQL_TYPE_DECIMAL:
|
||||
DBUG_ASSERT(0); /* Was obsolete */
|
||||
}
|
||||
/* 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
|
||||
|
@ -10546,7 +10547,7 @@ Column_definition::Column_definition(THD *thd, Field *old_field,
|
|||
interval= ((Field_enum*) old_field)->typelib;
|
||||
else
|
||||
interval=0;
|
||||
char_length= length;
|
||||
char_length= (uint)length;
|
||||
|
||||
/*
|
||||
Copy the default (constant/function) from the column object orig_field, if
|
||||
|
@ -10839,7 +10840,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)
|
||||
|
@ -10858,13 +10859,13 @@ bool Field::save_in_field_default_value(bool view_error_processing)
|
|||
ER_THD(thd, ER_NO_DEFAULT_FOR_FIELD),
|
||||
field_name);
|
||||
}
|
||||
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();
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -211,7 +211,7 @@ protected:
|
|||
CHARSET_INFO *cs, const char *str, size_t length,
|
||||
my_decimal *buf)
|
||||
{
|
||||
m_error= str2my_decimal(mask, str, length, cs,
|
||||
m_error= str2my_decimal(mask, str,(uint) length, cs,
|
||||
buf, (const char **) &m_end_of_num);
|
||||
// E_DEC_TRUNCATED means a very minor truncation: '1e-100' -> 0
|
||||
m_edom= m_error && m_error != E_DEC_TRUNCATED;
|
||||
|
@ -848,7 +848,7 @@ public:
|
|||
int store(const char *to, uint length, CHARSET_INFO *cs,
|
||||
enum_check_fields check_level);
|
||||
int store(const LEX_STRING *ls, CHARSET_INFO *cs)
|
||||
{ return store(ls->str, ls->length, cs); }
|
||||
{ return store(ls->str, (uint32) ls->length, cs); }
|
||||
virtual double val_real(void)=0;
|
||||
virtual longlong val_int(void)=0;
|
||||
virtual bool val_bool(void)= 0;
|
||||
|
|
|
@ -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;
|
||||
|
@ -1803,7 +1804,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 */
|
||||
}
|
||||
|
|
|
@ -2508,7 +2508,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,
|
||||
|
@ -2524,7 +2524,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,
|
||||
|
@ -6738,7 +6738,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)
|
||||
{
|
||||
|
@ -7704,7 +7704,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)
|
||||
|
|
|
@ -1372,7 +1372,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));
|
||||
|
@ -5557,9 +5557,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();
|
||||
|
|
|
@ -766,9 +766,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];
|
||||
|
||||
|
|
|
@ -1051,7 +1051,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
|
||||
{
|
||||
|
|
|
@ -3425,7 +3425,7 @@ public:
|
|||
Item_string(thd, str, length, system_charset_info)
|
||||
{ }
|
||||
Item_string_sys(THD *thd, const char *str):
|
||||
Item_string(thd, str, strlen(str), system_charset_info)
|
||||
Item_string(thd, str, (uint) strlen(str), system_charset_info)
|
||||
{ }
|
||||
};
|
||||
|
||||
|
@ -3512,7 +3512,7 @@ class Item_blob :public Item_partition_func_safe_string
|
|||
{
|
||||
public:
|
||||
Item_blob(THD *thd, const char *name_arg, uint length):
|
||||
Item_partition_func_safe_string(thd, name_arg, strlen(name_arg), &my_charset_bin)
|
||||
Item_partition_func_safe_string(thd, name_arg, (uint) strlen(name_arg), &my_charset_bin)
|
||||
{ max_length= length; }
|
||||
enum Type type() const { return TYPE_HOLDER; }
|
||||
enum_field_types field_type() const { return MYSQL_TYPE_BLOB; }
|
||||
|
|
|
@ -5404,7 +5404,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);
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -71,7 +71,7 @@ static void wrong_precision_error(uint errcode, Item *a,
|
|||
*/
|
||||
|
||||
bool get_length_and_scale(ulonglong length, ulonglong decimals,
|
||||
ulong *out_length, uint *out_decimals,
|
||||
uint *out_length, uint *out_decimals,
|
||||
uint max_precision, uint max_scale,
|
||||
Item *a)
|
||||
{
|
||||
|
@ -88,8 +88,9 @@ bool get_length_and_scale(ulonglong length, ulonglong decimals,
|
|||
|
||||
*out_decimals= (uint) decimals;
|
||||
my_decimal_trim(&length, out_decimals);
|
||||
*out_length= (ulong) length;
|
||||
|
||||
*out_length= (uint) length;
|
||||
|
||||
|
||||
if (*out_length < *out_decimals)
|
||||
{
|
||||
my_error(ER_M_BIGGER_THAN_D, MYF(0), "");
|
||||
|
@ -3309,7 +3310,7 @@ Create_udf_func Create_udf_func::s_singleton;
|
|||
Item*
|
||||
Create_udf_func::create_func(THD *thd, LEX_STRING 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);
|
||||
}
|
||||
|
@ -7182,7 +7183,7 @@ create_func_cast(THD *thd, Item *a, Cast_target cast_type,
|
|||
break;
|
||||
case ITEM_CAST_DECIMAL:
|
||||
{
|
||||
ulong len;
|
||||
uint len;
|
||||
uint dec;
|
||||
if (get_length_and_scale(length, decimals, &len, &dec,
|
||||
DECIMAL_MAX_PRECISION, DECIMAL_MAX_SCALE,
|
||||
|
@ -7193,9 +7194,7 @@ create_func_cast(THD *thd, Item *a, Cast_target cast_type,
|
|||
}
|
||||
case ITEM_CAST_DOUBLE:
|
||||
{
|
||||
ulong len;
|
||||
uint dec;
|
||||
|
||||
uint len, dec;
|
||||
if (!c_len)
|
||||
{
|
||||
length= DBL_DIG+7;
|
||||
|
|
|
@ -1040,8 +1040,8 @@ bool Item_func_hybrid_field_type::get_date(MYSQL_TIME *ltime,
|
|||
}
|
||||
case TIME_RESULT:
|
||||
return date_op(ltime,
|
||||
fuzzydate |
|
||||
(field_type() == MYSQL_TYPE_TIME ? TIME_TIME_ONLY : 0));
|
||||
(uint)(fuzzydate |
|
||||
(field_type() == MYSQL_TYPE_TIME ? TIME_TIME_ONLY : 0)));
|
||||
case STRING_RESULT:
|
||||
{
|
||||
char buff[40];
|
||||
|
|
|
@ -211,7 +211,7 @@ 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)
|
||||
{
|
||||
|
@ -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++;
|
||||
|
||||
|
@ -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)
|
||||
{
|
||||
|
|
|
@ -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))
|
||||
|
@ -1529,7 +1530,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);
|
||||
|
@ -2860,7 +2862,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))
|
||||
{
|
||||
|
@ -3134,7 +3136,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;
|
||||
|
|
|
@ -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
|
||||
|
@ -3694,12 +3694,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;
|
||||
|
@ -3776,7 +3776,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));
|
||||
|
@ -4002,7 +4002,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;
|
||||
}
|
||||
|
||||
|
|
|
@ -735,7 +735,7 @@ public:
|
|||
bool fix_fields(THD *thd, Item **ref);
|
||||
void fix_length_and_dec()
|
||||
{
|
||||
max_length= (username_char_length +
|
||||
max_length= (uint32) (username_char_length +
|
||||
HOSTNAME_LENGTH + 1) * SYSTEM_CHARSET_MBMAXLEN;
|
||||
}
|
||||
const char *func_name() const { return "user"; }
|
||||
|
@ -777,7 +777,7 @@ public:
|
|||
Item_func_sysconst(thd), context(context_arg) {}
|
||||
bool fix_fields(THD *thd, Item **ref);
|
||||
void fix_length_and_dec()
|
||||
{ max_length= username_char_length * SYSTEM_CHARSET_MBMAXLEN; }
|
||||
{ max_length= (uint32) username_char_length * SYSTEM_CHARSET_MBMAXLEN; }
|
||||
int save_in_field(Field *field, bool no_conversions)
|
||||
{ return save_str_value_in_field(field, &str_value); }
|
||||
const char *func_name() const { return "current_role"; }
|
||||
|
|
|
@ -714,7 +714,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++;
|
||||
|
@ -725,7 +725,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++;
|
||||
|
@ -1061,7 +1061,7 @@ longlong Item_func_week::val_int()
|
|||
if (get_arg0_date(<ime, 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(<ime, week_mode(week_format), &year);
|
||||
|
@ -2456,7 +2456,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;
|
||||
}
|
||||
|
||||
|
|
|
@ -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)
|
||||
{
|
||||
|
|
|
@ -5254,7 +5254,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:
|
||||
|
@ -5480,9 +5480,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
|
||||
|
|
|
@ -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))
|
||||
|
@ -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),
|
||||
|
@ -4170,7 +4170,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;
|
||||
|
@ -4271,7 +4271,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);
|
||||
|
@ -6487,7 +6487,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 : ""),
|
||||
|
@ -6611,7 +6611,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];
|
||||
|
@ -8673,7 +8673,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);
|
||||
|
@ -10382,7 +10382,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;
|
||||
|
@ -10418,9 +10418,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();
|
||||
|
|
|
@ -5097,7 +5097,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);
|
||||
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -4971,7 +4971,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();
|
||||
|
@ -5815,7 +5816,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);
|
||||
|
||||
|
|
|
@ -437,7 +437,7 @@ sql_parse_prepare(const LEX_STRING *file_name, MEM_ROOT *mem_root,
|
|||
DBUG_RETURN(0);
|
||||
}
|
||||
|
||||
if ((len= mysql_file_read(file, (uchar *)buff, stat_info.st_size,
|
||||
if ((len= mysql_file_read(file, (uchar *)buff, (size_t)stat_info.st_size,
|
||||
MYF(MY_WME))) == MY_FILE_ERROR)
|
||||
{
|
||||
mysql_file_close(file, MYF(MY_WME));
|
||||
|
|
|
@ -239,7 +239,7 @@ Rpl_filter::db_ok_with_wild_table(const char *db)
|
|||
int len;
|
||||
end= strmov(hash_key, db);
|
||||
*end++= '.';
|
||||
len= end - hash_key ;
|
||||
len= (int)(end - hash_key);
|
||||
if (wild_do_table_inited && find_wild(&wild_do_table, hash_key, len))
|
||||
{
|
||||
DBUG_PRINT("return",("1"));
|
||||
|
|
|
@ -1697,7 +1697,7 @@ rpl_parallel_thread::get_qev_common(Log_event *ev, ulonglong event_size)
|
|||
}
|
||||
qev->typ= rpl_parallel_thread::queued_event::QUEUED_EVENT;
|
||||
qev->ev= ev;
|
||||
qev->event_size= event_size;
|
||||
qev->event_size= (size_t)event_size;
|
||||
qev->next= NULL;
|
||||
return qev;
|
||||
}
|
||||
|
|
|
@ -339,8 +339,8 @@ unpack_row(rpl_group_info *rgi,
|
|||
" pack_ptr: %p; conv_table %p conv_field %p table %s"
|
||||
" row_end: %p",
|
||||
f->field_name, metadata,
|
||||
(ulong) old_pack_ptr, conv_table, conv_field,
|
||||
(table_found) ? "found" : "not found", (ulong)row_end
|
||||
old_pack_ptr, conv_table, conv_field,
|
||||
(table_found) ? "found" : "not found", row_end
|
||||
);
|
||||
}
|
||||
|
||||
|
|
|
@ -234,7 +234,7 @@ a file name for --relay-log-index option", opt_relaylog_index_name);
|
|||
mysql_mutex_lock(log_lock);
|
||||
if (relay_log.open_index_file(buf_relaylog_index_name, ln, TRUE) ||
|
||||
relay_log.open(ln, LOG_BIN, 0, 0, SEQ_READ_APPEND,
|
||||
max_relay_log_size, 1, TRUE))
|
||||
(ulong)max_relay_log_size, 1, TRUE))
|
||||
{
|
||||
mysql_mutex_unlock(log_lock);
|
||||
mysql_mutex_unlock(&data_lock);
|
||||
|
@ -1175,7 +1175,7 @@ int purge_relay_logs(Relay_log_info* rli, THD *thd, bool just_reset,
|
|||
}
|
||||
mysql_mutex_lock(rli->relay_log.get_log_lock());
|
||||
if (rli->relay_log.open(ln, LOG_BIN, 0, 0, SEQ_READ_APPEND,
|
||||
(rli->max_relay_log_size ? rli->max_relay_log_size :
|
||||
(ulong)(rli->max_relay_log_size ? rli->max_relay_log_size :
|
||||
max_binlog_size), 1, TRUE))
|
||||
{
|
||||
sql_print_error("Unable to purge relay log files. Failed to open relay "
|
||||
|
@ -1577,9 +1577,9 @@ rpl_load_gtid_slave_state(THD *thd)
|
|||
goto end;
|
||||
}
|
||||
}
|
||||
domain_id= (ulonglong)table->field[0]->val_int();
|
||||
domain_id= (uint32)table->field[0]->val_int();
|
||||
sub_id= (ulonglong)table->field[1]->val_int();
|
||||
server_id= (ulonglong)table->field[2]->val_int();
|
||||
server_id= (uint32)table->field[2]->val_int();
|
||||
seq_no= (ulonglong)table->field[3]->val_int();
|
||||
DBUG_PRINT("info", ("Read slave state row: %u-%u-%lu sub_id=%lu\n",
|
||||
(unsigned)domain_id, (unsigned)server_id,
|
||||
|
|
|
@ -967,7 +967,7 @@ bool Current_schema_tracker::update(THD *thd, set_var *)
|
|||
|
||||
bool Current_schema_tracker::store(THD *thd, String *buf)
|
||||
{
|
||||
ulonglong db_length, length;
|
||||
size_t db_length, length;
|
||||
|
||||
/*
|
||||
Protocol made (by unknown reasons) redundant:
|
||||
|
@ -1320,16 +1320,16 @@ bool Transaction_state_tracker::store(THD *thd, String *buf)
|
|||
}
|
||||
|
||||
{
|
||||
ulonglong length= buf->length() - start;
|
||||
size_t length= buf->length() - start;
|
||||
uchar *place= (uchar *)(buf->ptr() + (start - 2));
|
||||
DBUG_ASSERT(length < 249); // in fact < 110
|
||||
DBUG_ASSERT(start >= 3);
|
||||
|
||||
DBUG_ASSERT((place - 1)[0] == SESSION_TRACK_TRANSACTION_CHARACTERISTICS);
|
||||
/* Length of the overall entity. */
|
||||
place[0]= length + 1;
|
||||
place[0]= (uchar)length + 1;
|
||||
/* Transaction characteristics (length-encoded string). */
|
||||
place[1]= length;
|
||||
place[1]= (uchar)length;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -4526,12 +4526,12 @@ Stopping slave I/O thread due to out-of-memory error from master");
|
|||
lastchecktime = currenttime;
|
||||
if(tokenamount < network_read_len)
|
||||
{
|
||||
ulonglong micro_time = 1000*1000 * (network_read_len - tokenamount) / speed_limit_in_bytes ;
|
||||
ulonglong second_time = micro_time / (1000 * 1000);
|
||||
micro_time = micro_time % (1000 * 1000);
|
||||
ulonglong duration =1000ULL*1000 * (network_read_len - tokenamount) / speed_limit_in_bytes;
|
||||
time_t second_time = (time_t)(duration / (1000 * 1000));
|
||||
uint micro_time = duration % (1000 * 1000);
|
||||
|
||||
// at least sleep 1000 micro second
|
||||
my_sleep(micro_time > 1000 ? micro_time : 1000);
|
||||
my_sleep(MY_MAX(micro_time,1000));
|
||||
|
||||
/*
|
||||
If it sleep more than one second,
|
||||
|
|
|
@ -323,11 +323,11 @@ public:
|
|||
/// @return the current number of variables used in the parent contexts
|
||||
/// (from the root), including this context.
|
||||
uint current_var_count() const
|
||||
{ return m_var_offset + m_vars.elements(); }
|
||||
{ return m_var_offset + (uint)m_vars.elements(); }
|
||||
|
||||
/// @return the number of variables in this context alone.
|
||||
uint context_var_count() const
|
||||
{ return m_vars.elements(); }
|
||||
{ return (uint)m_vars.elements(); }
|
||||
|
||||
/// @return map index in this parsing context to runtime offset.
|
||||
uint var_context2runtime(uint i) const
|
||||
|
@ -476,10 +476,10 @@ public:
|
|||
const LEX_STRING *find_cursor(uint offset) const;
|
||||
|
||||
uint max_cursor_index() const
|
||||
{ return m_max_cursor_index + m_cursors.elements(); }
|
||||
{ return m_max_cursor_index + (uint)m_cursors.elements(); }
|
||||
|
||||
uint current_cursor_count() const
|
||||
{ return m_cursor_offset + m_cursors.elements(); }
|
||||
{ return m_cursor_offset + (uint)m_cursors.elements(); }
|
||||
|
||||
private:
|
||||
/// Constructor for a tree node.
|
||||
|
|
|
@ -12298,7 +12298,7 @@ static bool find_mpvio_user(MPVIO_EXT *mpvio)
|
|||
static bool
|
||||
read_client_connect_attrs(char **ptr, char *end, CHARSET_INFO *from_cs)
|
||||
{
|
||||
size_t length;
|
||||
ulonglong length;
|
||||
char *ptr_save= *ptr;
|
||||
|
||||
/* not enough bytes to hold the length */
|
||||
|
@ -12320,10 +12320,10 @@ read_client_connect_attrs(char **ptr, char *end, CHARSET_INFO *from_cs)
|
|||
return true;
|
||||
|
||||
#ifdef HAVE_PSI_THREAD_INTERFACE
|
||||
if (PSI_THREAD_CALL(set_thread_connect_attrs)(*ptr, length, from_cs) &&
|
||||
if (PSI_THREAD_CALL(set_thread_connect_attrs)(*ptr, (size_t)length, from_cs) &&
|
||||
current_thd->variables.log_warnings)
|
||||
sql_print_warning("Connection attributes of length %lu were truncated",
|
||||
(unsigned long) length);
|
||||
sql_print_warning("Connection attributes of length %llu were truncated",
|
||||
length);
|
||||
#endif
|
||||
return false;
|
||||
}
|
||||
|
@ -12580,7 +12580,7 @@ static ulong parse_client_handshake_packet(MPVIO_EXT *mpvio,
|
|||
|
||||
char *user= end;
|
||||
char *passwd= strend(user)+1;
|
||||
uint user_len= passwd - user - 1, db_len;
|
||||
uint user_len= (uint)(passwd - user - 1), db_len;
|
||||
char *db= passwd;
|
||||
char user_buff[USERNAME_LENGTH + 1]; // buffer to store user in utf8
|
||||
uint dummy_errors;
|
||||
|
@ -12595,15 +12595,22 @@ static ulong parse_client_handshake_packet(MPVIO_EXT *mpvio,
|
|||
Cast *passwd to an unsigned char, so that it doesn't extend the sign for
|
||||
*passwd > 127 and become 2**32-127+ after casting to uint.
|
||||
*/
|
||||
uint passwd_len;
|
||||
ulonglong len;
|
||||
size_t passwd_len;
|
||||
|
||||
if (!(thd->client_capabilities & CLIENT_SECURE_CONNECTION))
|
||||
passwd_len= strlen(passwd);
|
||||
len= strlen(passwd);
|
||||
else if (!(thd->client_capabilities & CLIENT_PLUGIN_AUTH_LENENC_CLIENT_DATA))
|
||||
passwd_len= (uchar)(*passwd++);
|
||||
len= (uchar)(*passwd++);
|
||||
else
|
||||
passwd_len= safe_net_field_length_ll((uchar**)&passwd,
|
||||
{
|
||||
len= safe_net_field_length_ll((uchar**)&passwd,
|
||||
net->read_pos + pkt_len - (uchar*)passwd);
|
||||
|
||||
if (len > pkt_len)
|
||||
return packet_error;
|
||||
}
|
||||
|
||||
passwd_len= (size_t)len;
|
||||
db= thd->client_capabilities & CLIENT_CONNECT_WITH_DB ?
|
||||
db + passwd_len + 1 : 0;
|
||||
|
||||
|
|
|
@ -62,15 +62,26 @@ static inline void mysql_audit_notify(THD *thd, uint event_class,
|
|||
#endif
|
||||
extern void mysql_audit_release(THD *thd);
|
||||
|
||||
static inline unsigned int strlen_uint(const char *s)
|
||||
{
|
||||
return (uint)strlen(s);
|
||||
}
|
||||
|
||||
static inline unsigned int safe_strlen_uint(const char *s)
|
||||
{
|
||||
return (uint)safe_strlen(s);
|
||||
}
|
||||
|
||||
#define MAX_USER_HOST_SIZE 512
|
||||
static inline uint make_user_name(THD *thd, char *buf)
|
||||
{
|
||||
const Security_context *sctx= thd->security_ctx;
|
||||
return strxnmov(buf, MAX_USER_HOST_SIZE,
|
||||
char *end= strxnmov(buf, MAX_USER_HOST_SIZE,
|
||||
sctx->priv_user[0] ? sctx->priv_user : "", "[",
|
||||
sctx->user ? sctx->user : "", "] @ ",
|
||||
sctx->host ? sctx->host : "", " [",
|
||||
sctx->ip ? sctx->ip : "", "]", NullS) - buf;
|
||||
sctx->ip ? sctx->ip : "", "]", NullS);
|
||||
return (uint)(end-buf);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -112,7 +123,7 @@ void mysql_audit_general_log(THD *thd, time_t time,
|
|||
event.general_thread_id= (unsigned long)thd->thread_id;
|
||||
event.general_charset= thd->variables.character_set_client;
|
||||
event.database= thd->db;
|
||||
event.database_length= thd->db_length;
|
||||
event.database_length= (unsigned int)thd->db_length;
|
||||
event.query_id= thd->query_id;
|
||||
}
|
||||
else
|
||||
|
@ -153,7 +164,7 @@ void mysql_audit_general(THD *thd, uint event_subtype,
|
|||
event.general_error_code= error_code;
|
||||
event.general_time= my_time(0);
|
||||
event.general_command= msg;
|
||||
event.general_command_length= safe_strlen(msg);
|
||||
event.general_command_length= safe_strlen_uint(msg);
|
||||
|
||||
if (thd)
|
||||
{
|
||||
|
@ -165,7 +176,7 @@ void mysql_audit_general(THD *thd, uint event_subtype,
|
|||
event.general_charset= thd->query_string.charset();
|
||||
event.general_rows= thd->get_stmt_da()->current_row_for_warning();
|
||||
event.database= thd->db;
|
||||
event.database_length= thd->db_length;
|
||||
event.database_length= (uint)thd->db_length;
|
||||
event.query_id= thd->query_id;
|
||||
}
|
||||
else
|
||||
|
@ -199,19 +210,19 @@ void mysql_audit_notify_connection_connect(THD *thd)
|
|||
thd->get_stmt_da()->sql_errno() : 0;
|
||||
event.thread_id= (unsigned long)thd->thread_id;
|
||||
event.user= sctx->user;
|
||||
event.user_length= safe_strlen(sctx->user);
|
||||
event.user_length= safe_strlen_uint(sctx->user);
|
||||
event.priv_user= sctx->priv_user;
|
||||
event.priv_user_length= strlen(sctx->priv_user);
|
||||
event.priv_user_length= strlen_uint(sctx->priv_user);
|
||||
event.external_user= sctx->external_user;
|
||||
event.external_user_length= safe_strlen(sctx->external_user);
|
||||
event.external_user_length= safe_strlen_uint(sctx->external_user);
|
||||
event.proxy_user= sctx->proxy_user;
|
||||
event.proxy_user_length= strlen(sctx->proxy_user);
|
||||
event.proxy_user_length= strlen_uint(sctx->proxy_user);
|
||||
event.host= sctx->host;
|
||||
event.host_length= safe_strlen(sctx->host);
|
||||
event.host_length= safe_strlen_uint(sctx->host);
|
||||
event.ip= sctx->ip;
|
||||
event.ip_length= safe_strlen(sctx->ip);
|
||||
event.ip_length= safe_strlen_uint(sctx->ip);
|
||||
event.database= thd->db;
|
||||
event.database_length= safe_strlen(thd->db);
|
||||
event.database_length= safe_strlen_uint(thd->db);
|
||||
|
||||
mysql_audit_notify(thd, MYSQL_AUDIT_CONNECTION_CLASS, &event);
|
||||
}
|
||||
|
@ -229,19 +240,19 @@ void mysql_audit_notify_connection_disconnect(THD *thd, int errcode)
|
|||
event.status= errcode;
|
||||
event.thread_id= (unsigned long)thd->thread_id;
|
||||
event.user= sctx->user;
|
||||
event.user_length= safe_strlen(sctx->user);
|
||||
event.user_length= safe_strlen_uint(sctx->user);
|
||||
event.priv_user= sctx->priv_user;
|
||||
event.priv_user_length= strlen(sctx->priv_user);
|
||||
event.priv_user_length= strlen_uint(sctx->priv_user);
|
||||
event.external_user= sctx->external_user;
|
||||
event.external_user_length= safe_strlen(sctx->external_user);
|
||||
event.external_user_length= safe_strlen_uint(sctx->external_user);
|
||||
event.proxy_user= sctx->proxy_user;
|
||||
event.proxy_user_length= strlen(sctx->proxy_user);
|
||||
event.proxy_user_length= strlen_uint(sctx->proxy_user);
|
||||
event.host= sctx->host;
|
||||
event.host_length= safe_strlen(sctx->host);
|
||||
event.host_length= safe_strlen_uint(sctx->host);
|
||||
event.ip= sctx->ip;
|
||||
event.ip_length= safe_strlen(sctx->ip) ;
|
||||
event.ip_length= safe_strlen_uint(sctx->ip) ;
|
||||
event.database= thd->db;
|
||||
event.database_length= safe_strlen(thd->db);
|
||||
event.database_length= safe_strlen_uint(thd->db);
|
||||
|
||||
mysql_audit_notify(thd, MYSQL_AUDIT_CONNECTION_CLASS, &event);
|
||||
}
|
||||
|
@ -260,19 +271,19 @@ void mysql_audit_notify_connection_change_user(THD *thd)
|
|||
thd->get_stmt_da()->sql_errno() : 0;
|
||||
event.thread_id= (unsigned long)thd->thread_id;
|
||||
event.user= sctx->user;
|
||||
event.user_length= safe_strlen(sctx->user);
|
||||
event.user_length= safe_strlen_uint(sctx->user);
|
||||
event.priv_user= sctx->priv_user;
|
||||
event.priv_user_length= strlen(sctx->priv_user);
|
||||
event.priv_user_length= strlen_uint(sctx->priv_user);
|
||||
event.external_user= sctx->external_user;
|
||||
event.external_user_length= safe_strlen(sctx->external_user);
|
||||
event.external_user_length= safe_strlen_uint(sctx->external_user);
|
||||
event.proxy_user= sctx->proxy_user;
|
||||
event.proxy_user_length= strlen(sctx->proxy_user);
|
||||
event.proxy_user_length= strlen_uint(sctx->proxy_user);
|
||||
event.host= sctx->host;
|
||||
event.host_length= safe_strlen(sctx->host);
|
||||
event.host_length= safe_strlen_uint(sctx->host);
|
||||
event.ip= sctx->ip;
|
||||
event.ip_length= safe_strlen(sctx->ip);
|
||||
event.ip_length= safe_strlen_uint(sctx->ip);
|
||||
event.database= thd->db;
|
||||
event.database_length= safe_strlen(thd->db);
|
||||
event.database_length= safe_strlen_uint(thd->db);
|
||||
|
||||
mysql_audit_notify(thd, MYSQL_AUDIT_CONNECTION_CLASS, &event);
|
||||
}
|
||||
|
@ -297,9 +308,9 @@ void mysql_audit_external_lock(THD *thd, TABLE_SHARE *share, int lock)
|
|||
event.host= sctx->host;
|
||||
event.ip= sctx->ip;
|
||||
event.database= share->db.str;
|
||||
event.database_length= share->db.length;
|
||||
event.database_length= (unsigned int)share->db.length;
|
||||
event.table= share->table_name.str;
|
||||
event.table_length= share->table_name.length;
|
||||
event.table_length= (unsigned int)share->table_name.length;
|
||||
event.new_database= 0;
|
||||
event.new_database_length= 0;
|
||||
event.new_table= 0;
|
||||
|
@ -331,9 +342,9 @@ void mysql_audit_create_table(TABLE *table)
|
|||
event.host= sctx->host;
|
||||
event.ip= sctx->ip;
|
||||
event.database= share->db.str;
|
||||
event.database_length= share->db.length;
|
||||
event.database_length= (unsigned int)share->db.length;
|
||||
event.table= share->table_name.str;
|
||||
event.table_length= share->table_name.length;
|
||||
event.table_length= (unsigned int)share->table_name.length;
|
||||
event.new_database= 0;
|
||||
event.new_database_length= 0;
|
||||
event.new_table= 0;
|
||||
|
@ -363,9 +374,9 @@ void mysql_audit_drop_table(THD *thd, TABLE_LIST *table)
|
|||
event.host= sctx->host;
|
||||
event.ip= sctx->ip;
|
||||
event.database= table->db;
|
||||
event.database_length= table->db_length;
|
||||
event.database_length= (unsigned int)table->db_length;
|
||||
event.table= table->table_name;
|
||||
event.table_length= table->table_name_length;
|
||||
event.table_length= (unsigned int)table->table_name_length;
|
||||
event.new_database= 0;
|
||||
event.new_database_length= 0;
|
||||
event.new_table= 0;
|
||||
|
@ -396,13 +407,13 @@ void mysql_audit_rename_table(THD *thd, const char *old_db, const char *old_tb,
|
|||
event.host= sctx->host;
|
||||
event.ip= sctx->ip;
|
||||
event.database= old_db;
|
||||
event.database_length= strlen(old_db);
|
||||
event.database_length= strlen_uint(old_db);
|
||||
event.table= old_tb;
|
||||
event.table_length= strlen(old_tb);
|
||||
event.table_length= strlen_uint(old_tb);
|
||||
event.new_database= new_db;
|
||||
event.new_database_length= strlen(new_db);
|
||||
event.new_database_length= strlen_uint(new_db);
|
||||
event.new_table= new_tb;
|
||||
event.new_table_length= strlen(new_tb);
|
||||
event.new_table_length= strlen_uint(new_tb);
|
||||
event.query_id= thd->query_id;
|
||||
|
||||
mysql_audit_notify(thd, MYSQL_AUDIT_TABLE_CLASS, &event);
|
||||
|
@ -428,9 +439,9 @@ void mysql_audit_alter_table(THD *thd, TABLE_LIST *table)
|
|||
event.host= sctx->host;
|
||||
event.ip= sctx->ip;
|
||||
event.database= table->db;
|
||||
event.database_length= table->db_length;
|
||||
event.database_length= (unsigned int)table->db_length;
|
||||
event.table= table->table_name;
|
||||
event.table_length= table->table_name_length;
|
||||
event.table_length= (unsigned int)table->table_name_length;
|
||||
event.new_database= 0;
|
||||
event.new_database_length= 0;
|
||||
event.new_table= 0;
|
||||
|
|
|
@ -24,8 +24,8 @@ int read_bootstrap_query(char *query, int *query_length,
|
|||
{
|
||||
char line_buffer[MAX_BOOTSTRAP_LINE_SIZE];
|
||||
const char *line;
|
||||
int len;
|
||||
int query_len= 0;
|
||||
size_t len;
|
||||
size_t query_len= 0;
|
||||
int fgets_error= 0;
|
||||
*error= 0;
|
||||
|
||||
|
|
|
@ -5235,9 +5235,9 @@ void THD::inc_status_sort_range()
|
|||
|
||||
void THD::inc_status_sort_rows(ha_rows count)
|
||||
{
|
||||
statistic_add(status_var.filesort_rows_, count, &LOCK_status);
|
||||
statistic_add(status_var.filesort_rows_, (ha_rows)count, &LOCK_status);
|
||||
#ifdef HAVE_PSI_STATEMENT_INTERFACE
|
||||
PSI_STATEMENT_CALL(inc_statement_sort_rows)(m_statement_psi, count);
|
||||
PSI_STATEMENT_CALL(inc_statement_sort_rows)(m_statement_psi, (ulong)count);
|
||||
#endif
|
||||
}
|
||||
|
||||
|
|
|
@ -3853,7 +3853,7 @@ public:
|
|||
mysql_mutex_unlock(&LOCK_thd_data);
|
||||
#ifdef HAVE_PSI_THREAD_INTERFACE
|
||||
if (result)
|
||||
PSI_THREAD_CALL(set_thread_db)(new_db, new_db_len);
|
||||
PSI_THREAD_CALL(set_thread_db)(new_db, (int) new_db_len);
|
||||
#endif
|
||||
return result;
|
||||
}
|
||||
|
@ -3878,7 +3878,7 @@ public:
|
|||
db_length= new_db_len;
|
||||
mysql_mutex_unlock(&LOCK_thd_data);
|
||||
#ifdef HAVE_PSI_THREAD_INTERFACE
|
||||
PSI_THREAD_CALL(set_thread_db)(new_db, new_db_len);
|
||||
PSI_THREAD_CALL(set_thread_db)(new_db, (int) new_db_len);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
|
|
@ -571,7 +571,10 @@ public:
|
|||
ErrConvString(const String *s)
|
||||
: ErrConv(), str(s->ptr()), len(s->length()), cs(s->charset()) {}
|
||||
const char *ptr() const
|
||||
{ return err_conv(err_buffer, sizeof(err_buffer), str, len, cs); }
|
||||
{
|
||||
DBUG_ASSERT(len < UINT_MAX32);
|
||||
return err_conv(err_buffer, (uint) sizeof(err_buffer), str, (uint) len, cs);
|
||||
}
|
||||
};
|
||||
|
||||
class ErrConvInteger : public ErrConv
|
||||
|
|
|
@ -695,7 +695,7 @@ void JOIN_CACHE::set_constants()
|
|||
pack_length_with_blob_ptrs= pack_length + blobs*sizeof(uchar *);
|
||||
min_buff_size= 0;
|
||||
min_records= 1;
|
||||
buff_size= MY_MAX(join->thd->variables.join_buff_size,
|
||||
buff_size= (size_t)MY_MAX(join->thd->variables.join_buff_size,
|
||||
get_min_join_buffer_size());
|
||||
size_of_rec_ofs= offset_size(buff_size);
|
||||
size_of_rec_len= blobs ? size_of_rec_ofs : offset_size(len);
|
||||
|
@ -840,7 +840,7 @@ ulong JOIN_CACHE::get_max_join_buffer_size(bool optimize_buff_size)
|
|||
len+= get_max_key_addon_space_per_record() + avg_aux_buffer_incr;
|
||||
space_per_record= len;
|
||||
|
||||
size_t limit_sz= join->thd->variables.join_buff_size;
|
||||
size_t limit_sz= (size_t)join->thd->variables.join_buff_size;
|
||||
if (join_tab->join_buffer_size_limit)
|
||||
set_if_smaller(limit_sz, join_tab->join_buffer_size_limit);
|
||||
if (!optimize_buff_size)
|
||||
|
@ -3828,7 +3828,7 @@ uint JOIN_TAB_SCAN_MRR::aux_buffer_incr(ulong recno)
|
|||
set_if_bigger(rec_per_key, 1);
|
||||
if (recno == 1)
|
||||
incr= ref->key_length + tab->file->ref_length;
|
||||
incr+= tab->file->stats.mrr_length_per_rec * rec_per_key;
|
||||
incr+= (uint)(tab->file->stats.mrr_length_per_rec * rec_per_key);
|
||||
return incr;
|
||||
}
|
||||
|
||||
|
|
|
@ -379,7 +379,7 @@ void Lex_input_stream::body_utf8_append(const char *ptr,
|
|||
if (m_cpp_utf8_processed_ptr >= ptr)
|
||||
return;
|
||||
|
||||
int bytes_to_copy= ptr - m_cpp_utf8_processed_ptr;
|
||||
size_t bytes_to_copy= ptr - m_cpp_utf8_processed_ptr;
|
||||
|
||||
memcpy(m_body_utf8_ptr, m_cpp_utf8_processed_ptr, bytes_to_copy);
|
||||
m_body_utf8_ptr += bytes_to_copy;
|
||||
|
|
|
@ -1482,7 +1482,7 @@ uint maria_multi_check(THD *thd, char *packet, uint packet_length)
|
|||
{
|
||||
char *packet_start= packet;
|
||||
size_t subpacket_length= net_field_length((uchar **)&packet_start);
|
||||
uint length_length= packet_start - packet;
|
||||
size_t length_length= packet_start - packet;
|
||||
// length of command + 3 bytes where that length was stored
|
||||
DBUG_PRINT("info", ("sub-packet length: %ld + %d command: %x",
|
||||
(ulong)subpacket_length, length_length,
|
||||
|
@ -1932,7 +1932,7 @@ bool dispatch_command(enum enum_server_command command, THD *thd,
|
|||
(The packet is guaranteed to end with an end zero)
|
||||
*/
|
||||
arg_end= strend(packet);
|
||||
uint arg_length= arg_end - packet;
|
||||
uint arg_length= (uint)(arg_end - packet);
|
||||
|
||||
/* Check given table name length. */
|
||||
if (packet_length - arg_length > NAME_LEN + 1 || arg_length > SAFE_NAME_LEN)
|
||||
|
@ -2262,7 +2262,7 @@ bool dispatch_command(enum enum_server_command command, THD *thd,
|
|||
char *packet_start= packet;
|
||||
/* We have to store next length because it will be destroyed by '\0' */
|
||||
size_t next_subpacket_length= net_field_length((uchar **)&packet_start);
|
||||
uint next_length_length= packet_start - packet;
|
||||
size_t next_length_length= packet_start - packet;
|
||||
unsigned char *readbuff= net->buff;
|
||||
|
||||
if (net_allocate_new_packet(net, thd, MYF(0)))
|
||||
|
@ -2277,7 +2277,7 @@ bool dispatch_command(enum enum_server_command command, THD *thd,
|
|||
{
|
||||
current_com++;
|
||||
size_t subpacket_length= next_subpacket_length + next_length_length;
|
||||
uint length_length= next_length_length;
|
||||
size_t length_length= next_length_length;
|
||||
if (subpacket_length < packet_length)
|
||||
{
|
||||
packet_start= packet + subpacket_length;
|
||||
|
@ -7645,7 +7645,7 @@ void create_select_for_variable(const char *var_name)
|
|||
if ((var= get_system_var(thd, OPT_SESSION, tmp, null_lex_str)))
|
||||
{
|
||||
end= strxmov(buff, "@@session.", var_name, NullS);
|
||||
var->set_name(thd, buff, end-buff, system_charset_info);
|
||||
var->set_name(thd, buff, (uint)(end-buff), system_charset_info);
|
||||
add_item_to_list(thd, var);
|
||||
}
|
||||
DBUG_VOID_RETURN;
|
||||
|
|
|
@ -3307,14 +3307,14 @@ uchar* sys_var_pluginvar::real_value_ptr(THD *thd, enum_var_type type)
|
|||
{
|
||||
switch (plugin_var->flags & PLUGIN_VAR_TYPEMASK) {
|
||||
case PLUGIN_VAR_BOOL:
|
||||
thd->sys_var_tmp.my_bool_value= option.def_value;
|
||||
thd->sys_var_tmp.my_bool_value= (my_bool)option.def_value;
|
||||
return (uchar*) &thd->sys_var_tmp.my_bool_value;
|
||||
case PLUGIN_VAR_INT:
|
||||
thd->sys_var_tmp.int_value= option.def_value;
|
||||
thd->sys_var_tmp.int_value= (int)option.def_value;
|
||||
return (uchar*) &thd->sys_var_tmp.int_value;
|
||||
case PLUGIN_VAR_LONG:
|
||||
case PLUGIN_VAR_ENUM:
|
||||
thd->sys_var_tmp.long_value= option.def_value;
|
||||
thd->sys_var_tmp.long_value= (long)option.def_value;
|
||||
return (uchar*) &thd->sys_var_tmp.long_value;
|
||||
case PLUGIN_VAR_LONGLONG:
|
||||
case PLUGIN_VAR_SET:
|
||||
|
|
|
@ -7807,7 +7807,7 @@ double table_cond_selectivity(JOIN *join, uint idx, JOIN_TAB *s,
|
|||
*/
|
||||
if (!is_hash_join_key_no(key))
|
||||
{
|
||||
table_map quick_key_map= (table_map(1) << table->quick_key_parts[key]) - 1;
|
||||
key_part_map quick_key_map= (key_part_map(1) << table->quick_key_parts[key]) - 1;
|
||||
if (table->quick_rows[key] &&
|
||||
!(quick_key_map & ~table->const_key_parts[key]))
|
||||
{
|
||||
|
|
|
@ -32,9 +32,9 @@
|
|||
** String functions
|
||||
*****************************************************************************/
|
||||
|
||||
bool String::real_alloc(uint32 length)
|
||||
bool String::real_alloc(size_t length)
|
||||
{
|
||||
uint32 arg_length= ALIGN_SIZE(length + 1);
|
||||
size_t arg_length= ALIGN_SIZE(length + 1);
|
||||
DBUG_ASSERT(arg_length > length);
|
||||
if (arg_length <= length)
|
||||
return TRUE; /* Overflow */
|
||||
|
@ -46,7 +46,8 @@ bool String::real_alloc(uint32 length)
|
|||
(thread_specific ?
|
||||
MY_THREAD_SPECIFIC : 0)))))
|
||||
return TRUE;
|
||||
Alloced_length=arg_length;
|
||||
DBUG_ASSERT(length < UINT_MAX32);
|
||||
Alloced_length=(uint32) arg_length;
|
||||
alloced=1;
|
||||
}
|
||||
Ptr[0]=0;
|
||||
|
@ -81,7 +82,7 @@ bool String::real_alloc(uint32 length)
|
|||
|
||||
@retval true An error occurred when attempting to allocate memory.
|
||||
*/
|
||||
bool String::realloc_raw(uint32 alloc_length)
|
||||
bool String::realloc_raw(size_t alloc_length)
|
||||
{
|
||||
if (Alloced_length <= alloc_length)
|
||||
{
|
||||
|
@ -113,7 +114,8 @@ bool String::realloc_raw(uint32 alloc_length)
|
|||
else
|
||||
return TRUE; // Signal error
|
||||
Ptr= new_ptr;
|
||||
Alloced_length= len;
|
||||
DBUG_ASSERT(len < UINT_MAX32);
|
||||
Alloced_length= (uint32)len;
|
||||
}
|
||||
return FALSE;
|
||||
}
|
||||
|
@ -140,7 +142,7 @@ bool String::set_real(double num,uint decimals, CHARSET_INFO *cs)
|
|||
if (decimals >= FLOATING_POINT_DECIMALS)
|
||||
{
|
||||
len= my_gcvt(num, MY_GCVT_ARG_DOUBLE, sizeof(buff) - 1, buff, NULL);
|
||||
return copy(buff, len, &my_charset_latin1, cs, &dummy_errors);
|
||||
return copy(buff, (uint)len, &my_charset_latin1, cs, &dummy_errors);
|
||||
}
|
||||
len= my_fcvt(num, decimals, buff, NULL);
|
||||
return copy(buff, (uint32) len, &my_charset_latin1, cs,
|
||||
|
@ -180,10 +182,11 @@ bool String::copy(const String &str)
|
|||
return FALSE;
|
||||
}
|
||||
|
||||
bool String::copy(const char *str,uint32 arg_length, CHARSET_INFO *cs)
|
||||
bool String::copy(const char *str,size_t arg_length, CHARSET_INFO *cs)
|
||||
{
|
||||
if (alloc(arg_length))
|
||||
return TRUE;
|
||||
DBUG_ASSERT(arg_length < UINT_MAX32);
|
||||
if ((str_length=arg_length))
|
||||
memcpy(Ptr,str,arg_length);
|
||||
Ptr[arg_length]=0;
|
||||
|
@ -440,8 +443,10 @@ bool String::append(const String &s)
|
|||
Append an ASCII string to the a string of the current character set
|
||||
*/
|
||||
|
||||
bool String::append(const char *s,uint32 arg_length)
|
||||
bool String::append(const char *s,size_t size)
|
||||
{
|
||||
DBUG_ASSERT(size <= UINT_MAX32);
|
||||
uint32 arg_length= (uint32) size;
|
||||
if (!arg_length)
|
||||
return FALSE;
|
||||
|
||||
|
@ -485,7 +490,7 @@ bool String::append_longlong(longlong val)
|
|||
if (realloc(str_length+MAX_BIGINT_WIDTH+2))
|
||||
return TRUE;
|
||||
char *end= (char*) longlong10_to_str(val, (char*) Ptr + str_length, -10);
|
||||
str_length= end - Ptr;
|
||||
str_length= (uint32)(end - Ptr);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
|
@ -495,7 +500,7 @@ bool String::append_ulonglong(ulonglong val)
|
|||
if (realloc(str_length+MAX_BIGINT_WIDTH+2))
|
||||
return TRUE;
|
||||
char *end= (char*) longlong10_to_str(val, (char*) Ptr + str_length, 10);
|
||||
str_length= end - Ptr;
|
||||
str_length= (uint32) (end - Ptr);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
|
@ -591,7 +596,7 @@ bool String::append_with_prefill(const char *s,uint32 arg_length,
|
|||
|
||||
uint32 String::numchars() const
|
||||
{
|
||||
return str_charset->cset->numchars(str_charset, Ptr, Ptr+str_length);
|
||||
return (uint32) str_charset->cset->numchars(str_charset, Ptr, Ptr+str_length);
|
||||
}
|
||||
|
||||
int String::charpos(longlong i,uint32 offset)
|
||||
|
@ -720,7 +725,7 @@ void String::qs_append(const char *str, uint32 len)
|
|||
void String::qs_append(double d)
|
||||
{
|
||||
char *buff = Ptr + str_length;
|
||||
str_length+= my_gcvt(d, MY_GCVT_ARG_DOUBLE, FLOATING_POINT_BUFFER - 1, buff,
|
||||
str_length+= (uint32) my_gcvt(d, MY_GCVT_ARG_DOUBLE, FLOATING_POINT_BUFFER - 1, buff,
|
||||
NULL);
|
||||
}
|
||||
|
||||
|
@ -1025,10 +1030,10 @@ String_copier::well_formed_copy(CHARSET_INFO *to_cs,
|
|||
my_charset_same(from_cs, to_cs))
|
||||
{
|
||||
m_cannot_convert_error_pos= NULL;
|
||||
return to_cs->cset->copy_fix(to_cs, to, to_length, from, from_length,
|
||||
return (uint) to_cs->cset->copy_fix(to_cs, to, to_length, from, from_length,
|
||||
nchars, this);
|
||||
}
|
||||
return my_convert_fix(to_cs, to, to_length, from_cs, from, from_length,
|
||||
return (uint) my_convert_fix(to_cs, to, to_length, from_cs, from, from_length,
|
||||
nchars, this, this);
|
||||
}
|
||||
|
||||
|
@ -1164,5 +1169,5 @@ uint convert_to_printable(char *to, size_t to_len,
|
|||
memcpy(dots, STRING_WITH_LEN("...\0"));
|
||||
else
|
||||
*t= '\0';
|
||||
return t - to;
|
||||
return (uint) (t - to);
|
||||
}
|
||||
|
|
|
@ -354,22 +354,22 @@ public:
|
|||
Ptr=0;
|
||||
str_length=0; /* Safety */
|
||||
}
|
||||
inline bool alloc(uint32 arg_length)
|
||||
inline bool alloc(size_t arg_length)
|
||||
{
|
||||
if (arg_length < Alloced_length)
|
||||
return 0;
|
||||
return real_alloc(arg_length);
|
||||
}
|
||||
bool real_alloc(uint32 arg_length); // Empties old string
|
||||
bool realloc_raw(uint32 arg_length);
|
||||
bool realloc(uint32 arg_length)
|
||||
bool real_alloc(size_t arg_length); // Empties old string
|
||||
bool realloc_raw(size_t arg_length);
|
||||
bool realloc(size_t arg_length)
|
||||
{
|
||||
if (realloc_raw(arg_length))
|
||||
return TRUE;
|
||||
Ptr[arg_length]=0; // This make other funcs shorter
|
||||
return FALSE;
|
||||
}
|
||||
bool realloc_with_extra(uint32 arg_length)
|
||||
bool realloc_with_extra(size_t arg_length)
|
||||
{
|
||||
if (extra_alloc < 4096)
|
||||
extra_alloc= extra_alloc*2+128;
|
||||
|
@ -378,7 +378,7 @@ public:
|
|||
Ptr[arg_length]=0; // This make other funcs shorter
|
||||
return FALSE;
|
||||
}
|
||||
bool realloc_with_extra_if_needed(uint32 arg_length)
|
||||
bool realloc_with_extra_if_needed(size_t arg_length)
|
||||
{
|
||||
if (arg_length < Alloced_length)
|
||||
{
|
||||
|
@ -388,7 +388,7 @@ public:
|
|||
return realloc_with_extra(arg_length);
|
||||
}
|
||||
// Shrink the buffer, but only if it is allocated on the heap.
|
||||
inline void shrink(uint32 arg_length)
|
||||
inline void shrink(size_t arg_length)
|
||||
{
|
||||
if (!is_alloced())
|
||||
return;
|
||||
|
@ -405,7 +405,7 @@ public:
|
|||
else
|
||||
{
|
||||
Ptr=new_ptr;
|
||||
Alloced_length=arg_length;
|
||||
Alloced_length=(uint32)arg_length;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -428,7 +428,7 @@ public:
|
|||
|
||||
bool copy(); // Alloc string if not alloced
|
||||
bool copy(const String &s); // Allocate new string
|
||||
bool copy(const char *s,uint32 arg_length, CHARSET_INFO *cs); // Allocate new string
|
||||
bool copy(const char *s,size_t arg_length, CHARSET_INFO *cs); // Allocate new string
|
||||
static bool needs_conversion(uint32 arg_length,
|
||||
CHARSET_INFO *cs_from, CHARSET_INFO *cs_to,
|
||||
uint32 *offset);
|
||||
|
@ -466,10 +466,10 @@ public:
|
|||
}
|
||||
bool append(const String &s);
|
||||
bool append(const char *s);
|
||||
bool append(const LEX_STRING *ls) { return append(ls->str, (uint32)ls->length); }
|
||||
bool append(const LEX_CSTRING *ls) { return append(ls->str, (uint32)ls->length); }
|
||||
bool append(const char *s, uint32 arg_length);
|
||||
bool append(const char *s, uint32 arg_length, CHARSET_INFO *cs);
|
||||
bool append(const LEX_STRING *ls) { return append(ls->str, (uint32) ls->length); }
|
||||
bool append(const LEX_CSTRING *ls) { return append(ls->str, (uint32) ls->length); }
|
||||
bool append(const char *s, size_t size);
|
||||
bool append(const char *s, uint arg_length, CHARSET_INFO *cs);
|
||||
bool append_ulonglong(ulonglong val);
|
||||
bool append_longlong(longlong val);
|
||||
bool append(IO_CACHE* file, uint32 arg_length);
|
||||
|
@ -552,10 +552,11 @@ public:
|
|||
float8store(Ptr + str_length, *d);
|
||||
str_length += 8;
|
||||
}
|
||||
void q_append(const char *data, uint32 data_len)
|
||||
void q_append(const char *data, size_t data_len)
|
||||
{
|
||||
memcpy(Ptr + str_length, data, data_len);
|
||||
str_length += data_len;
|
||||
DBUG_ASSERT(str_length <= UINT_MAX32 - data_len);
|
||||
str_length += (uint)data_len;
|
||||
}
|
||||
|
||||
void write_at_position(int position, uint32 value)
|
||||
|
@ -634,7 +635,9 @@ public:
|
|||
}
|
||||
bool append_for_single_quote(const char *st)
|
||||
{
|
||||
return append_for_single_quote(st, (uint)strlen(st));
|
||||
size_t len= strlen(st);
|
||||
DBUG_ASSERT(len < UINT_MAX32);
|
||||
return append_for_single_quote(st, (uint32) len);
|
||||
}
|
||||
|
||||
/* Swap two string objects. Efficient way to exchange data without memcpy. */
|
||||
|
@ -678,10 +681,11 @@ public:
|
|||
}
|
||||
void q_net_store_data(const uchar *from, size_t length)
|
||||
{
|
||||
DBUG_ASSERT(length < UINT_MAX32);
|
||||
DBUG_ASSERT(Alloced_length >= (str_length + length +
|
||||
net_length_size(length)));
|
||||
q_net_store_length(length);
|
||||
q_append((const char *)from, length);
|
||||
q_append((const char *)from, (uint32) length);
|
||||
}
|
||||
};
|
||||
|
||||
|
|
|
@ -194,7 +194,7 @@ inline bool parse_date_time_format(timestamp_type format_type,
|
|||
{
|
||||
return parse_date_time_format(format_type,
|
||||
date_time_format->format.str,
|
||||
date_time_format->format.length,
|
||||
(uint) date_time_format->format.length,
|
||||
date_time_format);
|
||||
}
|
||||
|
||||
|
|
|
@ -1733,7 +1733,7 @@ public:
|
|||
private:
|
||||
void move_cursor_if_possible()
|
||||
{
|
||||
int rows_difference= n_rows - n_rows_behind;
|
||||
longlong rows_difference= n_rows - n_rows_behind;
|
||||
if (rows_difference > 0) /* We still have to wait. */
|
||||
return;
|
||||
|
||||
|
|
|
@ -16547,7 +16547,7 @@ view_select:
|
|||
opt_with_clause query_expression_body_view view_check_option
|
||||
{
|
||||
LEX *lex= Lex;
|
||||
uint len= YYLIP->get_cpp_ptr() - lex->create_view_select.str;
|
||||
size_t len= YYLIP->get_cpp_ptr() - lex->create_view_select.str;
|
||||
uint not_used;
|
||||
void *create_view_select= thd->memdup(lex->create_view_select.str, len);
|
||||
lex->create_view_select.length= len;
|
||||
|
|
|
@ -2733,7 +2733,7 @@ static Sys_var_enum Sys_thread_handling(
|
|||
#ifdef HAVE_QUERY_CACHE
|
||||
static bool fix_query_cache_size(sys_var *self, THD *thd, enum_var_type type)
|
||||
{
|
||||
ulong new_cache_size= query_cache.resize(query_cache_size);
|
||||
ulong new_cache_size= query_cache.resize((ulong)query_cache_size);
|
||||
/*
|
||||
Note: query_cache_size is a global variable reflecting the
|
||||
requested cache size. See also query_cache_size_arg
|
||||
|
@ -4705,7 +4705,7 @@ static Sys_var_multi_source_ulonglong Sys_slave_skip_counter(
|
|||
static bool update_max_relay_log_size(sys_var *self, THD *thd, Master_info *mi)
|
||||
{
|
||||
mi->rli.max_relay_log_size= thd->variables.max_relay_log_size;
|
||||
mi->rli.relay_log.set_max_size(mi->rli.max_relay_log_size);
|
||||
mi->rli.relay_log.set_max_size((ulong)mi->rli.max_relay_log_size);
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -5330,7 +5330,7 @@ static Sys_var_ulong Sys_rowid_merge_buff_size(
|
|||
"rowid_merge_buff_size",
|
||||
"The size of the buffers used [NOT] IN evaluation via partial matching",
|
||||
SESSION_VAR(rowid_merge_buff_size), CMD_LINE(REQUIRED_ARG),
|
||||
VALID_RANGE(0, ((ulonglong)~(intptr)0)/2), DEFAULT(8*1024*1024),
|
||||
VALID_RANGE(0, LONG_MAX), DEFAULT(8*1024*1024),
|
||||
BLOCK_SIZE(1));
|
||||
|
||||
static Sys_var_mybool Sys_userstat(
|
||||
|
|
|
@ -234,25 +234,25 @@ typedef Sys_var_integer<long, GET_LONG, SHOW_SLONG> Sys_var_long;
|
|||
|
||||
template<> uchar *Sys_var_int::default_value_ptr(THD *thd)
|
||||
{
|
||||
thd->sys_var_tmp.int_value= option.def_value;
|
||||
thd->sys_var_tmp.int_value= (int)option.def_value;
|
||||
return (uchar*) &thd->sys_var_tmp.int_value;
|
||||
}
|
||||
|
||||
template<> uchar *Sys_var_uint::default_value_ptr(THD *thd)
|
||||
{
|
||||
thd->sys_var_tmp.uint_value= option.def_value;
|
||||
thd->sys_var_tmp.uint_value= (uint)option.def_value;
|
||||
return (uchar*) &thd->sys_var_tmp.uint_value;
|
||||
}
|
||||
|
||||
template<> uchar *Sys_var_long::default_value_ptr(THD *thd)
|
||||
{
|
||||
thd->sys_var_tmp.long_value= option.def_value;
|
||||
thd->sys_var_tmp.long_value= (long)option.def_value;
|
||||
return (uchar*) &thd->sys_var_tmp.long_value;
|
||||
}
|
||||
|
||||
template<> uchar *Sys_var_ulong::default_value_ptr(THD *thd)
|
||||
{
|
||||
thd->sys_var_tmp.ulong_value= option.def_value;
|
||||
thd->sys_var_tmp.ulong_value= (ulong)option.def_value;
|
||||
return (uchar*) &thd->sys_var_tmp.ulong_value;
|
||||
}
|
||||
|
||||
|
@ -369,7 +369,7 @@ public:
|
|||
uchar *global_value_ptr(THD *thd, const LEX_STRING *base)
|
||||
{ return valptr(thd, global_var(ulong)); }
|
||||
uchar *default_value_ptr(THD *thd)
|
||||
{ return valptr(thd, option.def_value); }
|
||||
{ return valptr(thd, (ulong)option.def_value); }
|
||||
};
|
||||
|
||||
/**
|
||||
|
@ -416,7 +416,7 @@ public:
|
|||
{ var->save_result.ulonglong_value= option.def_value; }
|
||||
uchar *default_value_ptr(THD *thd)
|
||||
{
|
||||
thd->sys_var_tmp.my_bool_value= option.def_value;
|
||||
thd->sys_var_tmp.my_bool_value=(my_bool) option.def_value;
|
||||
return (uchar*) &thd->sys_var_tmp.my_bool_value;
|
||||
}
|
||||
};
|
||||
|
|
|
@ -343,7 +343,7 @@ TABLE_SHARE *alloc_table_share(const char *db, const char *table_name,
|
|||
*/
|
||||
do
|
||||
{
|
||||
share->table_map_id= my_atomic_add64_explicit(&last_table_id, 1,
|
||||
share->table_map_id=(ulong) my_atomic_add64_explicit(&last_table_id, 1,
|
||||
MY_MEMORY_ORDER_RELAXED);
|
||||
} while (unlikely(share->table_map_id == ~0UL));
|
||||
}
|
||||
|
|
|
@ -1203,13 +1203,13 @@ int tdc_wait_for_old_version(THD *thd, const char *db, const char *table_name,
|
|||
|
||||
ulong tdc_refresh_version(void)
|
||||
{
|
||||
return my_atomic_load64_explicit(&tdc_version, MY_MEMORY_ORDER_RELAXED);
|
||||
return (ulong)my_atomic_load64_explicit(&tdc_version, MY_MEMORY_ORDER_RELAXED);
|
||||
}
|
||||
|
||||
|
||||
ulong tdc_increment_refresh_version(void)
|
||||
{
|
||||
ulong v= my_atomic_add64_explicit(&tdc_version, 1, MY_MEMORY_ORDER_RELAXED);
|
||||
ulong v= (ulong)my_atomic_add64_explicit(&tdc_version, 1, MY_MEMORY_ORDER_RELAXED);
|
||||
DBUG_PRINT("tcache", ("incremented global refresh_version to: %lu", v));
|
||||
return v + 1;
|
||||
}
|
||||
|
|
|
@ -55,6 +55,9 @@ typedef OVERLAPPED_ENTRY native_event;
|
|||
#error threadpool is not available on this platform
|
||||
#endif
|
||||
|
||||
#ifdef _MSC_VER
|
||||
#pragma warning (disable : 4312)
|
||||
#endif
|
||||
|
||||
static void io_poll_close(int fd)
|
||||
{
|
||||
|
@ -447,6 +450,7 @@ static void* native_event_get_userdata(native_event *event)
|
|||
|
||||
#elif defined(HAVE_IOCP)
|
||||
|
||||
|
||||
static int io_poll_create()
|
||||
{
|
||||
HANDLE h= CreateIoCompletionPort(INVALID_HANDLE_VALUE, 0, 0, 0);
|
||||
|
@ -504,7 +508,6 @@ static void* native_event_get_userdata(native_event *event)
|
|||
{
|
||||
return (void *)event->lpCompletionKey;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
|
@ -1483,7 +1486,7 @@ static int change_group(TP_connection_generic *c,
|
|||
thread_group_t *new_group)
|
||||
{
|
||||
int ret= 0;
|
||||
int fd= mysql_socket_getfd(c->thd->net.vio->mysql_socket);
|
||||
int fd= (int)mysql_socket_getfd(c->thd->net.vio->mysql_socket);
|
||||
|
||||
DBUG_ASSERT(c->thread_group == old_group);
|
||||
|
||||
|
@ -1511,7 +1514,7 @@ static int change_group(TP_connection_generic *c,
|
|||
|
||||
int TP_connection_generic::start_io()
|
||||
{
|
||||
int fd= mysql_socket_getfd(thd->net.vio->mysql_socket);
|
||||
int fd= (int)mysql_socket_getfd(thd->net.vio->mysql_socket);
|
||||
|
||||
#ifndef HAVE_IOCP
|
||||
/*
|
||||
|
|
|
@ -1095,7 +1095,7 @@ my_bool is_const_init(UDF_INIT *initid, UDF_ARGS *args, char *message)
|
|||
strmov(message, "IS_CONST accepts only one argument");
|
||||
return 1;
|
||||
}
|
||||
initid->ptr= (char*)((args->args[0] != NULL) ? 1UL : 0);
|
||||
initid->ptr= (char*)((args->args[0] != NULL) ? (size_t)1 : (size_t)0);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
|
@ -619,7 +619,7 @@ static bool pack_header(THD *thd, uchar *forminfo,
|
|||
ER_TOO_LONG_FIELD_COMMENT, field->field_name))
|
||||
DBUG_RETURN(1);
|
||||
|
||||
totlength+= field->length;
|
||||
totlength+= (size_t)field->length;
|
||||
com_length+= field->comment.length;
|
||||
/*
|
||||
We mark first TIMESTAMP field with NOW() in DEFAULT or ON UPDATE
|
||||
|
@ -949,7 +949,7 @@ static bool make_empty_rec(THD *thd, uchar *buff, uint table_options,
|
|||
/* regfield don't have to be deleted as it's allocated on THD::mem_root */
|
||||
Field *regfield= make_field(&share, thd->mem_root,
|
||||
buff+field->offset + data_offset,
|
||||
field->length,
|
||||
(uint32)field->length,
|
||||
null_pos + null_count / 8,
|
||||
null_count & 7,
|
||||
field->pack_flag,
|
||||
|
|
|
@ -409,7 +409,7 @@ unsigned int ha_archive::pack_row_v1(uchar *record)
|
|||
pos+= length;
|
||||
}
|
||||
}
|
||||
DBUG_RETURN(pos - record_buffer->buffer);
|
||||
DBUG_RETURN((int)(pos - record_buffer->buffer));
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
|
@ -1563,7 +1563,7 @@ static PCSZ MakeKey(PGLOBAL g, UDF_ARGS *args, int i)
|
|||
n = strlen(s);
|
||||
|
||||
if (IsJson(args, i))
|
||||
j = strchr(s, '_') - s + 1;
|
||||
j = (int)(strchr(s, '_') - s + 1);
|
||||
|
||||
if (j && n > j) {
|
||||
s += j;
|
||||
|
|
|
@ -534,7 +534,7 @@ void *PlugSubAlloc(PGLOBAL g, void *memp, size_t size)
|
|||
if (trace)
|
||||
htrc("PlugSubAlloc: %s\n", g->Message);
|
||||
|
||||
throw 1234;
|
||||
abort();
|
||||
} /* endif size OS32 code */
|
||||
|
||||
/*********************************************************************/
|
||||
|
|
|
@ -681,7 +681,7 @@ bool TDBMYSQL::MakeCommand(PGLOBAL g)
|
|||
strlwr(strcpy(name, Name)); // Not a keyword
|
||||
|
||||
if ((p = strstr(qrystr, name))) {
|
||||
Query->Set(Qrystr, p - qrystr);
|
||||
Query->Set(Qrystr, (uint)(p - qrystr));
|
||||
|
||||
if (qtd && *(p-1) == ' ') {
|
||||
Query->Append('`');
|
||||
|
|
|
@ -216,7 +216,7 @@ void ha_heap::update_key_stats()
|
|||
else
|
||||
{
|
||||
ha_rows hash_buckets= file->s->keydef[i].hash_buckets;
|
||||
ha_rows no_records= hash_buckets ? (file->s->records/hash_buckets) : 2;
|
||||
ulong no_records= hash_buckets ? (ulong)(file->s->records/hash_buckets) : 2;
|
||||
if (no_records < 2)
|
||||
no_records= 2;
|
||||
key->rec_per_key[key->user_defined_key_parts-1]= no_records;
|
||||
|
|
|
@ -163,6 +163,7 @@ IF(NOT TARGET innobase)
|
|||
RETURN()
|
||||
ENDIF()
|
||||
|
||||
INCLUDE(${MYSQL_CMAKE_SCRIPT_DIR}/compile_flags.cmake)
|
||||
# A GCC bug causes crash when compiling these files on ARM64 with -O1+
|
||||
# Compile them with -O0 as a workaround.
|
||||
IF(CMAKE_COMPILER_IS_GNUCXX AND CMAKE_SYSTEM_PROCESSOR MATCHES "aarch64")
|
||||
|
@ -170,7 +171,6 @@ IF(CMAKE_COMPILER_IS_GNUCXX AND CMAKE_SYSTEM_PROCESSOR MATCHES "aarch64")
|
|||
EXECUTE_PROCESS(COMMAND ${CMAKE_C_COMPILER} -dumpversion
|
||||
OUTPUT_VARIABLE GCC_VERSION)
|
||||
IF(GCC_VERSION VERSION_LESS 5.2)
|
||||
INCLUDE(${MYSQL_CMAKE_SCRIPT_DIR}/compile_flags.cmake)
|
||||
ADD_COMPILE_FLAGS(
|
||||
btr/btr0btr.cc
|
||||
btr/btr0cur.cc
|
||||
|
@ -180,5 +180,10 @@ IF(CMAKE_COMPILER_IS_GNUCXX AND CMAKE_SYSTEM_PROCESSOR MATCHES "aarch64")
|
|||
)
|
||||
ENDIF()
|
||||
ENDIF()
|
||||
IF(MSVC)
|
||||
# silence "switch statement contains 'default' but no 'case' label
|
||||
# on generated file.
|
||||
TARGET_COMPILE_OPTIONS(innobase PRIVATE "/wd4065")
|
||||
ENDIF()
|
||||
|
||||
ADD_SUBDIRECTORY(${CMAKE_SOURCE_DIR}/extra/mariabackup ${CMAKE_BINARY_DIR}/extra/mariabackup)
|
||||
|
|
|
@ -292,8 +292,8 @@ buf_read_ahead_random(
|
|||
node != NULL;
|
||||
node = UT_LIST_GET_NEXT(chain, node)) {
|
||||
|
||||
size += os_file_get_size(node->handle)
|
||||
/ page_size.physical();
|
||||
size += ulint(os_file_get_size(node->handle)
|
||||
/ page_size.physical());
|
||||
}
|
||||
|
||||
ut_ad(size == space->size);
|
||||
|
|
|
@ -1324,7 +1324,7 @@ fil_crypt_realloc_iops(
|
|||
if (10 * state->cnt_waited > state->batch) {
|
||||
/* if we waited more than 10% re-estimate max_iops */
|
||||
ulint avg_wait_time_us =
|
||||
state->sum_waited_us / state->cnt_waited;
|
||||
ulint(state->sum_waited_us / state->cnt_waited);
|
||||
|
||||
if (avg_wait_time_us == 0) {
|
||||
avg_wait_time_us = 1; // prevent division by zero
|
||||
|
@ -1669,7 +1669,7 @@ fil_crypt_get_page_throttle_func(
|
|||
|
||||
/* average page load */
|
||||
ulint add_sleeptime_ms = 0;
|
||||
ulint avg_wait_time_us = state->sum_waited_us / state->cnt_waited;
|
||||
ulint avg_wait_time_us =ulint(state->sum_waited_us / state->cnt_waited);
|
||||
ulint alloc_wait_us = 1000000 / state->allocated_iops;
|
||||
|
||||
if (avg_wait_time_us < alloc_wait_us) {
|
||||
|
|
|
@ -2181,7 +2181,7 @@ convert_error_code_to_mysql(
|
|||
bool comp = !!(flags & DICT_TF_COMPACT);
|
||||
ulint free_space = page_get_free_space_of_empty(comp) / 2;
|
||||
|
||||
if (free_space >= (comp ? COMPRESSED_REC_MAX_DATA_SIZE :
|
||||
if (free_space >= ulint(comp ? COMPRESSED_REC_MAX_DATA_SIZE :
|
||||
REDUNDANT_REC_MAX_DATA_SIZE)) {
|
||||
free_space = (comp ? COMPRESSED_REC_MAX_DATA_SIZE :
|
||||
REDUNDANT_REC_MAX_DATA_SIZE) - 1;
|
||||
|
@ -11850,7 +11850,7 @@ err_col:
|
|||
err = row_create_table_for_mysql(
|
||||
table, m_trx, false,
|
||||
(fil_encryption_t)options->encryption,
|
||||
options->encryption_key_id);
|
||||
(uint32_t)options->encryption_key_id);
|
||||
}
|
||||
|
||||
DBUG_EXECUTE_IF("ib_crash_during_create_for_encryption",
|
||||
|
@ -15472,7 +15472,7 @@ ha_innobase::update_table_comment(
|
|||
{
|
||||
uint length = (uint) strlen(comment);
|
||||
char* str=0;
|
||||
long flen;
|
||||
size_t flen;
|
||||
std::string fk_str;
|
||||
|
||||
/* We do not know if MySQL can call this function before calling
|
||||
|
@ -15500,9 +15500,7 @@ ha_innobase::update_table_comment(
|
|||
|
||||
flen = fk_str.length();
|
||||
|
||||
if (flen < 0) {
|
||||
flen = 0;
|
||||
} else if (length + flen + 3 > 64000) {
|
||||
if (length + flen + 3 > 64000) {
|
||||
flen = 64000 - 3 - length;
|
||||
}
|
||||
/* allocate buffer for the full string */
|
||||
|
@ -22139,8 +22137,8 @@ innobase_find_mysql_table_for_vc(
|
|||
char dbname[MAX_DATABASE_NAME_LEN + 1];
|
||||
char tbname[MAX_TABLE_NAME_LEN + 1];
|
||||
char* name = table->name.m_name;
|
||||
uint dbnamelen = dict_get_db_name_len(name);
|
||||
uint tbnamelen = strlen(name) - dbnamelen - 1;
|
||||
uint dbnamelen = (uint) dict_get_db_name_len(name);
|
||||
uint tbnamelen = (uint) strlen(name) - dbnamelen - 1;
|
||||
char t_dbname[MAX_DATABASE_NAME_LEN + 1];
|
||||
char t_tbname[MAX_TABLE_NAME_LEN + 1];
|
||||
|
||||
|
@ -22155,7 +22153,6 @@ innobase_find_mysql_table_for_vc(
|
|||
|
||||
if (is_part != NULL) {
|
||||
*is_part = '\0';
|
||||
tbnamelen = is_part - tbname;
|
||||
}
|
||||
|
||||
dbnamelen = filename_to_tablename(dbname, t_dbname,
|
||||
|
@ -22665,7 +22662,7 @@ innobase_convert_to_filename_charset(
|
|||
|
||||
return(static_cast<uint>(strconvert(
|
||||
cs_from, from, strlen(from),
|
||||
cs_to, to, static_cast<size_t>(len), &errors)));
|
||||
cs_to, to, static_cast<uint>(len), &errors)));
|
||||
}
|
||||
|
||||
/**********************************************************************
|
||||
|
@ -22684,7 +22681,7 @@ innobase_convert_to_system_charset(
|
|||
|
||||
return(static_cast<uint>(strconvert(
|
||||
cs1, from, strlen(from),
|
||||
cs2, to, static_cast<size_t>(len), errors)));
|
||||
cs2, to, static_cast<uint>(len), errors)));
|
||||
}
|
||||
|
||||
/**********************************************************************
|
||||
|
|
|
@ -326,7 +326,7 @@ my_error_innodb(
|
|||
bool comp = !!(flags & DICT_TF_COMPACT);
|
||||
ulint free_space = page_get_free_space_of_empty(comp) / 2;
|
||||
|
||||
if (free_space >= (comp ? COMPRESSED_REC_MAX_DATA_SIZE :
|
||||
if (free_space >= ulint(comp ? COMPRESSED_REC_MAX_DATA_SIZE :
|
||||
REDUNDANT_REC_MAX_DATA_SIZE)) {
|
||||
free_space = (comp ? COMPRESSED_REC_MAX_DATA_SIZE :
|
||||
REDUNDANT_REC_MAX_DATA_SIZE) - 1;
|
||||
|
|
|
@ -82,7 +82,7 @@ UNIV_INLINE
|
|||
const char*
|
||||
fil_get_compression_alg_name(
|
||||
/*=========================*/
|
||||
ulint comp_alg) /*!<in: compression algorithm number */
|
||||
ib_uint64_t comp_alg) /*!<in: compression algorithm number */
|
||||
{
|
||||
switch(comp_alg) {
|
||||
case PAGE_UNCOMPRESSED:
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue