diff options
Diffstat (limited to 'storage')
70 files changed, 246 insertions, 208 deletions
diff --git a/storage/archive/azio.c b/storage/archive/azio.c index 8bf90e700d4..0f66b999c94 100644 --- a/storage/archive/azio.c +++ b/storage/archive/azio.c @@ -479,7 +479,7 @@ unsigned int ZEXPORT azread ( azio_stream *s, voidp buf, size_t len, int *error) next_out = (Byte*)buf; s->stream.next_out = (Bytef*)buf; - s->stream.avail_out = len; + s->stream.avail_out = (uInt)len; if (s->stream.avail_out && s->back != EOF) { *next_out++ = s->back; @@ -521,7 +521,7 @@ unsigned int ZEXPORT azread ( azio_stream *s, voidp buf, size_t len, int *error) s->out += len; if (len == 0) s->z_eof = 1; { - return len; + return (uint)len; } } if (s->stream.avail_in == 0 && !s->z_eof) { @@ -574,7 +574,7 @@ unsigned int ZEXPORT azread ( azio_stream *s, voidp buf, size_t len, int *error) return 0; } - return (len - s->stream.avail_out); + return (uint)(len - s->stream.avail_out); } @@ -882,7 +882,7 @@ int azclose (azio_stream *s) Though this was added to support MySQL's FRM file, anything can be stored in this location. */ -int azwrite_frm(azio_stream *s, const uchar *blob, unsigned int length) +int azwrite_frm(azio_stream *s, const uchar *blob, size_t length) { if (s->mode == 'r') return 1; @@ -891,7 +891,7 @@ int azwrite_frm(azio_stream *s, const uchar *blob, unsigned int length) return 1; s->frm_start_pos= (uint) s->start; - s->frm_length= length; + s->frm_length= (uint)length; s->start+= length; if (my_pwrite(s->file, blob, s->frm_length, @@ -913,7 +913,7 @@ int azread_frm(azio_stream *s, uchar *blob) /* Simple comment field */ -int azwrite_comment(azio_stream *s, const char *blob, unsigned int length) +int azwrite_comment(azio_stream *s, const char *blob, size_t length) { if (s->mode == 'r') return 1; @@ -922,7 +922,7 @@ int azwrite_comment(azio_stream *s, const char *blob, unsigned int length) return 1; s->comment_start_pos= (uint) s->start; - s->comment_length= length; + s->comment_length= (uint)length; s->start+= length; my_pwrite(s->file, (uchar*) blob, s->comment_length, s->comment_start_pos, diff --git a/storage/archive/azlib.h b/storage/archive/azlib.h index d9318002901..20725aac304 100644 --- a/storage/archive/azlib.h +++ b/storage/archive/azlib.h @@ -334,10 +334,10 @@ extern int azclose(azio_stream *file); error number (see function gzerror below). */ -extern int azwrite_frm (azio_stream *s, const uchar *blob, unsigned int length); +extern int azwrite_frm (azio_stream *s, const uchar *blob,size_t length); extern int azread_frm (azio_stream *s, uchar *blob); extern int azwrite_comment (azio_stream *s, const char *blob, - unsigned int length); + size_t length); extern int azread_comment (azio_stream *s, char *blob); #ifdef __cplusplus diff --git a/storage/archive/ha_archive.cc b/storage/archive/ha_archive.cc index e478058c7fd..08d5220cfca 100644 --- a/storage/archive/ha_archive.cc +++ b/storage/archive/ha_archive.cc @@ -1361,7 +1361,7 @@ int ha_archive::get_row_version2(azio_stream *file_to_read, uchar *buf) if ((size_t) read != size) DBUG_RETURN(HA_ERR_END_OF_FILE); - ((Field_blob*) table->field[*ptr])->set_ptr(size, (uchar*) last); + ((Field_blob*) table->field[*ptr])->set_ptr(read, (uchar*) last); last += size; } else diff --git a/storage/connect/CMakeLists.txt b/storage/connect/CMakeLists.txt index 88bdcfca565..7e900e55368 100644 --- a/storage/connect/CMakeLists.txt +++ b/storage/connect/CMakeLists.txt @@ -326,6 +326,14 @@ IF(NOT TARGET connect) RETURN() ENDIF() + +IF(MSVC) + # Temporarily disable "conversion from size_t .." + IF(CMAKE_SIZEOF_VOID_P EQUAL 8) + SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /wd4267") + ENDIF() +ENDIF() + # Install some extra files that belong to connect engine IF(WIN32) # install ha_connect.lib diff --git a/storage/federatedx/federatedx_io_mysql.cc b/storage/federatedx/federatedx_io_mysql.cc index 2068716eeba..a83e54513d3 100644 --- a/storage/federatedx/federatedx_io_mysql.cc +++ b/storage/federatedx/federatedx_io_mysql.cc @@ -69,14 +69,14 @@ class federatedx_io_mysql :public federatedx_io bool requested_autocommit; bool actual_autocommit; - int actual_query(const char *buffer, uint length); + int actual_query(const char *buffer, size_t length); bool test_all_restrict() const; public: federatedx_io_mysql(FEDERATEDX_SERVER *); ~federatedx_io_mysql(); int simple_query(const char *fmt, ...); - int query(const char *buffer, uint length); + int query(const char *buffer, size_t length); virtual FEDERATEDX_IO_RESULT *store_result(); virtual size_t max_query_size() const; @@ -273,7 +273,7 @@ ulong federatedx_io_mysql::savepoint_release(ulong sp) if (last) { char buffer[STRING_BUFFER_USUAL_SIZE]; - int length= my_snprintf(buffer, sizeof(buffer), + size_t length= my_snprintf(buffer, sizeof(buffer), "RELEASE SAVEPOINT save%lu", last->level); actual_query(buffer, length); } @@ -308,7 +308,7 @@ ulong federatedx_io_mysql::savepoint_rollback(ulong sp) if (savept && !(savept->flags & SAVEPOINT_RESTRICT)) { char buffer[STRING_BUFFER_USUAL_SIZE]; - int length= my_snprintf(buffer, sizeof(buffer), + size_t length= my_snprintf(buffer, sizeof(buffer), "ROLLBACK TO SAVEPOINT save%lu", savept->level); actual_query(buffer, length); } @@ -341,7 +341,8 @@ void federatedx_io_mysql::savepoint_restrict(ulong sp) int federatedx_io_mysql::simple_query(const char *fmt, ...) { char buffer[STRING_BUFFER_USUAL_SIZE]; - int length, error; + size_t length; + int error; va_list arg; DBUG_ENTER("federatedx_io_mysql::simple_query"); @@ -377,7 +378,7 @@ bool federatedx_io_mysql::test_all_restrict() const } -int federatedx_io_mysql::query(const char *buffer, uint length) +int federatedx_io_mysql::query(const char *buffer, size_t length) { int error; bool wants_autocommit= requested_autocommit | is_readonly(); @@ -402,7 +403,7 @@ int federatedx_io_mysql::query(const char *buffer, uint length) if (!(savept->flags & SAVEPOINT_RESTRICT)) { char buf[STRING_BUFFER_USUAL_SIZE]; - int len= my_snprintf(buf, sizeof(buf), + size_t len= my_snprintf(buf, sizeof(buf), "SAVEPOINT save%lu", savept->level); if ((error= actual_query(buf, len))) DBUG_RETURN(error); @@ -419,7 +420,7 @@ int federatedx_io_mysql::query(const char *buffer, uint length) } -int federatedx_io_mysql::actual_query(const char *buffer, uint length) +int federatedx_io_mysql::actual_query(const char *buffer, size_t length) { int error; DBUG_ENTER("federatedx_io_mysql::actual_query"); @@ -452,7 +453,7 @@ int federatedx_io_mysql::actual_query(const char *buffer, uint length) mysql.reconnect= 1; } - error= mysql_real_query(&mysql, buffer, length); + error= mysql_real_query(&mysql, buffer, (ulong)length); DBUG_RETURN(error); } diff --git a/storage/federatedx/federatedx_io_null.cc b/storage/federatedx/federatedx_io_null.cc index aa35d4bdecc..1976f22124a 100644 --- a/storage/federatedx/federatedx_io_null.cc +++ b/storage/federatedx/federatedx_io_null.cc @@ -58,7 +58,7 @@ public: federatedx_io_null(FEDERATEDX_SERVER *); ~federatedx_io_null(); - int query(const char *buffer, uint length); + int query(const char *buffer, size_t length); virtual FEDERATEDX_IO_RESULT *store_result(); virtual size_t max_query_size() const; @@ -178,7 +178,7 @@ void federatedx_io_null::savepoint_restrict(ulong sp) } -int federatedx_io_null::query(const char *buffer, uint length) +int federatedx_io_null::query(const char *buffer, size_t length) { return 0; } diff --git a/storage/federatedx/ha_federatedx.cc b/storage/federatedx/ha_federatedx.cc index 8d5eee99476..8c21906fe84 100644 --- a/storage/federatedx/ha_federatedx.cc +++ b/storage/federatedx/ha_federatedx.cc @@ -482,7 +482,7 @@ int federatedx_done(void *p) in sql_show.cc except that quoting always occurs. */ -bool append_ident(String *string, const char *name, uint length, +bool append_ident(String *string, const char *name, size_t length, const char quote_char) { bool result; @@ -520,7 +520,7 @@ static int parse_url_error(FEDERATEDX_SHARE *share, TABLE_SHARE *table_s, int error_num) { char buf[FEDERATEDX_QUERY_BUFFER_SIZE]; - int buf_len; + size_t buf_len; DBUG_ENTER("ha_federatedx parse_url_error"); buf_len= MY_MIN(table_s->connect_string.length, @@ -1583,7 +1583,7 @@ static FEDERATEDX_SHARE *get_share(const char *table_name, TABLE *table) mysql_mutex_lock(&federatedx_mutex); tmp_share.share_key= table_name; - tmp_share.share_key_length= strlen(table_name); + tmp_share.share_key_length= (int)strlen(table_name); if (parse_url(&mem_root, &tmp_share, table->s, 0)) goto error; @@ -1768,7 +1768,7 @@ int ha_federatedx::open(const char *name, int mode, uint test_if_locked) DBUG_RETURN(error); } - ref_length= io->get_ref_length(); + ref_length= (uint)io->get_ref_length(); txn->release(&io); @@ -3066,7 +3066,7 @@ int ha_federatedx::info(uint flag) stats.block_size= 4096; if ((*iop)->table_metadata(&stats, share->table_name, - share->table_name_length, flag)) + (uint)share->table_name_length, flag)) goto error; } diff --git a/storage/federatedx/ha_federatedx.h b/storage/federatedx/ha_federatedx.h index 02b622b15af..f5affebc426 100644 --- a/storage/federatedx/ha_federatedx.h +++ b/storage/federatedx/ha_federatedx.h @@ -120,7 +120,7 @@ typedef struct st_federatedx_share { int share_key_length; ushort port; - uint table_name_length, server_name_length, connect_string_length; + size_t table_name_length, server_name_length, connect_string_length; uint use_count; THR_LOCK lock; FEDERATEDX_SERVER *s; @@ -171,7 +171,7 @@ public: static void operator delete(void *ptr, size_t size) { TRASH(ptr, size); } - virtual int query(const char *buffer, uint length)=0; + virtual int query(const char *buffer, size_t length)=0; virtual FEDERATEDX_IO_RESULT *store_result()=0; virtual size_t max_query_size() const=0; @@ -450,7 +450,7 @@ extern const char ident_quote_char; // Character for quoting extern const char value_quote_char; // Character for quoting // literals -extern bool append_ident(String *string, const char *name, uint length, +extern bool append_ident(String *string, const char *name, size_t length, const char quote_char); diff --git a/storage/heap/hp_delete.c b/storage/heap/hp_delete.c index 12f2c65f00b..301606af397 100644 --- a/storage/heap/hp_delete.c +++ b/storage/heap/hp_delete.c @@ -68,7 +68,7 @@ int hp_rb_delete_key(HP_INFO *info, register HP_KEYDEF *keyinfo, const uchar *record, uchar *recpos, int flag) { heap_rb_param custom_arg; - ulong old_allocated; + size_t old_allocated; int res; if (flag) diff --git a/storage/heap/hp_hash.c b/storage/heap/hp_hash.c index eca8f71458b..35a3cd20ee8 100644 --- a/storage/heap/hp_hash.c +++ b/storage/heap/hp_hash.c @@ -239,10 +239,10 @@ ulong hp_hashnr(register HP_KEYDEF *keydef, register const uchar *key) if (seg->type == HA_KEYTYPE_TEXT) { CHARSET_INFO *cs= seg->charset; - uint length= seg->length; + size_t length= seg->length; if (cs->mbmaxlen > 1) { - uint char_length; + size_t char_length; char_length= my_charpos(cs, pos, pos + length, length/cs->mbmaxlen); set_if_smaller(length, char_length); } @@ -251,11 +251,11 @@ ulong hp_hashnr(register HP_KEYDEF *keydef, register const uchar *key) else if (seg->type == HA_KEYTYPE_VARTEXT1) /* Any VARCHAR segments */ { CHARSET_INFO *cs= seg->charset; - uint pack_length= 2; /* Key packing is constant */ - uint length= uint2korr(pos); + size_t pack_length= 2; /* Key packing is constant */ + size_t length= uint2korr(pos); if (cs->mbmaxlen > 1) { - uint char_length; + size_t char_length; char_length= my_charpos(cs, pos +pack_length, pos +pack_length + length, seg->length/cs->mbmaxlen); @@ -300,7 +300,7 @@ ulong hp_rec_hashnr(register HP_KEYDEF *keydef, register const uchar *rec) if (seg->type == HA_KEYTYPE_TEXT) { CHARSET_INFO *cs= seg->charset; - uint char_length= seg->length; + size_t char_length= seg->length; if (cs->mbmaxlen > 1) { char_length= my_charpos(cs, pos, pos + char_length, @@ -312,11 +312,11 @@ ulong hp_rec_hashnr(register HP_KEYDEF *keydef, register const uchar *rec) else if (seg->type == HA_KEYTYPE_VARTEXT1) /* Any VARCHAR segments */ { CHARSET_INFO *cs= seg->charset; - uint pack_length= seg->bit_start; - uint length= (pack_length == 1 ? (uint) *(uchar*) pos : uint2korr(pos)); + size_t pack_length= seg->bit_start; + size_t length= (pack_length == 1 ? (size_t) *(uchar*) pos : uint2korr(pos)); if (cs->mbmaxlen > 1) { - uint char_length; + size_t char_length; char_length= my_charpos(cs, pos + pack_length, pos + pack_length + length, seg->length/cs->mbmaxlen); @@ -516,13 +516,13 @@ int hp_rec_key_cmp(HP_KEYDEF *keydef, const uchar *rec1, const uchar *rec2) if (seg->type == HA_KEYTYPE_TEXT) { CHARSET_INFO *cs= seg->charset; - uint char_length1; - uint char_length2; + size_t char_length1; + size_t char_length2; uchar *pos1= (uchar*)rec1 + seg->start; uchar *pos2= (uchar*)rec2 + seg->start; if (cs->mbmaxlen > 1) { - uint char_length= seg->length / cs->mbmaxlen; + size_t char_length= seg->length / cs->mbmaxlen; char_length1= my_charpos(cs, pos1, pos1 + seg->length, char_length); set_if_smaller(char_length1, seg->length); char_length2= my_charpos(cs, pos2, pos2 + seg->length, char_length); @@ -541,13 +541,13 @@ int hp_rec_key_cmp(HP_KEYDEF *keydef, const uchar *rec1, const uchar *rec2) { uchar *pos1= (uchar*) rec1 + seg->start; uchar *pos2= (uchar*) rec2 + seg->start; - uint char_length1, char_length2; - uint pack_length= seg->bit_start; + size_t char_length1, char_length2; + size_t pack_length= seg->bit_start; CHARSET_INFO *cs= seg->charset; if (pack_length == 1) { - char_length1= (uint) *(uchar*) pos1++; - char_length2= (uint) *(uchar*) pos2++; + char_length1= (size_t) *(uchar*) pos1++; + char_length2= (size_t) *(uchar*) pos2++; } else { @@ -558,9 +558,9 @@ int hp_rec_key_cmp(HP_KEYDEF *keydef, const uchar *rec1, const uchar *rec2) } if (cs->mbmaxlen > 1) { - uint safe_length1= char_length1; - uint safe_length2= char_length2; - uint char_length= seg->length / cs->mbmaxlen; + size_t safe_length1= char_length1; + size_t safe_length2= char_length2; + size_t char_length= seg->length / cs->mbmaxlen; char_length1= my_charpos(cs, pos1, pos1 + char_length1, char_length); set_if_smaller(char_length1, safe_length1); char_length2= my_charpos(cs, pos2, pos2 + char_length2, char_length); @@ -623,12 +623,12 @@ int hp_key_cmp(HP_KEYDEF *keydef, const uchar *rec, const uchar *key) if (seg->type == HA_KEYTYPE_TEXT) { CHARSET_INFO *cs= seg->charset; - uint char_length_key; - uint char_length_rec; + size_t char_length_key; + size_t char_length_rec; uchar *pos= (uchar*) rec + seg->start; if (cs->mbmaxlen > 1) { - uint char_length= seg->length / cs->mbmaxlen; + size_t char_length= seg->length / cs->mbmaxlen; char_length_key= my_charpos(cs, key, key + seg->length, char_length); set_if_smaller(char_length_key, seg->length); char_length_rec= my_charpos(cs, pos, pos + seg->length, char_length); @@ -649,16 +649,16 @@ int hp_key_cmp(HP_KEYDEF *keydef, const uchar *rec, const uchar *key) { uchar *pos= (uchar*) rec + seg->start; CHARSET_INFO *cs= seg->charset; - uint pack_length= seg->bit_start; - uint char_length_rec= (pack_length == 1 ? (uint) *(uchar*) pos : + size_t pack_length= seg->bit_start; + size_t char_length_rec= (pack_length == 1 ? (size_t) *(uchar*) pos : uint2korr(pos)); /* Key segments are always packed with 2 bytes */ - uint char_length_key= uint2korr(key); + size_t char_length_key= uint2korr(key); pos+= pack_length; key+= 2; /* skip key pack length */ if (cs->mbmaxlen > 1) { - uint char_length1, char_length2; + size_t char_length1, char_length2; char_length1= char_length2= seg->length / cs->mbmaxlen; char_length1= my_charpos(cs, key, key + char_length_key, char_length1); set_if_smaller(char_length_key, char_length1); @@ -703,7 +703,7 @@ void hp_make_key(HP_KEYDEF *keydef, uchar *key, const uchar *rec) for (seg=keydef->seg,endseg=seg+keydef->keysegs ; seg < endseg ; seg++) { CHARSET_INFO *cs= seg->charset; - uint char_length= seg->length; + size_t char_length= seg->length; uchar *pos= (uchar*) rec + seg->start; if (seg->null_bit) *key++= MY_TEST(rec[seg->null_pos] & seg->null_bit); @@ -742,7 +742,7 @@ uint hp_rb_make_key(HP_KEYDEF *keydef, uchar *key, for (seg= keydef->seg, endseg= seg + keydef->keysegs; seg < endseg; seg++) { - uint char_length; + size_t char_length; if (seg->null_bit) { if (!(*key++= 1 - MY_TEST(rec[seg->null_pos] & seg->null_bit))) @@ -790,9 +790,9 @@ uint hp_rb_make_key(HP_KEYDEF *keydef, uchar *key, if (seg->flag & HA_VAR_LENGTH_PART) { uchar *pos= (uchar*) rec + seg->start; - uint length= seg->length; - uint pack_length= seg->bit_start; - uint tmp_length= (pack_length == 1 ? (uint) *(uchar*) pos : + size_t length= seg->length; + size_t pack_length= seg->bit_start; + size_t tmp_length= (pack_length == 1 ? (uint) *(uchar*) pos : uint2korr(pos)); CHARSET_INFO *cs= seg->charset; char_length= length/cs->mbmaxlen; @@ -840,7 +840,7 @@ uint hp_rb_pack_key(HP_KEYDEF *keydef, uchar *key, const uchar *old, for (seg= keydef->seg, endseg= seg + keydef->keysegs; seg < endseg && keypart_map; old+= seg->length, seg++) { - uint char_length; + size_t char_length; keypart_map>>= 1; if (seg->null_bit) { @@ -867,8 +867,8 @@ uint hp_rb_pack_key(HP_KEYDEF *keydef, uchar *key, const uchar *old, if (seg->flag & (HA_VAR_LENGTH_PART | HA_BLOB_PART)) { /* Length of key-part used with heap_rkey() always 2 */ - uint tmp_length=uint2korr(old); - uint length= seg->length; + size_t tmp_length=uint2korr(old); + size_t length= seg->length; CHARSET_INFO *cs= seg->charset; char_length= length/cs->mbmaxlen; diff --git a/storage/innobase/CMakeLists.txt b/storage/innobase/CMakeLists.txt index 0a9a1a68458..64bf09f1342 100644 --- a/storage/innobase/CMakeLists.txt +++ b/storage/innobase/CMakeLists.txt @@ -180,6 +180,11 @@ IF(CMAKE_COMPILER_IS_GNUCXX AND CMAKE_SYSTEM_PROCESSOR MATCHES "aarch64") ENDIF() ENDIF() IF(MSVC) + IF(CMAKE_SIZEOF_VOID_P EQUAL 8) + ADD_COMPILE_FLAGS( + pars/lexyy.cc + COMPILE_FLAGS "/wd4267") + ENDIF() # silence "switch statement contains 'default' but no 'case' label # on generated file. TARGET_COMPILE_OPTIONS(innobase PRIVATE "/wd4065") diff --git a/storage/innobase/buf/buf0flu.cc b/storage/innobase/buf/buf0flu.cc index 5c96096a8dd..76431fd67f6 100644 --- a/storage/innobase/buf/buf0flu.cc +++ b/storage/innobase/buf/buf0flu.cc @@ -3480,8 +3480,8 @@ buf_flush_set_page_cleaner_thread_cnt(ulong new_cnt) if (new_cnt > page_cleaner.n_workers) { /* User has increased the number of page cleaner threads. */ - uint add = new_cnt - page_cleaner.n_workers; - for (uint i = 0; i < add; i++) { + ulint add = new_cnt - page_cleaner.n_workers; + for (ulint i = 0; i < add; i++) { os_thread_id_t cleaner_thread_id; os_thread_create(buf_flush_page_cleaner_worker, NULL, &cleaner_thread_id); } diff --git a/storage/innobase/fil/fil0crypt.cc b/storage/innobase/fil/fil0crypt.cc index 08a832a4cd5..63f48613896 100644 --- a/storage/innobase/fil/fil0crypt.cc +++ b/storage/innobase/fil/fil0crypt.cc @@ -589,7 +589,7 @@ fil_encrypt_buf( int rc = encryption_scheme_encrypt(src, srclen, dst, &dstlen, crypt_data, key_version, - space, offset, lsn); + (uint32)space, (uint32)offset, lsn); ut_a(rc == MY_AES_OK); ut_a(dstlen == srclen); @@ -1715,7 +1715,7 @@ btr_scrub_get_block_and_allocation_status( mtr_start(&local_mtr); - *allocation_status = fseg_page_is_free(space, offset) ? + *allocation_status = fseg_page_is_free(space, (uint32_t)offset) ? BTR_SCRUB_PAGE_FREE : BTR_SCRUB_PAGE_ALLOCATED; @@ -1779,7 +1779,7 @@ fil_crypt_rotate_page( return; } - ut_d(const bool was_free = fseg_page_is_free(space, offset)); + ut_d(const bool was_free = fseg_page_is_free(space, (uint32_t)offset)); mtr_t mtr; mtr.start(); diff --git a/storage/innobase/handler/ha_innodb.cc b/storage/innobase/handler/ha_innodb.cc index f2e71564945..e46cf823900 100644 --- a/storage/innobase/handler/ha_innodb.cc +++ b/storage/innobase/handler/ha_innodb.cc @@ -3260,7 +3260,7 @@ innobase_invalidate_query_cache( /* Argument TRUE below means we are using transactions */ mysql_query_cache_invalidate4(trx->mysql_thd, qcache_key_name, - (dbname_len + tabname_len + 2), + uint(dbname_len + tabname_len + 2), TRUE); #endif } @@ -6254,8 +6254,8 @@ no_such_table: DBUG_RETURN(HA_ERR_NO_SUCH_TABLE); } - uint n_fields = mysql_fields(table); - uint n_cols = dict_table_get_n_user_cols(ib_table) + size_t n_fields = mysql_fields(table); + size_t n_cols = dict_table_get_n_user_cols(ib_table) + dict_table_get_n_v_cols(ib_table) - !!DICT_TF2_FLAG_IS_SET(ib_table, DICT_TF2_FTS_HAS_DOC_ID); @@ -10098,7 +10098,7 @@ ha_innobase::rnd_pos( /* Note that we assume the length of the row reference is fixed for the table, and it is == ref_length */ - int error = index_read(buf, pos, ref_length, HA_READ_KEY_EXACT); + int error = index_read(buf, pos, (uint)ref_length, HA_READ_KEY_EXACT); if (error != 0) { DBUG_PRINT("error", ("Got error: %d", error)); @@ -14351,7 +14351,7 @@ ha_innobase::info_low( } stats.check_time = 0; - stats.mrr_length_per_rec= ref_length + 8; // 8 = max(sizeof(void *)); + stats.mrr_length_per_rec= (uint)ref_length + 8; // 8 = max(sizeof(void *)); if (stats.records == 0) { stats.mean_rec_length = 0; @@ -21851,7 +21851,7 @@ innobase_convert_to_filename_charset( CHARSET_INFO* cs_from = system_charset_info; return(static_cast<uint>(strconvert( - cs_from, from, strlen(from), + cs_from, from, uint(strlen(from)), cs_to, to, static_cast<uint>(len), &errors))); } @@ -21870,7 +21870,7 @@ innobase_convert_to_system_charset( CHARSET_INFO* cs2 = system_charset_info; return(static_cast<uint>(strconvert( - cs1, from, strlen(from), + cs1, from, static_cast<uint>(strlen(from)), cs2, to, static_cast<uint>(len), errors))); } diff --git a/storage/innobase/include/dict0mem.h b/storage/innobase/include/dict0mem.h index 01840379a71..749a5e38ec8 100644 --- a/storage/innobase/include/dict0mem.h +++ b/storage/innobase/include/dict0mem.h @@ -1107,7 +1107,7 @@ struct dict_index_t{ @param[out] len value length (in bytes), or UNIV_SQL_NULL @return default value @retval NULL if the default value is SQL NULL (len=UNIV_SQL_NULL) */ - const byte* instant_field_value(uint n, ulint* len) const + const byte* instant_field_value(ulint n, ulint* len) const { DBUG_ASSERT(is_instant() || id == DICT_INDEXES_ID); DBUG_ASSERT(n + (id == DICT_INDEXES_ID) >= n_core_fields); diff --git a/storage/innobase/include/sync0policy.h b/storage/innobase/include/sync0policy.h index cd51c0cb90f..78e77f93269 100644 --- a/storage/innobase/include/sync0policy.h +++ b/storage/innobase/include/sync0policy.h @@ -105,7 +105,7 @@ public: msg << m_mutex->policy().to_string(); - if (os_thread_pf(m_thread_id) != ULINT_UNDEFINED) { + if (m_thread_id != ULINT_UNDEFINED) { msg << " addr: " << m_mutex << " acquired: " << locked_from().c_str(); diff --git a/storage/innobase/log/log0crypt.cc b/storage/innobase/log/log0crypt.cc index e7d8e69a9c7..9cd06bc0c6f 100644 --- a/storage/innobase/log/log0crypt.cc +++ b/storage/innobase/log/log0crypt.cc @@ -393,9 +393,9 @@ log_tmp_block_encrypt( aes_ctr_iv[1] = offs; int rc = encryption_crypt( - src, size, dst, &dst_len, - const_cast<byte*>(info.crypt_key.bytes), sizeof info.crypt_key, - reinterpret_cast<byte*>(aes_ctr_iv), sizeof aes_ctr_iv, + src, (uint)size, dst, &dst_len, + const_cast<byte*>(info.crypt_key.bytes), (uint)(sizeof info.crypt_key), + reinterpret_cast<byte*>(aes_ctr_iv), (uint)(sizeof aes_ctr_iv), encrypt ? ENCRYPTION_FLAG_ENCRYPT|ENCRYPTION_FLAG_NOPAD : ENCRYPTION_FLAG_DECRYPT|ENCRYPTION_FLAG_NOPAD, diff --git a/storage/innobase/rem/rem0rec.cc b/storage/innobase/rem/rem0rec.cc index e3bea55d8ff..142aff4270c 100644 --- a/storage/innobase/rem/rem0rec.cc +++ b/storage/innobase/rem/rem0rec.cc @@ -240,7 +240,7 @@ rec_get_n_extern_new( /** Get the length of added field count in a REC_STATUS_COLUMNS_ADDED record. @param[in] n_add_field number of added fields, minus one @return storage size of the field count, in bytes */ -static inline unsigned rec_get_n_add_field_len(unsigned n_add_field) +static inline unsigned rec_get_n_add_field_len(ulint n_add_field) { ut_ad(n_add_field < REC_MAX_N_FIELDS); return n_add_field < 0x80 ? 1 : 2; @@ -268,7 +268,7 @@ static inline unsigned rec_get_n_add_field(const byte*& header) @param[in,out] header variable header of a REC_STATUS_COLUMNS_ADDED record @param[in] n_add number of added fields, minus 1 @return record header before the number of added fields */ -static inline void rec_set_n_add_field(byte*& header, unsigned n_add) +static inline void rec_set_n_add_field(byte*& header, ulint n_add) { ut_ad(n_add < REC_MAX_N_FIELDS); diff --git a/storage/innobase/row/row0ftsort.cc b/storage/innobase/row/row0ftsort.cc index 5d4824f0aae..7ebf7af5dbf 100644 --- a/storage/innobase/row/row0ftsort.cc +++ b/storage/innobase/row/row0ftsort.cc @@ -669,7 +669,7 @@ row_merge_fts_doc_tokenize( MySQL 5.7 changed the fulltext parser plugin interface by adding MYSQL_FTPARSER_BOOLEAN_INFO::position. Below we assume that the field is always 0. */ - unsigned pos = t_ctx->init_pos; + ulint pos = t_ctx->init_pos; byte position[4]; if (parser == NULL) { pos += t_ctx->processed_len + inc - str.f_len; diff --git a/storage/innobase/srv/srv0start.cc b/storage/innobase/srv/srv0start.cc index e45032955d7..02a1519914b 100644 --- a/storage/innobase/srv/srv0start.cc +++ b/storage/innobase/srv/srv0start.cc @@ -2348,7 +2348,7 @@ files_checked: == SRV_OPERATION_RESTORE; /* Delete subsequent log files. */ delete_log_files(logfilename, dirnamelen, - srv_n_log_files_found, trunc); + (uint)srv_n_log_files_found, trunc); if (trunc) { /* Truncate the first log file. */ strcpy(logfilename + dirnamelen, diff --git a/storage/maria/ft_maria.c b/storage/maria/ft_maria.c index 4a5c660af6d..b85a2ea797a 100644 --- a/storage/maria/ft_maria.c +++ b/storage/maria/ft_maria.c @@ -28,9 +28,9 @@ FT_INFO *maria_ft_init_search(uint flags, void *info, uint keynr, FT_INFO *res; if (flags & FT_BOOL) res= maria_ft_init_boolean_search((MARIA_HA *) info, keynr, query, - query_len, cs); + (uint)query_len, cs); else - res= maria_ft_init_nlq_search((MARIA_HA *) info, keynr, query, query_len, + res= maria_ft_init_nlq_search((MARIA_HA *) info, keynr, query, (uint)query_len, flags, record); return res; } diff --git a/storage/maria/ma_check.c b/storage/maria/ma_check.c index 970391a2c70..316a1a06ccc 100644 --- a/storage/maria/ma_check.c +++ b/storage/maria/ma_check.c @@ -3202,7 +3202,7 @@ static int write_page(MARIA_SHARE *share, File file, args.pageno= (pgcache_page_no_t) (pos / share->block_size); args.data= (uchar*) share; (* share->kfile.pre_write_hook)(&args); - res= my_pwrite(file, args.page, block_size, pos, myf_rw); + res= (int)my_pwrite(file, args.page, block_size, pos, myf_rw); (* share->kfile.post_write_hook)(res, &args); return res; } diff --git a/storage/maria/ma_checkpoint.c b/storage/maria/ma_checkpoint.c index 06d48569b2a..7d70f6970e4 100644 --- a/storage/maria/ma_checkpoint.c +++ b/storage/maria/ma_checkpoint.c @@ -48,7 +48,7 @@ static mysql_cond_t COND_checkpoint; static MA_SERVICE_THREAD_CONTROL checkpoint_control= {0, FALSE, FALSE, &LOCK_checkpoint, &COND_checkpoint}; /* is ulong like pagecache->blocks_changed */ -static ulong pages_to_flush_before_next_checkpoint; +static uint pages_to_flush_before_next_checkpoint; static PAGECACHE_FILE *dfiles, /**< data files to flush in background */ *dfiles_end; /**< list of data files ends here */ static PAGECACHE_FILE *kfiles, /**< index files to flush in background */ @@ -265,7 +265,7 @@ static int really_execute_checkpoint(void) ptr= record_pieces[3].str; pages_to_flush_before_next_checkpoint= uint4korr(ptr); DBUG_PRINT("checkpoint",("%u pages to flush before next checkpoint", - (uint)pages_to_flush_before_next_checkpoint)); + pages_to_flush_before_next_checkpoint)); /* compute log's low-water mark */ { @@ -638,7 +638,7 @@ pthread_handler_t ma_checkpoint_background(void *arg) case 1: /* set up parameters for background page flushing */ filter_param.up_to_lsn= last_checkpoint_lsn; - pages_bunch_size= pages_to_flush_before_next_checkpoint / interval; + pages_bunch_size= pages_to_flush_before_next_checkpoint / (uint)interval; dfile= dfiles; kfile= kfiles; /* fall through */ @@ -750,7 +750,7 @@ static int collect_tables(LEX_STRING *str, LSN checkpoint_start_log_horizon) char *ptr; uint error= 1, sync_error= 0, nb, nb_stored, i; my_bool unmark_tables= TRUE; - uint total_names_length; + size_t total_names_length; LIST *pos; /**< to iterate over open tables */ struct st_state_copy { uint index; @@ -981,7 +981,7 @@ static int collect_tables(LEX_STRING *str, LSN checkpoint_start_log_horizon) DBUG_PRINT("info", ("ignore_share: %d", ignore_share)); if (!ignore_share) { - uint open_file_name_len= share->open_file_name.length + 1; + size_t open_file_name_len= share->open_file_name.length + 1; /* remember the descriptors for background flush */ *(dfiles_end++)= dfile; *(kfiles_end++)= kfile; diff --git a/storage/maria/ma_delete.c b/storage/maria/ma_delete.c index c5a2378dc2b..b4b02212a16 100644 --- a/storage/maria/ma_delete.c +++ b/storage/maria/ma_delete.c @@ -801,7 +801,7 @@ static int underflow(MARIA_HA *info, MARIA_KEYDEF *keyinfo, if ((keypos < anc_buff + anc_length && (info->state->records & 1)) || first_key) { - size_t tmp_length; + uint tmp_length; uint next_page_flag; /* Use page right of anc-page */ DBUG_PRINT("test",("use right page")); @@ -968,7 +968,7 @@ static int underflow(MARIA_HA *info, MARIA_KEYDEF *keyinfo, (uchar*) 0, (uchar*) 0, &key_inserted); /* t_length will always be > 0 for a new page !*/ - tmp_length= (size_t) ((next_page.buff + buff_length) - half_pos); + tmp_length= (uint) ((next_page.buff + buff_length) - half_pos); bmove(next_page.buff + p_length + t_length, half_pos, tmp_length); (*keyinfo->store_key)(keyinfo, next_page.buff + p_length, &key_inserted); new_buff_length= tmp_length + t_length + p_length; @@ -1207,7 +1207,7 @@ static int underflow(MARIA_HA *info, MARIA_KEYDEF *keyinfo, DBUG_PRINT("info",("t_length: %d length: %d",t_length, (int) tmp_length)); bmove(leaf_buff+p_length+t_length, half_pos, tmp_length); (*keyinfo->store_key)(keyinfo,leaf_buff+p_length, &key_inserted); - new_leaf_length= tmp_length + t_length + p_length; + new_leaf_length= (uint)(tmp_length + t_length + p_length); DBUG_ASSERT(new_leaf_length <= share->max_index_block_size); leaf_page->size= new_leaf_length; diff --git a/storage/maria/ma_keycache.c b/storage/maria/ma_keycache.c index 39459c486fd..b63535a0897 100644 --- a/storage/maria/ma_keycache.c +++ b/storage/maria/ma_keycache.c @@ -106,7 +106,7 @@ int maria_assign_to_pagecache(MARIA_HA *info, /* store the key cache in the global hash structure for future opens */ if (multi_pagecache_set((uchar*) share->unique_file_name.str, - share->unique_file_name.length, + (uint)share->unique_file_name.length, share->pagecache)) error= my_errno; mysql_mutex_unlock(&share->intern_lock); diff --git a/storage/maria/ma_loghandler.c b/storage/maria/ma_loghandler.c index 778a98f7cc9..c81c7735df5 100644 --- a/storage/maria/ma_loghandler.c +++ b/storage/maria/ma_loghandler.c @@ -5373,7 +5373,7 @@ static void translog_relative_LSN_encode(struct st_translog_parts *parts, /* collect all LSN(s) in one chunk if it (they) is (are) divided */ if (part->length < lsns_len) { - uint copied= part->length; + size_t copied= part->length; LEX_CUSTRING *next_part; DBUG_PRINT("info", ("Using buffer:%p", compressed_LSNs)); memcpy(buffer, part->str, part->length); @@ -5394,7 +5394,7 @@ static void translog_relative_LSN_encode(struct st_translog_parts *parts, } else { - uint len= lsns_len - copied; + size_t len= lsns_len - copied; memcpy(buffer + copied, next_part->str, len); copied= lsns_len; next_part->str+= len; @@ -5430,11 +5430,12 @@ static void translog_relative_LSN_encode(struct st_translog_parts *parts, ref= lsn_korr(src_ptr); dst_ptr= translog_put_LSN_diff(base_lsn, ref, dst_ptr); } - part->length= (uint)((compressed_LSNs + + part->length= (size_t)((compressed_LSNs + (MAX_NUMBER_OF_LSNS_PER_RECORD * COMPRESSED_LSN_MAX_STORE_SIZE)) - dst_ptr); - parts->record_length-= (economy= lsns_len - part->length); + economy= lsns_len - (uint)part->length; + parts->record_length-= economy; DBUG_PRINT("info", ("new length of LSNs: %lu economy: %d", (ulong)part->length, economy)); parts->total_record_length-= economy; @@ -6302,7 +6303,7 @@ my_bool translog_write_record(LSN *lsn, #ifndef DBUG_OFF { uint i; - uint len= 0; + size_t len= 0; #ifdef HAVE_valgrind ha_checksum checksum= 0; #endif diff --git a/storage/maria/ma_page.c b/storage/maria/ma_page.c index ccaba3b7a33..ebf9beab10f 100644 --- a/storage/maria/ma_page.c +++ b/storage/maria/ma_page.c @@ -493,8 +493,8 @@ static my_bool _ma_log_compact_keypage(MARIA_PAGE *ma_page, if (translog_write_record(&lsn, LOGREC_REDO_INDEX, info->trn, info, - log_array[TRANSLOG_INTERNAL_PARTS + - 0].length + extra_length, + (translog_size_t)(log_array[TRANSLOG_INTERNAL_PARTS + + 0].length + extra_length), TRANSLOG_INTERNAL_PARTS + translog_parts, log_array, log_data, NULL)) DBUG_RETURN(1); diff --git a/storage/maria/ma_pagecache.c b/storage/maria/ma_pagecache.c index 8ed97d6eae4..6922326da19 100644 --- a/storage/maria/ma_pagecache.c +++ b/storage/maria/ma_pagecache.c @@ -667,7 +667,7 @@ static my_bool pagecache_fwrite(PAGECACHE *pagecache, DBUG_PRINT("error", ("write callback problem")); DBUG_RETURN(1); } - res= my_pwrite(filedesc->file, args.page, pagecache->block_size, + res= (int)my_pwrite(filedesc->file, args.page, pagecache->block_size, ((my_off_t) pageno << pagecache->shift), flags); (*filedesc->post_write_hook)(res, &args); DBUG_RETURN(res); @@ -810,7 +810,7 @@ size_t init_pagecache(PAGECACHE *pagecache, size_t use_mem, goto err; } /* Set my_hash_entries to the next bigger 2 power */ - if ((pagecache->hash_entries= next_power(blocks)) < + if ((pagecache->hash_entries= next_power((uint)blocks)) < (blocks) * 5/4) pagecache->hash_entries<<= 1; hash_links= 2 * blocks; diff --git a/storage/maria/ma_recovery.c b/storage/maria/ma_recovery.c index ad1df75f19e..9f436f3d8e5 100644 --- a/storage/maria/ma_recovery.c +++ b/storage/maria/ma_recovery.c @@ -3295,7 +3295,7 @@ static LSN parse_checkpoint_record(LSN lsn) { char name[FN_REFLEN]; LSN first_log_write_lsn; - uint name_len; + size_t name_len; uint16 sid= uint2korr(ptr); ptr+= 2; DBUG_ASSERT(sid > 0); diff --git a/storage/maria/ma_rename.c b/storage/maria/ma_rename.c index 71e2dea9d7e..0650d9f6a56 100644 --- a/storage/maria/ma_rename.c +++ b/storage/maria/ma_rename.c @@ -68,7 +68,7 @@ int maria_rename(const char *old_name, const char *new_name) { LSN lsn; LEX_CUSTRING log_array[TRANSLOG_INTERNAL_PARTS + 2]; - uint old_name_len= strlen(old_name)+1, new_name_len= strlen(new_name)+1; + size_t old_name_len= strlen(old_name)+1, new_name_len= strlen(new_name)+1; log_array[TRANSLOG_INTERNAL_PARTS + 0].str= (uchar*)old_name; log_array[TRANSLOG_INTERNAL_PARTS + 0].length= old_name_len; log_array[TRANSLOG_INTERNAL_PARTS + 1].str= (uchar*)new_name; @@ -83,7 +83,7 @@ int maria_rename(const char *old_name, const char *new_name) */ if (unlikely(translog_write_record(&lsn, LOGREC_REDO_RENAME_TABLE, &dummy_transaction_object, NULL, - old_name_len + new_name_len, + (translog_size_t)(old_name_len + new_name_len), sizeof(log_array)/sizeof(log_array[0]), log_array, NULL, NULL) || translog_flush(lsn))) diff --git a/storage/maria/ma_search.c b/storage/maria/ma_search.c index 39d9322d903..31e1d0cb302 100644 --- a/storage/maria/ma_search.c +++ b/storage/maria/ma_search.c @@ -949,7 +949,7 @@ uint _ma_get_static_key(MARIA_KEY *key, uint page_flag, uint nod_flag, register uchar **page) { register MARIA_KEYDEF *keyinfo= key->keyinfo; - size_t key_length= keyinfo->keylength; + uint key_length= keyinfo->keylength; key->ref_length= keyinfo->share->rec_reflength; key->data_length= key_length - key->ref_length; diff --git a/storage/maria/ma_test1.c b/storage/maria/ma_test1.c index 07da313db8a..d7ee7136fb2 100644 --- a/storage/maria/ma_test1.c +++ b/storage/maria/ma_test1.c @@ -577,7 +577,7 @@ static void create_key(uchar *key,uint rownr) } if (keyinfo[0].seg[0].flag & (HA_BLOB_PART | HA_VAR_LENGTH_PART)) { - uint tmp; + size_t tmp; create_key_part(key+2,rownr); tmp=strlen((char*) key+2); int2store(key,tmp); @@ -602,7 +602,7 @@ static void create_record(uchar *record,uint rownr) pos=record+1; if (recinfo[0].type == FIELD_BLOB) { - uint tmp; + size_t tmp; uchar *ptr; create_key_part(blob_key,rownr); tmp=strlen((char*) blob_key); @@ -613,7 +613,7 @@ static void create_record(uchar *record,uint rownr) } else if (recinfo[0].type == FIELD_VARCHAR) { - uint tmp, pack_length= HA_VARCHAR_PACKLENGTH(recinfo[0].length-1); + size_t tmp, pack_length= HA_VARCHAR_PACKLENGTH(recinfo[0].length-1); create_key_part(pos+pack_length,rownr); tmp= strlen((char*) pos+pack_length); if (pack_length == 1) @@ -629,7 +629,7 @@ static void create_record(uchar *record,uint rownr) } if (recinfo[1].type == FIELD_BLOB) { - uint tmp; + size_t tmp; uchar *ptr;; sprintf((char*) blob_record,"... row: %d", rownr); strappend((char*) blob_record,MY_MAX(MAX_REC_LENGTH-rownr,10),' '); @@ -640,7 +640,7 @@ static void create_record(uchar *record,uint rownr) } else if (recinfo[1].type == FIELD_VARCHAR) { - uint tmp, pack_length= HA_VARCHAR_PACKLENGTH(recinfo[1].length-1); + size_t tmp, pack_length= HA_VARCHAR_PACKLENGTH(recinfo[1].length-1); sprintf((char*) pos+pack_length, "... row: %d", rownr); tmp= strlen((char*) pos+pack_length); if (pack_length == 1) diff --git a/storage/maria/unittest/ma_control_file-t.c b/storage/maria/unittest/ma_control_file-t.c index 25ec982133a..e68078d5230 100644 --- a/storage/maria/unittest/ma_control_file-t.c +++ b/storage/maria/unittest/ma_control_file-t.c @@ -123,7 +123,7 @@ static char *create_tmpdir(const char *progname) { static char test_dirname[FN_REFLEN]; char tmp_name[FN_REFLEN]; - uint length; + size_t length; /* Create a temporary directory of name TMP-'executable', but without the -t extension */ fn_format(tmp_name, progname, "", "", MY_REPLACE_DIR | MY_REPLACE_EXT); diff --git a/storage/maria/unittest/ma_maria_log_cleanup.c b/storage/maria/unittest/ma_maria_log_cleanup.c index 23e5be739d1..9c1c916224b 100644 --- a/storage/maria/unittest/ma_maria_log_cleanup.c +++ b/storage/maria/unittest/ma_maria_log_cleanup.c @@ -70,7 +70,7 @@ char *create_tmpdir(const char *progname) { static char test_dirname[FN_REFLEN]; char tmp_name[FN_REFLEN]; - uint length; + size_t length; /* Create a temporary directory of name TMP-'executable', but without the -t extension */ fn_format(tmp_name, progname, "", "", MY_REPLACE_DIR | MY_REPLACE_EXT); diff --git a/storage/maria/unittest/ma_pagecache_consist.c b/storage/maria/unittest/ma_pagecache_consist.c index a9223ca9f6f..5e51c3f29b5 100644 --- a/storage/maria/unittest/ma_pagecache_consist.c +++ b/storage/maria/unittest/ma_pagecache_consist.c @@ -311,7 +311,7 @@ static char *create_tmpdir(const char *progname) { static char test_dirname[FN_REFLEN]; char tmp_name[FN_REFLEN]; - uint length; + size_t length; /* Create a temporary directory of name TMP-'executable', but without the -t extension */ fn_format(tmp_name, progname, "", "", MY_REPLACE_DIR | MY_REPLACE_EXT); @@ -334,7 +334,8 @@ int main(int argc __attribute__((unused)), { pthread_t tid; pthread_attr_t thr_attr; - int *param, error, pagen; + int *param, error; + size_t pagen; MY_INIT(argv[0]); #ifndef DBUG_OFF @@ -413,7 +414,7 @@ int main(int argc __attribute__((unused)), errno); exit(1); } - DBUG_PRINT("info", ("Page cache %d pages", pagen)); + DBUG_PRINT("info", ("Page cache %zd pages", pagen)); { unsigned char *buffr= malloc(TEST_PAGE_SIZE); uint i; diff --git a/storage/maria/unittest/ma_pagecache_rwconsist.c b/storage/maria/unittest/ma_pagecache_rwconsist.c index 0b05d976516..985140091f9 100644 --- a/storage/maria/unittest/ma_pagecache_rwconsist.c +++ b/storage/maria/unittest/ma_pagecache_rwconsist.c @@ -181,7 +181,7 @@ char *create_tmpdir(const char *progname) { static char test_dirname[FN_REFLEN]; char tmp_name[FN_REFLEN]; - uint length; + size_t length; /* Create a temporary directory of name TMP-'executable', but without the -t extension */ fn_format(tmp_name, progname, "", "", MY_REPLACE_DIR | MY_REPLACE_EXT); @@ -204,7 +204,8 @@ int main(int argc __attribute__((unused)), { pthread_t tid; pthread_attr_t thr_attr; - int *param, error, pagen; + int *param, error; + size_t pagen; MY_INIT(argv[0]); @@ -282,7 +283,7 @@ int main(int argc __attribute__((unused)), errno); exit(1); } - DBUG_PRINT("info", ("Page cache %d pages", pagen)); + DBUG_PRINT("info", ("Page cache %zu pages", pagen)); { unsigned char *buffr= malloc(TEST_PAGE_SIZE); memset(buffr, '\0', TEST_PAGE_SIZE); diff --git a/storage/maria/unittest/ma_pagecache_rwconsist2.c b/storage/maria/unittest/ma_pagecache_rwconsist2.c index cfc877d5556..9cc2ced2042 100644 --- a/storage/maria/unittest/ma_pagecache_rwconsist2.c +++ b/storage/maria/unittest/ma_pagecache_rwconsist2.c @@ -177,7 +177,7 @@ static char *create_tmpdir(const char *progname) { static char test_dirname[FN_REFLEN]; char tmp_name[FN_REFLEN]; - uint length; + size_t length; /* Create a temporary directory of name TMP-'executable', but without the -t extension */ fn_format(tmp_name, progname, "", "", MY_REPLACE_DIR | MY_REPLACE_EXT); @@ -200,7 +200,8 @@ int main(int argc __attribute__((unused)), { pthread_t tid; pthread_attr_t thr_attr; - int *param, error, pagen; + int *param, error; + size_t pagen; MY_INIT(argv[0]); @@ -278,7 +279,7 @@ int main(int argc __attribute__((unused)), errno); exit(1); } - DBUG_PRINT("info", ("Page cache %d pages", pagen)); + DBUG_PRINT("info", ("Page cache %zd pages", pagen)); { unsigned char *buffr= malloc(TEST_PAGE_SIZE); memset(buffr, '\0', TEST_PAGE_SIZE); diff --git a/storage/maria/unittest/ma_pagecache_single.c b/storage/maria/unittest/ma_pagecache_single.c index e149af7cf5e..8de52ccf481 100644 --- a/storage/maria/unittest/ma_pagecache_single.c +++ b/storage/maria/unittest/ma_pagecache_single.c @@ -701,7 +701,7 @@ static char *create_tmpdir(const char *progname) { static char test_dirname[FN_REFLEN]; char tmp_name[FN_REFLEN]; - uint length; + size_t length; /* Create a temporary directory of name TMP-'executable', but without the -t extension */ fn_format(tmp_name, progname, "", "", MY_REPLACE_DIR | MY_REPLACE_EXT); @@ -724,7 +724,8 @@ int main(int argc __attribute__((unused)), { pthread_t tid; pthread_attr_t thr_attr; - int *param, error, pagen; + int *param, error; + size_t pagen; File tmp_file; MY_INIT(argv[0]); @@ -809,7 +810,7 @@ int main(int argc __attribute__((unused)), errno); exit(1); } - DBUG_PRINT("info", ("Page cache %d pages", pagen)); + DBUG_PRINT("info", ("Page cache %zd pages", pagen)); pthread_mutex_lock(&LOCK_thread_count); param=(int*) malloc(sizeof(int)); diff --git a/storage/maria/unittest/ma_test_loghandler_purge-t.c b/storage/maria/unittest/ma_test_loghandler_purge-t.c index ef31b47c9c5..a4eecd6bfdc 100644 --- a/storage/maria/unittest/ma_test_loghandler_purge-t.c +++ b/storage/maria/unittest/ma_test_loghandler_purge-t.c @@ -36,7 +36,7 @@ static const char *default_dbug_option; int main(int argc __attribute__((unused)), char *argv[]) { ulong i; - uint pagen; + size_t pagen; uchar long_tr_id[6]; PAGECACHE pagecache; LSN lsn; diff --git a/storage/myisam/ft_boolean_search.c b/storage/myisam/ft_boolean_search.c index 0649d02b73f..8065bb696a1 100644 --- a/storage/myisam/ft_boolean_search.c +++ b/storage/myisam/ft_boolean_search.c @@ -290,7 +290,7 @@ static int ftb_parse_query_internal(MYSQL_FTPARSER_PARAM *param, info.prev= ' '; info.quot= 0; while (ft_get_word(cs, start, end, &w, &info)) - param->mysql_add_word(param, (char*) w.pos, w.len, &info); + param->mysql_add_word(param, (char*) w.pos, (int)w.len, &info); return(0); } @@ -675,7 +675,7 @@ static int ftb_check_phrase_internal(MYSQL_FTPARSER_PARAM *param, while (ft_simple_get_word(phrase_param->cs, (uchar**) &document, docend, &word, FALSE)) { - param->mysql_add_word(param, (char*) word.pos, word.len, 0); + param->mysql_add_word(param, (char*) word.pos, (int)word.len, 0); if (phrase_param->match) break; } @@ -961,7 +961,7 @@ static int ftb_find_relevance_parse(MYSQL_FTPARSER_PARAM *param, uchar *end= (uchar*) doc + len; FT_WORD w; while (ft_simple_get_word(ftb->charset, (uchar**) &doc, end, &w, TRUE)) - param->mysql_add_word(param, (char*) w.pos, w.len, 0); + param->mysql_add_word(param, (char*) w.pos, (int)w.len, 0); return(0); } diff --git a/storage/myisam/ft_myisam.c b/storage/myisam/ft_myisam.c index 4e1879fa8ce..4cbf67ba30f 100644 --- a/storage/myisam/ft_myisam.c +++ b/storage/myisam/ft_myisam.c @@ -28,9 +28,9 @@ FT_INFO *ft_init_search(uint flags, void *info, uint keynr, { FT_INFO *res; if (flags & FT_BOOL) - res= ft_init_boolean_search((MI_INFO *)info, keynr, query, query_len,cs); + res= ft_init_boolean_search((MI_INFO *)info, keynr, query, (uint)query_len,cs); else - res= ft_init_nlq_search((MI_INFO *)info, keynr, query, query_len, flags, + res= ft_init_nlq_search((MI_INFO *)info, keynr, query, (uint)query_len, flags, record); return res; } diff --git a/storage/myisam/ft_parser.c b/storage/myisam/ft_parser.c index c36a3e3f5c8..aec7bd338ac 100644 --- a/storage/myisam/ft_parser.c +++ b/storage/myisam/ft_parser.c @@ -295,7 +295,7 @@ static int ft_parse_internal(MYSQL_FTPARSER_PARAM *param, DBUG_ENTER("ft_parse_internal"); while (ft_simple_get_word(wtree->custom_arg, &doc, end, &w, TRUE)) - if (param->mysql_add_word(param, (char*) w.pos, w.len, 0)) + if (param->mysql_add_word(param, (char*) w.pos, (int)w.len, 0)) DBUG_RETURN(1); DBUG_RETURN(0); } diff --git a/storage/myisam/ft_stopwords.c b/storage/myisam/ft_stopwords.c index 7c743743adc..7294106b569 100644 --- a/storage/myisam/ft_stopwords.c +++ b/storage/myisam/ft_stopwords.c @@ -77,7 +77,7 @@ int ft_init_stopwords() if (ft_stopword_file) { File fd; - uint len; + size_t len; uchar *buffer, *start, *end; FT_WORD w; int error=-1; @@ -87,7 +87,7 @@ int ft_init_stopwords() if ((fd=my_open(ft_stopword_file, O_RDONLY, MYF(MY_WME))) == -1) DBUG_RETURN(-1); - len=(uint)my_seek(fd, 0L, MY_SEEK_END, MYF(0)); + len=(size_t)my_seek(fd, 0L, MY_SEEK_END, MYF(0)); my_seek(fd, 0L, MY_SEEK_SET, MYF(0)); if (!(start=buffer=my_malloc(len+1, MYF(MY_WME)))) goto err0; @@ -124,7 +124,7 @@ int is_stopword(const char *word, size_t len) { FT_STOPWORD sw; sw.pos=word; - sw.len=len; + sw.len=(uint)len; return tree_search(stopwords3,&sw, stopwords3->custom_arg) != NULL; } diff --git a/storage/myisam/mi_cache.c b/storage/myisam/mi_cache.c index 6fa599ff981..012d410c793 100644 --- a/storage/myisam/mi_cache.c +++ b/storage/myisam/mi_cache.c @@ -35,10 +35,10 @@ #include "myisamdef.h" -int _mi_read_cache(IO_CACHE *info, uchar *buff, my_off_t pos, uint length, +int _mi_read_cache(IO_CACHE *info, uchar *buff, my_off_t pos, size_t length, int flag) { - uint read_length,in_buff_length; + size_t read_length,in_buff_length; my_off_t offset; uchar *in_buff_pos; DBUG_ENTER("_mi_read_cache"); @@ -48,7 +48,7 @@ int _mi_read_cache(IO_CACHE *info, uchar *buff, my_off_t pos, uint length, { read_length=length; if ((my_off_t) read_length > (my_off_t) (info->pos_in_file-pos)) - read_length=(uint) (info->pos_in_file-pos); + read_length=(size_t)(info->pos_in_file-pos); info->seek_not_done=1; if (mysql_file_pread(info->file, buff, read_length, pos, MYF(MY_NABP))) DBUG_RETURN(1); @@ -61,9 +61,9 @@ int _mi_read_cache(IO_CACHE *info, uchar *buff, my_off_t pos, uint length, (offset= (my_off_t) (pos - info->pos_in_file)) < (my_off_t) (info->read_end - info->request_pos)) { - in_buff_pos=info->request_pos+(uint) offset; - in_buff_length= MY_MIN(length, (size_t) (info->read_end-in_buff_pos)); - memcpy(buff,info->request_pos+(uint) offset,(size_t) in_buff_length); + in_buff_pos=info->request_pos+ (uint)offset; + in_buff_length= MY_MIN(length, (size_t)(info->read_end-in_buff_pos)); + memcpy(buff,info->request_pos+(uint) offset, in_buff_length); if (!(length-=in_buff_length)) DBUG_RETURN(0); pos+=in_buff_length; diff --git a/storage/myisam/mi_key.c b/storage/myisam/mi_key.c index 9a2526ad2cf..52066c0033d 100644 --- a/storage/myisam/mi_key.c +++ b/storage/myisam/mi_key.c @@ -74,8 +74,8 @@ uint _mi_make_key(register MI_INFO *info, uint keynr, uchar *key, for (keyseg=info->s->keyinfo[keynr].seg ; keyseg->type ;keyseg++) { enum ha_base_keytype type=(enum ha_base_keytype) keyseg->type; - uint length=keyseg->length; - uint char_length; + size_t length=keyseg->length; + size_t char_length; CHARSET_INFO *cs=keyseg->charset; if (keyseg->null_bit) @@ -116,11 +116,11 @@ uint _mi_make_key(register MI_INFO *info, uint keynr, uchar *key, uchar *end= pos + length; while (pos < end && pos[0] == ' ') pos++; - length=(uint) (end-pos); + length=(size_t) (end-pos); } FIX_LENGTH(cs, pos, length, char_length); store_key_length_inc(key,char_length); - memcpy((uchar*) key,(uchar*) pos,(size_t) char_length); + memcpy(key, pos,char_length); key+=char_length; continue; } @@ -133,7 +133,7 @@ uint _mi_make_key(register MI_INFO *info, uint keynr, uchar *key, set_if_smaller(length,tmp_length); FIX_LENGTH(cs, pos, length, char_length); store_key_length_inc(key,char_length); - memcpy((uchar*) key,(uchar*) pos,(size_t) char_length); + memcpy(key, pos, char_length); key+= char_length; continue; } @@ -144,7 +144,7 @@ uint _mi_make_key(register MI_INFO *info, uint keynr, uchar *key, set_if_smaller(length,tmp_length); FIX_LENGTH(cs, pos, length, char_length); store_key_length_inc(key,char_length); - memcpy((uchar*) key,(uchar*) pos,(size_t) char_length); + memcpy(key, pos, char_length); key+= char_length; continue; } @@ -235,8 +235,8 @@ uint _mi_pack_key(register MI_INFO *info, uint keynr, uchar *key, uchar *old, old+= keyseg->length, keyseg++) { enum ha_base_keytype type= (enum ha_base_keytype) keyseg->type; - uint length= keyseg->length; - uint char_length; + size_t length= keyseg->length; + size_t char_length; uchar *pos; CHARSET_INFO *cs=keyseg->charset; @@ -259,7 +259,7 @@ uint _mi_pack_key(register MI_INFO *info, uint keynr, uchar *key, uchar *old, uchar *end= pos + length; while (pos < end && pos[0] == ' ') pos++; - length= (uint) (end - pos); + length= (size_t)(end - pos); } else if (type != HA_KEYTYPE_BINARY) { @@ -267,7 +267,7 @@ uint _mi_pack_key(register MI_INFO *info, uint keynr, uchar *key, uchar *old, } FIX_LENGTH(cs, pos, length, char_length); store_key_length_inc(key,char_length); - memcpy((uchar*) key,pos,(size_t) char_length); + memcpy(key,pos,char_length); key+= char_length; continue; } @@ -280,7 +280,7 @@ uint _mi_pack_key(register MI_INFO *info, uint keynr, uchar *key, uchar *old, FIX_LENGTH(cs, pos, length, char_length); store_key_length_inc(key,char_length); old+=2; /* Skip length */ - memcpy((uchar*) key, pos,(size_t) char_length); + memcpy(key, pos, char_length); key+= char_length; continue; } diff --git a/storage/myisam/mi_locking.c b/storage/myisam/mi_locking.c index 1921926463e..5e5e56db6e8 100644 --- a/storage/myisam/mi_locking.c +++ b/storage/myisam/mi_locking.c @@ -608,7 +608,7 @@ int _mi_mark_file_changed(MI_INFO *info) { mi_int2store(buff,share->state.open_count); buff[2]=1; /* Mark that it's changed */ - DBUG_RETURN(mysql_file_pwrite(share->kfile, buff, sizeof(buff), + DBUG_RETURN((int)mysql_file_pwrite(share->kfile, buff, sizeof(buff), sizeof(share->state.header), MYF(MY_NABP))); } @@ -637,9 +637,9 @@ int _mi_decrement_open_count(MI_INFO *info) { share->state.open_count--; mi_int2store(buff,share->state.open_count); - write_error= mysql_file_pwrite(share->kfile, buff, sizeof(buff), + write_error= (mysql_file_pwrite(share->kfile, buff, sizeof(buff), sizeof(share->state.header), - MYF(MY_NABP)); + MYF(MY_NABP)) != 0); } if (!lock_error && !my_disable_locking) lock_error=mi_lock_database(info,old_lock); diff --git a/storage/myisam/mi_open.c b/storage/myisam/mi_open.c index 41b0e18da02..a50fe0879c3 100644 --- a/storage/myisam/mi_open.c +++ b/storage/myisam/mi_open.c @@ -127,7 +127,7 @@ MI_INFO *mi_open(const char *name, int mode, uint open_flags) share= &share_buff; bzero((uchar*) &share_buff,sizeof(share_buff)); share_buff.key_cache= multi_key_cache_search((uchar*) name_buff, - strlen(name_buff), + (uint)strlen(name_buff), dflt_key_cache); DBUG_EXECUTE_IF("myisam_pretend_crashed_table_on_open", @@ -342,7 +342,7 @@ MI_INFO *mi_open(const char *name, int mode, uint open_flags) (char*) key_del, (sizeof(my_off_t) * share->state.header.max_block_size_index)); strmov(share->unique_file_name, name_buff); - share->unique_name_length= strlen(name_buff); + share->unique_name_length= (uint)strlen(name_buff); strmov(share->index_file_name, index_name); strmov(share->data_file_name, data_name); @@ -687,7 +687,7 @@ MI_INFO *mi_open(const char *name, int mode, uint open_flags) if (myisam_log_file >= 0) { intern_filename(name_buff,share->index_file_name); - _myisam_log(MI_LOG_OPEN, m_info, (uchar*) name_buff, strlen(name_buff)); + _myisam_log(MI_LOG_OPEN, m_info, (uchar*) name_buff, (uint)strlen(name_buff)); } DBUG_RETURN(m_info); diff --git a/storage/myisam/mi_preload.c b/storage/myisam/mi_preload.c index e0d23e0fca0..5c782defcde 100644 --- a/storage/myisam/mi_preload.c +++ b/storage/myisam/mi_preload.c @@ -98,7 +98,7 @@ int mi_preload(MI_INFO *info, ulonglong key_map, my_bool ignore_leaves) { if (key_cache_insert(share->key_cache, share->kfile, pos, DFLT_INIT_HITS, - (uchar*) buff, block_length)) + buff, (uint)block_length)) goto err; } pos+= block_length; @@ -110,7 +110,7 @@ int mi_preload(MI_INFO *info, ulonglong key_map, my_bool ignore_leaves) { if (key_cache_insert(share->key_cache, share->kfile, pos, DFLT_INIT_HITS, - (uchar*) buff, length)) + (uchar*) buff, (uint)length)) goto err; pos+= length; } diff --git a/storage/myisam/mi_test1.c b/storage/myisam/mi_test1.c index bc1f6438e31..61e992694d2 100644 --- a/storage/myisam/mi_test1.c +++ b/storage/myisam/mi_test1.c @@ -386,7 +386,7 @@ static void create_key(uchar *key,uint rownr) } if (keyinfo[0].seg[0].flag & (HA_BLOB_PART | HA_VAR_LENGTH_PART)) { - uint tmp; + size_t tmp; create_key_part(key+2,rownr); tmp=strlen((char*) key+2); int2store(key,tmp); @@ -411,7 +411,7 @@ static void create_record(uchar *record,uint rownr) pos=record+1; if (recinfo[1].type == FIELD_BLOB) { - uint tmp; + size_t tmp; uchar *ptr; create_key_part(blob_key,rownr); tmp=strlen((char*) blob_key); @@ -422,7 +422,7 @@ static void create_record(uchar *record,uint rownr) } else if (recinfo[1].type == FIELD_VARCHAR) { - uint tmp, pack_length= HA_VARCHAR_PACKLENGTH(recinfo[1].length-1); + size_t tmp, pack_length= HA_VARCHAR_PACKLENGTH(recinfo[1].length-1); create_key_part(pos+pack_length,rownr); tmp= strlen((char*) pos+pack_length); if (pack_length == 1) @@ -438,7 +438,7 @@ static void create_record(uchar *record,uint rownr) } if (recinfo[2].type == FIELD_BLOB) { - uint tmp; + size_t tmp; uchar *ptr;; sprintf((char*) blob_record,"... row: %d", rownr); strappend((char*) blob_record,MY_MAX(MAX_REC_LENGTH-rownr,10),' '); @@ -449,7 +449,7 @@ static void create_record(uchar *record,uint rownr) } else if (recinfo[2].type == FIELD_VARCHAR) { - uint tmp, pack_length= HA_VARCHAR_PACKLENGTH(recinfo[1].length-1); + size_t tmp, pack_length= HA_VARCHAR_PACKLENGTH(recinfo[1].length-1); sprintf((char*) pos+pack_length, "... row: %d", rownr); tmp= strlen((char*) pos+pack_length); if (pack_length == 1) diff --git a/storage/myisam/myisamdef.h b/storage/myisam/myisamdef.h index 1431f98ec1b..2c0c1eec49a 100644 --- a/storage/myisam/myisamdef.h +++ b/storage/myisam/myisamdef.h @@ -561,7 +561,7 @@ extern uint _mi_pack_key(MI_INFO *info, uint keynr, uchar *key, HA_KEYSEG ** last_used_keyseg); extern int _mi_read_key_record(MI_INFO *info, my_off_t filepos, uchar *buf); extern int _mi_read_cache(IO_CACHE *info, uchar *buff, my_off_t pos, - uint length, int re_read_if_possibly); + size_t length, int re_read_if_possibly); extern ulonglong retrieve_auto_increment(MI_INFO *info, const uchar *record); extern uchar *mi_alloc_rec_buff(MI_INFO *, ulong, uchar **); diff --git a/storage/myisammrg/ha_myisammrg.cc b/storage/myisammrg/ha_myisammrg.cc index ace1f7c509e..4a35f3666d0 100644 --- a/storage/myisammrg/ha_myisammrg.cc +++ b/storage/myisammrg/ha_myisammrg.cc @@ -233,9 +233,9 @@ extern "C" int myisammrg_parent_open_callback(void *callback_param, Mrg_child_def *mrg_child_def; char *db; char *table_name; - uint dirlen; - uint db_length; - uint table_name_length; + size_t dirlen; + size_t db_length; + size_t table_name_length; char dir_path[FN_REFLEN]; char name_buf[NAME_LEN]; DBUG_ENTER("myisammrg_parent_open_callback"); @@ -1549,7 +1549,7 @@ int ha_myisammrg::create_mrg(const char *name, HA_CREATE_INFO *create_info) opened through the table cache. They are opened by db.table_name, not by their path name. */ - uint length= build_table_filename(buff, sizeof(buff), + size_t length= build_table_filename(buff, sizeof(buff), tables->db.str, tables->table_name.str, "", 0); /* If a MyISAM table is in the same directory as the MERGE table, diff --git a/storage/myisammrg/myrg_open.c b/storage/myisammrg/myrg_open.c index 7f3937f572d..2dcbb735a8b 100644 --- a/storage/myisammrg/myrg_open.c +++ b/storage/myisammrg/myrg_open.c @@ -36,7 +36,8 @@ MYRG_INFO *myrg_open(const char *name, int mode, int handle_locking) { int save_errno,errpos=0; - uint files= 0, i, dir_length, length, UNINIT_VAR(key_parts), min_keys= 0; + uint files= 0, i, UNINIT_VAR(key_parts), min_keys= 0; + size_t length, dir_length; ulonglong file_offset=0; char name_buff[FN_REFLEN*2],buff[FN_REFLEN],*end; MYRG_INFO *m_info=0; @@ -228,7 +229,7 @@ MYRG_INFO *myrg_parent_open(const char *parent_name, int errpos; int save_errno; int insert_method; - uint length; + size_t length; uint child_count; File fd; IO_CACHE file_cache; diff --git a/storage/perfschema/pfs.cc b/storage/perfschema/pfs.cc index fd415d8bc21..1b57a3d38ab 100644 --- a/storage/perfschema/pfs.cc +++ b/storage/perfschema/pfs.cc @@ -1239,9 +1239,9 @@ static enum_operation_type socket_operation_map[]= static int build_prefix(const LEX_CSTRING *prefix, const char *category, char *output, int *output_length) { - int len= strlen(category); + size_t len= strlen(category); char *out_ptr= output; - int prefix_length= prefix->length; + size_t prefix_length= prefix->length; if (unlikely((prefix_length + len + 1) >= PFS_MAX_FULL_PREFIX_NAME_LENGTH)) @@ -1291,7 +1291,7 @@ static int build_prefix(const LEX_CSTRING *prefix, const char *category, { \ DBUG_ASSERT(info->m_key != NULL); \ DBUG_ASSERT(info->m_name != NULL); \ - len= strlen(info->m_name); \ + len= (int)strlen(info->m_name); \ full_length= prefix_length + len; \ if (likely(full_length <= PFS_MAX_INFO_NAME_LENGTH)) \ { \ @@ -1403,7 +1403,7 @@ static void register_stage_v1(const char *category, info= *info_array; DBUG_ASSERT(info != NULL); DBUG_ASSERT(info->m_name != NULL); - len= strlen(info->m_name); + len= (int)strlen(info->m_name); full_length= prefix_length + len; if (likely(full_length <= PFS_MAX_INFO_NAME_LENGTH)) { @@ -1447,7 +1447,7 @@ static void register_statement_v1(const char *category, if (info->m_name == NULL) continue; - len= strlen(info->m_name); + len= (int)strlen(info->m_name); full_length= prefix_length + len; if (likely(full_length <= PFS_MAX_INFO_NAME_LENGTH)) { @@ -1789,7 +1789,7 @@ static void create_file_v1(PSI_file_key key, const char *name, File file) return; } - uint len= strlen(name); + uint len= (uint)strlen(name); PFS_file *pfs_file= find_or_create_file(pfs_thread, klass, name, len, true); file_handle_array[index]= pfs_file; @@ -3964,7 +3964,7 @@ static PSI_file* end_file_open_wait_v1(PSI_file_locker *locker, PFS_file_class *klass= reinterpret_cast<PFS_file_class*> (state->m_class); PFS_thread *thread= reinterpret_cast<PFS_thread*> (state->m_thread); const char *name= state->m_name; - uint len= strlen(name); + uint len= (uint)strlen(name); PFS_file *pfs_file= find_or_create_file(thread, klass, name, len, true); state->m_file= reinterpret_cast<PSI_file*> (pfs_file); } @@ -3996,7 +3996,7 @@ static void end_file_open_wait_and_bind_to_descriptor_v1 PFS_file_class *klass= reinterpret_cast<PFS_file_class*> (state->m_class); PFS_thread *thread= reinterpret_cast<PFS_thread*> (state->m_thread); const char *name= state->m_name; - uint len= strlen(name); + uint len= (uint)strlen(name); pfs_file= find_or_create_file(thread, klass, name, len, true); state->m_file= reinterpret_cast<PSI_file*> (pfs_file); } @@ -4189,7 +4189,7 @@ static void start_file_close_wait_v1(PSI_file_locker *locker, case PSI_FILE_DELETE: thread= reinterpret_cast<PFS_thread*> (state->m_thread); name= state->m_name; - len= strlen(name); + len= (uint)strlen(name); pfs_file= find_or_create_file(thread, NULL, name, len, false); state->m_file= reinterpret_cast<PSI_file*> (pfs_file); break; diff --git a/storage/perfschema/pfs_digest.cc b/storage/perfschema/pfs_digest.cc index 86b05f37fd2..1cc685b7e7b 100644 --- a/storage/perfschema/pfs_digest.cc +++ b/storage/perfschema/pfs_digest.cc @@ -340,7 +340,7 @@ void purge_digest(PFS_thread* thread, PFS_digest_key *hash_key) return; } -void PFS_statements_digest_stat::reset_data(unsigned char *token_array, uint length) +void PFS_statements_digest_stat::reset_data(unsigned char *token_array, size_t length) { m_lock.set_dirty(); m_digest_storage.reset(token_array, length); diff --git a/storage/perfschema/pfs_digest.h b/storage/perfschema/pfs_digest.h index 429a9f4250a..a61e12d911d 100644 --- a/storage/perfschema/pfs_digest.h +++ b/storage/perfschema/pfs_digest.h @@ -61,7 +61,7 @@ struct PFS_ALIGNED PFS_statements_digest_stat ulonglong m_last_seen; /** Reset data for this record. */ - void reset_data(unsigned char* token_array, uint length); + void reset_data(unsigned char* token_array, size_t length); /** Reset data and remove index for this record. */ void reset_index(PFS_thread *thread); }; diff --git a/storage/perfschema/pfs_global.cc b/storage/perfschema/pfs_global.cc index fe1670d0192..732f70a40df 100644 --- a/storage/perfschema/pfs_global.cc +++ b/storage/perfschema/pfs_global.cc @@ -219,6 +219,6 @@ uint pfs_get_socket_address(char *host, } /* Return actual IP address string length */ - return (strlen((const char*)host)); + return ((uint)strlen((const char*)host)); } diff --git a/storage/perfschema/pfs_instr.cc b/storage/perfschema/pfs_instr.cc index 9cb2c68dbaf..61819993c39 100644 --- a/storage/perfschema/pfs_instr.cc +++ b/storage/perfschema/pfs_instr.cc @@ -1296,7 +1296,7 @@ find_or_create_file(PFS_thread *thread, PFS_file_class *klass, *buf_end= '\0'; normalized_filename= buffer; - normalized_length= strlen(normalized_filename); + normalized_length= (int)strlen(normalized_filename); PFS_file **entry; uint retry_count= 0; diff --git a/storage/perfschema/pfs_instr_class.cc b/storage/perfschema/pfs_instr_class.cc index 647702c0d8f..3f5fce9e7a2 100644 --- a/storage/perfschema/pfs_instr_class.cc +++ b/storage/perfschema/pfs_instr_class.cc @@ -1185,7 +1185,7 @@ PFS_instr_class *sanitize_idle_class(PFS_instr_class *unsafe) static void set_keys(PFS_table_share *pfs, const TABLE_SHARE *share) { - int len; + uint len; KEY *key_info= share->key_info; PFS_table_key *pfs_key= pfs->m_keys; PFS_table_key *pfs_key_last= pfs->m_keys + share->keys; @@ -1193,7 +1193,7 @@ static void set_keys(PFS_table_share *pfs, const TABLE_SHARE *share) for ( ; pfs_key < pfs_key_last; pfs_key++, key_info++) { - len= key_info->name.length; + len= (uint)key_info->name.length; memcpy(pfs_key->m_name, key_info->name.str, len); pfs_key->m_name_length= len; } @@ -1215,7 +1215,7 @@ static int compare_keys(PFS_table_share *pfs, const TABLE_SHARE *share) for ( ; pfs_key < pfs_key_last; pfs_key++, key_info++) { - len= key_info->name.length; + len= (uint)key_info->name.length; if (len != pfs_key->m_name_length) return 1; @@ -1248,9 +1248,9 @@ PFS_table_share* find_or_create_table_share(PFS_thread *thread, } const char *schema_name= share->db.str; - uint schema_name_length= share->db.length; + uint schema_name_length= (uint)share->db.length; const char *table_name= share->table_name.str; - uint table_name_length= share->table_name.length; + uint table_name_length= (uint)share->table_name.length; set_table_share_key(&key, temporary, schema_name, schema_name_length, diff --git a/storage/perfschema/pfs_server.cc b/storage/perfschema/pfs_server.cc index ee965c0e7da..eca0f619868 100644 --- a/storage/perfschema/pfs_server.cc +++ b/storage/perfschema/pfs_server.cc @@ -249,8 +249,8 @@ void cleanup_instrument_config() int add_pfs_instr_to_array(const char* name, const char* value) { - int name_length= strlen(name); - int value_length= strlen(value); + size_t name_length= strlen(name); + size_t value_length= strlen(value); /* Allocate structure plus string buffers plus null terminators */ PFS_instr_config* e = (PFS_instr_config*)my_malloc(sizeof(PFS_instr_config) @@ -260,7 +260,7 @@ int add_pfs_instr_to_array(const char* name, const char* value) /* Copy the instrument name */ e->m_name= (char*)e + sizeof(PFS_instr_config); memcpy(e->m_name, name, name_length); - e->m_name_length= name_length; + e->m_name_length= (uint)name_length; e->m_name[name_length]= '\0'; /* Set flags accordingly */ diff --git a/storage/perfschema/table_events_stages.cc b/storage/perfschema/table_events_stages.cc index 42761d92abf..4d86b131049 100644 --- a/storage/perfschema/table_events_stages.cc +++ b/storage/perfschema/table_events_stages.cc @@ -156,7 +156,7 @@ void table_events_stages_common::make_row(PFS_events_stages *stage) return; base= base_name(safe_source_file); - m_row.m_source_length= my_snprintf(m_row.m_source, sizeof(m_row.m_source), + m_row.m_source_length= (uint)my_snprintf(m_row.m_source, sizeof(m_row.m_source), "%s:%d", base, stage->m_source_line); if (m_row.m_source_length > sizeof(m_row.m_source)) m_row.m_source_length= sizeof(m_row.m_source); diff --git a/storage/perfschema/table_events_statements.cc b/storage/perfschema/table_events_statements.cc index fdc63034be5..37237154173 100644 --- a/storage/perfschema/table_events_statements.cc +++ b/storage/perfschema/table_events_statements.cc @@ -270,7 +270,7 @@ void table_events_statements_common::make_row_part_1(PFS_events_statements *stat if (chars > 3) { chars-= 3; - size_t bytes_offset= m_row.m_sqltext.charpos(chars, 0); + uint32 bytes_offset= m_row.m_sqltext.charpos(chars, 0); m_row.m_sqltext.length(bytes_offset); m_row.m_sqltext.append("...", 3); } diff --git a/storage/perfschema/table_events_waits.cc b/storage/perfschema/table_events_waits.cc index 01f8cd5e6b5..ec5acfefeb1 100644 --- a/storage/perfschema/table_events_waits.cc +++ b/storage/perfschema/table_events_waits.cc @@ -427,7 +427,7 @@ void table_events_waits_common::make_row(bool thread_own_wait, return; base= base_name(wait->m_source_file); - m_row.m_source_length= my_snprintf(m_row.m_source, sizeof(m_row.m_source), + m_row.m_source_length= (uint)my_snprintf(m_row.m_source, sizeof(m_row.m_source), "%s:%d", base, wait->m_source_line); if (m_row.m_source_length > sizeof(m_row.m_source)) m_row.m_source_length= sizeof(m_row.m_source); @@ -662,7 +662,7 @@ int table_events_waits_common::read_row_values(TABLE *table, break; case 16: /* OPERATION */ operation= &operation_names_map[(int) m_row.m_operation - 1]; - set_field_varchar_utf8(f, operation->str, operation->length); + set_field_varchar_utf8(f, operation->str, (uint)operation->length); break; case 17: /* NUMBER_OF_BYTES */ if ((m_row.m_operation == OPERATION_TYPE_FILEREAD) || diff --git a/storage/perfschema/table_host_cache.cc b/storage/perfschema/table_host_cache.cc index df13207e578..d9853906b99 100644 --- a/storage/perfschema/table_host_cache.cc +++ b/storage/perfschema/table_host_cache.cc @@ -150,7 +150,7 @@ end: void table_host_cache::make_row(Host_entry *entry, row_host_cache *row) { - row->m_ip_length= strlen(entry->ip_key); + row->m_ip_length= (int)strlen(entry->ip_key); strcpy(row->m_ip, entry->ip_key); row->m_hostname_length= entry->m_hostname_length; if (row->m_hostname_length > 0) diff --git a/storage/perfschema/table_setup_consumers.cc b/storage/perfschema/table_setup_consumers.cc index f3529eb8846..b4cb359c0d2 100644 --- a/storage/perfschema/table_setup_consumers.cc +++ b/storage/perfschema/table_setup_consumers.cc @@ -174,7 +174,7 @@ int table_setup_consumers::read_row_values(TABLE *table, switch(f->field_index) { case 0: /* NAME */ - set_field_varchar_utf8(f, m_row->m_name.str, m_row->m_name.length); + set_field_varchar_utf8(f, m_row->m_name.str,(uint) m_row->m_name.length); break; case 1: /* ENABLED */ set_field_enum(f, (*m_row->m_enabled_ptr) ? ENUM_YES : ENUM_NO); diff --git a/storage/perfschema/table_setup_timers.cc b/storage/perfschema/table_setup_timers.cc index 9c6af49595d..6020548abaa 100644 --- a/storage/perfschema/table_setup_timers.cc +++ b/storage/perfschema/table_setup_timers.cc @@ -129,7 +129,7 @@ int table_setup_timers::read_row_values(TABLE *table, switch(f->field_index) { case 0: /* NAME */ - set_field_varchar_utf8(f, m_row->m_name.str, m_row->m_name.length); + set_field_varchar_utf8(f, m_row->m_name.str,(uint) m_row->m_name.length); break; case 1: /* TIMER_NAME */ set_field_enum(f, *(m_row->m_timer_name_ptr)); diff --git a/storage/perfschema/table_threads.cc b/storage/perfschema/table_threads.cc index 1458c0b11d5..f5c97ddd175 100644 --- a/storage/perfschema/table_threads.cc +++ b/storage/perfschema/table_threads.cc @@ -228,7 +228,7 @@ int table_threads::read_row_values(TABLE *table, case 7: /* PROCESSLIST_COMMAND */ if (m_row.m_processlist_id != 0) set_field_varchar_utf8(f, command_name[m_row.m_command].str, - command_name[m_row.m_command].length); + (uint)command_name[m_row.m_command].length); else f->set_null(); break; diff --git a/storage/perfschema/unittest/pfs-t.cc b/storage/perfschema/unittest/pfs-t.cc index b8814f2ad2d..3da18ac30c0 100644 --- a/storage/perfschema/unittest/pfs-t.cc +++ b/storage/perfschema/unittest/pfs-t.cc @@ -43,10 +43,10 @@ PFS_file* lookup_file_by_name(const char* name) { uint i; PFS_file *pfs; - uint len= strlen(name); + size_t len= strlen(name); size_t dirlen; const char *filename; - uint filename_length;; + size_t filename_length;; for (i= 0; i < file_max; i++) { diff --git a/storage/rocksdb/CMakeLists.txt b/storage/rocksdb/CMakeLists.txt index 6cb7eb1d439..c3a95299b88 100644 --- a/storage/rocksdb/CMakeLists.txt +++ b/storage/rocksdb/CMakeLists.txt @@ -216,9 +216,13 @@ IF(MSVC) # additional const qualifiers to parameters of the overriden virtual functions # This creates a lot of warnings, that we silence here. ADD_DEFINITIONS(/wd4373) - # Some checks in C++ runtime that make debug build much slower ADD_DEFINITIONS(-D_ITERATOR_DEBUG_LEVEL=0) + + # Temporarily disable "conversion from size_t .." warnings + IF(CMAKE_SIZEOF_VOID_P EQUAL 8) + SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /wd4267") + ENDIF() ENDIF() IF(GIT_EXECUTABLE) diff --git a/storage/sphinx/CMakeLists.txt b/storage/sphinx/CMakeLists.txt index e50ba74ba90..f05da9a496f 100644 --- a/storage/sphinx/CMakeLists.txt +++ b/storage/sphinx/CMakeLists.txt @@ -5,6 +5,13 @@ ADD_DEFINITIONS(-DMYSQL_SERVER) MY_CHECK_AND_SET_COMPILER_FLAG("-Wno-write-strings") IF(MSVC) + # Temporarily disable "conversion from size_t .." warnings + IF(CMAKE_SIZEOF_VOID_P EQUAL 8) + SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /wd4267") + ENDIF() +ENDIF() + +IF(MSVC) LINK_LIBRARIES(ws2_32) ENDIF(MSVC) diff --git a/storage/spider/CMakeLists.txt b/storage/spider/CMakeLists.txt index 499b4948485..d267a6ba3f9 100644 --- a/storage/spider/CMakeLists.txt +++ b/storage/spider/CMakeLists.txt @@ -6,6 +6,13 @@ IF(HAVE_WVLA) SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -Wno-vla") ENDIF() +IF(MSVC) + # Temporarily disable "conversion from size_t .." + IF(CMAKE_SIZEOF_VOID_P EQUAL 8) + SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /wd4267") + ENDIF() +ENDIF() + SET(SPIDER_SOURCES spd_param.cc spd_sys_table.cc spd_trx.cc spd_db_conn.cc spd_conn.cc spd_table.cc spd_direct_sql.cc spd_udf.cc spd_ping_table.cc |