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:
commit
2d9421c3bb
@ -373,7 +373,7 @@ static void find_tool(char *tool_executable_name, const char *tool_name,
|
||||
}
|
||||
else
|
||||
{
|
||||
int len;
|
||||
size_t len;
|
||||
|
||||
/*
|
||||
mysql_upgrade was run absolutely or relatively. We can find a sibling
|
||||
|
@ -837,7 +837,7 @@ static int execute_commands(MYSQL *mysql,int argc, char **argv)
|
||||
bool old= (find_type(argv[0], &command_typelib, 2) ==
|
||||
ADMIN_OLD_PASSWORD);
|
||||
#ifdef __WIN__
|
||||
uint pw_len= strlen(pw);
|
||||
uint pw_len= (uint) strlen(pw);
|
||||
if (pw_len > 1 && pw[0] == '\'' && pw[pw_len-1] == '\'')
|
||||
printf("Warning: single quotes were not trimmed from the password by"
|
||||
" your command\nline client, as you might have expected.\n");
|
||||
|
@ -128,7 +128,7 @@ static Exit_status safe_connect();
|
||||
class Load_log_processor
|
||||
{
|
||||
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
|
||||
@ -285,9 +285,9 @@ public:
|
||||
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,
|
||||
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,
|
||||
uint block_len, uint file_id,
|
||||
size_t block_len, uint file_id,
|
||||
Create_file_log_event *ce);
|
||||
};
|
||||
|
||||
@ -305,7 +305,7 @@ public:
|
||||
File Load_log_processor::prepare_new_file_for_old_format(Load_log_event *le,
|
||||
char *filename)
|
||||
{
|
||||
uint len;
|
||||
size_t len;
|
||||
char *tail;
|
||||
File file;
|
||||
|
||||
@ -319,7 +319,7 @@ File Load_log_processor::prepare_new_file_for_old_format(Load_log_event *le,
|
||||
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;
|
||||
}
|
||||
@ -411,9 +411,9 @@ Exit_status Load_log_processor::load_old_format_file(NET* net,
|
||||
@retval OK_CONTINUE No error, the program should continue.
|
||||
*/
|
||||
Exit_status Load_log_processor::process_first_event(const char *bname,
|
||||
uint blen,
|
||||
size_t blen,
|
||||
const uchar *block,
|
||||
uint block_len,
|
||||
size_t block_len,
|
||||
uint file_id,
|
||||
Create_file_log_event *ce)
|
||||
{
|
||||
@ -456,7 +456,7 @@ Exit_status Load_log_processor::process_first_event(const char *bname,
|
||||
}
|
||||
|
||||
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)))
|
||||
{
|
||||
@ -1189,7 +1189,7 @@ static my_time_t convert_str_to_timestamp(const char* str)
|
||||
long dummy_my_timezone;
|
||||
my_bool dummy_in_dst_time_gap;
|
||||
/* 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)
|
||||
{
|
||||
error("Incorrect date and time argument: %s", str);
|
||||
|
@ -349,7 +349,7 @@ static int get_options(int *argc, char ***argv)
|
||||
|
||||
if (!what_to_do)
|
||||
{
|
||||
int pnlen = strlen(my_progname);
|
||||
size_t pnlen= strlen(my_progname);
|
||||
|
||||
if (pnlen < 6) /* name too short */
|
||||
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
|
||||
*/
|
||||
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++)
|
||||
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 = 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));
|
||||
}
|
||||
else
|
||||
@ -486,7 +487,7 @@ static uint fixed_name_length(const char *name)
|
||||
else if (*p == '.')
|
||||
extra_length+= 2;
|
||||
}
|
||||
return (p - name) + extra_length;
|
||||
return (uint) ((p - name) + extra_length);
|
||||
}
|
||||
|
||||
|
||||
|
@ -802,7 +802,7 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)),
|
||||
opt_set_charset= 0;
|
||||
opt_compatible_mode_str= argument;
|
||||
opt_compatible_mode= find_set(&compatible_mode_typelib,
|
||||
argument, strlen(argument),
|
||||
argument, (uint) strlen(argument),
|
||||
&err_ptr, &err_len);
|
||||
if (err_len)
|
||||
{
|
||||
|
@ -1929,7 +1929,7 @@ parse_option(const char *origin, option_string **stmt, char delm)
|
||||
char *ptr= (char *)origin;
|
||||
option_string **sptr= stmt;
|
||||
option_string *tmp;
|
||||
uint length= strlen(origin);
|
||||
size_t length= strlen(origin);
|
||||
uint count= 0; /* We know that there is always one */
|
||||
|
||||
for (tmp= *sptr= (option_string *)my_malloc(sizeof(option_string),
|
||||
|
@ -1316,7 +1316,7 @@ void log_msg(const char *fmt, ...)
|
||||
void cat_file(DYNAMIC_STRING* ds, const char* filename)
|
||||
{
|
||||
int fd;
|
||||
uint len;
|
||||
size_t len;
|
||||
char buff[512];
|
||||
|
||||
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;
|
||||
File fd2;
|
||||
uint len, len2;
|
||||
size_t len, len2;
|
||||
char buff[512], buff2[512];
|
||||
|
||||
if ((fd2= my_open(filename2, O_RDONLY, MYF(0))) < 0)
|
||||
|
@ -468,7 +468,7 @@ bool String::append(const char *s,uint32 arg_length)
|
||||
|
||||
bool String::append(const char *s)
|
||||
{
|
||||
return append(s, strlen(s));
|
||||
return append(s, (uint) strlen(s));
|
||||
}
|
||||
|
||||
|
||||
|
@ -660,7 +660,7 @@ static ha_checksum checksum_format_specifier(const char* msg)
|
||||
case 'u':
|
||||
case 'x':
|
||||
case 's':
|
||||
chksum= my_checksum(chksum, start, p-start);
|
||||
chksum= my_checksum(chksum, start, (uint) (p - start));
|
||||
start= 0; /* Not in format specifier anymore */
|
||||
break;
|
||||
|
||||
|
@ -106,7 +106,7 @@ void input_buffer::add_size(uint i)
|
||||
|
||||
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
|
||||
{
|
||||
return end_ - buffer_;
|
||||
return (uint) (end_ - buffer_);
|
||||
}
|
||||
|
||||
|
||||
|
@ -78,7 +78,7 @@ typename A::pointer StdReallocate(A& a, T* p, typename A::size_type oldSize,
|
||||
if (preserve) {
|
||||
A b = A();
|
||||
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);
|
||||
STL::swap(a, b);
|
||||
return newPointer;
|
||||
|
@ -288,7 +288,7 @@ void AbstractGroup::SimultaneousMultiply(Integer *results, const Integer &base,
|
||||
r = buckets[i][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(r, buckets[i][j]);
|
||||
|
@ -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)
|
||||
: key_(k, kSz)
|
||||
{
|
||||
int sz = strlen(n);
|
||||
size_t sz = strlen(n);
|
||||
memcpy(name_, n, sz);
|
||||
name_[sz] = 0;
|
||||
|
||||
|
@ -64,6 +64,9 @@ functions */
|
||||
#endif
|
||||
#ifndef __WIN32__
|
||||
#define __WIN32__
|
||||
#define _INTEGRAL_MAX_BITS 32
|
||||
#else
|
||||
#define _INTEGRAL_MAX_BITS 64
|
||||
#endif
|
||||
#endif /* _WIN64 */
|
||||
#ifndef __WIN__
|
||||
|
@ -1617,7 +1617,7 @@ mysql_hex_string(char *to, const char *from, ulong length)
|
||||
ulong STDCALL
|
||||
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
|
||||
@ -1625,8 +1625,8 @@ mysql_real_escape_string(MYSQL *mysql, char *to,const char *from,
|
||||
ulong length)
|
||||
{
|
||||
if (mysql->server_status & SERVER_STATUS_NO_BACKSLASH_ESCAPES)
|
||||
return escape_quotes_for_mysql(mysql->charset, to, 0, from, length);
|
||||
return escape_string_for_mysql(mysql->charset, to, 0, from, length);
|
||||
return (uint) escape_quotes_for_mysql(mysql->charset, to, 0, from, length);
|
||||
return (uint) escape_string_for_mysql(mysql->charset, to, 0, from, length);
|
||||
}
|
||||
|
||||
void STDCALL
|
||||
|
@ -371,7 +371,7 @@ void freeze_size(DYNAMIC_ARRAY *array)
|
||||
|
||||
int get_index_dynamic(DYNAMIC_ARRAY *array, uchar* element)
|
||||
{
|
||||
uint ret;
|
||||
size_t ret;
|
||||
if (array->buffer > element)
|
||||
return -1;
|
||||
|
||||
|
@ -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
|
||||
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);
|
||||
}
|
||||
|
||||
|
||||
|
@ -328,7 +328,7 @@ static my_bool my_read_charset_file(const char *filename, myf myflags)
|
||||
{
|
||||
uchar *buf;
|
||||
int fd;
|
||||
uint len, tmp_len;
|
||||
size_t len, tmp_len;
|
||||
MY_STAT stat_info;
|
||||
|
||||
if (!my_stat(filename, &stat_info, MYF(myflags)) ||
|
||||
|
@ -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));
|
||||
return crc;
|
||||
#else
|
||||
return (ha_checksum)crc32((uint)crc, pos, length);
|
||||
return (ha_checksum)crc32((uint)crc, pos, (uint)length);
|
||||
#endif
|
||||
}
|
||||
|
||||
|
@ -182,7 +182,7 @@ int my_search_option_files(const char *conf_file, int *argc, char ***argv,
|
||||
/* Handle --defaults-group-suffix= */
|
||||
uint i;
|
||||
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;
|
||||
char *ptr;
|
||||
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++)
|
||||
{
|
||||
uint len;
|
||||
size_t len;
|
||||
extra_groups[i]= group->type_names[i]; /** copy group */
|
||||
|
||||
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;
|
||||
|
||||
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)
|
||||
{
|
||||
char buf[FN_REFLEN];
|
||||
uint len;
|
||||
size_t len;
|
||||
char *p;
|
||||
my_bool err __attribute__((unused));
|
||||
|
||||
@ -1004,14 +1004,14 @@ static size_t my_get_system_windows_directory(char *buffer, size_t size)
|
||||
"GetSystemWindowsDirectoryA");
|
||||
|
||||
if (func_ptr)
|
||||
return func_ptr(buffer, size);
|
||||
return func_ptr(buffer, (uint) size);
|
||||
|
||||
/*
|
||||
Windows NT 4.0 Terminal Server Edition:
|
||||
To retrieve the shared Windows directory, call GetSystemDirectory and
|
||||
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)
|
||||
{
|
||||
count-= 8;
|
||||
|
@ -68,11 +68,9 @@ int modify_defaults_file(const char *file_location, const char *option,
|
||||
FILE *cnf_file;
|
||||
MY_STAT file_stat;
|
||||
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;
|
||||
my_bool in_section= FALSE, opt_applied= 0;
|
||||
uint reserve_extended;
|
||||
uint new_opt_len;
|
||||
int reserve_occupied= 0;
|
||||
DBUG_ENTER("modify_defaults_file");
|
||||
|
||||
|
11
mysys/hash.c
11
mysys/hash.c
@ -157,14 +157,14 @@ my_hash_key(const HASH *hash, const uchar *record, size_t *length,
|
||||
|
||||
/* 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));
|
||||
return (hashnr & ((buffmax >> 1) -1));
|
||||
}
|
||||
|
||||
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;
|
||||
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)
|
||||
{
|
||||
int flag;
|
||||
size_t idx;
|
||||
uint halfbuff,hash_nr,first_index;
|
||||
size_t idx,halfbuff,hash_nr,first_index;
|
||||
uchar *ptr_to_rec,*ptr_to_rec2;
|
||||
HASH_LINK *data,*empty,*gpos,*gpos2,*pos;
|
||||
|
||||
@ -539,8 +538,8 @@ exit:
|
||||
my_bool my_hash_update(HASH *hash, uchar *record, uchar *old_key,
|
||||
size_t old_key_length)
|
||||
{
|
||||
uint new_index,new_pos_index,blength,records,empty;
|
||||
size_t idx;
|
||||
uint new_index,new_pos_index,blength,records;
|
||||
size_t idx,empty;
|
||||
HASH_LINK org_link,*data,*previous,*pos;
|
||||
DBUG_ENTER("my_hash_update");
|
||||
|
||||
|
@ -2404,7 +2404,7 @@ static void read_block(KEY_CACHE *keycache,
|
||||
BLOCK_LINK *block, uint read_length,
|
||||
uint min_length, my_bool primary)
|
||||
{
|
||||
uint got_length;
|
||||
size_t got_length;
|
||||
|
||||
/* On entry cache_lock is locked */
|
||||
|
||||
|
@ -47,7 +47,7 @@ my_bool init_tmpdir(MY_TMPDIR *tmpdir, const char *pathlist)
|
||||
}
|
||||
do
|
||||
{
|
||||
uint length;
|
||||
size_t length;
|
||||
end=strcend(pathlist, DELIM);
|
||||
strmake(buff, pathlist, (uint) (end-pathlist));
|
||||
length= cleanup_dirname(buff, buff);
|
||||
|
@ -36,7 +36,7 @@ struct utimbuf {
|
||||
|
||||
int my_append(const char *from, const char *to, myf MyFlags)
|
||||
{
|
||||
uint Count;
|
||||
size_t Count;
|
||||
File from_file,to_file;
|
||||
uchar buff[IO_SIZE];
|
||||
DBUG_ENTER("my_append");
|
||||
|
@ -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))))
|
||||
return 0; /* Not enough memory */
|
||||
|
||||
tmp_complen= *complen;
|
||||
tmp_complen= (uint) *complen;
|
||||
res= compress((Bytef*) compbuf, &tmp_complen, (Bytef*) packet, (uLong) *len);
|
||||
*complen= tmp_complen;
|
||||
|
||||
@ -118,7 +118,7 @@ my_bool my_uncompress(uchar *packet, size_t len, size_t *complen)
|
||||
if (!compbuf)
|
||||
DBUG_RETURN(1); /* Not enough memory */
|
||||
|
||||
tmp_complen= *complen;
|
||||
tmp_complen= (uint) *complen;
|
||||
error= uncompress((Bytef*) compbuf, &tmp_complen, (Bytef*) packet,
|
||||
(uLong) len);
|
||||
*complen= tmp_complen;
|
||||
|
@ -172,7 +172,7 @@ char* my_cgets(char *buffer, size_t clen, size_t* plen)
|
||||
do
|
||||
{
|
||||
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))
|
||||
{
|
||||
result= NULL;
|
||||
|
@ -50,7 +50,7 @@ struct utimbuf {
|
||||
|
||||
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" */
|
||||
int create_flag;
|
||||
File from_file,to_file;
|
||||
|
@ -55,7 +55,7 @@ int my_getwd(char * buf, size_t size, myf MyFlags)
|
||||
else
|
||||
{
|
||||
#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_error(EE_GETWD,MYF(ME_BELL+ME_WAITTANG),errno);
|
||||
|
@ -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);
|
||||
readbytes= (uint) -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);
|
||||
#else
|
||||
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;
|
||||
pthread_mutex_lock(&my_file_info[Filedes].mutex);
|
||||
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);
|
||||
if (error)
|
||||
break;
|
||||
|
@ -23,7 +23,7 @@ size_t my_quick_read(File Filedes,uchar *Buffer,size_t Count,myf MyFlags)
|
||||
{
|
||||
size_t readbytes;
|
||||
|
||||
if ((readbytes = read(Filedes, Buffer, Count)) != Count)
|
||||
if ((readbytes = read(Filedes, Buffer, (uint) Count)) != Count)
|
||||
{
|
||||
#ifndef DBUG_OFF
|
||||
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
|
||||
writtenbytes =
|
||||
#endif
|
||||
(size_t) write(Filedes,Buffer,Count)) != Count)
|
||||
(size_t) write(Filedes,Buffer, (uint) Count)) != Count)
|
||||
{
|
||||
#ifndef DBUG_OFF
|
||||
if ((writtenbytes == 0 || writtenbytes == (size_t) -1) && errno == EINTR)
|
||||
|
@ -44,7 +44,7 @@ size_t my_read(File Filedes, uchar *Buffer, size_t Count, myf MyFlags)
|
||||
for (;;)
|
||||
{
|
||||
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;
|
||||
DBUG_PRINT("warning",("Read only %d bytes off %lu from %d, errno: %d",
|
||||
|
@ -174,7 +174,7 @@ void *_mymalloc(size_t size, const char *filename, uint lineno, myf MyFlags)
|
||||
data[size + 3]= MAGICEND3;
|
||||
irem->filename= (char *) filename;
|
||||
irem->linenum= lineno;
|
||||
irem->datasize= size;
|
||||
irem->datasize= (uint32) size;
|
||||
irem->prev= NULL;
|
||||
|
||||
/* Add this remember structure to the linked list */
|
||||
|
@ -25,7 +25,7 @@
|
||||
my_bool init_dynamic_string(DYNAMIC_STRING *str, const char *init_str,
|
||||
size_t init_alloc, size_t alloc_increment)
|
||||
{
|
||||
uint length;
|
||||
size_t length;
|
||||
DBUG_ENTER("init_dynamic_string");
|
||||
|
||||
if (!alloc_increment)
|
||||
@ -100,7 +100,7 @@ my_bool dynstr_append_mem(DYNAMIC_STRING *str, const char *append,
|
||||
char *new_ptr;
|
||||
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;
|
||||
new_length*=str->alloc_increment;
|
||||
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 */
|
||||
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, quote_str, quote_len);
|
||||
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 *);
|
||||
}
|
||||
va_end(dirty_text);
|
||||
|
@ -100,7 +100,7 @@ err:
|
||||
|
||||
int Buffer::get_size()
|
||||
{
|
||||
return buffer_size;
|
||||
return (uint) buffer_size;
|
||||
}
|
||||
|
||||
|
||||
|
@ -163,7 +163,7 @@ static bool start_process(Instance_options *instance_options,
|
||||
|
||||
int cmdlen= 0;
|
||||
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 */
|
||||
|
||||
char *cmdline= new char[cmdlen];
|
||||
|
@ -103,7 +103,7 @@ const char *Options::Debug::config_str= "d:t:i:O,im.trace";
|
||||
#endif
|
||||
|
||||
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.
|
||||
|
@ -206,7 +206,7 @@ inline void get_word(const char **text, size_t *word_len,
|
||||
break;
|
||||
}
|
||||
|
||||
*word_len= word_end - *text;
|
||||
*word_len= (uint) (word_end - *text);
|
||||
}
|
||||
|
||||
#endif /* INCLUDES_MYSQL_INSTANCE_MANAGER_PARSE_H */
|
||||
|
@ -3183,7 +3183,7 @@ int STDCALL mysql_set_character_set(MYSQL *mysql, const char *cs_name)
|
||||
if (mysql_get_server_version(mysql) < 40100)
|
||||
return 0;
|
||||
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;
|
||||
}
|
||||
|
@ -44,8 +44,8 @@ void parse_user(const char *user_id_str, size_t user_id_len,
|
||||
}
|
||||
else
|
||||
{
|
||||
*user_name_len= p - user_id_str;
|
||||
*host_name_len= user_id_len - *user_name_len - 1;
|
||||
*user_name_len= (uint) (p - user_id_str);
|
||||
*host_name_len= (uint) (user_id_len - *user_name_len - 1);
|
||||
|
||||
if (*user_name_len > USERNAME_LENGTH)
|
||||
*user_name_len= USERNAME_LENGTH;
|
||||
|
@ -380,7 +380,7 @@ bool
|
||||
Event_job_data::load_from_row(THD *thd, TABLE *table)
|
||||
{
|
||||
char *ptr;
|
||||
uint len;
|
||||
size_t len;
|
||||
LEX_STRING tz_name;
|
||||
|
||||
DBUG_ENTER("Event_job_data::load_from_row");
|
||||
@ -580,7 +580,7 @@ bool
|
||||
Event_timed::load_from_row(THD *thd, TABLE *table)
|
||||
{
|
||||
char *ptr;
|
||||
uint len;
|
||||
size_t len;
|
||||
|
||||
DBUG_ENTER("Event_timed::load_from_row");
|
||||
|
||||
|
@ -527,8 +527,8 @@ Event_parse_data::init_definer(THD *thd)
|
||||
|
||||
const char *definer_user= thd->lex->definer->user.str;
|
||||
const char *definer_host= thd->lex->definer->host.str;
|
||||
int definer_user_len= thd->lex->definer->user.length;
|
||||
int definer_host_len= thd->lex->definer->host.length;
|
||||
size_t definer_user_len= thd->lex->definer->user.length;
|
||||
size_t definer_host_len= thd->lex->definer->host.length;
|
||||
|
||||
DBUG_PRINT("info",("init definer_user thd->mem_root: 0x%lx "
|
||||
"definer_user: 0x%lx", (long) thd->mem_root,
|
||||
|
@ -694,7 +694,7 @@ send_show_create_event(THD *thd, Event_timed *et, Protocol *protocol)
|
||||
&sql_mode))
|
||||
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();
|
||||
|
||||
|
@ -204,7 +204,7 @@ void insert_symbols()
|
||||
for (cur= symbols; i<array_elements(symbols); cur++, i++){
|
||||
hash_lex_struct *root=
|
||||
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\
|
||||
else\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\
|
||||
}\n\
|
||||
\n\
|
||||
@ -545,7 +545,7 @@ static SYMBOL *get_hash_symbol(const char *s,\n\
|
||||
register int16 ires= (int16)(cur_struct>>16);\n\
|
||||
if (ires==array_elements(symbols)) return 0;\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\
|
||||
}\n\
|
||||
\n\
|
||||
|
@ -1092,7 +1092,7 @@ inline void Item_sp_variable::make_field(Send_field *field)
|
||||
if (name)
|
||||
it->set_name(name, (uint) strlen(name), system_charset_info);
|
||||
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);
|
||||
}
|
||||
|
||||
|
@ -2739,7 +2739,7 @@ longlong Item_func_find_in_set::val_int()
|
||||
if (is_last_item && !is_separator)
|
||||
str_end= substr_end;
|
||||
if (!my_strnncoll(cs, (const uchar *) str_begin,
|
||||
str_end - str_begin,
|
||||
(uint) (str_end - str_begin),
|
||||
find_str, find_str_len))
|
||||
return (longlong) position;
|
||||
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)
|
||||
{
|
||||
/* 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);
|
||||
}
|
||||
|
||||
|
||||
|
@ -1830,17 +1830,17 @@ bool Item_func_user::init(const char *user, const char *host)
|
||||
if (user)
|
||||
{
|
||||
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;
|
||||
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);
|
||||
str_value.length(res_length);
|
||||
str_value.length((uint) res_length);
|
||||
str_value.mark_as_const();
|
||||
}
|
||||
return FALSE;
|
||||
@ -2544,7 +2544,7 @@ String *Item_func_rpad::val_str(String *str)
|
||||
memcpy(to,ptr_pad,(size_t) pad_byte_length);
|
||||
to+= pad_byte_length;
|
||||
}
|
||||
res->length(to- (char*) res->ptr());
|
||||
res->length((uint) (to- (char*) res->ptr()));
|
||||
return (res);
|
||||
|
||||
err:
|
||||
@ -2812,7 +2812,7 @@ String *Item_func_charset::val_str(String *str)
|
||||
|
||||
CHARSET_INFO *cs= args[0]->collation.collation;
|
||||
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);
|
||||
return str;
|
||||
}
|
||||
@ -2824,7 +2824,7 @@ String *Item_func_collation::val_str(String *str)
|
||||
CHARSET_INFO *cs= args[0]->collation.collation;
|
||||
|
||||
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);
|
||||
return str;
|
||||
}
|
||||
|
@ -391,7 +391,7 @@ static bool extract_date_time(DATE_TIME_FORMAT *format,
|
||||
if (tmp - val > 6)
|
||||
tmp= (char*) val + 6;
|
||||
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)
|
||||
l_time->second_part*= (ulong) log_10_int[frac_part];
|
||||
val= tmp;
|
||||
@ -642,14 +642,14 @@ bool make_date_time(DATE_TIME_FORMAT *format, MYSQL_TIME *l_time,
|
||||
if (!l_time->month)
|
||||
return 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);
|
||||
break;
|
||||
case 'b':
|
||||
if (!l_time->month)
|
||||
return 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);
|
||||
break;
|
||||
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,
|
||||
l_time->day),0);
|
||||
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);
|
||||
break;
|
||||
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,
|
||||
l_time->day),0);
|
||||
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);
|
||||
break;
|
||||
case 'D':
|
||||
if (type == MYSQL_TIMESTAMP_TIME)
|
||||
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');
|
||||
if (l_time->day >= 10 && l_time->day <= 19)
|
||||
str->append(STRING_WITH_LEN("th"));
|
||||
@ -696,62 +696,62 @@ bool make_date_time(DATE_TIME_FORMAT *format, MYSQL_TIME *l_time,
|
||||
}
|
||||
break;
|
||||
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');
|
||||
break;
|
||||
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');
|
||||
break;
|
||||
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');
|
||||
break;
|
||||
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');
|
||||
break;
|
||||
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');
|
||||
break;
|
||||
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');
|
||||
break;
|
||||
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');
|
||||
break;
|
||||
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');
|
||||
break;
|
||||
case 'h':
|
||||
case 'I':
|
||||
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');
|
||||
break;
|
||||
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');
|
||||
break;
|
||||
case 'j':
|
||||
if (type == MYSQL_TIMESTAMP_TIME)
|
||||
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) -
|
||||
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');
|
||||
break;
|
||||
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');
|
||||
break;
|
||||
case 'l':
|
||||
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');
|
||||
break;
|
||||
case 'p':
|
||||
@ -770,7 +770,7 @@ bool make_date_time(DATE_TIME_FORMAT *format, MYSQL_TIME *l_time,
|
||||
break;
|
||||
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');
|
||||
break;
|
||||
case 'T':
|
||||
@ -788,11 +788,11 @@ bool make_date_time(DATE_TIME_FORMAT *format, MYSQL_TIME *l_time,
|
||||
uint year;
|
||||
if (type == MYSQL_TIMESTAMP_TIME)
|
||||
return 1;
|
||||
length= int10_to_str(calc_week(l_time,
|
||||
length= (uint) (int10_to_str(calc_week(l_time,
|
||||
(*ptr) == 'U' ?
|
||||
WEEK_FIRST_WEEKDAY : WEEK_MONDAY_FIRST,
|
||||
&year),
|
||||
intbuff, 10) - intbuff;
|
||||
intbuff, 10) - intbuff);
|
||||
str->append_with_prefill(intbuff, length, 2, '0');
|
||||
}
|
||||
break;
|
||||
@ -802,12 +802,12 @@ bool make_date_time(DATE_TIME_FORMAT *format, MYSQL_TIME *l_time,
|
||||
uint year;
|
||||
if (type == MYSQL_TIMESTAMP_TIME)
|
||||
return 1;
|
||||
length= int10_to_str(calc_week(l_time,
|
||||
length= (uint) (int10_to_str(calc_week(l_time,
|
||||
((*ptr) == 'V' ?
|
||||
(WEEK_YEAR | WEEK_FIRST_WEEKDAY) :
|
||||
(WEEK_YEAR | WEEK_MONDAY_FIRST)),
|
||||
&year),
|
||||
intbuff, 10) - intbuff;
|
||||
intbuff, 10) - intbuff);
|
||||
str->append_with_prefill(intbuff, length, 2, '0');
|
||||
}
|
||||
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_MONDAY_FIRST),
|
||||
&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');
|
||||
}
|
||||
break;
|
||||
@ -831,7 +831,7 @@ bool make_date_time(DATE_TIME_FORMAT *format, MYSQL_TIME *l_time,
|
||||
return 1;
|
||||
weekday=calc_weekday(calc_daynr(l_time->year,l_time->month,
|
||||
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');
|
||||
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');
|
||||
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)
|
||||
value*= (long) log_10_int[msec_length];
|
||||
}
|
||||
@ -1060,7 +1060,7 @@ String* Item_func_monthname::val_str(String* str)
|
||||
}
|
||||
null_value=0;
|
||||
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);
|
||||
return str;
|
||||
}
|
||||
@ -1210,7 +1210,7 @@ String* Item_func_dayname::val_str(String* str)
|
||||
return (String*) 0;
|
||||
|
||||
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);
|
||||
return str;
|
||||
}
|
||||
@ -3176,14 +3176,14 @@ String *Item_func_get_format::val_str(String *str)
|
||||
format++)
|
||||
{
|
||||
uint format_name_len;
|
||||
format_name_len= strlen(format_name);
|
||||
format_name_len= (uint) strlen(format_name);
|
||||
if (val_len == format_name_len &&
|
||||
!my_strnncoll(&my_charset_latin1,
|
||||
(const uchar *) val->ptr(), val_len,
|
||||
(const uchar *) format_name, val_len))
|
||||
{
|
||||
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;
|
||||
}
|
||||
}
|
||||
|
@ -461,7 +461,7 @@ void mysql_unlock_read_tables(THD *thd, MYSQL_LOCK *sql_lock)
|
||||
for (i= 0; i < sql_lock->table_count; i++)
|
||||
{
|
||||
TABLE *tbl= *table;
|
||||
tbl->lock_position= table - sql_lock->table;
|
||||
tbl->lock_position= (uint) (table - sql_lock->table);
|
||||
tbl->lock_data_start= found;
|
||||
found+= tbl->lock_count;
|
||||
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);
|
||||
/* 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);
|
||||
my_free((uchar*) sql_lock,MYF(0));
|
||||
DBUG_RETURN(0);
|
||||
|
@ -1280,7 +1280,7 @@ void Log_event::print_header(IO_CACHE* file,
|
||||
char emit_buf[256]; // Enough for storing one line
|
||||
my_b_printf(file, "# Position Timestamp Type Master ID "
|
||||
"Size Master Pos Flags \n");
|
||||
int const bytes_written=
|
||||
size_t const bytes_written=
|
||||
my_snprintf(emit_buf, sizeof(emit_buf),
|
||||
"# %8.8lx %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.
|
||||
*/
|
||||
char emit_buf[256];
|
||||
int const bytes_written=
|
||||
size_t const bytes_written=
|
||||
my_snprintf(emit_buf, sizeof(emit_buf),
|
||||
"# %8.8lx %-48.48s |%16s|\n",
|
||||
(unsigned long) (hexdump_from + (i & 0xfffffff0)),
|
||||
@ -1335,7 +1335,7 @@ void Log_event::print_header(IO_CACHE* file,
|
||||
if (hex_string[0])
|
||||
{
|
||||
char emit_buf[256];
|
||||
int const bytes_written=
|
||||
size_t const bytes_written=
|
||||
my_snprintf(emit_buf, sizeof(emit_buf),
|
||||
"# %8.8lx %-48.48s |%s|\n",
|
||||
(unsigned long) (hexdump_from + (i & 0xfffffff0)),
|
||||
@ -1628,7 +1628,7 @@ beg:
|
||||
|
||||
case MYSQL_TYPE_DATETIME:
|
||||
{
|
||||
uint d, t;
|
||||
size_t d, t;
|
||||
uint64 i64= uint8korr(ptr); /* YYYYMMDDhhmmss */
|
||||
d= 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;
|
||||
db = table_name + table_name_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
|
||||
|
||||
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_port = uint2korr(mem_pool + SL_MASTER_PORT_OFFSET);
|
||||
master_host = mem_pool + SL_MASTER_HOST_OFFSET;
|
||||
master_host_len = strlen(master_host);
|
||||
master_host_len = (uint) strlen(master_host);
|
||||
// safety
|
||||
master_log = master_host + master_host_len + 1;
|
||||
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;
|
||||
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););
|
||||
int data_size= ROWS_HEADER_LEN;
|
||||
data_size+= no_bytes_in_map(&m_cols);
|
||||
data_size+= end - buf;
|
||||
data_size+= (uint) (end - buf);
|
||||
|
||||
if (type_code == UPDATE_ROWS_EVENT)
|
||||
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;
|
||||
}
|
||||
|
||||
@ -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);
|
||||
|
||||
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));
|
||||
if (bytes_read < event_len)
|
||||
{
|
||||
@ -9268,7 +9268,7 @@ bool
|
||||
Incident_log_event::write_data_body(IO_CACHE *file)
|
||||
{
|
||||
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));
|
||||
}
|
||||
|
||||
|
||||
|
@ -3314,7 +3314,7 @@ public:
|
||||
virtual Log_event_type get_type_code() { return TABLE_MAP_EVENT; }
|
||||
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
|
||||
virtual int save_field_metadata();
|
||||
virtual bool write_data_header(IO_CACHE *file);
|
||||
@ -3897,7 +3897,7 @@ public:
|
||||
return m_incident > INCIDENT_NONE && m_incident < INCIDENT_COUNT;
|
||||
}
|
||||
virtual int get_data_size() {
|
||||
return INCIDENT_HEADER_LEN + 1 + m_message.length;
|
||||
return INCIDENT_HEADER_LEN + 1 + (uint) m_message.length;
|
||||
}
|
||||
|
||||
private:
|
||||
|
@ -1382,9 +1382,9 @@ int Old_rows_log_event::get_data_size()
|
||||
(m_rows_cur - m_rows_buf););
|
||||
int data_size= ROWS_HEADER_LEN;
|
||||
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;
|
||||
}
|
||||
|
||||
|
@ -249,7 +249,7 @@ static int net_data_is_ready(my_socket sd)
|
||||
|
||||
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;
|
||||
else
|
||||
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 *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];
|
||||
uint header_size=NET_HEADER_SIZE+1;
|
||||
DBUG_ENTER("net_write_command");
|
||||
@ -495,7 +495,7 @@ net_write_buff(NET *net, const uchar *packet, ulong len)
|
||||
{
|
||||
ulong left_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
|
||||
left_length= (ulong) (net->buff_end - net->write_pos);
|
||||
|
||||
|
@ -367,7 +367,7 @@ public:
|
||||
char *name(uint *lenp = 0) const
|
||||
{
|
||||
if (lenp)
|
||||
*lenp= m_name.length;
|
||||
*lenp= (uint) m_name.length;
|
||||
return m_name.str;
|
||||
}
|
||||
|
||||
|
@ -281,7 +281,7 @@ public:
|
||||
uint32 len, String *res);
|
||||
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))
|
||||
return 1;
|
||||
wkt->qs_append(get_class_info()->m_name.str, len);
|
||||
|
@ -664,7 +664,7 @@ public:
|
||||
*/
|
||||
|
||||
char *db;
|
||||
uint db_length;
|
||||
size_t db_length;
|
||||
|
||||
public:
|
||||
|
||||
|
@ -54,7 +54,7 @@ static int get_or_create_user_conn(THD *thd, const char *user,
|
||||
USER_RESOURCES *mqh)
|
||||
{
|
||||
int return_val= 0;
|
||||
uint temp_len, user_len;
|
||||
size_t temp_len, user_len;
|
||||
char temp_user[USER_HOST_BUFF_SIZE];
|
||||
struct user_conn *uc;
|
||||
|
||||
|
@ -31,7 +31,7 @@
|
||||
SQL_CRYPT::SQL_CRYPT(const char *password)
|
||||
{
|
||||
ulong rand_nr[2];
|
||||
hash_password(rand_nr,password, strlen(password));
|
||||
hash_password(rand_nr,password, (uint) strlen(password));
|
||||
crypt_init(rand_nr);
|
||||
}
|
||||
|
||||
|
@ -251,7 +251,7 @@ bool mysqld_show_warnings(THD *thd, ulong levels_to_show)
|
||||
protocol->store(warning_level_names[err->level].str,
|
||||
warning_level_names[err->level].length, system_charset_info);
|
||||
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())
|
||||
DBUG_RETURN(TRUE);
|
||||
}
|
||||
|
@ -1893,7 +1893,7 @@ bool delayed_get_table(THD *thd, TABLE_LIST *table_list)
|
||||
pthread_mutex_lock(&LOCK_thread_count);
|
||||
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));
|
||||
if (di->thd.db == NULL || di->thd.query == NULL)
|
||||
{
|
||||
|
@ -253,7 +253,7 @@ void Lex_input_stream::body_utf8_append_literal(THD *thd,
|
||||
{
|
||||
thd->convert_string(&utf_txt,
|
||||
&my_charset_utf8_general_ci,
|
||||
txt->str, txt->length,
|
||||
txt->str, (uint) txt->length,
|
||||
txt_cs);
|
||||
}
|
||||
else
|
||||
@ -435,7 +435,7 @@ bool is_keyword(const char *name, uint len)
|
||||
bool is_lex_native_function(const LEX_STRING *name)
|
||||
{
|
||||
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 */
|
||||
@ -1074,7 +1074,7 @@ int MYSQLlex(void *arg, void *yythd)
|
||||
if (c != '.')
|
||||
{ // Found complete integer number.
|
||||
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
|
||||
case MY_LEX_REAL: // Incomplete real number
|
||||
@ -1977,8 +1977,8 @@ void st_select_lex::print_order(String *str,
|
||||
if (order->counter_used)
|
||||
{
|
||||
char buffer[20];
|
||||
uint length= my_snprintf(buffer, 20, "%d", order->counter);
|
||||
str->append(buffer, length);
|
||||
size_t length= my_snprintf(buffer, 20, "%d", order->counter);
|
||||
str->append(buffer, (uint) length);
|
||||
}
|
||||
else
|
||||
(*order->item)->print(str, query_type);
|
||||
|
@ -1361,7 +1361,7 @@ public:
|
||||
/** Get the utf8-body 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);
|
||||
|
@ -534,8 +534,8 @@ static bool write_execute_load_query_log_event(THD *thd,
|
||||
{
|
||||
Execute_load_query_log_event
|
||||
e(thd, thd->query, thd->query_length,
|
||||
(char*)thd->lex->fname_start - (char*)thd->query,
|
||||
(char*)thd->lex->fname_end - (char*)thd->query,
|
||||
(uint) ((char*)thd->lex->fname_start - (char*)thd->query),
|
||||
(uint) ((char*)thd->lex->fname_end - (char*)thd->query),
|
||||
(duplicates == DUP_REPLACE) ? LOAD_DUP_REPLACE :
|
||||
(ignore ? LOAD_DUP_IGNORE : LOAD_DUP_ERROR),
|
||||
transactional_table, FALSE, killed_err_arg);
|
||||
|
@ -759,13 +759,13 @@ static bool insert_params_with_log(Prepared_statement *stmt, uchar *null_array,
|
||||
Item_param *param= *it;
|
||||
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();
|
||||
else
|
||||
{
|
||||
if (read_pos >= data_end)
|
||||
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)
|
||||
DBUG_RETURN(1);
|
||||
}
|
||||
@ -797,13 +797,13 @@ static bool insert_params(Prepared_statement *stmt, uchar *null_array,
|
||||
Item_param *param= *it;
|
||||
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();
|
||||
else
|
||||
{
|
||||
if (read_pos >= data_end)
|
||||
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)
|
||||
DBUG_RETURN(1);
|
||||
}
|
||||
|
@ -119,7 +119,7 @@ int make_profile_table_for_show(THD *thd, ST_SCHEMA_TABLE *schema_table)
|
||||
if (field)
|
||||
{
|
||||
field->set_name(field_info->old_name,
|
||||
strlen(field_info->old_name),
|
||||
(uint) strlen(field_info->old_name),
|
||||
system_charset_info);
|
||||
if (add_item_to_list(thd, field))
|
||||
return 1;
|
||||
|
@ -205,7 +205,7 @@ void adjust_linfo_offsets(my_off_t purge_offset)
|
||||
|
||||
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;
|
||||
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)
|
||||
{
|
||||
int res;
|
||||
uint log_file_name1_len= strlen(log_file_name1);
|
||||
uint log_file_name2_len= strlen(log_file_name2);
|
||||
size_t log_file_name1_len= strlen(log_file_name1);
|
||||
size_t log_file_name2_len= strlen(log_file_name2);
|
||||
|
||||
// We assume that both log names match up to '.'
|
||||
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))
|
||||
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),
|
||||
block_len -= min(block_len, max_event_size))
|
||||
{
|
||||
|
@ -60,7 +60,7 @@ prepare_server_struct_for_insert(LEX_SERVER_OPTIONS *server_options);
|
||||
/* drop functions */
|
||||
static int delete_server_record(TABLE *table,
|
||||
char *server_name,
|
||||
int server_name_length);
|
||||
size_t server_name_length);
|
||||
static int delete_server_record_in_cache(LEX_SERVER_OPTIONS *server_options);
|
||||
|
||||
/* update functions */
|
||||
@ -301,7 +301,7 @@ get_server_from_table_to_cache(TABLE *table)
|
||||
|
||||
/* get each field into the server struct ptr */
|
||||
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]);
|
||||
server->host= ptr ? ptr : blank;
|
||||
ptr= get_field(&mem, table->field[2]);
|
||||
@ -911,7 +911,7 @@ end:
|
||||
|
||||
static int
|
||||
delete_server_record(TABLE *table,
|
||||
char *server_name, int server_name_length)
|
||||
char *server_name, size_t server_name_length)
|
||||
{
|
||||
int error;
|
||||
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 *buff)
|
||||
{
|
||||
uint server_name_length;
|
||||
size_t server_name_length;
|
||||
FOREIGN_SERVER *server;
|
||||
DBUG_ENTER("get_server_by_name");
|
||||
DBUG_PRINT("info", ("server_name %s", server_name));
|
||||
|
@ -458,7 +458,7 @@ bool String::append(const char *s,uint32 arg_length)
|
||||
|
||||
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;
|
||||
res= to - to_start;
|
||||
res= (uint) (to - to_start);
|
||||
}
|
||||
return (uint32) res;
|
||||
}
|
||||
|
@ -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 errors;
|
||||
uint res;
|
||||
size_t res;
|
||||
DBUG_ENTER("filename_to_tablename");
|
||||
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;
|
||||
/* Don't add FN_ROOTDIR if mysql_data_home already includes it */
|
||||
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 &&
|
||||
memcmp(pos - rootdir_len, FN_ROOTDIR, rootdir_len) != 0)
|
||||
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);
|
||||
}
|
||||
|
||||
uint length= unpack_filename(buff, buff);
|
||||
size_t length= unpack_filename(buff, buff);
|
||||
DBUG_PRINT("exit", ("buff: '%s'", buff));
|
||||
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;
|
||||
*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;
|
||||
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);
|
||||
for (uint i= 0; (tmp= int_it++); i++)
|
||||
{
|
||||
uint lengthsp;
|
||||
size_t lengthsp;
|
||||
if (String::needs_conversion(tmp->length(), tmp->charset(),
|
||||
cs, &dummy))
|
||||
{
|
||||
@ -4236,7 +4236,7 @@ static bool mysql_admin_table(THD* thd, TABLE_LIST* tables,
|
||||
(!(alter_info->flags & ALTER_ALL_PARTITION)))
|
||||
{
|
||||
char buff[FN_REFLEN + MYSQL_ERRMSG_SIZE];
|
||||
uint length;
|
||||
size_t length;
|
||||
DBUG_PRINT("admin", ("sending non existent partition error"));
|
||||
protocol->prepare_for_resend();
|
||||
protocol->store(table_name, system_charset_info);
|
||||
@ -4318,7 +4318,7 @@ static bool mysql_admin_table(THD* thd, TABLE_LIST* tables,
|
||||
{
|
||||
/* purecov: begin inspected */
|
||||
char buff[FN_REFLEN + MYSQL_ERRMSG_SIZE];
|
||||
uint length;
|
||||
size_t length;
|
||||
DBUG_PRINT("admin", ("sending error message"));
|
||||
protocol->prepare_for_resend();
|
||||
protocol->store(table_name, system_charset_info);
|
||||
@ -4436,7 +4436,7 @@ send_result_message:
|
||||
case HA_ADMIN_NOT_IMPLEMENTED:
|
||||
{
|
||||
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);
|
||||
protocol->store(STRING_WITH_LEN("note"), system_charset_info);
|
||||
protocol->store(buf, length, system_charset_info);
|
||||
@ -4446,7 +4446,7 @@ send_result_message:
|
||||
case HA_ADMIN_NOT_BASE_TABLE:
|
||||
{
|
||||
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);
|
||||
protocol->store(STRING_WITH_LEN("note"), system_charset_info);
|
||||
protocol->store(buf, length, system_charset_info);
|
||||
@ -4574,7 +4574,7 @@ send_result_message:
|
||||
case HA_ADMIN_NEEDS_ALTER:
|
||||
{
|
||||
char buf[MYSQL_ERRMSG_SIZE];
|
||||
uint length;
|
||||
size_t length;
|
||||
|
||||
protocol->store(STRING_WITH_LEN("error"), system_charset_info);
|
||||
length=my_snprintf(buf, sizeof(buf), ER(ER_TABLE_NEEDS_UPGRADE),
|
||||
@ -4587,7 +4587,7 @@ send_result_message:
|
||||
default: // Probably HA_ADMIN_INTERNAL_ERROR
|
||||
{
|
||||
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",
|
||||
result_code);
|
||||
protocol->store(STRING_WITH_LEN("error"), system_charset_info);
|
||||
|
@ -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_on_table_name(on_table_names_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;
|
||||
|
||||
DBUG_ASSERT(definitions_list.elements == on_table_names_list.elements &&
|
||||
|
@ -159,7 +159,7 @@ void udf_init()
|
||||
DBUG_PRINT("info",("init udf record"));
|
||||
LEX_STRING name;
|
||||
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]);
|
||||
bool new_dl=0;
|
||||
Item_udftype udftype=UDFTYPE_FUNCTION;
|
||||
|
@ -61,7 +61,7 @@ static void make_unique_view_field_name(Item *target,
|
||||
char *name= (target->orig_name ?
|
||||
target->orig_name :
|
||||
target->name);
|
||||
uint name_len, attempt;
|
||||
size_t name_len, attempt;
|
||||
char buff[NAME_LEN+1];
|
||||
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++))
|
||||
{
|
||||
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;
|
||||
}
|
||||
}
|
||||
@ -1672,7 +1672,7 @@ frm_type_enum mysql_frm_type(THD *thd, char *path, enum legacy_db_type *dbt)
|
||||
{
|
||||
File file;
|
||||
uchar header[10]; //"TYPE=VIEW\n" it is 10 characters
|
||||
int error;
|
||||
size_t error;
|
||||
DBUG_ENTER("mysql_frm_type");
|
||||
|
||||
*dbt= DB_TYPE_UNKNOWN;
|
||||
|
@ -1099,7 +1099,7 @@ char * is_const(UDF_INIT *initid, UDF_ARGS *args __attribute__((unused)),
|
||||
sprintf(result, "not const");
|
||||
}
|
||||
*is_null= 0;
|
||||
*length= strlen(result);
|
||||
*length= (uint) strlen(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)))
|
||||
{
|
||||
strmov(result, initid->ptr);
|
||||
*length= strlen(result);
|
||||
*length= (uint) strlen(result);
|
||||
*is_null= 0;
|
||||
return result;
|
||||
}
|
||||
|
@ -130,7 +130,7 @@ static double get_merge_buffers_cost(uint *buff_elems, uint elem_size,
|
||||
total_buf_elems+= *pbuf;
|
||||
*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 */
|
||||
return 2*((double)total_buf_elems*elem_size) / IO_SIZE +
|
||||
|
@ -390,7 +390,7 @@ int destroy (s)
|
||||
Reads the given number of uncompressed bytes from the compressed 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 */
|
||||
Byte *next_out; /* == stream.next_out but not forced far (for MSDOS) */
|
||||
|
@ -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.
|
||||
If the input file was not in gzip format, gzread copies the given number
|
||||
|
@ -553,7 +553,7 @@ int ha_tina::chain_append()
|
||||
/* We set up for the next position */
|
||||
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;
|
||||
if (chain_alloced)
|
||||
{
|
||||
|
@ -63,7 +63,7 @@ class ha_tina: public handler
|
||||
TINA_SHARE *share; /* Shared lock info */
|
||||
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 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;
|
||||
uchar byte_buffer[IO_SIZE];
|
||||
Transparent_file *file_buff;
|
||||
|
@ -24,7 +24,7 @@ class Transparent_file
|
||||
uchar *buff; /* in-memory window to the file or mmaped area */
|
||||
/* current window sizes */
|
||||
off_t lower_bound;
|
||||
off_t upper_bound;
|
||||
my_off_t upper_bound;
|
||||
uint buff_size;
|
||||
|
||||
public:
|
||||
|
@ -505,7 +505,7 @@ int federated_done(void *p)
|
||||
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)
|
||||
{
|
||||
bool result;
|
||||
@ -515,7 +515,7 @@ static bool append_ident(String *string, const char *name, uint length,
|
||||
|
||||
if (quote_char)
|
||||
{
|
||||
string->reserve(length * 2 + 2);
|
||||
string->reserve((uint) length * 2 + 2);
|
||||
if ((result= string->append("e_char, 1, system_charset_info)))
|
||||
goto err;
|
||||
|
||||
@ -533,7 +533,7 @@ static bool append_ident(String *string, const char *name, uint length,
|
||||
result= string->append("e_char, 1, system_charset_info);
|
||||
}
|
||||
else
|
||||
result= string->append(name, length, system_charset_info);
|
||||
result= string->append(name, (uint) length, system_charset_info);
|
||||
|
||||
err:
|
||||
DBUG_RETURN(result);
|
||||
@ -543,7 +543,7 @@ err:
|
||||
static int parse_url_error(FEDERATED_SHARE *share, TABLE *table, int error_num)
|
||||
{
|
||||
char buf[FEDERATED_QUERY_BUFFER_SIZE];
|
||||
int buf_len;
|
||||
size_t buf_len;
|
||||
DBUG_ENTER("ha_federated parse_url_error");
|
||||
|
||||
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->table_name++;
|
||||
share->table_name_length= strlen(share->table_name);
|
||||
share->table_name_length= (uint) strlen(share->table_name);
|
||||
|
||||
DBUG_PRINT("info",
|
||||
("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);
|
||||
|
||||
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))
|
||||
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))
|
||||
{
|
||||
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,
|
||||
ident_quote_char);
|
||||
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))
|
||||
{
|
||||
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,
|
||||
ident_quote_char);
|
||||
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;
|
||||
DBUG_ENTER("ha_federated::real_query");
|
||||
@ -3169,7 +3169,7 @@ int ha_federated::real_query(const char *query, uint length)
|
||||
if (!query || !length)
|
||||
goto end;
|
||||
|
||||
rc= mysql_real_query(mysql, query, length);
|
||||
rc= mysql_real_query(mysql, query, (uint) length);
|
||||
|
||||
end:
|
||||
DBUG_RETURN(rc);
|
||||
|
@ -70,7 +70,7 @@ typedef struct st_federated_share {
|
||||
int share_key_length;
|
||||
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;
|
||||
THR_LOCK lock;
|
||||
} FEDERATED_SHARE;
|
||||
@ -113,7 +113,7 @@ private:
|
||||
uint key_len,
|
||||
ha_rkey_function find_flag,
|
||||
MYSQL_RES **result);
|
||||
int real_query(const char *query, uint length);
|
||||
int real_query(const char *query, size_t length);
|
||||
int real_connect();
|
||||
public:
|
||||
ha_federated(handlerton *hton, TABLE_SHARE *table_arg);
|
||||
|
@ -69,7 +69,7 @@ int heap_write(HP_INFO *info, const uchar *record)
|
||||
err:
|
||||
if (my_errno == HA_ERR_FOUND_DUPP_KEY)
|
||||
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 got ENOMEM, the key wasn't inserted, so don't try to delete it
|
||||
|
@ -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(
|
||||
thd, f_key_info.referenced_key_name,
|
||||
foreign->referenced_index->name,
|
||||
strlen(foreign->referenced_index->name), 1);
|
||||
(uint) strlen(foreign->referenced_index->name), 1);
|
||||
}
|
||||
else
|
||||
f_key_info.referenced_key_name= 0;
|
||||
@ -7119,7 +7119,7 @@ innodb_show_status(
|
||||
|
||||
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)) {
|
||||
result= TRUE;
|
||||
}
|
||||
@ -7149,7 +7149,7 @@ innodb_mutex_show_status(
|
||||
ulint rw_lock_count_os_yield= 0;
|
||||
ulonglong rw_lock_wait_time= 0;
|
||||
#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");
|
||||
|
||||
mutex_enter_noninline(&mutex_list_mutex);
|
||||
@ -7193,9 +7193,9 @@ innodb_mutex_show_status(
|
||||
rw_lock_wait_time += mutex->lspent_time;
|
||||
}
|
||||
#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);
|
||||
buf2len= my_snprintf(buf2, sizeof(buf2), "os_waits=%lu",
|
||||
buf2len= (uint) my_snprintf(buf2, sizeof(buf2), "os_waits=%lu",
|
||||
mutex->count_os_wait);
|
||||
|
||||
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());
|
||||
|
||||
buf->copy(trx->detailed_error, strlen(trx->detailed_error),
|
||||
buf->copy(trx->detailed_error, (uint) strlen(trx->detailed_error),
|
||||
system_charset_info);
|
||||
|
||||
return FALSE;
|
||||
|
@ -684,7 +684,7 @@ struct for_node_struct{
|
||||
definition */
|
||||
que_node_t* loop_start_limit;/* initial 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
|
||||
is entered, and will not change within
|
||||
the loop */
|
||||
|
@ -62,7 +62,7 @@ static void mi_check_print_msg(MI_CHECK *param, const char* msg_type,
|
||||
{
|
||||
THD* thd = (THD*)param->thd;
|
||||
Protocol *protocol= thd->protocol;
|
||||
uint length, msg_length;
|
||||
size_t length, msg_length;
|
||||
char msgbuf[MI_MAX_MSG_BUF];
|
||||
char name[NAME_LEN*2+2];
|
||||
|
||||
@ -1557,7 +1557,7 @@ bool ha_myisam::check_and_repair(THD *thd)
|
||||
old_query_length= thd->query_length;
|
||||
pthread_mutex_lock(&LOCK_thread_count);
|
||||
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);
|
||||
|
||||
if ((marked_crashed= mi_is_crashed(file)) || check(thd, &check_opt))
|
||||
|
@ -660,7 +660,7 @@ void mi_collect_stats_nonulls_first(HA_KEYSEG *keyseg, ulonglong *notnull,
|
||||
uchar *key)
|
||||
{
|
||||
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
|
||||
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;
|
||||
|
||||
/* 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++)
|
||||
notnull[kp]++;
|
||||
|
||||
@ -3952,7 +3952,7 @@ static int sort_ft_key_write(MI_SORT_PARAM *sort_param, const void *a)
|
||||
key_block++;
|
||||
sort_info->key_block=key_block;
|
||||
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 */
|
||||
for (error=0; !error && p < ft_buf->buf; p+= val_len)
|
||||
|
@ -255,7 +255,7 @@ my_bool _mi_read_pack_info(MI_INFO *info, pbool fix_keys)
|
||||
MYF(MY_HOLD_ON_ERROR));
|
||||
/* 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;
|
||||
for (i=0 ; i < trees ; i++)
|
||||
share->decode_trees[i].table=ADD_TO_PTR(share->decode_trees[i].table,
|
||||
|
@ -409,7 +409,7 @@ int _mi_prefix_search(MI_INFO *info, register MI_KEYDEF *keyinfo, uchar *page,
|
||||
}
|
||||
from+=keyseg->length;
|
||||
page=from+nod_flag;
|
||||
length=from-vseg;
|
||||
length= (uint) (from - vseg);
|
||||
}
|
||||
|
||||
if (page > end)
|
||||
|
@ -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)))
|
||||
{
|
||||
case 0: /* found - exit from recursion */
|
||||
*saved_key = k - page_buf;
|
||||
*saved_key = (uint) (k - page_buf);
|
||||
goto ok;
|
||||
case 1: /* not found - continue searching */
|
||||
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;
|
||||
memcpy(info->lastkey, k, info->lastkey_length);
|
||||
info->rtree_recursion_depth = level;
|
||||
*saved_key = last - page_buf;
|
||||
*saved_key = (uint) (last - page_buf);
|
||||
|
||||
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)))
|
||||
{
|
||||
case 0: /* found - exit from recursion */
|
||||
*saved_key = k - page_buf;
|
||||
*saved_key = (uint) (k - page_buf);
|
||||
goto ok;
|
||||
case 1: /* not found - continue searching */
|
||||
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);
|
||||
|
||||
info->rtree_recursion_depth = level;
|
||||
*saved_key = k - page_buf;
|
||||
*saved_key = (uint) (k - page_buf);
|
||||
|
||||
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;
|
||||
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)
|
||||
{
|
||||
info->buff_used = 1;
|
||||
|
@ -218,7 +218,7 @@ static int myisammrg_parent_open_callback(void *callback_param,
|
||||
TABLE_LIST *child_l;
|
||||
const char *db;
|
||||
const char *table_name;
|
||||
uint dirlen;
|
||||
size_t dirlen;
|
||||
char dir_path[FN_REFLEN];
|
||||
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,
|
||||
LEX_STRING *db, LEX_STRING *name)
|
||||
{
|
||||
uint dir_length, prefix_length;
|
||||
size_t dir_length, prefix_length;
|
||||
char buff[FN_REFLEN];
|
||||
|
||||
db->length= 0;
|
||||
@ -1034,7 +1034,7 @@ int ha_myisammrg::create(const char *name, register TABLE *form,
|
||||
const char **table_names, **pos;
|
||||
TABLE_LIST *tables= (TABLE_LIST*) create_info->merge_list.first;
|
||||
THD *thd= current_thd;
|
||||
uint dirlgt= dirname_length(name);
|
||||
size_t dirlgt= dirname_length(name);
|
||||
DBUG_ENTER("ha_myisammrg::create");
|
||||
|
||||
/* 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)
|
||||
{
|
||||
const char *current_db;
|
||||
uint db_length;
|
||||
size_t db_length;
|
||||
THD *thd= current_thd;
|
||||
MYRG_TABLE *open_table, *first;
|
||||
|
||||
|
@ -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;
|
||||
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;
|
||||
const char *s, *b, *e=str+len;
|
||||
|
@ -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 *);
|
||||
DBUG_ASSERT(to <= 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));
|
||||
to+= width;
|
||||
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, ...)
|
||||
{
|
||||
int result;
|
||||
size_t result;
|
||||
va_list args;
|
||||
va_start(args,fmt);
|
||||
result= my_vsnprintf(to, n, fmt, args);
|
||||
|
@ -54,14 +54,14 @@ int main (int argc, char **argv)
|
||||
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);
|
||||
|
||||
printf("%ld inserted\n",
|
||||
(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);
|
||||
|
||||
|
@ -262,7 +262,7 @@ static MYSQL_STMT *STDCALL
|
||||
mysql_simple_prepare(MYSQL *mysql_arg, const char *query)
|
||||
{
|
||||
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);
|
||||
return 0;
|
||||
|
Loading…
x
Reference in New Issue
Block a user