diff options
Diffstat (limited to 'storage')
32 files changed, 106 insertions, 91 deletions
diff --git a/storage/connect/connect.h b/storage/connect/connect.h index bbefda52274..b877f1ffb6c 100644 --- a/storage/connect/connect.h +++ b/storage/connect/connect.h @@ -57,6 +57,7 @@ class DOXDEF: public DOSDEF { /* This is the DOS/UNIX Access Method base class declaration. */ /***********************************************************************/ class TDBDOX: public TDBDOS { + TDBDOX(): TDBDOS((PGLOBAL)0,(PTDBDOS) 0) {} /* Never called */ friend int MakeIndex(PGLOBAL, PTDB, PIXDEF); friend int CntCloseTable(PGLOBAL, PTDB, bool, bool); friend int CntIndexInit(PGLOBAL, PTDB, int, bool); diff --git a/storage/connect/csort.cpp b/storage/connect/csort.cpp index 2f918782c80..b36653994f0 100644 --- a/storage/connect/csort.cpp +++ b/storage/connect/csort.cpp @@ -775,7 +775,11 @@ void CSORT::Qstc(int *base, int *max) /* Small group. Do special quicker processing. */ /*****************************************************************/ if ((rc = Qcompare(base, (i = base + 1))) > 0) - c = *base, *base = *i, *i = c; + { + c = *base; + *base = *i; + *i = c; + } if (Pof) Pof[base - Pex] = Pof[i - Pex] = (rc) ? 1 : 2; diff --git a/storage/connect/ha_connect.cc b/storage/connect/ha_connect.cc index 7fda7d86ece..434f7b4060c 100644 --- a/storage/connect/ha_connect.cc +++ b/storage/connect/ha_connect.cc @@ -1098,7 +1098,7 @@ bool GetBooleanTableOption(PGLOBAL g, PTOS options, char *opname, bool bdef) /****************************************************************************/ int GetIntegerTableOption(PGLOBAL g, PTOS options, char *opname, int idef) { - ulonglong opval= NO_IVAL; + ulonglong opval= (ulonglong) NO_IVAL; if (!options) return idef; diff --git a/storage/connect/jsonudf.cpp b/storage/connect/jsonudf.cpp index 6987230121a..a60dacd80fb 100644 --- a/storage/connect/jsonudf.cpp +++ b/storage/connect/jsonudf.cpp @@ -1302,7 +1302,7 @@ static my_bool CalcLen(UDF_ARGS *args, my_bool obj, { char fn[_MAX_PATH]; unsigned long i, k, m, n; - long fl, j = -1; + long fl= 0, j = -1; reslen = args->arg_count + 2; @@ -1370,7 +1370,6 @@ static my_bool CalcLen(UDF_ARGS *args, my_bool obj, memlen += (k + sizeof(JOBJECT) + sizeof(JPAIR)); } else memlen += sizeof(JARRAY); - fl= 0; switch (args->arg_type[i]) { case STRING_RESULT: if (n == 2 && args->args[i]) { diff --git a/storage/connect/tabodbc.cpp b/storage/connect/tabodbc.cpp index c555f2a5abb..aca4ae92927 100644 --- a/storage/connect/tabodbc.cpp +++ b/storage/connect/tabodbc.cpp @@ -681,7 +681,7 @@ bool TDBODBC::MakeCommand(PGLOBAL g) } else { sprintf(g->Message, "Cannot use this %s command", (Mode == MODE_UPDATE) ? "UPDATE" : "DELETE"); - return NULL; + return false; } // endif p Query = new(g) STRING(g, 0, stmt); diff --git a/storage/innobase/btr/btr0cur.cc b/storage/innobase/btr/btr0cur.cc index a6bb258344f..3b41fcf34fc 100644 --- a/storage/innobase/btr/btr0cur.cc +++ b/storage/innobase/btr/btr0cur.cc @@ -4070,7 +4070,7 @@ btr_estimate_number_of_different_key_vals( */ if (index->stat_index_size > 1) { n_sample_pages = (srv_stats_transient_sample_pages < index->stat_index_size) ? - ut_min(index->stat_index_size, + (ulint) ut_min((double) index->stat_index_size, log2(index->stat_index_size)*srv_stats_transient_sample_pages) : index->stat_index_size; diff --git a/storage/innobase/btr/btr0defragment.cc b/storage/innobase/btr/btr0defragment.cc index 26bab936de5..4d9eab8f2bd 100644 --- a/storage/innobase/btr/btr0defragment.cc +++ b/storage/innobase/btr/btr0defragment.cc @@ -151,7 +151,7 @@ void btr_defragment_init() { srv_defragment_interval = ut_microseconds_to_timer( - 1000000.0 / srv_defragment_frequency); + (ulonglong) (1000000.0 / srv_defragment_frequency)); mutex_create(btr_defragment_mutex_key, &btr_defragment_mutex, SYNC_ANY_LATCH); os_thread_create(btr_defragment_thread, NULL, NULL); diff --git a/storage/innobase/buf/buf0flu.cc b/storage/innobase/buf/buf0flu.cc index 780230b38ba..30b3b6f4698 100644 --- a/storage/innobase/buf/buf0flu.cc +++ b/storage/innobase/buf/buf0flu.cc @@ -2066,7 +2066,7 @@ ulint af_get_pct_for_dirty() /*==================*/ { - ulint dirty_pct = buf_get_modified_ratio_pct(); + ulint dirty_pct = (ulint) buf_get_modified_ratio_pct(); if (dirty_pct > 0 && srv_max_buf_pool_modified_pct == 0) { return(100); @@ -2086,7 +2086,7 @@ af_get_pct_for_dirty() } } else if (dirty_pct > srv_max_dirty_pages_pct_lwm) { /* We should start flushing pages gradually. */ - return((dirty_pct * 100) + return (ulint) ((dirty_pct * 100) / (srv_max_buf_pool_modified_pct + 1)); } @@ -2104,8 +2104,8 @@ af_get_pct_for_lsn( { lsn_t max_async_age; lsn_t lsn_age_factor; - lsn_t af_lwm = (srv_adaptive_flushing_lwm - * log_get_capacity()) / 100; + lsn_t af_lwm = (lsn_t) ((srv_adaptive_flushing_lwm + * log_get_capacity()) / 100); if (age < af_lwm) { /* No adaptive flushing. */ diff --git a/storage/innobase/fil/fil0crypt.cc b/storage/innobase/fil/fil0crypt.cc index ceffa950739..2db3063d6b5 100644 --- a/storage/innobase/fil/fil0crypt.cc +++ b/storage/innobase/fil/fil0crypt.cc @@ -474,7 +474,7 @@ fil_parse_write_crypt_data( 4 + // size of key_id 1; // fil_encryption_t - if (end_ptr - ptr < entry_size){ + if ((uint) (end_ptr - ptr) < entry_size){ return NULL; } @@ -500,7 +500,7 @@ fil_parse_write_crypt_data( fil_encryption_t encryption = (fil_encryption_t)mach_read_from_1(ptr); ptr +=1; - if (end_ptr - ptr < len) { + if ((uint) (end_ptr - ptr) < len) { return NULL; } @@ -1351,7 +1351,7 @@ fil_crypt_space_needs_rotation( last_scrub_completed; bool need_scrubbing = crypt_data->rotate_state.scrubbing.is_active - && diff >= srv_background_scrub_data_interval; + && diff >= (time_t) srv_background_scrub_data_interval; if (need_key_rotation == false && need_scrubbing == false) break; @@ -2247,7 +2247,7 @@ DECLARE_THREAD(fil_crypt_thread)( time_t waited = time(0) - wait_start; - if (waited >= srv_background_scrub_data_check_interval) { + if (waited >= (time_t) srv_background_scrub_data_check_interval) { break; } } diff --git a/storage/innobase/handler/ha_innodb.cc b/storage/innobase/handler/ha_innodb.cc index a7987f1596e..dc4b4487eeb 100644 --- a/storage/innobase/handler/ha_innodb.cc +++ b/storage/innobase/handler/ha_innodb.cc @@ -17753,7 +17753,7 @@ innodb_defragment_frequency_update( { srv_defragment_frequency = (*static_cast<const uint*>(save)); srv_defragment_interval = ut_microseconds_to_timer( - 1000000.0 / srv_defragment_frequency); + (ulonglong) (1000000.0 / srv_defragment_frequency)); } /****************************************************************//** diff --git a/storage/innobase/lock/lock0lock.cc b/storage/innobase/lock/lock0lock.cc index bc7ec1d221b..2798cf00d1f 100644 --- a/storage/innobase/lock/lock0lock.cc +++ b/storage/innobase/lock/lock0lock.cc @@ -2387,7 +2387,7 @@ lock_rec_add_to_queue( if (wsrep_debug) { fprintf(stderr, "BF skipping wait: %lu\n", - trx->id); + (ulong) trx->id); lock_rec_print(stderr, lock); } } else @@ -4961,7 +4961,7 @@ lock_table_other_has_incompatible( #ifdef WITH_WSREP if(wsrep_thd_is_wsrep(trx->mysql_thd)) { if (wsrep_debug) { - fprintf(stderr, "WSREP: trx %ld table lock abort\n", + fprintf(stderr, "WSREP: trx " TRX_ID_FMT " table lock abort\n", trx->id); } trx_mutex_enter(lock->trx); diff --git a/storage/innobase/log/log0crypt.cc b/storage/innobase/log/log0crypt.cc index db2e84d7e45..f518845b1a8 100644 --- a/storage/innobase/log/log0crypt.cc +++ b/storage/innobase/log/log0crypt.cc @@ -144,11 +144,11 @@ log_crypt_print_checkpoint_keys( ib_uint64_t checkpoint_no = log_block_get_checkpoint_no(log_block); if (crypt_info.size()) { - fprintf(stderr, "InnoDB: redo log checkpoint: %lu [ chk key ]: ", checkpoint_no); + fprintf(stderr, "InnoDB: redo log checkpoint: %lu [ chk key ]: ", (ulong) checkpoint_no); for (size_t i = 0; i < crypt_info.size(); i++) { struct crypt_info_t* it = &crypt_info[i]; fprintf(stderr, "[ %lu %u ] ", - it->checkpoint_no, + (ulong) it->checkpoint_no, it->key_version); } fprintf(stderr, "\n"); diff --git a/storage/innobase/os/os0file.cc b/storage/innobase/os/os0file.cc index 3a0bd1fc328..5948aadf220 100644 --- a/storage/innobase/os/os0file.cc +++ b/storage/innobase/os/os0file.cc @@ -2402,7 +2402,7 @@ os_file_set_size( fprintf(stderr, "InnoDB: Error: preallocating file " "space for file \'%s\' failed. Current size " "%lu, desired size %lu\n", - name, current_size, size); + name, (ulong) current_size, (ulong) size); os_file_handle_error_no_exit(name, "posix_fallocate", FALSE, __FILE__, __LINE__); return(FALSE); @@ -6298,7 +6298,7 @@ os_file_trim( fprintf(stderr, " InnoDB: Warning: fallocate call failed with error code %d.\n" " InnoDB: start: %lu len: %lu payload: %lu\n" - " InnoDB: Disabling fallocate for now.\n", errno, off, trim_len, len); + " InnoDB: Disabling fallocate for now.\n", errno, (ulong) off, (ulong) trim_len, (ulong) len); os_file_handle_error_no_exit(slot->name, " fallocate(FALLOC_PUNCH_HOLE | FALLOC_FL_KEEP_SIZE) ", diff --git a/storage/innobase/row/row0merge.cc b/storage/innobase/row/row0merge.cc index 36ae979e965..e8f3ad97c67 100644 --- a/storage/innobase/row/row0merge.cc +++ b/storage/innobase/row/row0merge.cc @@ -109,9 +109,9 @@ row_merge_encrypt_buf( if (! ((rc == MY_AES_OK) && ((ulint)dstlen == srv_sort_buf_size-ROW_MERGE_RESERVE_SIZE))) { ib_logf(IB_LOG_LEVEL_FATAL, "Unable to encrypt data-block " - " src: %p srclen: %lu buf: %p buflen: %d." + " src: %p srclen: %lu buf: %p buflen: %u." " return-code: %d. Can't continue!\n", - input_buf, (size_t)srv_sort_buf_size, + input_buf, (ulong) srv_sort_buf_size, crypted_buf, dstlen, rc); ut_error; } @@ -153,7 +153,7 @@ row_merge_decrypt_buf( "Unable to encrypt data-block " " src: %p srclen: %lu buf: %p buflen: %d." " return-code: %d. Can't continue!\n", - input_buf, (size_t)srv_sort_buf_size, + input_buf, (ulong) srv_sort_buf_size, crypted_buf, dstlen, rc); ut_error; } @@ -2067,7 +2067,7 @@ write_buffers: pct_cost : ((pct_cost * read_rows) / table_total_rows); /* presenting 10.12% as 1012 integer */ - onlineddl_pct_progress = curr_progress * 100; + onlineddl_pct_progress = (ulint) (curr_progress * 100); } } @@ -2603,7 +2603,7 @@ row_merge_sort( /* Find the number N which 2^N is greater or equal than num_runs */ /* N is merge sort running count */ - total_merge_sort_count = ceil(my_log2f(num_runs)); + total_merge_sort_count = (ulint) ceil(my_log2f(num_runs)); if(total_merge_sort_count <= 0) { total_merge_sort_count=1; } @@ -2650,7 +2650,7 @@ row_merge_sort( pct_cost : ((pct_cost * merge_count) / total_merge_sort_count); /* presenting 10.12% as 1012 integer */; - onlineddl_pct_progress = (pct_progress + curr_progress) * 100; + onlineddl_pct_progress = (ulint) ((pct_progress + curr_progress) * 100); } if (error != DB_SUCCESS) { @@ -2933,7 +2933,7 @@ row_merge_insert_index_tuples( ((pct_cost * inserted_rows) / table_total_rows); /* presenting 10.12% as 1012 integer */; - onlineddl_pct_progress = (pct_progress + curr_progress) * 100; + onlineddl_pct_progress = (ulint) ((pct_progress + curr_progress) * 100); } } } diff --git a/storage/maria/ma_check_standalone.h b/storage/maria/ma_check_standalone.h index 6626a62c4ef..890d6ba3d31 100644 --- a/storage/maria/ma_check_standalone.h +++ b/storage/maria/ma_check_standalone.h @@ -23,7 +23,7 @@ void _mi_report_crashed(void *file __attribute__((unused)), { } -static unsigned int no_key() +static unsigned int no_key(unsigned int not_used __attribute__((unused))) { return ENCRYPTION_KEY_VERSION_INVALID; } diff --git a/storage/maria/ma_checksum.c b/storage/maria/ma_checksum.c index da2d40d3687..48b29946cea 100644 --- a/storage/maria/ma_checksum.c +++ b/storage/maria/ma_checksum.c @@ -58,7 +58,7 @@ ha_checksum _ma_checksum(MARIA_HA *info, const uchar *record) length= _ma_calc_blob_length(blob_size_length, pos); if (length) { - memcpy(&pos, pos + blob_size_length, sizeof(char*)); + memcpy((char**) &pos, pos + blob_size_length, sizeof(char*)); crc= my_checksum(crc, pos, length); } continue; diff --git a/storage/maria/ma_ft_update.c b/storage/maria/ma_ft_update.c index a166b7b21fb..59c134cd4d3 100644 --- a/storage/maria/ma_ft_update.c +++ b/storage/maria/ma_ft_update.c @@ -83,7 +83,7 @@ uint _ma_ft_segiterator(register FT_SEG_ITERATOR *ftsi) if (ftsi->seg->flag & HA_BLOB_PART) { ftsi->len= _ma_calc_blob_length(ftsi->seg->bit_start,ftsi->pos); - memcpy(&ftsi->pos, ftsi->pos+ftsi->seg->bit_start, sizeof(char*)); + memcpy((char**) &ftsi->pos, ftsi->pos+ftsi->seg->bit_start, sizeof(char*)); DBUG_RETURN(1); } ftsi->len=ftsi->seg->length; diff --git a/storage/maria/ma_sort.c b/storage/maria/ma_sort.c index ef6e8506ac6..e90b1d96a4a 100644 --- a/storage/maria/ma_sort.c +++ b/storage/maria/ma_sort.c @@ -195,8 +195,10 @@ int _ma_create_index_by_sort(MARIA_SORT_PARAM *info, my_bool no_messages, while ((maxbuffer= (uint) (records/(keys-1)+1)) != maxbuffer_org); } - if ((sort_keys=(uchar**) my_malloc(keys*(sort_length+sizeof(char*))+ - HA_FT_MAXBYTELEN, MYF(0)))) + if ((sort_keys= ((uchar**) + my_malloc((size_t) (keys*(sort_length+sizeof(char*))+ + HA_FT_MAXBYTELEN), + MYF(0))))) { if (my_init_dynamic_array(&buffpek, sizeof(BUFFPEK), maxbuffer, MY_MIN(maxbuffer/2, 1000), MYF(0))) @@ -436,13 +438,15 @@ pthread_handler_t _ma_thr_find_all_keys(void *arg) } while ((maxbuffer= (uint) (idx/(keys-1)+1)) != maxbuffer_org); } - if ((sort_keys= (uchar **) - my_malloc(keys*(sort_length+sizeof(char*))+ - ((sort_param->keyinfo->flag & HA_FULLTEXT) ? - HA_FT_MAXBYTELEN : 0), MYF(0)))) + if ((sort_keys= ((uchar **) + my_malloc((size_t) + (keys*(sort_length+sizeof(char*))+ + ((sort_param->keyinfo->flag & HA_FULLTEXT) ? + HA_FT_MAXBYTELEN : 0)), MYF(0))))) { if (my_init_dynamic_array(&sort_param->buffpek, sizeof(BUFFPEK), - maxbuffer, MY_MIN(maxbuffer/2, 1000), MYF(0))) + maxbuffer, MY_MIN(maxbuffer/2, 1000), + MYF(0))) { my_free(sort_keys); sort_keys= (uchar **) NULL; /* for err: label */ @@ -624,7 +628,7 @@ int _ma_thr_write_keys(MARIA_SORT_PARAM *sort_param) length=param->sort_buffer_length; while (length >= MIN_SORT_MEMORY) { - if ((mergebuf= my_malloc(length, MYF(0)))) + if ((mergebuf= my_malloc((size_t) length, MYF(0)))) break; length=length*3/4; } @@ -728,8 +732,8 @@ static int write_keys(MARIA_SORT_PARAM *info, register uchar **sort_keys, if (!buffpek) DBUG_RETURN(1); /* Out of memory */ - my_qsort2((uchar*) sort_keys,count,sizeof(uchar*),(qsort2_cmp) info->key_cmp, - info); + my_qsort2((uchar*) sort_keys,(size_t) count, sizeof(uchar*), + (qsort2_cmp) info->key_cmp, info); if (!my_b_inited(tempfile) && open_cached_file(tempfile, my_tmpdir(info->tmpdir), "ST", DISK_BUFFER_SIZE, info->sort_info->param->myf_rw)) @@ -774,8 +778,8 @@ static int write_keys_varlen(MARIA_SORT_PARAM *info, if (!buffpek) DBUG_RETURN(1); /* Out of memory */ - my_qsort2((uchar*) sort_keys,count,sizeof(uchar*),(qsort2_cmp) info->key_cmp, - info); + my_qsort2((uchar*) sort_keys, (size_t) count, sizeof(uchar*), + (qsort2_cmp) info->key_cmp, info); if (!my_b_inited(tempfile) && open_cached_file(tempfile, my_tmpdir(info->tmpdir), "ST", DISK_BUFFER_SIZE, info->sort_info->param->myf_rw)) @@ -917,7 +921,8 @@ static my_off_t read_to_buffer(IO_CACHE *fromfile, BUFFPEK *buffpek, register ha_keys count; my_off_t length; - if ((count= (ha_keys) MY_MIN((ha_rows) buffpek->max_keys,buffpek->count))) + if ((count= (ha_keys) MY_MIN((ha_rows) buffpek->max_keys, + (ha_rows) buffpek->count))) { if (my_b_pread(fromfile, (uchar*) buffpek->base, (length= sort_length * count), buffpek->file_pos)) @@ -985,7 +990,7 @@ static int write_merge_key(MARIA_SORT_PARAM *info __attribute__((unused)), IO_CACHE *to_file, uchar *key, uint sort_length, ha_keys count) { - return my_b_write(to_file, key, ((size_t) sort_length) * count); + return my_b_write(to_file, key, (size_t) (sort_length * count)); } /* @@ -1045,7 +1050,7 @@ merge_buffers(MARIA_SORT_PARAM *info, ha_keys keys, IO_CACHE *from_file, if (to_file) { if (info->write_key(info,to_file, buffpek->key, - (uint) sort_length,1)) + sort_length, 1)) goto err; /* purecov: inspected */ } else @@ -1062,7 +1067,7 @@ merge_buffers(MARIA_SORT_PARAM *info, ha_keys keys, IO_CACHE *from_file, if (!(read_length= info->read_to_buffer(from_file,buffpek,sort_length))) { uchar *base= buffpek->base; - uint max_keys=buffpek->max_keys; + ha_keys max_keys=buffpek->max_keys; queue_remove_top(&queue); diff --git a/storage/mroonga/vendor/groonga/lib/ctx.c b/storage/mroonga/vendor/groonga/lib/ctx.c index 92caba561eb..c4a485527c1 100644 --- a/storage/mroonga/vendor/groonga/lib/ctx.c +++ b/storage/mroonga/vendor/groonga/lib/ctx.c @@ -51,7 +51,8 @@ #define GRN_CTX_INITIALIZER(enc) \ { GRN_SUCCESS, 0, enc, 0, GRN_LOG_NOTICE,\ - GRN_CTX_FIN, 0, 0, 0, 0, {0}, NULL, NULL, NULL, NULL, NULL } + GRN_CTX_FIN, 0, 0, 0, 0, {0}, NULL, NULL, NULL, NULL, NULL, \ + {NULL, NULL,NULL, NULL,NULL, NULL,NULL, NULL,NULL, NULL,NULL, NULL,NULL, NULL,NULL, NULL}, ""} #define GRN_CTX_CLOSED(ctx) ((ctx)->stat == GRN_CTX_FIN) diff --git a/storage/mroonga/vendor/groonga/lib/db.c b/storage/mroonga/vendor/groonga/lib/db.c index e213812d926..05e4d73e5ed 100644 --- a/storage/mroonga/vendor/groonga/lib/db.c +++ b/storage/mroonga/vendor/groonga/lib/db.c @@ -4137,7 +4137,7 @@ grn_column_create(grn_ctx *ctx, grn_obj *table, { grn_db *s; uint32_t value_size; - grn_obj *db, *res = NULL; + grn_obj *db= NULL, *res = NULL; grn_id id = GRN_ID_NIL; grn_id range = GRN_ID_NIL; grn_id domain = GRN_ID_NIL; diff --git a/storage/mroonga/vendor/groonga/lib/ii.c b/storage/mroonga/vendor/groonga/lib/ii.c index 388e0566756..df6e4ba3a34 100644 --- a/storage/mroonga/vendor/groonga/lib/ii.c +++ b/storage/mroonga/vendor/groonga/lib/ii.c @@ -385,7 +385,7 @@ chunk_free(grn_ctx *ctx, grn_ii *ii, uint32_t offset, uint32_t dummy, uint32_t s } */ grn_io_win iw, iw_; - grn_ii_ginfo *ginfo; + grn_ii_ginfo *ginfo= 0; uint32_t seg, m, *gseg; seg = offset >> GRN_II_N_CHUNK_VARIATION; if (size > S_CHUNK) { diff --git a/storage/myisam/ft_update.c b/storage/myisam/ft_update.c index 10a36650b0a..8f437476121 100644 --- a/storage/myisam/ft_update.c +++ b/storage/myisam/ft_update.c @@ -83,7 +83,7 @@ uint _mi_ft_segiterator(register FT_SEG_ITERATOR *ftsi) if (ftsi->seg->flag & HA_BLOB_PART) { ftsi->len=_mi_calc_blob_length(ftsi->seg->bit_start,ftsi->pos); - memcpy(&ftsi->pos, ftsi->pos+ftsi->seg->bit_start, sizeof(char*)); + memcpy((char**) &ftsi->pos, ftsi->pos+ftsi->seg->bit_start, sizeof(char*)); DBUG_RETURN(1); } ftsi->len=ftsi->seg->length; diff --git a/storage/myisam/mi_unique.c b/storage/myisam/mi_unique.c index 5192d404939..dae453beaec 100644 --- a/storage/myisam/mi_unique.c +++ b/storage/myisam/mi_unique.c @@ -112,7 +112,7 @@ ha_checksum mi_unique_hash(MI_UNIQUEDEF *def, const uchar *record) else if (keyseg->flag & HA_BLOB_PART) { uint tmp_length=_mi_calc_blob_length(keyseg->bit_start,pos); - memcpy(&pos, pos+keyseg->bit_start, sizeof(char*)); + memcpy((char**) &pos, pos+keyseg->bit_start, sizeof(char*)); if (!length || length > tmp_length) length=tmp_length; /* The whole blob */ } @@ -207,8 +207,8 @@ int mi_unique_comp(MI_UNIQUEDEF *def, const uchar *a, const uchar *b, set_if_smaller(a_length, keyseg->length); set_if_smaller(b_length, keyseg->length); } - memcpy(&pos_a, pos_a+keyseg->bit_start, sizeof(char*)); - memcpy(&pos_b, pos_b+keyseg->bit_start, sizeof(char*)); + memcpy((char**) &pos_a, pos_a+keyseg->bit_start, sizeof(char*)); + memcpy((char**) &pos_b, pos_b+keyseg->bit_start, sizeof(char*)); } if (type == HA_KEYTYPE_TEXT || type == HA_KEYTYPE_VARTEXT1 || type == HA_KEYTYPE_VARTEXT2) diff --git a/storage/myisam/sort.c b/storage/myisam/sort.c index f490e5f0b44..17e2ca4190b 100644 --- a/storage/myisam/sort.c +++ b/storage/myisam/sort.c @@ -191,8 +191,9 @@ int _create_index_by_sort(MI_SORT_PARAM *info,my_bool no_messages, while ((maxbuffer= (uint) (records/(keys-1)+1)) != maxbuffer_org); } - if ((sort_keys=(uchar **)my_malloc(keys*(sort_length+sizeof(char*))+ - HA_FT_MAXBYTELEN, MYF(0)))) + if ((sort_keys= ((uchar **) + my_malloc((size_t) (keys*(sort_length+sizeof(char*))+ + HA_FT_MAXBYTELEN), MYF(0))))) { if (my_init_dynamic_array(&buffpek, sizeof(BUFFPEK), maxbuffer, MY_MIN(maxbuffer/2, 1000), MYF(0))) @@ -417,13 +418,15 @@ pthread_handler_t thr_find_all_keys(void *arg) } while ((maxbuffer= (uint) (idx/(keys-1)+1)) != maxbuffer_org); } - if ((sort_keys= (uchar**) - my_malloc(keys*(sort_length+sizeof(char*))+ - ((sort_param->keyinfo->flag & HA_FULLTEXT) ? - HA_FT_MAXBYTELEN : 0), MYF(0)))) + if ((sort_keys= ((uchar**) + my_malloc((size_t) + (keys*(sort_length+sizeof(char*))+ + ((sort_param->keyinfo->flag & HA_FULLTEXT) ? + HA_FT_MAXBYTELEN : 0)), MYF(0))))) { if (my_init_dynamic_array(&sort_param->buffpek, sizeof(BUFFPEK), - maxbuffer, MY_MIN(maxbuffer/2, 1000), MYF(0))) + maxbuffer, MY_MIN(maxbuffer/2, 1000), + MYF(0))) { my_free(sort_keys); sort_keys= (uchar **) NULL; /* for err: label */ @@ -603,7 +606,7 @@ int thr_write_keys(MI_SORT_PARAM *sort_param) length=param->sort_buffer_length; while (length >= MIN_SORT_BUFFER) { - if ((mergebuf= my_malloc(length, MYF(0)))) + if ((mergebuf= my_malloc((size_t) length, MYF(0)))) break; length=length*3/4; } @@ -695,8 +698,8 @@ static int write_keys(MI_SORT_PARAM *info, register uchar **sort_keys, if (!buffpek) DBUG_RETURN(1); /* Out of memory */ - my_qsort2((uchar*) sort_keys,count,sizeof(uchar*),(qsort2_cmp) info->key_cmp, - info); + my_qsort2((uchar*) sort_keys,(size_t) count, sizeof(uchar*), + (qsort2_cmp) info->key_cmp, info); if (!my_b_inited(tempfile) && open_cached_file(tempfile, my_tmpdir(info->tmpdir), "ST", DISK_BUFFER_SIZE, info->sort_info->param->myf_rw)) @@ -741,8 +744,8 @@ static int write_keys_varlen(MI_SORT_PARAM *info, if (!buffpek) DBUG_RETURN(1); /* Out of memory */ - my_qsort2((uchar*) sort_keys,count,sizeof(uchar*),(qsort2_cmp) info->key_cmp, - info); + my_qsort2((uchar*) sort_keys, (size_t) count, sizeof(uchar*), + (qsort2_cmp) info->key_cmp, info); if (!my_b_inited(tempfile) && open_cached_file(tempfile, my_tmpdir(info->tmpdir), "ST", DISK_BUFFER_SIZE, info->sort_info->param->myf_rw)) @@ -865,10 +868,12 @@ static my_off_t read_to_buffer(IO_CACHE *fromfile, BUFFPEK *buffpek, register ha_keys count; my_off_t length; - if ((count= (ha_keys) MY_MIN((ha_rows) buffpek->max_keys,buffpek->count))) + if ((count= (ha_keys) MY_MIN((ha_rows) buffpek->max_keys, + (ha_rows) buffpek->count))) { if (my_b_pread(fromfile, (uchar*) buffpek->base, - (length= sort_length * count), buffpek->file_pos)) + (length= (my_off_t) (sort_length * count)), + buffpek->file_pos)) return(HA_OFFSET_ERROR); buffpek->key=buffpek->base; buffpek->file_pos+= length; /* New filepos */ @@ -933,7 +938,7 @@ static int write_merge_key(MI_SORT_PARAM *info __attribute__((unused)), IO_CACHE *to_file, uchar *key, uint sort_length, ha_keys count) { - return my_b_write(to_file, key, ((size_t) sort_length) * count); + return my_b_write(to_file, key, (size_t) (sort_length * count)); } /* @@ -993,7 +998,7 @@ merge_buffers(MI_SORT_PARAM *info, ha_keys keys, IO_CACHE *from_file, if (to_file) { if (info->write_key(info,to_file,(uchar*) buffpek->key, - (uint) sort_length,1)) + sort_length, 1)) { error=1; goto err; /* purecov: inspected */ } @@ -1016,7 +1021,7 @@ merge_buffers(MI_SORT_PARAM *info, ha_keys keys, IO_CACHE *from_file, if (!(read_length= info->read_to_buffer(from_file,buffpek,sort_length))) { uchar *base= buffpek->base; - uint max_keys=buffpek->max_keys; + ha_keys max_keys=buffpek->max_keys; queue_remove_top(&queue); diff --git a/storage/xtradb/btr/btr0cur.cc b/storage/xtradb/btr/btr0cur.cc index 5bb94dfce2a..7ee37836bfb 100644 --- a/storage/xtradb/btr/btr0cur.cc +++ b/storage/xtradb/btr/btr0cur.cc @@ -4257,7 +4257,7 @@ btr_estimate_number_of_different_key_vals( */ if (index->stat_index_size > 1) { n_sample_pages = (srv_stats_transient_sample_pages < index->stat_index_size) ? - ut_min(index->stat_index_size, + (ulint) ut_min((double) index->stat_index_size, log2(index->stat_index_size)*srv_stats_transient_sample_pages) : index->stat_index_size; diff --git a/storage/xtradb/btr/btr0defragment.cc b/storage/xtradb/btr/btr0defragment.cc index 6e7a3fd2411..8de85e746ca 100644 --- a/storage/xtradb/btr/btr0defragment.cc +++ b/storage/xtradb/btr/btr0defragment.cc @@ -151,7 +151,7 @@ void btr_defragment_init() { srv_defragment_interval = ut_microseconds_to_timer( - 1000000.0 / srv_defragment_frequency); + (ulonglong) (1000000.0 / srv_defragment_frequency)); mutex_create(btr_defragment_mutex_key, &btr_defragment_mutex, SYNC_ANY_LATCH); os_thread_create(btr_defragment_thread, NULL, NULL); diff --git a/storage/xtradb/buf/buf0flu.cc b/storage/xtradb/buf/buf0flu.cc index 5d64b75784a..ec13673a56c 100644 --- a/storage/xtradb/buf/buf0flu.cc +++ b/storage/xtradb/buf/buf0flu.cc @@ -2425,7 +2425,7 @@ ulint af_get_pct_for_dirty() /*==================*/ { - ulint dirty_pct = buf_get_modified_ratio_pct(); + ulint dirty_pct = (ulint) buf_get_modified_ratio_pct(); if (dirty_pct > 0 && srv_max_buf_pool_modified_pct == 0) { return(100); @@ -2445,7 +2445,7 @@ af_get_pct_for_dirty() } } else if (dirty_pct > srv_max_dirty_pages_pct_lwm) { /* We should start flushing pages gradually. */ - return((dirty_pct * 100) + return (ulint) ((dirty_pct * 100) / (srv_max_buf_pool_modified_pct + 1)); } @@ -2463,8 +2463,8 @@ af_get_pct_for_lsn( { lsn_t max_async_age; lsn_t lsn_age_factor; - lsn_t af_lwm = (srv_adaptive_flushing_lwm - * log_get_capacity()) / 100; + lsn_t af_lwm = (lsn_t) ((srv_adaptive_flushing_lwm + * log_get_capacity()) / 100); if (age < af_lwm) { /* No adaptive flushing. */ diff --git a/storage/xtradb/handler/ha_innodb.cc b/storage/xtradb/handler/ha_innodb.cc index 38cd3177ade..3a5e98fcb32 100644 --- a/storage/xtradb/handler/ha_innodb.cc +++ b/storage/xtradb/handler/ha_innodb.cc @@ -18361,7 +18361,7 @@ innodb_defragment_frequency_update( { srv_defragment_frequency = (*static_cast<const uint*>(save)); srv_defragment_interval = ut_microseconds_to_timer( - 1000000.0 / srv_defragment_frequency); + (ulonglong) (1000000.0 / srv_defragment_frequency)); } /****************************************************************//** diff --git a/storage/xtradb/lock/lock0lock.cc b/storage/xtradb/lock/lock0lock.cc index 6d69f441019..4f7a60c1c7a 100644 --- a/storage/xtradb/lock/lock0lock.cc +++ b/storage/xtradb/lock/lock0lock.cc @@ -2409,7 +2409,7 @@ lock_rec_add_to_queue( if (wsrep_debug) { fprintf(stderr, "BF skipping wait: %lu\n", - trx->id); + (ulong) trx->id); lock_rec_print(stderr, lock); } } else @@ -4998,7 +4998,7 @@ lock_table_other_has_incompatible( #ifdef WITH_WSREP if(wsrep_thd_is_wsrep(trx->mysql_thd)) { if (wsrep_debug) { - fprintf(stderr, "WSREP: trx %ld table lock abort\n", + fprintf(stderr, "WSREP: trx " TRX_ID_FMT " table lock abort\n", trx->id); } trx_mutex_enter(lock->trx); diff --git a/storage/xtradb/log/log0crypt.cc b/storage/xtradb/log/log0crypt.cc index db2e84d7e45..f518845b1a8 100644 --- a/storage/xtradb/log/log0crypt.cc +++ b/storage/xtradb/log/log0crypt.cc @@ -144,11 +144,11 @@ log_crypt_print_checkpoint_keys( ib_uint64_t checkpoint_no = log_block_get_checkpoint_no(log_block); if (crypt_info.size()) { - fprintf(stderr, "InnoDB: redo log checkpoint: %lu [ chk key ]: ", checkpoint_no); + fprintf(stderr, "InnoDB: redo log checkpoint: %lu [ chk key ]: ", (ulong) checkpoint_no); for (size_t i = 0; i < crypt_info.size(); i++) { struct crypt_info_t* it = &crypt_info[i]; fprintf(stderr, "[ %lu %u ] ", - it->checkpoint_no, + (ulong) it->checkpoint_no, it->key_version); } fprintf(stderr, "\n"); diff --git a/storage/xtradb/os/os0file.cc b/storage/xtradb/os/os0file.cc index 2bb094e115d..7cb283dba75 100644 --- a/storage/xtradb/os/os0file.cc +++ b/storage/xtradb/os/os0file.cc @@ -6364,7 +6364,7 @@ os_file_trim( fprintf(stderr, " InnoDB: Warning: fallocate call failed with error code %d.\n" " InnoDB: start: %lu len: %lu payload: %lu\n" - " InnoDB: Disabling fallocate for now.\n", errno, off, trim_len, len); + " InnoDB: Disabling fallocate for now.\n", errno, (ulong) off, (ulong) trim_len, (ulong) len); os_file_handle_error_no_exit(slot->name, " fallocate(FALLOC_PUNCH_HOLE | FALLOC_FL_KEEP_SIZE) ", diff --git a/storage/xtradb/row/row0merge.cc b/storage/xtradb/row/row0merge.cc index 1b1d2cb56e5..49dd12ae96f 100644 --- a/storage/xtradb/row/row0merge.cc +++ b/storage/xtradb/row/row0merge.cc @@ -109,9 +109,9 @@ row_merge_encrypt_buf( if (! ((rc == MY_AES_OK) && ((ulint)dstlen == srv_sort_buf_size-ROW_MERGE_RESERVE_SIZE))) { ib_logf(IB_LOG_LEVEL_FATAL, "Unable to encrypt data-block " - " src: %p srclen: %lu buf: %p buflen: %d." + " src: %p srclen: %lu buf: %p buflen: %u." " return-code: %d. Can't continue!\n", - input_buf, (size_t)srv_sort_buf_size, + input_buf, (ulong) srv_sort_buf_size, crypted_buf, dstlen, rc); ut_error; } @@ -153,7 +153,7 @@ row_merge_decrypt_buf( "Unable to encrypt data-block " " src: %p srclen: %lu buf: %p buflen: %d." " return-code: %d. Can't continue!\n", - input_buf, (size_t)srv_sort_buf_size, + input_buf, (ulong) srv_sort_buf_size, crypted_buf, dstlen, rc); ut_error; } @@ -2010,7 +2010,7 @@ write_buffers: pct_cost : ((pct_cost * read_rows) / table_total_rows); /* presenting 10.12% as 1012 integer */ - onlineddl_pct_progress = curr_progress * 100; + onlineddl_pct_progress = (ulint) (curr_progress * 100); } } @@ -2545,7 +2545,7 @@ row_merge_sort( /* Find the number N which 2^N is greater or equal than num_runs */ /* N is merge sort running count */ - total_merge_sort_count = ceil(my_log2f(num_runs)); + total_merge_sort_count = (ulint) ceil(my_log2f(num_runs)); if(total_merge_sort_count <= 0) { total_merge_sort_count=1; } @@ -2592,7 +2592,7 @@ row_merge_sort( pct_cost : ((pct_cost * merge_count) / total_merge_sort_count); /* presenting 10.12% as 1012 integer */; - onlineddl_pct_progress = (pct_progress + curr_progress) * 100; + onlineddl_pct_progress = (ulint) ((pct_progress + curr_progress) * 100); } if (error != DB_SUCCESS) { @@ -2875,7 +2875,7 @@ row_merge_insert_index_tuples( ((pct_cost * inserted_rows) / table_total_rows); /* presenting 10.12% as 1012 integer */; - onlineddl_pct_progress = (pct_progress + curr_progress) * 100; + onlineddl_pct_progress = (ulint) ((pct_progress + curr_progress) * 100); } } } |