Bug#29125 Windows Server X64: so many compiler warnings

- Remove bothersome warning messages.  This change focuses on the warnings 
that are covered by the ignore file: support-files/compiler_warnings.supp.
- Strings are guaranteed to be max uint in length
This commit is contained in:
Ignacio Galarza 2009-02-13 11:41:47 -05:00
commit 2d9421c3bb
94 changed files with 241 additions and 240 deletions

View File

@ -373,7 +373,7 @@ static void find_tool(char *tool_executable_name, const char *tool_name,
} }
else else
{ {
int len; size_t len;
/* /*
mysql_upgrade was run absolutely or relatively. We can find a sibling mysql_upgrade was run absolutely or relatively. We can find a sibling

View File

@ -837,7 +837,7 @@ static int execute_commands(MYSQL *mysql,int argc, char **argv)
bool old= (find_type(argv[0], &command_typelib, 2) == bool old= (find_type(argv[0], &command_typelib, 2) ==
ADMIN_OLD_PASSWORD); ADMIN_OLD_PASSWORD);
#ifdef __WIN__ #ifdef __WIN__
uint pw_len= strlen(pw); uint pw_len= (uint) strlen(pw);
if (pw_len > 1 && pw[0] == '\'' && pw[pw_len-1] == '\'') if (pw_len > 1 && pw[0] == '\'' && pw[pw_len-1] == '\'')
printf("Warning: single quotes were not trimmed from the password by" printf("Warning: single quotes were not trimmed from the password by"
" your command\nline client, as you might have expected.\n"); " your command\nline client, as you might have expected.\n");

View File

@ -128,7 +128,7 @@ static Exit_status safe_connect();
class Load_log_processor class Load_log_processor
{ {
char target_dir_name[FN_REFLEN]; char target_dir_name[FN_REFLEN];
int target_dir_name_len; size_t target_dir_name_len;
/* /*
When we see first event corresponding to some LOAD DATA statement in When we see first event corresponding to some LOAD DATA statement in
@ -285,9 +285,9 @@ public:
File prepare_new_file_for_old_format(Load_log_event *le, char *filename); File prepare_new_file_for_old_format(Load_log_event *le, char *filename);
Exit_status load_old_format_file(NET* net, const char *server_fname, Exit_status load_old_format_file(NET* net, const char *server_fname,
uint server_fname_len, File file); uint server_fname_len, File file);
Exit_status process_first_event(const char *bname, uint blen, Exit_status process_first_event(const char *bname, size_t blen,
const uchar *block, const uchar *block,
uint block_len, uint file_id, size_t block_len, uint file_id,
Create_file_log_event *ce); Create_file_log_event *ce);
}; };
@ -305,7 +305,7 @@ public:
File Load_log_processor::prepare_new_file_for_old_format(Load_log_event *le, File Load_log_processor::prepare_new_file_for_old_format(Load_log_event *le,
char *filename) char *filename)
{ {
uint len; size_t len;
char *tail; char *tail;
File file; File file;
@ -319,7 +319,7 @@ File Load_log_processor::prepare_new_file_for_old_format(Load_log_event *le,
return -1; return -1;
} }
le->set_fname_outside_temp_buf(filename,len+strlen(tail)); le->set_fname_outside_temp_buf(filename,len+(uint) strlen(tail));
return file; return file;
} }
@ -411,9 +411,9 @@ Exit_status Load_log_processor::load_old_format_file(NET* net,
@retval OK_CONTINUE No error, the program should continue. @retval OK_CONTINUE No error, the program should continue.
*/ */
Exit_status Load_log_processor::process_first_event(const char *bname, Exit_status Load_log_processor::process_first_event(const char *bname,
uint blen, size_t blen,
const uchar *block, const uchar *block,
uint block_len, size_t block_len,
uint file_id, uint file_id,
Create_file_log_event *ce) Create_file_log_event *ce)
{ {
@ -456,7 +456,7 @@ Exit_status Load_log_processor::process_first_event(const char *bname,
} }
if (ce) if (ce)
ce->set_fname_outside_temp_buf(fname, strlen(fname)); ce->set_fname_outside_temp_buf(fname, (uint) strlen(fname));
if (my_write(file, (uchar*)block, block_len, MYF(MY_WME|MY_NABP))) if (my_write(file, (uchar*)block, block_len, MYF(MY_WME|MY_NABP)))
{ {
@ -1189,7 +1189,7 @@ static my_time_t convert_str_to_timestamp(const char* str)
long dummy_my_timezone; long dummy_my_timezone;
my_bool dummy_in_dst_time_gap; my_bool dummy_in_dst_time_gap;
/* We require a total specification (date AND time) */ /* We require a total specification (date AND time) */
if (str_to_datetime(str, strlen(str), &l_time, 0, &was_cut) != if (str_to_datetime(str, (uint) strlen(str), &l_time, 0, &was_cut) !=
MYSQL_TIMESTAMP_DATETIME || was_cut) MYSQL_TIMESTAMP_DATETIME || was_cut)
{ {
error("Incorrect date and time argument: %s", str); error("Incorrect date and time argument: %s", str);

View File

@ -349,7 +349,7 @@ static int get_options(int *argc, char ***argv)
if (!what_to_do) if (!what_to_do)
{ {
int pnlen = strlen(my_progname); size_t pnlen= strlen(my_progname);
if (pnlen < 6) /* name too short */ if (pnlen < 6) /* name too short */
what_to_do = DO_CHECK; what_to_do = DO_CHECK;
@ -448,7 +448,8 @@ static int process_selected_tables(char *db, char **table_names, int tables)
space is for more readable output in logs and in case of error space is for more readable output in logs and in case of error
*/ */
char *table_names_comma_sep, *end; char *table_names_comma_sep, *end;
int i, tot_length = 0; size_t tot_length= 0;
int i= 0;
for (i = 0; i < tables; i++) for (i = 0; i < tables; i++)
tot_length+= fixed_name_length(*(table_names + i)) + 2; tot_length+= fixed_name_length(*(table_names + i)) + 2;
@ -464,7 +465,7 @@ static int process_selected_tables(char *db, char **table_names, int tables)
*end++= ','; *end++= ',';
} }
*--end = 0; *--end = 0;
handle_request_for_tables(table_names_comma_sep + 1, tot_length - 1); handle_request_for_tables(table_names_comma_sep + 1, (uint) (tot_length - 1));
my_free(table_names_comma_sep, MYF(0)); my_free(table_names_comma_sep, MYF(0));
} }
else else
@ -486,7 +487,7 @@ static uint fixed_name_length(const char *name)
else if (*p == '.') else if (*p == '.')
extra_length+= 2; extra_length+= 2;
} }
return (p - name) + extra_length; return (uint) ((p - name) + extra_length);
} }

View File

@ -802,7 +802,7 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)),
opt_set_charset= 0; opt_set_charset= 0;
opt_compatible_mode_str= argument; opt_compatible_mode_str= argument;
opt_compatible_mode= find_set(&compatible_mode_typelib, opt_compatible_mode= find_set(&compatible_mode_typelib,
argument, strlen(argument), argument, (uint) strlen(argument),
&err_ptr, &err_len); &err_ptr, &err_len);
if (err_len) if (err_len)
{ {

View File

@ -1929,7 +1929,7 @@ parse_option(const char *origin, option_string **stmt, char delm)
char *ptr= (char *)origin; char *ptr= (char *)origin;
option_string **sptr= stmt; option_string **sptr= stmt;
option_string *tmp; option_string *tmp;
uint length= strlen(origin); size_t length= strlen(origin);
uint count= 0; /* We know that there is always one */ uint count= 0; /* We know that there is always one */
for (tmp= *sptr= (option_string *)my_malloc(sizeof(option_string), for (tmp= *sptr= (option_string *)my_malloc(sizeof(option_string),

View File

@ -1316,7 +1316,7 @@ void log_msg(const char *fmt, ...)
void cat_file(DYNAMIC_STRING* ds, const char* filename) void cat_file(DYNAMIC_STRING* ds, const char* filename)
{ {
int fd; int fd;
uint len; size_t len;
char buff[512]; char buff[512];
if ((fd= my_open(filename, O_RDONLY, MYF(0))) < 0) if ((fd= my_open(filename, O_RDONLY, MYF(0))) < 0)
@ -1614,7 +1614,7 @@ int compare_files2(File fd, const char* filename2)
{ {
int error= RESULT_OK; int error= RESULT_OK;
File fd2; File fd2;
uint len, len2; size_t len, len2;
char buff[512], buff2[512]; char buff[512], buff2[512];
if ((fd2= my_open(filename2, O_RDONLY, MYF(0))) < 0) if ((fd2= my_open(filename2, O_RDONLY, MYF(0))) < 0)

View File

@ -468,7 +468,7 @@ bool String::append(const char *s,uint32 arg_length)
bool String::append(const char *s) bool String::append(const char *s)
{ {
return append(s, strlen(s)); return append(s, (uint) strlen(s));
} }

View File

@ -660,7 +660,7 @@ static ha_checksum checksum_format_specifier(const char* msg)
case 'u': case 'u':
case 'x': case 'x':
case 's': case 's':
chksum= my_checksum(chksum, start, p-start); chksum= my_checksum(chksum, start, (uint) (p - start));
start= 0; /* Not in format specifier anymore */ start= 0; /* Not in format specifier anymore */
break; break;

View File

@ -106,7 +106,7 @@ void input_buffer::add_size(uint i)
uint input_buffer::get_capacity() const uint input_buffer::get_capacity() const
{ {
return end_ - buffer_; return (uint) (end_ - buffer_);
} }
@ -223,7 +223,7 @@ uint output_buffer::get_size() const
uint output_buffer::get_capacity() const uint output_buffer::get_capacity() const
{ {
return end_ - buffer_; return (uint) (end_ - buffer_);
} }

View File

@ -78,7 +78,7 @@ typename A::pointer StdReallocate(A& a, T* p, typename A::size_type oldSize,
if (preserve) { if (preserve) {
A b = A(); A b = A();
typename A::pointer newPointer = b.allocate(newSize, 0); typename A::pointer newPointer = b.allocate(newSize, 0);
memcpy(newPointer, p, sizeof(T) * min(oldSize, newSize)); memcpy(newPointer, p, sizeof(T) * min((word32) oldSize, (word32) newSize));
a.deallocate(p, oldSize); a.deallocate(p, oldSize);
STL::swap(a, b); STL::swap(a, b);
return newPointer; return newPointer;

View File

@ -288,7 +288,7 @@ void AbstractGroup::SimultaneousMultiply(Integer *results, const Integer &base,
r = buckets[i][buckets[i].size()-1]; r = buckets[i][buckets[i].size()-1];
if (buckets[i].size() > 1) if (buckets[i].size() > 1)
{ {
for (int j = buckets[i].size()-2; j >= 1; j--) for (int j= (unsigned int) (buckets[i].size()) - 2; j >= 1; j--)
{ {
Accumulate(buckets[i][j], buckets[i][j+1]); Accumulate(buckets[i][j], buckets[i][j+1]);
Accumulate(r, buckets[i][j]); Accumulate(r, buckets[i][j]);

View File

@ -213,7 +213,7 @@ void PublicKey::AddToEnd(const byte* data, word32 len)
Signer::Signer(const byte* k, word32 kSz, const char* n, const byte* h) Signer::Signer(const byte* k, word32 kSz, const char* n, const byte* h)
: key_(k, kSz) : key_(k, kSz)
{ {
int sz = strlen(n); size_t sz = strlen(n);
memcpy(name_, n, sz); memcpy(name_, n, sz);
name_[sz] = 0; name_[sz] = 0;

View File

@ -64,6 +64,9 @@ functions */
#endif #endif
#ifndef __WIN32__ #ifndef __WIN32__
#define __WIN32__ #define __WIN32__
#define _INTEGRAL_MAX_BITS 32
#else
#define _INTEGRAL_MAX_BITS 64
#endif #endif
#endif /* _WIN64 */ #endif /* _WIN64 */
#ifndef __WIN__ #ifndef __WIN__

View File

@ -1617,7 +1617,7 @@ mysql_hex_string(char *to, const char *from, ulong length)
ulong STDCALL ulong STDCALL
mysql_escape_string(char *to,const char *from,ulong length) mysql_escape_string(char *to,const char *from,ulong length)
{ {
return escape_string_for_mysql(default_charset_info, to, 0, from, length); return (uint) escape_string_for_mysql(default_charset_info, to, 0, from, length);
} }
ulong STDCALL ulong STDCALL
@ -1625,8 +1625,8 @@ mysql_real_escape_string(MYSQL *mysql, char *to,const char *from,
ulong length) ulong length)
{ {
if (mysql->server_status & SERVER_STATUS_NO_BACKSLASH_ESCAPES) if (mysql->server_status & SERVER_STATUS_NO_BACKSLASH_ESCAPES)
return escape_quotes_for_mysql(mysql->charset, to, 0, from, length); return (uint) escape_quotes_for_mysql(mysql->charset, to, 0, from, length);
return escape_string_for_mysql(mysql->charset, to, 0, from, length); return (uint) escape_string_for_mysql(mysql->charset, to, 0, from, length);
} }
void STDCALL void STDCALL

View File

@ -371,7 +371,7 @@ void freeze_size(DYNAMIC_ARRAY *array)
int get_index_dynamic(DYNAMIC_ARRAY *array, uchar* element) int get_index_dynamic(DYNAMIC_ARRAY *array, uchar* element)
{ {
uint ret; size_t ret;
if (array->buffer > element) if (array->buffer > element)
return -1; return -1;

View File

@ -223,7 +223,7 @@ base64_decode(const char *src_base, size_t len,
The variable 'i' is set to 'len' when padding has been read, so it The variable 'i' is set to 'len' when padding has been read, so it
does not actually reflect the number of bytes read from 'src'. does not actually reflect the number of bytes read from 'src'.
*/ */
return i != len ? -1 : d - dst_base; return i != len ? -1 : (uint) (d - dst_base);
} }

View File

@ -328,7 +328,7 @@ static my_bool my_read_charset_file(const char *filename, myf myflags)
{ {
uchar *buf; uchar *buf;
int fd; int fd;
uint len, tmp_len; size_t len, tmp_len;
MY_STAT stat_info; MY_STAT stat_info;
if (!my_stat(filename, &stat_info, MYF(myflags)) || if (!my_stat(filename, &stat_info, MYF(myflags)) ||

View File

@ -36,7 +36,7 @@ ha_checksum my_checksum(ha_checksum crc, const uchar *pos, size_t length)
crc=((crc << 8) + *((uchar*) pos)) + (crc >> (8*sizeof(ha_checksum)-8)); crc=((crc << 8) + *((uchar*) pos)) + (crc >> (8*sizeof(ha_checksum)-8));
return crc; return crc;
#else #else
return (ha_checksum)crc32((uint)crc, pos, length); return (ha_checksum)crc32((uint)crc, pos, (uint)length);
#endif #endif
} }

View File

@ -182,7 +182,7 @@ int my_search_option_files(const char *conf_file, int *argc, char ***argv,
/* Handle --defaults-group-suffix= */ /* Handle --defaults-group-suffix= */
uint i; uint i;
const char **extra_groups; const char **extra_groups;
const uint instance_len= strlen(my_defaults_group_suffix); const size_t instance_len= strlen(my_defaults_group_suffix);
struct handle_option_ctx *ctx= (struct handle_option_ctx*) func_ctx; struct handle_option_ctx *ctx= (struct handle_option_ctx*) func_ctx;
char *ptr; char *ptr;
TYPELIB *group= ctx->group; TYPELIB *group= ctx->group;
@ -194,11 +194,11 @@ int my_search_option_files(const char *conf_file, int *argc, char ***argv,
for (i= 0; i < group->count; i++) for (i= 0; i < group->count; i++)
{ {
uint len; size_t len;
extra_groups[i]= group->type_names[i]; /** copy group */ extra_groups[i]= group->type_names[i]; /** copy group */
len= strlen(extra_groups[i]); len= strlen(extra_groups[i]);
if (!(ptr= alloc_root(ctx->alloc, len+instance_len+1))) if (!(ptr= alloc_root(ctx->alloc, (uint) (len+instance_len+1))))
goto err; goto err;
extra_groups[i+group->count]= ptr; extra_groups[i+group->count]= ptr;
@ -970,7 +970,7 @@ void print_defaults(const char *conf_file, const char **groups)
static int add_directory(MEM_ROOT *alloc, const char *dir, const char **dirs) static int add_directory(MEM_ROOT *alloc, const char *dir, const char **dirs)
{ {
char buf[FN_REFLEN]; char buf[FN_REFLEN];
uint len; size_t len;
char *p; char *p;
my_bool err __attribute__((unused)); my_bool err __attribute__((unused));
@ -1004,14 +1004,14 @@ static size_t my_get_system_windows_directory(char *buffer, size_t size)
"GetSystemWindowsDirectoryA"); "GetSystemWindowsDirectoryA");
if (func_ptr) if (func_ptr)
return func_ptr(buffer, size); return func_ptr(buffer, (uint) size);
/* /*
Windows NT 4.0 Terminal Server Edition: Windows NT 4.0 Terminal Server Edition:
To retrieve the shared Windows directory, call GetSystemDirectory and To retrieve the shared Windows directory, call GetSystemDirectory and
trim the "System32" element from the end of the returned path. trim the "System32" element from the end of the returned path.
*/ */
count= GetSystemDirectory(buffer, size); count= GetSystemDirectory(buffer, (uint) size);
if (count > 8 && stricmp(buffer+(count-8), "\\System32") == 0) if (count > 8 && stricmp(buffer+(count-8), "\\System32") == 0)
{ {
count-= 8; count-= 8;

View File

@ -68,11 +68,9 @@ int modify_defaults_file(const char *file_location, const char *option,
FILE *cnf_file; FILE *cnf_file;
MY_STAT file_stat; MY_STAT file_stat;
char linebuff[BUFF_SIZE], *src_ptr, *dst_ptr, *file_buffer; char linebuff[BUFF_SIZE], *src_ptr, *dst_ptr, *file_buffer;
size_t opt_len= 0, optval_len= 0, sect_len; size_t opt_len= 0, optval_len= 0, sect_len, new_opt_len, reserve_extended;
uint nr_newlines= 0, buffer_size; uint nr_newlines= 0, buffer_size;
my_bool in_section= FALSE, opt_applied= 0; my_bool in_section= FALSE, opt_applied= 0;
uint reserve_extended;
uint new_opt_len;
int reserve_occupied= 0; int reserve_occupied= 0;
DBUG_ENTER("modify_defaults_file"); DBUG_ENTER("modify_defaults_file");

View File

@ -157,14 +157,14 @@ my_hash_key(const HASH *hash, const uchar *record, size_t *length,
/* Calculate pos according to keys */ /* Calculate pos according to keys */
static uint my_hash_mask(uint hashnr, uint buffmax, uint maxlength) static uint my_hash_mask(size_t hashnr, size_t buffmax, size_t maxlength)
{ {
if ((hashnr & (buffmax-1)) < maxlength) return (hashnr & (buffmax-1)); if ((hashnr & (buffmax-1)) < maxlength) return (hashnr & (buffmax-1));
return (hashnr & ((buffmax >> 1) -1)); return (hashnr & ((buffmax >> 1) -1));
} }
static uint my_hash_rec_mask(const HASH *hash, HASH_LINK *pos, static uint my_hash_rec_mask(const HASH *hash, HASH_LINK *pos,
uint buffmax, uint maxlength) size_t buffmax, size_t maxlength)
{ {
size_t length; size_t length;
uchar *key= (uchar*) my_hash_key(hash, pos->data, &length, 0); uchar *key= (uchar*) my_hash_key(hash, pos->data, &length, 0);
@ -309,8 +309,7 @@ static int hashcmp(const HASH *hash, HASH_LINK *pos, const uchar *key,
my_bool my_hash_insert(HASH *info, const uchar *record) my_bool my_hash_insert(HASH *info, const uchar *record)
{ {
int flag; int flag;
size_t idx; size_t idx,halfbuff,hash_nr,first_index;
uint halfbuff,hash_nr,first_index;
uchar *ptr_to_rec,*ptr_to_rec2; uchar *ptr_to_rec,*ptr_to_rec2;
HASH_LINK *data,*empty,*gpos,*gpos2,*pos; HASH_LINK *data,*empty,*gpos,*gpos2,*pos;
@ -539,8 +538,8 @@ exit:
my_bool my_hash_update(HASH *hash, uchar *record, uchar *old_key, my_bool my_hash_update(HASH *hash, uchar *record, uchar *old_key,
size_t old_key_length) size_t old_key_length)
{ {
uint new_index,new_pos_index,blength,records,empty; uint new_index,new_pos_index,blength,records;
size_t idx; size_t idx,empty;
HASH_LINK org_link,*data,*previous,*pos; HASH_LINK org_link,*data,*previous,*pos;
DBUG_ENTER("my_hash_update"); DBUG_ENTER("my_hash_update");

View File

@ -2404,7 +2404,7 @@ static void read_block(KEY_CACHE *keycache,
BLOCK_LINK *block, uint read_length, BLOCK_LINK *block, uint read_length,
uint min_length, my_bool primary) uint min_length, my_bool primary)
{ {
uint got_length; size_t got_length;
/* On entry cache_lock is locked */ /* On entry cache_lock is locked */

View File

@ -47,7 +47,7 @@ my_bool init_tmpdir(MY_TMPDIR *tmpdir, const char *pathlist)
} }
do do
{ {
uint length; size_t length;
end=strcend(pathlist, DELIM); end=strcend(pathlist, DELIM);
strmake(buff, pathlist, (uint) (end-pathlist)); strmake(buff, pathlist, (uint) (end-pathlist));
length= cleanup_dirname(buff, buff); length= cleanup_dirname(buff, buff);

View File

@ -36,7 +36,7 @@ struct utimbuf {
int my_append(const char *from, const char *to, myf MyFlags) int my_append(const char *from, const char *to, myf MyFlags)
{ {
uint Count; size_t Count;
File from_file,to_file; File from_file,to_file;
uchar buff[IO_SIZE]; uchar buff[IO_SIZE];
DBUG_ENTER("my_append"); DBUG_ENTER("my_append");

View File

@ -67,7 +67,7 @@ uchar *my_compress_alloc(const uchar *packet, size_t *len, size_t *complen)
if (!(compbuf= (uchar *) my_malloc(*complen, MYF(MY_WME)))) if (!(compbuf= (uchar *) my_malloc(*complen, MYF(MY_WME))))
return 0; /* Not enough memory */ return 0; /* Not enough memory */
tmp_complen= *complen; tmp_complen= (uint) *complen;
res= compress((Bytef*) compbuf, &tmp_complen, (Bytef*) packet, (uLong) *len); res= compress((Bytef*) compbuf, &tmp_complen, (Bytef*) packet, (uLong) *len);
*complen= tmp_complen; *complen= tmp_complen;
@ -118,7 +118,7 @@ my_bool my_uncompress(uchar *packet, size_t len, size_t *complen)
if (!compbuf) if (!compbuf)
DBUG_RETURN(1); /* Not enough memory */ DBUG_RETURN(1); /* Not enough memory */
tmp_complen= *complen; tmp_complen= (uint) *complen;
error= uncompress((Bytef*) compbuf, &tmp_complen, (Bytef*) packet, error= uncompress((Bytef*) compbuf, &tmp_complen, (Bytef*) packet,
(uLong) len); (uLong) len);
*complen= tmp_complen; *complen= tmp_complen;

View File

@ -172,7 +172,7 @@ char* my_cgets(char *buffer, size_t clen, size_t* plen)
do do
{ {
clen= min(clen, (size_t) csbi.dwSize.X*csbi.dwSize.Y); clen= min(clen, (size_t) csbi.dwSize.X*csbi.dwSize.Y);
if (!ReadConsole((HANDLE)my_coninpfh, (LPVOID)buffer, clen - 1, &plen_res, if (!ReadConsole((HANDLE)my_coninpfh, (LPVOID)buffer, (DWORD) clen - 1, &plen_res,
NULL)) NULL))
{ {
result= NULL; result= NULL;

View File

@ -50,7 +50,7 @@ struct utimbuf {
int my_copy(const char *from, const char *to, myf MyFlags) int my_copy(const char *from, const char *to, myf MyFlags)
{ {
uint Count; size_t Count;
my_bool new_file_stat= 0; /* 1 if we could stat "to" */ my_bool new_file_stat= 0; /* 1 if we could stat "to" */
int create_flag; int create_flag;
File from_file,to_file; File from_file,to_file;

View File

@ -55,7 +55,7 @@ int my_getwd(char * buf, size_t size, myf MyFlags)
else else
{ {
#if defined(HAVE_GETCWD) #if defined(HAVE_GETCWD)
if (!getcwd(buf,size-2) && MyFlags & MY_WME) if (!getcwd(buf,(uint) (size-2)) && MyFlags & MY_WME)
{ {
my_errno=errno; my_errno=errno;
my_error(EE_GETWD,MYF(ME_BELL+ME_WAITTANG),errno); my_error(EE_GETWD,MYF(ME_BELL+ME_WAITTANG),errno);

View File

@ -59,7 +59,7 @@ size_t my_pread(File Filedes, uchar *Buffer, size_t Count, my_off_t offset,
pthread_mutex_lock(&my_file_info[Filedes].mutex); pthread_mutex_lock(&my_file_info[Filedes].mutex);
readbytes= (uint) -1; readbytes= (uint) -1;
error= (lseek(Filedes, offset, MY_SEEK_SET) == (my_off_t) -1 || error= (lseek(Filedes, offset, MY_SEEK_SET) == (my_off_t) -1 ||
(readbytes= read(Filedes, Buffer, Count)) != Count); (readbytes= read(Filedes, Buffer, (uint) Count)) != Count);
pthread_mutex_unlock(&my_file_info[Filedes].mutex); pthread_mutex_unlock(&my_file_info[Filedes].mutex);
#else #else
if ((error= ((readbytes= pread(Filedes, Buffer, Count, offset)) != Count))) if ((error= ((readbytes= pread(Filedes, Buffer, Count, offset)) != Count)))
@ -136,7 +136,7 @@ size_t my_pwrite(int Filedes, const uchar *Buffer, size_t Count,
writenbytes= (size_t) -1; writenbytes= (size_t) -1;
pthread_mutex_lock(&my_file_info[Filedes].mutex); pthread_mutex_lock(&my_file_info[Filedes].mutex);
error= (lseek(Filedes, offset, MY_SEEK_SET) != (my_off_t) -1 && error= (lseek(Filedes, offset, MY_SEEK_SET) != (my_off_t) -1 &&
(writenbytes = write(Filedes, Buffer, Count)) == Count); (writenbytes = write(Filedes, Buffer, (uint) Count)) == Count);
pthread_mutex_unlock(&my_file_info[Filedes].mutex); pthread_mutex_unlock(&my_file_info[Filedes].mutex);
if (error) if (error)
break; break;

View File

@ -23,7 +23,7 @@ size_t my_quick_read(File Filedes,uchar *Buffer,size_t Count,myf MyFlags)
{ {
size_t readbytes; size_t readbytes;
if ((readbytes = read(Filedes, Buffer, Count)) != Count) if ((readbytes = read(Filedes, Buffer, (uint) Count)) != Count)
{ {
#ifndef DBUG_OFF #ifndef DBUG_OFF
if ((readbytes == 0 || readbytes == (size_t) -1) && errno == EINTR) if ((readbytes == 0 || readbytes == (size_t) -1) && errno == EINTR)
@ -50,7 +50,7 @@ size_t my_quick_write(File Filedes,const uchar *Buffer,size_t Count)
#ifndef DBUG_OFF #ifndef DBUG_OFF
writtenbytes = writtenbytes =
#endif #endif
(size_t) write(Filedes,Buffer,Count)) != Count) (size_t) write(Filedes,Buffer, (uint) Count)) != Count)
{ {
#ifndef DBUG_OFF #ifndef DBUG_OFF
if ((writtenbytes == 0 || writtenbytes == (size_t) -1) && errno == EINTR) if ((writtenbytes == 0 || writtenbytes == (size_t) -1) && errno == EINTR)

View File

@ -44,7 +44,7 @@ size_t my_read(File Filedes, uchar *Buffer, size_t Count, myf MyFlags)
for (;;) for (;;)
{ {
errno= 0; /* Linux doesn't reset this */ errno= 0; /* Linux doesn't reset this */
if ((readbytes= read(Filedes, Buffer, Count)) != Count) if ((readbytes= read(Filedes, Buffer, (uint) Count)) != Count)
{ {
my_errno= errno ? errno : -1; my_errno= errno ? errno : -1;
DBUG_PRINT("warning",("Read only %d bytes off %lu from %d, errno: %d", DBUG_PRINT("warning",("Read only %d bytes off %lu from %d, errno: %d",

View File

@ -174,7 +174,7 @@ void *_mymalloc(size_t size, const char *filename, uint lineno, myf MyFlags)
data[size + 3]= MAGICEND3; data[size + 3]= MAGICEND3;
irem->filename= (char *) filename; irem->filename= (char *) filename;
irem->linenum= lineno; irem->linenum= lineno;
irem->datasize= size; irem->datasize= (uint32) size;
irem->prev= NULL; irem->prev= NULL;
/* Add this remember structure to the linked list */ /* Add this remember structure to the linked list */

View File

@ -25,7 +25,7 @@
my_bool init_dynamic_string(DYNAMIC_STRING *str, const char *init_str, my_bool init_dynamic_string(DYNAMIC_STRING *str, const char *init_str,
size_t init_alloc, size_t alloc_increment) size_t init_alloc, size_t alloc_increment)
{ {
uint length; size_t length;
DBUG_ENTER("init_dynamic_string"); DBUG_ENTER("init_dynamic_string");
if (!alloc_increment) if (!alloc_increment)
@ -100,7 +100,7 @@ my_bool dynstr_append_mem(DYNAMIC_STRING *str, const char *append,
char *new_ptr; char *new_ptr;
if (str->length+length >= str->max_length) if (str->length+length >= str->max_length)
{ {
uint new_length=(str->length+length+str->alloc_increment)/ size_t new_length=(str->length+length+str->alloc_increment)/
str->alloc_increment; str->alloc_increment;
new_length*=str->alloc_increment; new_length*=str->alloc_increment;
if (!(new_ptr=(char*) my_realloc(str->str,new_length,MYF(MY_WME)))) if (!(new_ptr=(char*) my_realloc(str->str,new_length,MYF(MY_WME))))
@ -160,12 +160,12 @@ my_bool dynstr_append_os_quoted(DYNAMIC_STRING *str, const char *append, ...)
/* Search for quote in each string and replace with escaped quote */ /* Search for quote in each string and replace with escaped quote */
while(*(next_pos= strcend(cur_pos, quote_str[0])) != '\0') while(*(next_pos= strcend(cur_pos, quote_str[0])) != '\0')
{ {
ret&= dynstr_append_mem(str, cur_pos, next_pos - cur_pos); ret&= dynstr_append_mem(str, cur_pos, (uint) (next_pos - cur_pos));
ret&= dynstr_append_mem(str ,"\\", 1); ret&= dynstr_append_mem(str ,"\\", 1);
ret&= dynstr_append_mem(str, quote_str, quote_len); ret&= dynstr_append_mem(str, quote_str, quote_len);
cur_pos= next_pos + 1; cur_pos= next_pos + 1;
} }
ret&= dynstr_append_mem(str, cur_pos, next_pos - cur_pos); ret&= dynstr_append_mem(str, cur_pos, (uint) (next_pos - cur_pos));
append= va_arg(dirty_text, char *); append= va_arg(dirty_text, char *);
} }
va_end(dirty_text); va_end(dirty_text);

View File

@ -100,7 +100,7 @@ err:
int Buffer::get_size() int Buffer::get_size()
{ {
return buffer_size; return (uint) buffer_size;
} }

View File

@ -163,7 +163,7 @@ static bool start_process(Instance_options *instance_options,
int cmdlen= 0; int cmdlen= 0;
for (int i= 0; instance_options->argv[i] != 0; i++) for (int i= 0; instance_options->argv[i] != 0; i++)
cmdlen+= strlen(instance_options->argv[i]) + 3; cmdlen+= (uint) strlen(instance_options->argv[i]) + 3;
cmdlen++; /* make room for the null */ cmdlen++; /* make room for the null */
char *cmdline= new char[cmdlen]; char *cmdline= new char[cmdlen];

View File

@ -103,7 +103,7 @@ const char *Options::Debug::config_str= "d:t:i:O,im.trace";
#endif #endif
static const char * const ANGEL_PID_FILE_SUFFIX= ".angel.pid"; static const char * const ANGEL_PID_FILE_SUFFIX= ".angel.pid";
static const int ANGEL_PID_FILE_SUFFIX_LEN= strlen(ANGEL_PID_FILE_SUFFIX); static const int ANGEL_PID_FILE_SUFFIX_LEN= (uint) strlen(ANGEL_PID_FILE_SUFFIX);
/* /*
List of options, accepted by the instance manager. List of options, accepted by the instance manager.

View File

@ -206,7 +206,7 @@ inline void get_word(const char **text, size_t *word_len,
break; break;
} }
*word_len= word_end - *text; *word_len= (uint) (word_end - *text);
} }
#endif /* INCLUDES_MYSQL_INSTANCE_MANAGER_PARSE_H */ #endif /* INCLUDES_MYSQL_INSTANCE_MANAGER_PARSE_H */

View File

@ -3183,7 +3183,7 @@ int STDCALL mysql_set_character_set(MYSQL *mysql, const char *cs_name)
if (mysql_get_server_version(mysql) < 40100) if (mysql_get_server_version(mysql) < 40100)
return 0; return 0;
sprintf(buff, "SET NAMES %s", cs_name); sprintf(buff, "SET NAMES %s", cs_name);
if (!mysql_real_query(mysql, buff, strlen(buff))) if (!mysql_real_query(mysql, buff, (uint) strlen(buff)))
{ {
mysql->charset= cs; mysql->charset= cs;
} }

View File

@ -44,8 +44,8 @@ void parse_user(const char *user_id_str, size_t user_id_len,
} }
else else
{ {
*user_name_len= p - user_id_str; *user_name_len= (uint) (p - user_id_str);
*host_name_len= user_id_len - *user_name_len - 1; *host_name_len= (uint) (user_id_len - *user_name_len - 1);
if (*user_name_len > USERNAME_LENGTH) if (*user_name_len > USERNAME_LENGTH)
*user_name_len= USERNAME_LENGTH; *user_name_len= USERNAME_LENGTH;

View File

@ -380,7 +380,7 @@ bool
Event_job_data::load_from_row(THD *thd, TABLE *table) Event_job_data::load_from_row(THD *thd, TABLE *table)
{ {
char *ptr; char *ptr;
uint len; size_t len;
LEX_STRING tz_name; LEX_STRING tz_name;
DBUG_ENTER("Event_job_data::load_from_row"); DBUG_ENTER("Event_job_data::load_from_row");
@ -580,7 +580,7 @@ bool
Event_timed::load_from_row(THD *thd, TABLE *table) Event_timed::load_from_row(THD *thd, TABLE *table)
{ {
char *ptr; char *ptr;
uint len; size_t len;
DBUG_ENTER("Event_timed::load_from_row"); DBUG_ENTER("Event_timed::load_from_row");

View File

@ -527,8 +527,8 @@ Event_parse_data::init_definer(THD *thd)
const char *definer_user= thd->lex->definer->user.str; const char *definer_user= thd->lex->definer->user.str;
const char *definer_host= thd->lex->definer->host.str; const char *definer_host= thd->lex->definer->host.str;
int definer_user_len= thd->lex->definer->user.length; size_t definer_user_len= thd->lex->definer->user.length;
int definer_host_len= thd->lex->definer->host.length; size_t definer_host_len= thd->lex->definer->host.length;
DBUG_PRINT("info",("init definer_user thd->mem_root: 0x%lx " DBUG_PRINT("info",("init definer_user thd->mem_root: 0x%lx "
"definer_user: 0x%lx", (long) thd->mem_root, "definer_user: 0x%lx", (long) thd->mem_root,

View File

@ -694,7 +694,7 @@ send_show_create_event(THD *thd, Event_timed *et, Protocol *protocol)
&sql_mode)) &sql_mode))
DBUG_RETURN(TRUE); DBUG_RETURN(TRUE);
field_list.push_back(new Item_empty_string("sql_mode", sql_mode.length)); field_list.push_back(new Item_empty_string("sql_mode", (uint) sql_mode.length));
tz_name= et->time_zone->get_name(); tz_name= et->time_zone->get_name();

View File

@ -204,7 +204,7 @@ void insert_symbols()
for (cur= symbols; i<array_elements(symbols); cur++, i++){ for (cur= symbols; i<array_elements(symbols); cur++, i++){
hash_lex_struct *root= hash_lex_struct *root=
get_hash_struct_by_len(&root_by_len,cur->length,&max_len); get_hash_struct_by_len(&root_by_len,cur->length,&max_len);
insert_into_hash(root,cur->name,0,i,0); insert_into_hash(root,cur->name,0,(uint) i,0);
} }
} }
@ -516,7 +516,7 @@ static SYMBOL *get_hash_symbol(const char *s,\n\
res= symbols+ires;\n\ res= symbols+ires;\n\
else\n\ else\n\
res= sql_functions-ires-1;\n\ res= sql_functions-ires-1;\n\
register uint count= cur_str-s;\n\ register uint count= (uint) (cur_str - s);\n\
return lex_casecmp(cur_str,res->name+count,len-count) ? 0 : res;\n\ return lex_casecmp(cur_str,res->name+count,len-count) ? 0 : res;\n\
}\n\ }\n\
\n\ \n\
@ -545,7 +545,7 @@ static SYMBOL *get_hash_symbol(const char *s,\n\
register int16 ires= (int16)(cur_struct>>16);\n\ register int16 ires= (int16)(cur_struct>>16);\n\
if (ires==array_elements(symbols)) return 0;\n\ if (ires==array_elements(symbols)) return 0;\n\
register SYMBOL *res= symbols+ires;\n\ register SYMBOL *res= symbols+ires;\n\
register uint count= cur_str-s;\n\ register uint count= (uint) (cur_str - s);\n\
return lex_casecmp(cur_str,res->name+count,len-count)!=0 ? 0 : res;\n\ return lex_casecmp(cur_str,res->name+count,len-count)!=0 ? 0 : res;\n\
}\n\ }\n\
\n\ \n\

View File

@ -1092,7 +1092,7 @@ inline void Item_sp_variable::make_field(Send_field *field)
if (name) if (name)
it->set_name(name, (uint) strlen(name), system_charset_info); it->set_name(name, (uint) strlen(name), system_charset_info);
else else
it->set_name(m_name.str, m_name.length, system_charset_info); it->set_name(m_name.str, (uint) m_name.length, system_charset_info);
it->make_field(field); it->make_field(field);
} }

View File

@ -2739,7 +2739,7 @@ longlong Item_func_find_in_set::val_int()
if (is_last_item && !is_separator) if (is_last_item && !is_separator)
str_end= substr_end; str_end= substr_end;
if (!my_strnncoll(cs, (const uchar *) str_begin, if (!my_strnncoll(cs, (const uchar *) str_begin,
str_end - str_begin, (uint) (str_end - str_begin),
find_str, find_str_len)) find_str, find_str_len))
return (longlong) position; return (longlong) position;
else else
@ -4825,7 +4825,7 @@ Item_func_get_system_var(sys_var *var_arg, enum_var_type var_type_arg,
component(*component_arg), cache_present(0) component(*component_arg), cache_present(0)
{ {
/* set_name() will allocate the name */ /* set_name() will allocate the name */
set_name(name_arg, name_len_arg, system_charset_info); set_name(name_arg, (uint) name_len_arg, system_charset_info);
} }

View File

@ -1830,17 +1830,17 @@ bool Item_func_user::init(const char *user, const char *host)
if (user) if (user)
{ {
CHARSET_INFO *cs= str_value.charset(); CHARSET_INFO *cs= str_value.charset();
uint res_length= (strlen(user)+strlen(host)+2) * cs->mbmaxlen; size_t res_length= (strlen(user)+strlen(host)+2) * cs->mbmaxlen;
if (str_value.alloc(res_length)) if (str_value.alloc((uint) res_length))
{ {
null_value=1; null_value=1;
return TRUE; return TRUE;
} }
res_length=cs->cset->snprintf(cs, (char*)str_value.ptr(), res_length, res_length=cs->cset->snprintf(cs, (char*)str_value.ptr(), (uint) res_length,
"%s@%s", user, host); "%s@%s", user, host);
str_value.length(res_length); str_value.length((uint) res_length);
str_value.mark_as_const(); str_value.mark_as_const();
} }
return FALSE; return FALSE;
@ -2544,7 +2544,7 @@ String *Item_func_rpad::val_str(String *str)
memcpy(to,ptr_pad,(size_t) pad_byte_length); memcpy(to,ptr_pad,(size_t) pad_byte_length);
to+= pad_byte_length; to+= pad_byte_length;
} }
res->length(to- (char*) res->ptr()); res->length((uint) (to- (char*) res->ptr()));
return (res); return (res);
err: err:
@ -2812,7 +2812,7 @@ String *Item_func_charset::val_str(String *str)
CHARSET_INFO *cs= args[0]->collation.collation; CHARSET_INFO *cs= args[0]->collation.collation;
null_value= 0; null_value= 0;
str->copy(cs->csname, strlen(cs->csname), str->copy(cs->csname, (uint) strlen(cs->csname),
&my_charset_latin1, collation.collation, &dummy_errors); &my_charset_latin1, collation.collation, &dummy_errors);
return str; return str;
} }
@ -2824,7 +2824,7 @@ String *Item_func_collation::val_str(String *str)
CHARSET_INFO *cs= args[0]->collation.collation; CHARSET_INFO *cs= args[0]->collation.collation;
null_value= 0; null_value= 0;
str->copy(cs->name, strlen(cs->name), str->copy(cs->name, (uint) strlen(cs->name),
&my_charset_latin1, collation.collation, &dummy_errors); &my_charset_latin1, collation.collation, &dummy_errors);
return str; return str;
} }

View File

@ -391,7 +391,7 @@ static bool extract_date_time(DATE_TIME_FORMAT *format,
if (tmp - val > 6) if (tmp - val > 6)
tmp= (char*) val + 6; tmp= (char*) val + 6;
l_time->second_part= (int) my_strtoll10(val, &tmp, &error); l_time->second_part= (int) my_strtoll10(val, &tmp, &error);
frac_part= 6 - (tmp - val); frac_part= 6 - (uint) (tmp - val);
if (frac_part > 0) if (frac_part > 0)
l_time->second_part*= (ulong) log_10_int[frac_part]; l_time->second_part*= (ulong) log_10_int[frac_part];
val= tmp; val= tmp;
@ -642,14 +642,14 @@ bool make_date_time(DATE_TIME_FORMAT *format, MYSQL_TIME *l_time,
if (!l_time->month) if (!l_time->month)
return 1; return 1;
str->append(locale->month_names->type_names[l_time->month-1], str->append(locale->month_names->type_names[l_time->month-1],
strlen(locale->month_names->type_names[l_time->month-1]), (uint) strlen(locale->month_names->type_names[l_time->month-1]),
system_charset_info); system_charset_info);
break; break;
case 'b': case 'b':
if (!l_time->month) if (!l_time->month)
return 1; return 1;
str->append(locale->ab_month_names->type_names[l_time->month-1], str->append(locale->ab_month_names->type_names[l_time->month-1],
strlen(locale->ab_month_names->type_names[l_time->month-1]), (uint) strlen(locale->ab_month_names->type_names[l_time->month-1]),
system_charset_info); system_charset_info);
break; break;
case 'W': case 'W':
@ -658,7 +658,7 @@ bool make_date_time(DATE_TIME_FORMAT *format, MYSQL_TIME *l_time,
weekday= calc_weekday(calc_daynr(l_time->year,l_time->month, weekday= calc_weekday(calc_daynr(l_time->year,l_time->month,
l_time->day),0); l_time->day),0);
str->append(locale->day_names->type_names[weekday], str->append(locale->day_names->type_names[weekday],
strlen(locale->day_names->type_names[weekday]), (uint) strlen(locale->day_names->type_names[weekday]),
system_charset_info); system_charset_info);
break; break;
case 'a': case 'a':
@ -667,13 +667,13 @@ bool make_date_time(DATE_TIME_FORMAT *format, MYSQL_TIME *l_time,
weekday=calc_weekday(calc_daynr(l_time->year,l_time->month, weekday=calc_weekday(calc_daynr(l_time->year,l_time->month,
l_time->day),0); l_time->day),0);
str->append(locale->ab_day_names->type_names[weekday], str->append(locale->ab_day_names->type_names[weekday],
strlen(locale->ab_day_names->type_names[weekday]), (uint) strlen(locale->ab_day_names->type_names[weekday]),
system_charset_info); system_charset_info);
break; break;
case 'D': case 'D':
if (type == MYSQL_TIMESTAMP_TIME) if (type == MYSQL_TIMESTAMP_TIME)
return 1; return 1;
length= int10_to_str(l_time->day, intbuff, 10) - intbuff; length= (uint) (int10_to_str(l_time->day, intbuff, 10) - intbuff);
str->append_with_prefill(intbuff, length, 1, '0'); str->append_with_prefill(intbuff, length, 1, '0');
if (l_time->day >= 10 && l_time->day <= 19) if (l_time->day >= 10 && l_time->day <= 19)
str->append(STRING_WITH_LEN("th")); str->append(STRING_WITH_LEN("th"));
@ -696,62 +696,62 @@ bool make_date_time(DATE_TIME_FORMAT *format, MYSQL_TIME *l_time,
} }
break; break;
case 'Y': case 'Y':
length= int10_to_str(l_time->year, intbuff, 10) - intbuff; length= (uint) (int10_to_str(l_time->year, intbuff, 10) - intbuff);
str->append_with_prefill(intbuff, length, 4, '0'); str->append_with_prefill(intbuff, length, 4, '0');
break; break;
case 'y': case 'y':
length= int10_to_str(l_time->year%100, intbuff, 10) - intbuff; length= (uint) (int10_to_str(l_time->year%100, intbuff, 10) - intbuff);
str->append_with_prefill(intbuff, length, 2, '0'); str->append_with_prefill(intbuff, length, 2, '0');
break; break;
case 'm': case 'm':
length= int10_to_str(l_time->month, intbuff, 10) - intbuff; length= (uint) (int10_to_str(l_time->month, intbuff, 10) - intbuff);
str->append_with_prefill(intbuff, length, 2, '0'); str->append_with_prefill(intbuff, length, 2, '0');
break; break;
case 'c': case 'c':
length= int10_to_str(l_time->month, intbuff, 10) - intbuff; length= (uint) (int10_to_str(l_time->month, intbuff, 10) - intbuff);
str->append_with_prefill(intbuff, length, 1, '0'); str->append_with_prefill(intbuff, length, 1, '0');
break; break;
case 'd': case 'd':
length= int10_to_str(l_time->day, intbuff, 10) - intbuff; length= (uint) (int10_to_str(l_time->day, intbuff, 10) - intbuff);
str->append_with_prefill(intbuff, length, 2, '0'); str->append_with_prefill(intbuff, length, 2, '0');
break; break;
case 'e': case 'e':
length= int10_to_str(l_time->day, intbuff, 10) - intbuff; length= (uint) (int10_to_str(l_time->day, intbuff, 10) - intbuff);
str->append_with_prefill(intbuff, length, 1, '0'); str->append_with_prefill(intbuff, length, 1, '0');
break; break;
case 'f': case 'f':
length= int10_to_str(l_time->second_part, intbuff, 10) - intbuff; length= (uint) (int10_to_str(l_time->second_part, intbuff, 10) - intbuff);
str->append_with_prefill(intbuff, length, 6, '0'); str->append_with_prefill(intbuff, length, 6, '0');
break; break;
case 'H': case 'H':
length= int10_to_str(l_time->hour, intbuff, 10) - intbuff; length= (uint) (int10_to_str(l_time->hour, intbuff, 10) - intbuff);
str->append_with_prefill(intbuff, length, 2, '0'); str->append_with_prefill(intbuff, length, 2, '0');
break; break;
case 'h': case 'h':
case 'I': case 'I':
hours_i= (l_time->hour%24 + 11)%12+1; hours_i= (l_time->hour%24 + 11)%12+1;
length= int10_to_str(hours_i, intbuff, 10) - intbuff; length= (uint) (int10_to_str(hours_i, intbuff, 10) - intbuff);
str->append_with_prefill(intbuff, length, 2, '0'); str->append_with_prefill(intbuff, length, 2, '0');
break; break;
case 'i': /* minutes */ case 'i': /* minutes */
length= int10_to_str(l_time->minute, intbuff, 10) - intbuff; length= (uint) (int10_to_str(l_time->minute, intbuff, 10) - intbuff);
str->append_with_prefill(intbuff, length, 2, '0'); str->append_with_prefill(intbuff, length, 2, '0');
break; break;
case 'j': case 'j':
if (type == MYSQL_TIMESTAMP_TIME) if (type == MYSQL_TIMESTAMP_TIME)
return 1; return 1;
length= int10_to_str(calc_daynr(l_time->year,l_time->month, length= (uint) (int10_to_str(calc_daynr(l_time->year,l_time->month,
l_time->day) - l_time->day) -
calc_daynr(l_time->year,1,1) + 1, intbuff, 10) - intbuff; calc_daynr(l_time->year,1,1) + 1, intbuff, 10) - intbuff);
str->append_with_prefill(intbuff, length, 3, '0'); str->append_with_prefill(intbuff, length, 3, '0');
break; break;
case 'k': case 'k':
length= int10_to_str(l_time->hour, intbuff, 10) - intbuff; length= (uint) (int10_to_str(l_time->hour, intbuff, 10) - intbuff);
str->append_with_prefill(intbuff, length, 1, '0'); str->append_with_prefill(intbuff, length, 1, '0');
break; break;
case 'l': case 'l':
hours_i= (l_time->hour%24 + 11)%12+1; hours_i= (l_time->hour%24 + 11)%12+1;
length= int10_to_str(hours_i, intbuff, 10) - intbuff; length= (uint) (int10_to_str(hours_i, intbuff, 10) - intbuff);
str->append_with_prefill(intbuff, length, 1, '0'); str->append_with_prefill(intbuff, length, 1, '0');
break; break;
case 'p': case 'p':
@ -770,7 +770,7 @@ bool make_date_time(DATE_TIME_FORMAT *format, MYSQL_TIME *l_time,
break; break;
case 'S': case 'S':
case 's': case 's':
length= int10_to_str(l_time->second, intbuff, 10) - intbuff; length= (uint) (int10_to_str(l_time->second, intbuff, 10) - intbuff);
str->append_with_prefill(intbuff, length, 2, '0'); str->append_with_prefill(intbuff, length, 2, '0');
break; break;
case 'T': case 'T':
@ -788,11 +788,11 @@ bool make_date_time(DATE_TIME_FORMAT *format, MYSQL_TIME *l_time,
uint year; uint year;
if (type == MYSQL_TIMESTAMP_TIME) if (type == MYSQL_TIMESTAMP_TIME)
return 1; return 1;
length= int10_to_str(calc_week(l_time, length= (uint) (int10_to_str(calc_week(l_time,
(*ptr) == 'U' ? (*ptr) == 'U' ?
WEEK_FIRST_WEEKDAY : WEEK_MONDAY_FIRST, WEEK_FIRST_WEEKDAY : WEEK_MONDAY_FIRST,
&year), &year),
intbuff, 10) - intbuff; intbuff, 10) - intbuff);
str->append_with_prefill(intbuff, length, 2, '0'); str->append_with_prefill(intbuff, length, 2, '0');
} }
break; break;
@ -802,12 +802,12 @@ bool make_date_time(DATE_TIME_FORMAT *format, MYSQL_TIME *l_time,
uint year; uint year;
if (type == MYSQL_TIMESTAMP_TIME) if (type == MYSQL_TIMESTAMP_TIME)
return 1; return 1;
length= int10_to_str(calc_week(l_time, length= (uint) (int10_to_str(calc_week(l_time,
((*ptr) == 'V' ? ((*ptr) == 'V' ?
(WEEK_YEAR | WEEK_FIRST_WEEKDAY) : (WEEK_YEAR | WEEK_FIRST_WEEKDAY) :
(WEEK_YEAR | WEEK_MONDAY_FIRST)), (WEEK_YEAR | WEEK_MONDAY_FIRST)),
&year), &year),
intbuff, 10) - intbuff; intbuff, 10) - intbuff);
str->append_with_prefill(intbuff, length, 2, '0'); str->append_with_prefill(intbuff, length, 2, '0');
} }
break; break;
@ -822,7 +822,7 @@ bool make_date_time(DATE_TIME_FORMAT *format, MYSQL_TIME *l_time,
WEEK_YEAR | WEEK_FIRST_WEEKDAY : WEEK_YEAR | WEEK_FIRST_WEEKDAY :
WEEK_YEAR | WEEK_MONDAY_FIRST), WEEK_YEAR | WEEK_MONDAY_FIRST),
&year); &year);
length= int10_to_str(year, intbuff, 10) - intbuff; length= (uint) (int10_to_str(year, intbuff, 10) - intbuff);
str->append_with_prefill(intbuff, length, 4, '0'); str->append_with_prefill(intbuff, length, 4, '0');
} }
break; break;
@ -831,7 +831,7 @@ bool make_date_time(DATE_TIME_FORMAT *format, MYSQL_TIME *l_time,
return 1; return 1;
weekday=calc_weekday(calc_daynr(l_time->year,l_time->month, weekday=calc_weekday(calc_daynr(l_time->year,l_time->month,
l_time->day),1); l_time->day),1);
length= int10_to_str(weekday, intbuff, 10) - intbuff; length= (uint) (int10_to_str(weekday, intbuff, 10) - intbuff);
str->append_with_prefill(intbuff, length, 1, '0'); str->append_with_prefill(intbuff, length, 1, '0');
break; break;
@ -881,7 +881,7 @@ static bool get_interval_info(const char *str,uint length,CHARSET_INFO *cs,
value= value*LL(10) + (longlong) (*str - '0'); value= value*LL(10) + (longlong) (*str - '0');
if (transform_msec && i == count - 1) // microseconds always last if (transform_msec && i == count - 1) // microseconds always last
{ {
long msec_length= 6 - (str - start); long msec_length= 6 - (uint) (str - start);
if (msec_length > 0) if (msec_length > 0)
value*= (long) log_10_int[msec_length]; value*= (long) log_10_int[msec_length];
} }
@ -1060,7 +1060,7 @@ String* Item_func_monthname::val_str(String* str)
} }
null_value=0; null_value=0;
month_name= locale->month_names->type_names[month-1]; month_name= locale->month_names->type_names[month-1];
str->copy(month_name, strlen(month_name), &my_charset_utf8_bin, str->copy(month_name, (uint) strlen(month_name), &my_charset_utf8_bin,
collation.collation, &err); collation.collation, &err);
return str; return str;
} }
@ -1210,7 +1210,7 @@ String* Item_func_dayname::val_str(String* str)
return (String*) 0; return (String*) 0;
day_name= locale->day_names->type_names[weekday]; day_name= locale->day_names->type_names[weekday];
str->copy(day_name, strlen(day_name), &my_charset_utf8_bin, str->copy(day_name, (uint) strlen(day_name), &my_charset_utf8_bin,
collation.collation, &err); collation.collation, &err);
return str; return str;
} }
@ -3176,14 +3176,14 @@ String *Item_func_get_format::val_str(String *str)
format++) format++)
{ {
uint format_name_len; uint format_name_len;
format_name_len= strlen(format_name); format_name_len= (uint) strlen(format_name);
if (val_len == format_name_len && if (val_len == format_name_len &&
!my_strnncoll(&my_charset_latin1, !my_strnncoll(&my_charset_latin1,
(const uchar *) val->ptr(), val_len, (const uchar *) val->ptr(), val_len,
(const uchar *) format_name, val_len)) (const uchar *) format_name, val_len))
{ {
const char *format_str= get_date_time_format_str(format, type); const char *format_str= get_date_time_format_str(format, type);
str->set(format_str, strlen(format_str), &my_charset_bin); str->set(format_str, (uint) strlen(format_str), &my_charset_bin);
return str; return str;
} }
} }

View File

@ -461,7 +461,7 @@ void mysql_unlock_read_tables(THD *thd, MYSQL_LOCK *sql_lock)
for (i= 0; i < sql_lock->table_count; i++) for (i= 0; i < sql_lock->table_count; i++)
{ {
TABLE *tbl= *table; TABLE *tbl= *table;
tbl->lock_position= table - sql_lock->table; tbl->lock_position= (uint) (table - sql_lock->table);
tbl->lock_data_start= found; tbl->lock_data_start= found;
found+= tbl->lock_count; found+= tbl->lock_count;
table++; table++;
@ -862,7 +862,7 @@ static MYSQL_LOCK *get_lock_data(THD *thd, TABLE **table_ptr, uint count,
{ {
my_error(ER_OPEN_AS_READONLY,MYF(0),table->alias); my_error(ER_OPEN_AS_READONLY,MYF(0),table->alias);
/* Clear the lock type of the lock data that are stored already. */ /* Clear the lock type of the lock data that are stored already. */
sql_lock->lock_count= locks - sql_lock->locks; sql_lock->lock_count= (uint) (locks - sql_lock->locks);
reset_lock_data(sql_lock); reset_lock_data(sql_lock);
my_free((uchar*) sql_lock,MYF(0)); my_free((uchar*) sql_lock,MYF(0));
DBUG_RETURN(0); DBUG_RETURN(0);

View File

@ -1280,7 +1280,7 @@ void Log_event::print_header(IO_CACHE* file,
char emit_buf[256]; // Enough for storing one line char emit_buf[256]; // Enough for storing one line
my_b_printf(file, "# Position Timestamp Type Master ID " my_b_printf(file, "# Position Timestamp Type Master ID "
"Size Master Pos Flags \n"); "Size Master Pos Flags \n");
int const bytes_written= size_t const bytes_written=
my_snprintf(emit_buf, sizeof(emit_buf), my_snprintf(emit_buf, sizeof(emit_buf),
"# %8.8lx %02x %02x %02x %02x %02x " "# %8.8lx %02x %02x %02x %02x %02x "
"%02x %02x %02x %02x %02x %02x %02x %02x " "%02x %02x %02x %02x %02x %02x %02x %02x "
@ -1315,7 +1315,7 @@ void Log_event::print_header(IO_CACHE* file,
TODO: Rewrite my_b_printf() to support full printf() syntax. TODO: Rewrite my_b_printf() to support full printf() syntax.
*/ */
char emit_buf[256]; char emit_buf[256];
int const bytes_written= size_t const bytes_written=
my_snprintf(emit_buf, sizeof(emit_buf), my_snprintf(emit_buf, sizeof(emit_buf),
"# %8.8lx %-48.48s |%16s|\n", "# %8.8lx %-48.48s |%16s|\n",
(unsigned long) (hexdump_from + (i & 0xfffffff0)), (unsigned long) (hexdump_from + (i & 0xfffffff0)),
@ -1335,7 +1335,7 @@ void Log_event::print_header(IO_CACHE* file,
if (hex_string[0]) if (hex_string[0])
{ {
char emit_buf[256]; char emit_buf[256];
int const bytes_written= size_t const bytes_written=
my_snprintf(emit_buf, sizeof(emit_buf), my_snprintf(emit_buf, sizeof(emit_buf),
"# %8.8lx %-48.48s |%s|\n", "# %8.8lx %-48.48s |%s|\n",
(unsigned long) (hexdump_from + (i & 0xfffffff0)), (unsigned long) (hexdump_from + (i & 0xfffffff0)),
@ -1628,7 +1628,7 @@ beg:
case MYSQL_TYPE_DATETIME: case MYSQL_TYPE_DATETIME:
{ {
uint d, t; size_t d, t;
uint64 i64= uint8korr(ptr); /* YYYYMMDDhhmmss */ uint64 i64= uint8korr(ptr); /* YYYYMMDDhhmmss */
d= i64 / 1000000; d= i64 / 1000000;
t= i64 % 1000000; t= i64 % 1000000;
@ -4198,7 +4198,7 @@ int Load_log_event::copy_log_event(const char *buf, ulong event_len,
table_name = fields + field_block_len; table_name = fields + field_block_len;
db = table_name + table_name_len + 1; db = table_name + table_name_len + 1;
fname = db + db_len + 1; fname = db + db_len + 1;
fname_len = strlen(fname); fname_len = (uint) strlen(fname);
// null termination is accomplished by the caller doing buf[event_len]=0 // null termination is accomplished by the caller doing buf[event_len]=0
DBUG_RETURN(0); DBUG_RETURN(0);
@ -5697,7 +5697,7 @@ void Slave_log_event::init_from_mem_pool(int data_size)
master_pos = uint8korr(mem_pool + SL_MASTER_POS_OFFSET); master_pos = uint8korr(mem_pool + SL_MASTER_POS_OFFSET);
master_port = uint2korr(mem_pool + SL_MASTER_PORT_OFFSET); master_port = uint2korr(mem_pool + SL_MASTER_PORT_OFFSET);
master_host = mem_pool + SL_MASTER_HOST_OFFSET; master_host = mem_pool + SL_MASTER_HOST_OFFSET;
master_host_len = strlen(master_host); master_host_len = (uint) strlen(master_host);
// safety // safety
master_log = master_host + master_host_len + 1; master_log = master_host + master_host_len + 1;
if (master_log > mem_pool + data_size) if (master_log > mem_pool + data_size)
@ -5705,7 +5705,7 @@ void Slave_log_event::init_from_mem_pool(int data_size)
master_host = 0; master_host = 0;
return; return;
} }
master_log_len = strlen(master_log); master_log_len = (uint) strlen(master_log);
} }
@ -6995,12 +6995,12 @@ int Rows_log_event::get_data_size()
(m_rows_cur - m_rows_buf);); (m_rows_cur - m_rows_buf););
int data_size= ROWS_HEADER_LEN; int data_size= ROWS_HEADER_LEN;
data_size+= no_bytes_in_map(&m_cols); data_size+= no_bytes_in_map(&m_cols);
data_size+= end - buf; data_size+= (uint) (end - buf);
if (type_code == UPDATE_ROWS_EVENT) if (type_code == UPDATE_ROWS_EVENT)
data_size+= no_bytes_in_map(&m_cols_ai); data_size+= no_bytes_in_map(&m_cols_ai);
data_size+= (m_rows_cur - m_rows_buf); data_size+= (uint) (m_rows_cur - m_rows_buf);
return data_size; return data_size;
} }
@ -7893,7 +7893,7 @@ Table_map_log_event::Table_map_log_event(const char *buf, uint event_len,
memcpy(m_coltype, ptr_after_colcnt, m_colcnt); memcpy(m_coltype, ptr_after_colcnt, m_colcnt);
ptr_after_colcnt= ptr_after_colcnt + m_colcnt; ptr_after_colcnt= ptr_after_colcnt + m_colcnt;
bytes_read= ptr_after_colcnt - (uchar *)buf; bytes_read= (uint) (ptr_after_colcnt - (uchar *)buf);
DBUG_PRINT("info", ("Bytes read: %d.\n", bytes_read)); DBUG_PRINT("info", ("Bytes read: %d.\n", bytes_read));
if (bytes_read < event_len) if (bytes_read < event_len)
{ {
@ -9268,7 +9268,7 @@ bool
Incident_log_event::write_data_body(IO_CACHE *file) Incident_log_event::write_data_body(IO_CACHE *file)
{ {
DBUG_ENTER("Incident_log_event::write_data_body"); DBUG_ENTER("Incident_log_event::write_data_body");
DBUG_RETURN(write_str(file, m_message.str, m_message.length)); DBUG_RETURN(write_str(file, m_message.str, (uint) m_message.length));
} }

View File

@ -3314,7 +3314,7 @@ public:
virtual Log_event_type get_type_code() { return TABLE_MAP_EVENT; } virtual Log_event_type get_type_code() { return TABLE_MAP_EVENT; }
virtual bool is_valid() const { return m_memory != NULL; /* we check malloc */ } virtual bool is_valid() const { return m_memory != NULL; /* we check malloc */ }
virtual int get_data_size() { return m_data_size; } virtual int get_data_size() { return (uint) m_data_size; }
#ifndef MYSQL_CLIENT #ifndef MYSQL_CLIENT
virtual int save_field_metadata(); virtual int save_field_metadata();
virtual bool write_data_header(IO_CACHE *file); virtual bool write_data_header(IO_CACHE *file);
@ -3897,7 +3897,7 @@ public:
return m_incident > INCIDENT_NONE && m_incident < INCIDENT_COUNT; return m_incident > INCIDENT_NONE && m_incident < INCIDENT_COUNT;
} }
virtual int get_data_size() { virtual int get_data_size() {
return INCIDENT_HEADER_LEN + 1 + m_message.length; return INCIDENT_HEADER_LEN + 1 + (uint) m_message.length;
} }
private: private:

View File

@ -1382,9 +1382,9 @@ int Old_rows_log_event::get_data_size()
(m_rows_cur - m_rows_buf);); (m_rows_cur - m_rows_buf););
int data_size= ROWS_HEADER_LEN; int data_size= ROWS_HEADER_LEN;
data_size+= no_bytes_in_map(&m_cols); data_size+= no_bytes_in_map(&m_cols);
data_size+= end - buf; data_size+= (uint) (end - buf);
data_size+= (m_rows_cur - m_rows_buf); data_size+= (uint) (m_rows_cur - m_rows_buf);
return data_size; return data_size;
} }

View File

@ -249,7 +249,7 @@ static int net_data_is_ready(my_socket sd)
tv.tv_sec= tv.tv_usec= 0; tv.tv_sec= tv.tv_usec= 0;
if ((res= select(sd+1, &sfds, NULL, NULL, &tv)) < 0) if ((res= select((int) (sd + 1), &sfds, NULL, NULL, &tv)) < 0)
return 0; return 0;
else else
return test(res ? FD_ISSET(sd, &sfds) : 0); return test(res ? FD_ISSET(sd, &sfds) : 0);
@ -429,7 +429,7 @@ net_write_command(NET *net,uchar command,
const uchar *header, size_t head_len, const uchar *header, size_t head_len,
const uchar *packet, size_t len) const uchar *packet, size_t len)
{ {
ulong length=len+1+head_len; /* 1 extra byte for command */ size_t length=len+1+head_len; /* 1 extra byte for command */
uchar buff[NET_HEADER_SIZE+1]; uchar buff[NET_HEADER_SIZE+1];
uint header_size=NET_HEADER_SIZE+1; uint header_size=NET_HEADER_SIZE+1;
DBUG_ENTER("net_write_command"); DBUG_ENTER("net_write_command");
@ -495,7 +495,7 @@ net_write_buff(NET *net, const uchar *packet, ulong len)
{ {
ulong left_length; ulong left_length;
if (net->compress && net->max_packet > MAX_PACKET_LENGTH) if (net->compress && net->max_packet > MAX_PACKET_LENGTH)
left_length= MAX_PACKET_LENGTH - (net->write_pos - net->buff); left_length= (ulong) (MAX_PACKET_LENGTH - (net->write_pos - net->buff));
else else
left_length= (ulong) (net->buff_end - net->write_pos); left_length= (ulong) (net->buff_end - net->write_pos);

View File

@ -367,7 +367,7 @@ public:
char *name(uint *lenp = 0) const char *name(uint *lenp = 0) const
{ {
if (lenp) if (lenp)
*lenp= m_name.length; *lenp= (uint) m_name.length;
return m_name.str; return m_name.str;
} }

View File

@ -281,7 +281,7 @@ public:
uint32 len, String *res); uint32 len, String *res);
int as_wkt(String *wkt, const char **end) int as_wkt(String *wkt, const char **end)
{ {
uint32 len= get_class_info()->m_name.length; uint32 len= (uint) get_class_info()->m_name.length;
if (wkt->reserve(len + 2, 512)) if (wkt->reserve(len + 2, 512))
return 1; return 1;
wkt->qs_append(get_class_info()->m_name.str, len); wkt->qs_append(get_class_info()->m_name.str, len);

View File

@ -664,7 +664,7 @@ public:
*/ */
char *db; char *db;
uint db_length; size_t db_length;
public: public:

View File

@ -54,7 +54,7 @@ static int get_or_create_user_conn(THD *thd, const char *user,
USER_RESOURCES *mqh) USER_RESOURCES *mqh)
{ {
int return_val= 0; int return_val= 0;
uint temp_len, user_len; size_t temp_len, user_len;
char temp_user[USER_HOST_BUFF_SIZE]; char temp_user[USER_HOST_BUFF_SIZE];
struct user_conn *uc; struct user_conn *uc;

View File

@ -31,7 +31,7 @@
SQL_CRYPT::SQL_CRYPT(const char *password) SQL_CRYPT::SQL_CRYPT(const char *password)
{ {
ulong rand_nr[2]; ulong rand_nr[2];
hash_password(rand_nr,password, strlen(password)); hash_password(rand_nr,password, (uint) strlen(password));
crypt_init(rand_nr); crypt_init(rand_nr);
} }

View File

@ -251,7 +251,7 @@ bool mysqld_show_warnings(THD *thd, ulong levels_to_show)
protocol->store(warning_level_names[err->level].str, protocol->store(warning_level_names[err->level].str,
warning_level_names[err->level].length, system_charset_info); warning_level_names[err->level].length, system_charset_info);
protocol->store((uint32) err->code); protocol->store((uint32) err->code);
protocol->store(err->msg, strlen(err->msg), system_charset_info); protocol->store(err->msg, (uint) strlen(err->msg), system_charset_info);
if (protocol->write()) if (protocol->write())
DBUG_RETURN(TRUE); DBUG_RETURN(TRUE);
} }

View File

@ -1893,7 +1893,7 @@ bool delayed_get_table(THD *thd, TABLE_LIST *table_list)
pthread_mutex_lock(&LOCK_thread_count); pthread_mutex_lock(&LOCK_thread_count);
thread_count++; thread_count++;
pthread_mutex_unlock(&LOCK_thread_count); pthread_mutex_unlock(&LOCK_thread_count);
di->thd.set_db(table_list->db, strlen(table_list->db)); di->thd.set_db(table_list->db, (uint) strlen(table_list->db));
di->thd.query= my_strdup(table_list->table_name, MYF(MY_WME)); di->thd.query= my_strdup(table_list->table_name, MYF(MY_WME));
if (di->thd.db == NULL || di->thd.query == NULL) if (di->thd.db == NULL || di->thd.query == NULL)
{ {

View File

@ -253,7 +253,7 @@ void Lex_input_stream::body_utf8_append_literal(THD *thd,
{ {
thd->convert_string(&utf_txt, thd->convert_string(&utf_txt,
&my_charset_utf8_general_ci, &my_charset_utf8_general_ci,
txt->str, txt->length, txt->str, (uint) txt->length,
txt_cs); txt_cs);
} }
else else
@ -435,7 +435,7 @@ bool is_keyword(const char *name, uint len)
bool is_lex_native_function(const LEX_STRING *name) bool is_lex_native_function(const LEX_STRING *name)
{ {
DBUG_ASSERT(name != NULL); DBUG_ASSERT(name != NULL);
return (get_hash_symbol(name->str, name->length, 1) != 0); return (get_hash_symbol(name->str, (uint) name->length, 1) != 0);
} }
/* make a copy of token before ptr and set yytoklen */ /* make a copy of token before ptr and set yytoklen */
@ -1074,7 +1074,7 @@ int MYSQLlex(void *arg, void *yythd)
if (c != '.') if (c != '.')
{ // Found complete integer number. { // Found complete integer number.
yylval->lex_str=get_token(lip, 0, lip->yyLength()); yylval->lex_str=get_token(lip, 0, lip->yyLength());
return int_token(yylval->lex_str.str,yylval->lex_str.length); return int_token(yylval->lex_str.str, (uint) yylval->lex_str.length);
} }
// fall through // fall through
case MY_LEX_REAL: // Incomplete real number case MY_LEX_REAL: // Incomplete real number
@ -1977,8 +1977,8 @@ void st_select_lex::print_order(String *str,
if (order->counter_used) if (order->counter_used)
{ {
char buffer[20]; char buffer[20];
uint length= my_snprintf(buffer, 20, "%d", order->counter); size_t length= my_snprintf(buffer, 20, "%d", order->counter);
str->append(buffer, length); str->append(buffer, (uint) length);
} }
else else
(*order->item)->print(str, query_type); (*order->item)->print(str, query_type);

View File

@ -1361,7 +1361,7 @@ public:
/** Get the utf8-body length. */ /** Get the utf8-body length. */
uint get_body_utf8_length() uint get_body_utf8_length()
{ {
return m_body_utf8_ptr - m_body_utf8; return (uint) (m_body_utf8_ptr - m_body_utf8);
} }
void body_utf8_start(THD *thd, const char *begin_ptr); void body_utf8_start(THD *thd, const char *begin_ptr);

View File

@ -534,8 +534,8 @@ static bool write_execute_load_query_log_event(THD *thd,
{ {
Execute_load_query_log_event Execute_load_query_log_event
e(thd, thd->query, thd->query_length, e(thd, thd->query, thd->query_length,
(char*)thd->lex->fname_start - (char*)thd->query, (uint) ((char*)thd->lex->fname_start - (char*)thd->query),
(char*)thd->lex->fname_end - (char*)thd->query, (uint) ((char*)thd->lex->fname_end - (char*)thd->query),
(duplicates == DUP_REPLACE) ? LOAD_DUP_REPLACE : (duplicates == DUP_REPLACE) ? LOAD_DUP_REPLACE :
(ignore ? LOAD_DUP_IGNORE : LOAD_DUP_ERROR), (ignore ? LOAD_DUP_IGNORE : LOAD_DUP_ERROR),
transactional_table, FALSE, killed_err_arg); transactional_table, FALSE, killed_err_arg);

View File

@ -759,13 +759,13 @@ static bool insert_params_with_log(Prepared_statement *stmt, uchar *null_array,
Item_param *param= *it; Item_param *param= *it;
if (param->state != Item_param::LONG_DATA_VALUE) if (param->state != Item_param::LONG_DATA_VALUE)
{ {
if (is_param_null(null_array, it - begin)) if (is_param_null(null_array, (uint) (it - begin)))
param->set_null(); param->set_null();
else else
{ {
if (read_pos >= data_end) if (read_pos >= data_end)
DBUG_RETURN(1); DBUG_RETURN(1);
param->set_param_func(param, &read_pos, data_end - read_pos); param->set_param_func(param, &read_pos, (uint) (data_end - read_pos));
if (param->state == Item_param::NO_VALUE) if (param->state == Item_param::NO_VALUE)
DBUG_RETURN(1); DBUG_RETURN(1);
} }
@ -797,13 +797,13 @@ static bool insert_params(Prepared_statement *stmt, uchar *null_array,
Item_param *param= *it; Item_param *param= *it;
if (param->state != Item_param::LONG_DATA_VALUE) if (param->state != Item_param::LONG_DATA_VALUE)
{ {
if (is_param_null(null_array, it - begin)) if (is_param_null(null_array, (uint) (it - begin)))
param->set_null(); param->set_null();
else else
{ {
if (read_pos >= data_end) if (read_pos >= data_end)
DBUG_RETURN(1); DBUG_RETURN(1);
param->set_param_func(param, &read_pos, data_end - read_pos); param->set_param_func(param, &read_pos, (uint) (data_end - read_pos));
if (param->state == Item_param::NO_VALUE) if (param->state == Item_param::NO_VALUE)
DBUG_RETURN(1); DBUG_RETURN(1);
} }

View File

@ -119,7 +119,7 @@ int make_profile_table_for_show(THD *thd, ST_SCHEMA_TABLE *schema_table)
if (field) if (field)
{ {
field->set_name(field_info->old_name, field->set_name(field_info->old_name,
strlen(field_info->old_name), (uint) strlen(field_info->old_name),
system_charset_info); system_charset_info);
if (add_item_to_list(thd, field)) if (add_item_to_list(thd, field))
return 1; return 1;

View File

@ -205,7 +205,7 @@ void adjust_linfo_offsets(my_off_t purge_offset)
bool log_in_use(const char* log_name) bool log_in_use(const char* log_name)
{ {
int log_name_len = strlen(log_name) + 1; size_t log_name_len = strlen(log_name) + 1;
THD *tmp; THD *tmp;
bool result = 0; bool result = 0;
@ -1366,8 +1366,8 @@ int cmp_master_pos(const char* log_file_name1, ulonglong log_pos1,
const char* log_file_name2, ulonglong log_pos2) const char* log_file_name2, ulonglong log_pos2)
{ {
int res; int res;
uint log_file_name1_len= strlen(log_file_name1); size_t log_file_name1_len= strlen(log_file_name1);
uint log_file_name2_len= strlen(log_file_name2); size_t log_file_name2_len= strlen(log_file_name2);
// We assume that both log names match up to '.' // We assume that both log names match up to '.'
if (log_file_name1_len == log_file_name2_len) if (log_file_name1_len == log_file_name2_len)
@ -1687,7 +1687,7 @@ int log_loaded_block(IO_CACHE* file)
lf_info->last_pos_in_file >= my_b_get_pos_in_file(file)) lf_info->last_pos_in_file >= my_b_get_pos_in_file(file))
DBUG_RETURN(0); DBUG_RETURN(0);
for (block_len= my_b_get_bytes_in_buffer(file); block_len > 0; for (block_len= (uint) (my_b_get_bytes_in_buffer(file)); block_len > 0;
buffer += min(block_len, max_event_size), buffer += min(block_len, max_event_size),
block_len -= min(block_len, max_event_size)) block_len -= min(block_len, max_event_size))
{ {

View File

@ -60,7 +60,7 @@ prepare_server_struct_for_insert(LEX_SERVER_OPTIONS *server_options);
/* drop functions */ /* drop functions */
static int delete_server_record(TABLE *table, static int delete_server_record(TABLE *table,
char *server_name, char *server_name,
int server_name_length); size_t server_name_length);
static int delete_server_record_in_cache(LEX_SERVER_OPTIONS *server_options); static int delete_server_record_in_cache(LEX_SERVER_OPTIONS *server_options);
/* update functions */ /* update functions */
@ -301,7 +301,7 @@ get_server_from_table_to_cache(TABLE *table)
/* get each field into the server struct ptr */ /* get each field into the server struct ptr */
server->server_name= get_field(&mem, table->field[0]); server->server_name= get_field(&mem, table->field[0]);
server->server_name_length= strlen(server->server_name); server->server_name_length= (uint) strlen(server->server_name);
ptr= get_field(&mem, table->field[1]); ptr= get_field(&mem, table->field[1]);
server->host= ptr ? ptr : blank; server->host= ptr ? ptr : blank;
ptr= get_field(&mem, table->field[2]); ptr= get_field(&mem, table->field[2]);
@ -911,7 +911,7 @@ end:
static int static int
delete_server_record(TABLE *table, delete_server_record(TABLE *table,
char *server_name, int server_name_length) char *server_name, size_t server_name_length)
{ {
int error; int error;
DBUG_ENTER("delete_server_record"); DBUG_ENTER("delete_server_record");
@ -1271,7 +1271,7 @@ static FOREIGN_SERVER *clone_server(MEM_ROOT *mem, const FOREIGN_SERVER *server,
FOREIGN_SERVER *get_server_by_name(MEM_ROOT *mem, const char *server_name, FOREIGN_SERVER *get_server_by_name(MEM_ROOT *mem, const char *server_name,
FOREIGN_SERVER *buff) FOREIGN_SERVER *buff)
{ {
uint server_name_length; size_t server_name_length;
FOREIGN_SERVER *server; FOREIGN_SERVER *server;
DBUG_ENTER("get_server_by_name"); DBUG_ENTER("get_server_by_name");
DBUG_PRINT("info", ("server_name %s", server_name)); DBUG_PRINT("info", ("server_name %s", server_name));

View File

@ -458,7 +458,7 @@ bool String::append(const char *s,uint32 arg_length)
bool String::append(const char *s) bool String::append(const char *s)
{ {
return append(s, strlen(s)); return append(s, (uint) strlen(s));
} }
@ -1051,7 +1051,7 @@ outp:
} }
} }
*from_end_pos= from; *from_end_pos= from;
res= to - to_start; res= (uint) (to - to_start);
} }
return (uint32) res; return (uint32) res;
} }

View File

@ -84,7 +84,7 @@ static void wait_for_kill_signal(THD *thd)
uint filename_to_tablename(const char *from, char *to, uint to_length) uint filename_to_tablename(const char *from, char *to, uint to_length)
{ {
uint errors; uint errors;
uint res; size_t res;
DBUG_ENTER("filename_to_tablename"); DBUG_ENTER("filename_to_tablename");
DBUG_PRINT("enter", ("from '%s'", from)); DBUG_PRINT("enter", ("from '%s'", from));
@ -224,7 +224,7 @@ uint build_table_filename(char *buff, size_t bufflen, const char *db,
char *end = buff + bufflen; char *end = buff + bufflen;
/* Don't add FN_ROOTDIR if mysql_data_home already includes it */ /* Don't add FN_ROOTDIR if mysql_data_home already includes it */
char *pos = strnmov(buff, mysql_data_home, bufflen); char *pos = strnmov(buff, mysql_data_home, bufflen);
int rootdir_len= strlen(FN_ROOTDIR); size_t rootdir_len= strlen(FN_ROOTDIR);
if (pos - rootdir_len >= buff && if (pos - rootdir_len >= buff &&
memcmp(pos - rootdir_len, FN_ROOTDIR, rootdir_len) != 0) memcmp(pos - rootdir_len, FN_ROOTDIR, rootdir_len) != 0)
pos= strnmov(pos, FN_ROOTDIR, end - pos); pos= strnmov(pos, FN_ROOTDIR, end - pos);
@ -273,7 +273,7 @@ uint build_tmptable_filename(THD* thd, char *buff, size_t bufflen)
my_casedn_str(files_charset_info, p); my_casedn_str(files_charset_info, p);
} }
uint length= unpack_filename(buff, buff); size_t length= unpack_filename(buff, buff);
DBUG_PRINT("exit", ("buff: '%s'", buff)); DBUG_PRINT("exit", ("buff: '%s'", buff));
DBUG_RETURN(length); DBUG_RETURN(length);
} }
@ -1991,7 +1991,7 @@ void calculate_interval_lengths(CHARSET_INFO *cs, TYPELIB *interval,
for (pos= interval->type_names, len= interval->type_lengths; for (pos= interval->type_names, len= interval->type_lengths;
*pos ; pos++, len++) *pos ; pos++, len++)
{ {
uint length= cs->cset->numchars(cs, *pos, *pos + *len); size_t length= cs->cset->numchars(cs, *pos, *pos + *len);
*tot_length+= length; *tot_length+= length;
set_if_bigger(*max_length, (uint32)length); set_if_bigger(*max_length, (uint32)length);
} }
@ -2320,7 +2320,7 @@ mysql_prepare_create_table(THD *thd, HA_CREATE_INFO *create_info,
DBUG_ASSERT(comma_length > 0); DBUG_ASSERT(comma_length > 0);
for (uint i= 0; (tmp= int_it++); i++) for (uint i= 0; (tmp= int_it++); i++)
{ {
uint lengthsp; size_t lengthsp;
if (String::needs_conversion(tmp->length(), tmp->charset(), if (String::needs_conversion(tmp->length(), tmp->charset(),
cs, &dummy)) cs, &dummy))
{ {
@ -4236,7 +4236,7 @@ static bool mysql_admin_table(THD* thd, TABLE_LIST* tables,
(!(alter_info->flags & ALTER_ALL_PARTITION))) (!(alter_info->flags & ALTER_ALL_PARTITION)))
{ {
char buff[FN_REFLEN + MYSQL_ERRMSG_SIZE]; char buff[FN_REFLEN + MYSQL_ERRMSG_SIZE];
uint length; size_t length;
DBUG_PRINT("admin", ("sending non existent partition error")); DBUG_PRINT("admin", ("sending non existent partition error"));
protocol->prepare_for_resend(); protocol->prepare_for_resend();
protocol->store(table_name, system_charset_info); protocol->store(table_name, system_charset_info);
@ -4318,7 +4318,7 @@ static bool mysql_admin_table(THD* thd, TABLE_LIST* tables,
{ {
/* purecov: begin inspected */ /* purecov: begin inspected */
char buff[FN_REFLEN + MYSQL_ERRMSG_SIZE]; char buff[FN_REFLEN + MYSQL_ERRMSG_SIZE];
uint length; size_t length;
DBUG_PRINT("admin", ("sending error message")); DBUG_PRINT("admin", ("sending error message"));
protocol->prepare_for_resend(); protocol->prepare_for_resend();
protocol->store(table_name, system_charset_info); protocol->store(table_name, system_charset_info);
@ -4436,7 +4436,7 @@ send_result_message:
case HA_ADMIN_NOT_IMPLEMENTED: case HA_ADMIN_NOT_IMPLEMENTED:
{ {
char buf[MYSQL_ERRMSG_SIZE]; char buf[MYSQL_ERRMSG_SIZE];
uint length=my_snprintf(buf, sizeof(buf), size_t length=my_snprintf(buf, sizeof(buf),
ER(ER_CHECK_NOT_IMPLEMENTED), operator_name); ER(ER_CHECK_NOT_IMPLEMENTED), operator_name);
protocol->store(STRING_WITH_LEN("note"), system_charset_info); protocol->store(STRING_WITH_LEN("note"), system_charset_info);
protocol->store(buf, length, system_charset_info); protocol->store(buf, length, system_charset_info);
@ -4446,7 +4446,7 @@ send_result_message:
case HA_ADMIN_NOT_BASE_TABLE: case HA_ADMIN_NOT_BASE_TABLE:
{ {
char buf[MYSQL_ERRMSG_SIZE]; char buf[MYSQL_ERRMSG_SIZE];
uint length= my_snprintf(buf, sizeof(buf), size_t length= my_snprintf(buf, sizeof(buf),
ER(ER_BAD_TABLE_ERROR), table_name); ER(ER_BAD_TABLE_ERROR), table_name);
protocol->store(STRING_WITH_LEN("note"), system_charset_info); protocol->store(STRING_WITH_LEN("note"), system_charset_info);
protocol->store(buf, length, system_charset_info); protocol->store(buf, length, system_charset_info);
@ -4574,7 +4574,7 @@ send_result_message:
case HA_ADMIN_NEEDS_ALTER: case HA_ADMIN_NEEDS_ALTER:
{ {
char buf[MYSQL_ERRMSG_SIZE]; char buf[MYSQL_ERRMSG_SIZE];
uint length; size_t length;
protocol->store(STRING_WITH_LEN("error"), system_charset_info); protocol->store(STRING_WITH_LEN("error"), system_charset_info);
length=my_snprintf(buf, sizeof(buf), ER(ER_TABLE_NEEDS_UPGRADE), length=my_snprintf(buf, sizeof(buf), ER(ER_TABLE_NEEDS_UPGRADE),
@ -4587,7 +4587,7 @@ send_result_message:
default: // Probably HA_ADMIN_INTERNAL_ERROR default: // Probably HA_ADMIN_INTERNAL_ERROR
{ {
char buf[MYSQL_ERRMSG_SIZE]; char buf[MYSQL_ERRMSG_SIZE];
uint length=my_snprintf(buf, sizeof(buf), size_t length=my_snprintf(buf, sizeof(buf),
"Unknown - internal error %d during operation", "Unknown - internal error %d during operation",
result_code); result_code);
protocol->store(STRING_WITH_LEN("error"), system_charset_info); protocol->store(STRING_WITH_LEN("error"), system_charset_info);

View File

@ -1728,7 +1728,7 @@ Table_triggers_list::change_table_name_in_triggers(THD *thd,
List_iterator_fast<LEX_STRING> it_def(definitions_list); List_iterator_fast<LEX_STRING> it_def(definitions_list);
List_iterator_fast<LEX_STRING> it_on_table_name(on_table_names_list); List_iterator_fast<LEX_STRING> it_on_table_name(on_table_names_list);
List_iterator_fast<ulonglong> it_mode(definition_modes_list); List_iterator_fast<ulonglong> it_mode(definition_modes_list);
uint on_q_table_name_len, before_on_len; size_t on_q_table_name_len, before_on_len;
String buff; String buff;
DBUG_ASSERT(definitions_list.elements == on_table_names_list.elements && DBUG_ASSERT(definitions_list.elements == on_table_names_list.elements &&

View File

@ -159,7 +159,7 @@ void udf_init()
DBUG_PRINT("info",("init udf record")); DBUG_PRINT("info",("init udf record"));
LEX_STRING name; LEX_STRING name;
name.str=get_field(&mem, table->field[0]); name.str=get_field(&mem, table->field[0]);
name.length = strlen(name.str); name.length = (uint) strlen(name.str);
char *dl_name= get_field(&mem, table->field[2]); char *dl_name= get_field(&mem, table->field[2]);
bool new_dl=0; bool new_dl=0;
Item_udftype udftype=UDFTYPE_FUNCTION; Item_udftype udftype=UDFTYPE_FUNCTION;

View File

@ -61,7 +61,7 @@ static void make_unique_view_field_name(Item *target,
char *name= (target->orig_name ? char *name= (target->orig_name ?
target->orig_name : target->orig_name :
target->name); target->name);
uint name_len, attempt; size_t name_len, attempt;
char buff[NAME_LEN+1]; char buff[NAME_LEN+1];
List_iterator_fast<Item> itc(item_list); List_iterator_fast<Item> itc(item_list);
@ -545,7 +545,7 @@ bool mysql_create_view(THD *thd, TABLE_LIST *views,
} }
while ((item= it++, name= nm++)) while ((item= it++, name= nm++))
{ {
item->set_name(name->str, name->length, system_charset_info); item->set_name(name->str, (uint) name->length, system_charset_info);
item->is_autogenerated_name= FALSE; item->is_autogenerated_name= FALSE;
} }
} }
@ -1672,7 +1672,7 @@ frm_type_enum mysql_frm_type(THD *thd, char *path, enum legacy_db_type *dbt)
{ {
File file; File file;
uchar header[10]; //"TYPE=VIEW\n" it is 10 characters uchar header[10]; //"TYPE=VIEW\n" it is 10 characters
int error; size_t error;
DBUG_ENTER("mysql_frm_type"); DBUG_ENTER("mysql_frm_type");
*dbt= DB_TYPE_UNKNOWN; *dbt= DB_TYPE_UNKNOWN;

View File

@ -1099,7 +1099,7 @@ char * is_const(UDF_INIT *initid, UDF_ARGS *args __attribute__((unused)),
sprintf(result, "not const"); sprintf(result, "not const");
} }
*is_null= 0; *is_null= 0;
*length= strlen(result); *length= (uint) strlen(result);
return result; return result;
} }
@ -1133,7 +1133,7 @@ char * check_const_len(UDF_INIT *initid, UDF_ARGS *args __attribute__((unused)),
char *is_null, char *error __attribute__((unused))) char *is_null, char *error __attribute__((unused)))
{ {
strmov(result, initid->ptr); strmov(result, initid->ptr);
*length= strlen(result); *length= (uint) strlen(result);
*is_null= 0; *is_null= 0;
return result; return result;
} }

View File

@ -130,7 +130,7 @@ static double get_merge_buffers_cost(uint *buff_elems, uint elem_size,
total_buf_elems+= *pbuf; total_buf_elems+= *pbuf;
*last= total_buf_elems; *last= total_buf_elems;
int n_buffers= last - first + 1; size_t n_buffers= last - first + 1;
/* Using log2(n)=log(n)/log(2) formula */ /* Using log2(n)=log(n)/log(2) formula */
return 2*((double)total_buf_elems*elem_size) / IO_SIZE + return 2*((double)total_buf_elems*elem_size) / IO_SIZE +

View File

@ -390,7 +390,7 @@ int destroy (s)
Reads the given number of uncompressed bytes from the compressed file. Reads the given number of uncompressed bytes from the compressed file.
azread returns the number of bytes actually read (0 for end of file). azread returns the number of bytes actually read (0 for end of file).
*/ */
unsigned int ZEXPORT azread ( azio_stream *s, voidp buf, unsigned int len, int *error) unsigned int ZEXPORT azread ( azio_stream *s, voidp buf, size_t len, int *error)
{ {
Bytef *start = (Bytef*)buf; /* starting point for crc computation */ Bytef *start = (Bytef*)buf; /* starting point for crc computation */
Byte *next_out; /* == stream.next_out but not forced far (for MSDOS) */ Byte *next_out; /* == stream.next_out but not forced far (for MSDOS) */

View File

@ -265,7 +265,7 @@ int azdopen(azio_stream *s,File fd, int Flags);
*/ */
extern unsigned int azread ( azio_stream *s, voidp buf, unsigned int len, int *error); extern unsigned int azread ( azio_stream *s, voidp buf, size_t len, int *error);
/* /*
Reads the given number of uncompressed bytes from the compressed file. Reads the given number of uncompressed bytes from the compressed file.
If the input file was not in gzip format, gzread copies the given number If the input file was not in gzip format, gzread copies the given number

View File

@ -553,7 +553,7 @@ int ha_tina::chain_append()
/* We set up for the next position */ /* We set up for the next position */
if ((off_t)(chain_ptr - chain) == (chain_size -1)) if ((off_t)(chain_ptr - chain) == (chain_size -1))
{ {
off_t location= chain_ptr - chain; my_off_t location= chain_ptr - chain;
chain_size += DEFAULT_CHAIN_LENGTH; chain_size += DEFAULT_CHAIN_LENGTH;
if (chain_alloced) if (chain_alloced)
{ {

View File

@ -63,7 +63,7 @@ class ha_tina: public handler
TINA_SHARE *share; /* Shared lock info */ TINA_SHARE *share; /* Shared lock info */
off_t current_position; /* Current position in the file during a file scan */ off_t current_position; /* Current position in the file during a file scan */
off_t next_position; /* Next position in the file scan */ off_t next_position; /* Next position in the file scan */
off_t local_saved_data_file_length; /* save position for reads */ my_off_t local_saved_data_file_length; /* save position for reads */
off_t temp_file_length; off_t temp_file_length;
uchar byte_buffer[IO_SIZE]; uchar byte_buffer[IO_SIZE];
Transparent_file *file_buff; Transparent_file *file_buff;

View File

@ -24,7 +24,7 @@ class Transparent_file
uchar *buff; /* in-memory window to the file or mmaped area */ uchar *buff; /* in-memory window to the file or mmaped area */
/* current window sizes */ /* current window sizes */
off_t lower_bound; off_t lower_bound;
off_t upper_bound; my_off_t upper_bound;
uint buff_size; uint buff_size;
public: public:

View File

@ -505,7 +505,7 @@ int federated_done(void *p)
in sql_show.cc except that quoting always occurs. in sql_show.cc except that quoting always occurs.
*/ */
static bool append_ident(String *string, const char *name, uint length, static bool append_ident(String *string, const char *name, size_t length,
const char quote_char) const char quote_char)
{ {
bool result; bool result;
@ -515,7 +515,7 @@ static bool append_ident(String *string, const char *name, uint length,
if (quote_char) if (quote_char)
{ {
string->reserve(length * 2 + 2); string->reserve((uint) length * 2 + 2);
if ((result= string->append(&quote_char, 1, system_charset_info))) if ((result= string->append(&quote_char, 1, system_charset_info)))
goto err; goto err;
@ -533,7 +533,7 @@ static bool append_ident(String *string, const char *name, uint length,
result= string->append(&quote_char, 1, system_charset_info); result= string->append(&quote_char, 1, system_charset_info);
} }
else else
result= string->append(name, length, system_charset_info); result= string->append(name, (uint) length, system_charset_info);
err: err:
DBUG_RETURN(result); DBUG_RETURN(result);
@ -543,7 +543,7 @@ err:
static int parse_url_error(FEDERATED_SHARE *share, TABLE *table, int error_num) static int parse_url_error(FEDERATED_SHARE *share, TABLE *table, int error_num)
{ {
char buf[FEDERATED_QUERY_BUFFER_SIZE]; char buf[FEDERATED_QUERY_BUFFER_SIZE];
int buf_len; size_t buf_len;
DBUG_ENTER("ha_federated parse_url_error"); DBUG_ENTER("ha_federated parse_url_error");
buf_len= min(table->s->connect_string.length, buf_len= min(table->s->connect_string.length,
@ -721,7 +721,7 @@ static int parse_url(MEM_ROOT *mem_root, FEDERATED_SHARE *share, TABLE *table,
{ {
share->connection_string[share->table_name - share->connection_string]= '\0'; share->connection_string[share->table_name - share->connection_string]= '\0';
share->table_name++; share->table_name++;
share->table_name_length= strlen(share->table_name); share->table_name_length= (uint) strlen(share->table_name);
DBUG_PRINT("info", DBUG_PRINT("info",
("internal format, parsed table_name share->connection_string \ ("internal format, parsed table_name share->connection_string \
@ -1489,7 +1489,7 @@ static FEDERATED_SHARE *get_share(const char *table_name, TABLE *table)
pthread_mutex_lock(&federated_mutex); pthread_mutex_lock(&federated_mutex);
tmp_share.share_key= table_name; tmp_share.share_key= table_name;
tmp_share.share_key_length= strlen(table_name); tmp_share.share_key_length= (uint) strlen(table_name);
if (parse_url(&mem_root, &tmp_share, table, 0)) if (parse_url(&mem_root, &tmp_share, table, 0))
goto error; goto error;
@ -2161,7 +2161,7 @@ int ha_federated::update_row(const uchar *old_data, uchar *new_data)
{ {
if (bitmap_is_set(table->write_set, (*field)->field_index)) if (bitmap_is_set(table->write_set, (*field)->field_index))
{ {
uint field_name_length= strlen((*field)->field_name); size_t field_name_length= strlen((*field)->field_name);
append_ident(&update_string, (*field)->field_name, field_name_length, append_ident(&update_string, (*field)->field_name, field_name_length,
ident_quote_char); ident_quote_char);
update_string.append(STRING_WITH_LEN(" = ")); update_string.append(STRING_WITH_LEN(" = "));
@ -2187,7 +2187,7 @@ int ha_federated::update_row(const uchar *old_data, uchar *new_data)
if (bitmap_is_set(table->read_set, (*field)->field_index)) if (bitmap_is_set(table->read_set, (*field)->field_index))
{ {
uint field_name_length= strlen((*field)->field_name); size_t field_name_length= strlen((*field)->field_name);
append_ident(&where_string, (*field)->field_name, field_name_length, append_ident(&where_string, (*field)->field_name, field_name_length,
ident_quote_char); ident_quote_char);
if (field_in_record_is_null(table, *field, (char*) old_data)) if (field_in_record_is_null(table, *field, (char*) old_data))
@ -3158,7 +3158,7 @@ int ha_federated::real_connect()
} }
int ha_federated::real_query(const char *query, uint length) int ha_federated::real_query(const char *query, size_t length)
{ {
int rc= 0; int rc= 0;
DBUG_ENTER("ha_federated::real_query"); DBUG_ENTER("ha_federated::real_query");
@ -3169,7 +3169,7 @@ int ha_federated::real_query(const char *query, uint length)
if (!query || !length) if (!query || !length)
goto end; goto end;
rc= mysql_real_query(mysql, query, length); rc= mysql_real_query(mysql, query, (uint) length);
end: end:
DBUG_RETURN(rc); DBUG_RETURN(rc);

View File

@ -70,7 +70,7 @@ typedef struct st_federated_share {
int share_key_length; int share_key_length;
ushort port; ushort port;
uint table_name_length, server_name_length, connect_string_length, use_count; size_t table_name_length, server_name_length, connect_string_length, use_count;
pthread_mutex_t mutex; pthread_mutex_t mutex;
THR_LOCK lock; THR_LOCK lock;
} FEDERATED_SHARE; } FEDERATED_SHARE;
@ -113,7 +113,7 @@ private:
uint key_len, uint key_len,
ha_rkey_function find_flag, ha_rkey_function find_flag,
MYSQL_RES **result); MYSQL_RES **result);
int real_query(const char *query, uint length); int real_query(const char *query, size_t length);
int real_connect(); int real_connect();
public: public:
ha_federated(handlerton *hton, TABLE_SHARE *table_arg); ha_federated(handlerton *hton, TABLE_SHARE *table_arg);

View File

@ -69,7 +69,7 @@ int heap_write(HP_INFO *info, const uchar *record)
err: err:
if (my_errno == HA_ERR_FOUND_DUPP_KEY) if (my_errno == HA_ERR_FOUND_DUPP_KEY)
DBUG_PRINT("info",("Duplicate key: %d", (int) (keydef - share->keydef))); DBUG_PRINT("info",("Duplicate key: %d", (int) (keydef - share->keydef)));
info->errkey= keydef - share->keydef; info->errkey= (int) (keydef - share->keydef);
/* /*
We don't need to delete non-inserted key from rb-tree. Also, if We don't need to delete non-inserted key from rb-tree. Also, if
we got ENOMEM, the key wasn't inserted, so don't try to delete it we got ENOMEM, the key wasn't inserted, so don't try to delete it

View File

@ -6506,7 +6506,7 @@ ha_innobase::get_foreign_key_list(THD *thd, List<FOREIGN_KEY_INFO> *f_key_list)
f_key_info.referenced_key_name = thd_make_lex_string( f_key_info.referenced_key_name = thd_make_lex_string(
thd, f_key_info.referenced_key_name, thd, f_key_info.referenced_key_name,
foreign->referenced_index->name, foreign->referenced_index->name,
strlen(foreign->referenced_index->name), 1); (uint) strlen(foreign->referenced_index->name), 1);
} }
else else
f_key_info.referenced_key_name= 0; f_key_info.referenced_key_name= 0;
@ -7119,7 +7119,7 @@ innodb_show_status(
bool result = FALSE; bool result = FALSE;
if (stat_print(thd, innobase_hton_name, strlen(innobase_hton_name), if (stat_print(thd, innobase_hton_name, (uint) strlen(innobase_hton_name),
STRING_WITH_LEN(""), str, flen)) { STRING_WITH_LEN(""), str, flen)) {
result= TRUE; result= TRUE;
} }
@ -7149,7 +7149,7 @@ innodb_mutex_show_status(
ulint rw_lock_count_os_yield= 0; ulint rw_lock_count_os_yield= 0;
ulonglong rw_lock_wait_time= 0; ulonglong rw_lock_wait_time= 0;
#endif /* UNIV_DEBUG */ #endif /* UNIV_DEBUG */
uint hton_name_len= strlen(innobase_hton_name), buf1len, buf2len; uint hton_name_len= (uint) strlen(innobase_hton_name), buf1len, buf2len;
DBUG_ENTER("innodb_mutex_show_status"); DBUG_ENTER("innodb_mutex_show_status");
mutex_enter_noninline(&mutex_list_mutex); mutex_enter_noninline(&mutex_list_mutex);
@ -7193,9 +7193,9 @@ innodb_mutex_show_status(
rw_lock_wait_time += mutex->lspent_time; rw_lock_wait_time += mutex->lspent_time;
} }
#else /* UNIV_DEBUG */ #else /* UNIV_DEBUG */
buf1len= my_snprintf(buf1, sizeof(buf1), "%s:%lu", buf1len= (uint) my_snprintf(buf1, sizeof(buf1), "%s:%lu",
mutex->cfile_name, (ulong) mutex->cline); mutex->cfile_name, (ulong) mutex->cline);
buf2len= my_snprintf(buf2, sizeof(buf2), "os_waits=%lu", buf2len= (uint) my_snprintf(buf2, sizeof(buf2), "os_waits=%lu",
mutex->count_os_wait); mutex->count_os_wait);
if (stat_print(thd, innobase_hton_name, if (stat_print(thd, innobase_hton_name,
@ -7708,7 +7708,7 @@ ha_innobase::get_error_message(int error, String *buf)
{ {
trx_t* trx = check_trx_exists(ha_thd()); trx_t* trx = check_trx_exists(ha_thd());
buf->copy(trx->detailed_error, strlen(trx->detailed_error), buf->copy(trx->detailed_error, (uint) strlen(trx->detailed_error),
system_charset_info); system_charset_info);
return FALSE; return FALSE;

View File

@ -684,7 +684,7 @@ struct for_node_struct{
definition */ definition */
que_node_t* loop_start_limit;/* initial value of loop variable */ que_node_t* loop_start_limit;/* initial value of loop variable */
que_node_t* loop_end_limit; /* end value of loop variable */ que_node_t* loop_end_limit; /* end value of loop variable */
int loop_end_value; /* evaluated value for the end value: lint loop_end_value; /* evaluated value for the end value:
it is calculated only when the loop it is calculated only when the loop
is entered, and will not change within is entered, and will not change within
the loop */ the loop */

View File

@ -62,7 +62,7 @@ static void mi_check_print_msg(MI_CHECK *param, const char* msg_type,
{ {
THD* thd = (THD*)param->thd; THD* thd = (THD*)param->thd;
Protocol *protocol= thd->protocol; Protocol *protocol= thd->protocol;
uint length, msg_length; size_t length, msg_length;
char msgbuf[MI_MAX_MSG_BUF]; char msgbuf[MI_MAX_MSG_BUF];
char name[NAME_LEN*2+2]; char name[NAME_LEN*2+2];
@ -1557,7 +1557,7 @@ bool ha_myisam::check_and_repair(THD *thd)
old_query_length= thd->query_length; old_query_length= thd->query_length;
pthread_mutex_lock(&LOCK_thread_count); pthread_mutex_lock(&LOCK_thread_count);
thd->query= table->s->table_name.str; thd->query= table->s->table_name.str;
thd->query_length= table->s->table_name.length; thd->query_length= (uint) table->s->table_name.length;
pthread_mutex_unlock(&LOCK_thread_count); pthread_mutex_unlock(&LOCK_thread_count);
if ((marked_crashed= mi_is_crashed(file)) || check(thd, &check_opt)) if ((marked_crashed= mi_is_crashed(file)) || check(thd, &check_opt))

View File

@ -660,7 +660,7 @@ void mi_collect_stats_nonulls_first(HA_KEYSEG *keyseg, ulonglong *notnull,
uchar *key) uchar *key)
{ {
uint first_null, kp; uint first_null, kp;
first_null= ha_find_null(keyseg, key) - keyseg; first_null= (uint) (ha_find_null(keyseg, key) - keyseg);
/* /*
All prefix tuples that don't include keypart_{first_null} are not-null All prefix tuples that don't include keypart_{first_null} are not-null
tuples (and all others aren't), increment counters for them. tuples (and all others aren't), increment counters for them.
@ -716,7 +716,7 @@ int mi_collect_stats_nonulls_next(HA_KEYSEG *keyseg, ulonglong *notnull,
seg= keyseg + diffs[0] - 1; seg= keyseg + diffs[0] - 1;
/* Find first NULL in last_key */ /* Find first NULL in last_key */
first_null_seg= ha_find_null(seg, last_key + diffs[1]) - keyseg; first_null_seg= (uint) (ha_find_null(seg, last_key + diffs[1]) - keyseg);
for (kp= 0; kp < first_null_seg; kp++) for (kp= 0; kp < first_null_seg; kp++)
notnull[kp]++; notnull[kp]++;
@ -3952,7 +3952,7 @@ static int sort_ft_key_write(MI_SORT_PARAM *sort_param, const void *a)
key_block++; key_block++;
sort_info->key_block=key_block; sort_info->key_block=key_block;
sort_param->keyinfo=& sort_info->info->s->ft2_keyinfo; sort_param->keyinfo=& sort_info->info->s->ft2_keyinfo;
ft_buf->count=(ft_buf->buf - p)/val_len; ft_buf->count=(uint) (ft_buf->buf - p)/val_len;
/* flushing buffer to second-level tree */ /* flushing buffer to second-level tree */
for (error=0; !error && p < ft_buf->buf; p+= val_len) for (error=0; !error && p < ft_buf->buf; p+= val_len)

View File

@ -255,7 +255,7 @@ my_bool _mi_read_pack_info(MI_INFO *info, pbool fix_keys)
MYF(MY_HOLD_ON_ERROR)); MYF(MY_HOLD_ON_ERROR));
/* Fix the table addresses in the tree heads. */ /* Fix the table addresses in the tree heads. */
{ {
long diff=PTR_BYTE_DIFF(decode_table,share->decode_tables); my_ptrdiff_t diff=PTR_BYTE_DIFF(decode_table,share->decode_tables);
share->decode_tables=decode_table; share->decode_tables=decode_table;
for (i=0 ; i < trees ; i++) for (i=0 ; i < trees ; i++)
share->decode_trees[i].table=ADD_TO_PTR(share->decode_trees[i].table, share->decode_trees[i].table=ADD_TO_PTR(share->decode_trees[i].table,

View File

@ -409,7 +409,7 @@ int _mi_prefix_search(MI_INFO *info, register MI_KEYDEF *keyinfo, uchar *page,
} }
from+=keyseg->length; from+=keyseg->length;
page=from+nod_flag; page=from+nod_flag;
length=from-vseg; length= (uint) (from - vseg);
} }
if (page > end) if (page > end)

View File

@ -95,7 +95,7 @@ static int rtree_find_req(MI_INFO *info, MI_KEYDEF *keyinfo, uint search_flag,
_mi_kpos(nod_flag, k), level + 1))) _mi_kpos(nod_flag, k), level + 1)))
{ {
case 0: /* found - exit from recursion */ case 0: /* found - exit from recursion */
*saved_key = k - page_buf; *saved_key = (uint) (k - page_buf);
goto ok; goto ok;
case 1: /* not found - continue searching */ case 1: /* not found - continue searching */
info->rtree_recursion_depth = level; info->rtree_recursion_depth = level;
@ -117,7 +117,7 @@ static int rtree_find_req(MI_INFO *info, MI_KEYDEF *keyinfo, uint search_flag,
info->lastkey_length = k_len + info->s->base.rec_reflength; info->lastkey_length = k_len + info->s->base.rec_reflength;
memcpy(info->lastkey, k, info->lastkey_length); memcpy(info->lastkey, k, info->lastkey_length);
info->rtree_recursion_depth = level; info->rtree_recursion_depth = level;
*saved_key = last - page_buf; *saved_key = (uint) (last - page_buf);
if (after_key < last) if (after_key < last)
{ {
@ -314,7 +314,7 @@ static int rtree_get_req(MI_INFO *info, MI_KEYDEF *keyinfo, uint key_length,
_mi_kpos(nod_flag, k), level + 1))) _mi_kpos(nod_flag, k), level + 1)))
{ {
case 0: /* found - exit from recursion */ case 0: /* found - exit from recursion */
*saved_key = k - page_buf; *saved_key = (uint) (k - page_buf);
goto ok; goto ok;
case 1: /* not found - continue searching */ case 1: /* not found - continue searching */
info->rtree_recursion_depth = level; info->rtree_recursion_depth = level;
@ -333,7 +333,7 @@ static int rtree_get_req(MI_INFO *info, MI_KEYDEF *keyinfo, uint key_length,
memcpy(info->lastkey, k, info->lastkey_length); memcpy(info->lastkey, k, info->lastkey_length);
info->rtree_recursion_depth = level; info->rtree_recursion_depth = level;
*saved_key = k - page_buf; *saved_key = (uint) (k - page_buf);
if (after_key < last) if (after_key < last)
{ {
@ -420,7 +420,7 @@ int rtree_get_next(MI_INFO *info, uint keynr, uint key_length)
info->lastkey_length = k_len + info->s->base.rec_reflength; info->lastkey_length = k_len + info->s->base.rec_reflength;
memcpy(info->lastkey, key, k_len + info->s->base.rec_reflength); memcpy(info->lastkey, key, k_len + info->s->base.rec_reflength);
*(int*)info->int_keypos = key - info->buff; *(uint*)info->int_keypos = (uint) (key - info->buff);
if (after_key >= info->int_maxpos) if (after_key >= info->int_maxpos)
{ {
info->buff_used = 1; info->buff_used = 1;

View File

@ -218,7 +218,7 @@ static int myisammrg_parent_open_callback(void *callback_param,
TABLE_LIST *child_l; TABLE_LIST *child_l;
const char *db; const char *db;
const char *table_name; const char *table_name;
uint dirlen; size_t dirlen;
char dir_path[FN_REFLEN]; char dir_path[FN_REFLEN];
DBUG_ENTER("myisammrg_parent_open_callback"); DBUG_ENTER("myisammrg_parent_open_callback");
@ -961,7 +961,7 @@ THR_LOCK_DATA **ha_myisammrg::store_lock(THD *thd,
static void split_file_name(const char *file_name, static void split_file_name(const char *file_name,
LEX_STRING *db, LEX_STRING *name) LEX_STRING *db, LEX_STRING *name)
{ {
uint dir_length, prefix_length; size_t dir_length, prefix_length;
char buff[FN_REFLEN]; char buff[FN_REFLEN];
db->length= 0; db->length= 0;
@ -1034,7 +1034,7 @@ int ha_myisammrg::create(const char *name, register TABLE *form,
const char **table_names, **pos; const char **table_names, **pos;
TABLE_LIST *tables= (TABLE_LIST*) create_info->merge_list.first; TABLE_LIST *tables= (TABLE_LIST*) create_info->merge_list.first;
THD *thd= current_thd; THD *thd= current_thd;
uint dirlgt= dirname_length(name); size_t dirlgt= dirname_length(name);
DBUG_ENTER("ha_myisammrg::create"); DBUG_ENTER("ha_myisammrg::create");
/* Allocate a table_names array in thread mem_root. */ /* Allocate a table_names array in thread mem_root. */
@ -1093,7 +1093,7 @@ int ha_myisammrg::create(const char *name, register TABLE *form,
void ha_myisammrg::append_create_info(String *packet) void ha_myisammrg::append_create_info(String *packet)
{ {
const char *current_db; const char *current_db;
uint db_length; size_t db_length;
THD *thd= current_thd; THD *thd= current_thd;
MYRG_TABLE *open_table, *first; MYRG_TABLE *open_table, *first;

View File

@ -39,7 +39,7 @@
*/ */
static char *mstr(char *str,const char *src,uint l1,uint l2) static char *mstr(char *str,const char *src,size_t l1,size_t l2)
{ {
l1= l1<l2 ? l1 : l2; l1= l1<l2 ? l1 : l2;
memcpy(str,src,l1); memcpy(str,src,l1);
@ -143,7 +143,7 @@ typedef struct my_cs_file_info
static int fill_uchar(uchar *a,uint size,const char *str, uint len) static int fill_uchar(uchar *a,uint size,const char *str, size_t len)
{ {
uint i= 0; uint i= 0;
const char *s, *b, *e=str+len; const char *s, *b, *e=str+len;

View File

@ -108,7 +108,7 @@ size_t my_vsnprintf(char *to, size_t n, const char* fmt, va_list ap)
char *par = va_arg(ap, char *); char *par = va_arg(ap, char *);
DBUG_ASSERT(to <= end); DBUG_ASSERT(to <= end);
if (to + abs(width) + 1 > end) if (to + abs(width) + 1 > end)
width= end - to - 1; /* sign doesn't matter */ width= (uint) (end - to - 1); /* sign doesn't matter */
memmove(to, par, abs(width)); memmove(to, par, abs(width));
to+= width; to+= width;
continue; continue;
@ -176,7 +176,7 @@ size_t my_vsnprintf(char *to, size_t n, const char* fmt, va_list ap)
size_t my_snprintf(char* to, size_t n, const char* fmt, ...) size_t my_snprintf(char* to, size_t n, const char* fmt, ...)
{ {
int result; size_t result;
va_list args; va_list args;
va_start(args,fmt); va_start(args,fmt);
result= my_vsnprintf(to, n, fmt, args); result= my_vsnprintf(to, n, fmt, args);

View File

@ -54,14 +54,14 @@ int main (int argc, char **argv)
printf("%s\n", mysql_error(&conn)); printf("%s\n", mysql_error(&conn));
} }
OK = mysql_real_query (&conn, query4, strlen(query4)); OK = mysql_real_query (&conn, query4, (uint) strlen(query4));
assert(0 == OK); assert(0 == OK);
printf("%ld inserted\n", printf("%ld inserted\n",
(long) mysql_insert_id(&conn)); (long) mysql_insert_id(&conn));
OK = mysql_real_query (&conn, query5, strlen(query5)); OK = mysql_real_query (&conn, query5, (uint) strlen(query5));
assert(0 == OK); assert(0 == OK);

View File

@ -262,7 +262,7 @@ static MYSQL_STMT *STDCALL
mysql_simple_prepare(MYSQL *mysql_arg, const char *query) mysql_simple_prepare(MYSQL *mysql_arg, const char *query)
{ {
MYSQL_STMT *stmt= mysql_stmt_init(mysql_arg); MYSQL_STMT *stmt= mysql_stmt_init(mysql_arg);
if (stmt && mysql_stmt_prepare(stmt, query, strlen(query))) if (stmt && mysql_stmt_prepare(stmt, query, (uint) strlen(query)))
{ {
mysql_stmt_close(stmt); mysql_stmt_close(stmt);
return 0; return 0;