diff options
author | unknown <sanja@askmonty.org> | 2011-10-27 15:22:52 +0300 |
---|---|---|
committer | unknown <sanja@askmonty.org> | 2011-10-27 15:22:52 +0300 |
commit | 28e2777991b238d770529d0438e4f18fbfc3e271 (patch) | |
tree | 38f9c8b2a404dca974887089cfb67e492ee68e77 | |
parent | 78eb1d48c91f260cab3f616d8a9a8de8040d2347 (diff) | |
download | mariadb-git-28e2777991b238d770529d0438e4f18fbfc3e271.tar.gz |
Fix gcc 4.6 warnings about assigned but not used variables.
Fixed my_gethwaddr.c to allow compilation on Mac OS X.
-rw-r--r-- | client/mysqltest.cc | 3 | ||||
-rw-r--r-- | mysys/my_gethwaddr.c | 5 | ||||
-rw-r--r-- | sql/sql_show.cc | 4 | ||||
-rw-r--r-- | storage/maria/ma_bitmap.c | 4 | ||||
-rw-r--r-- | storage/maria/ma_blockrec.c | 11 | ||||
-rw-r--r-- | storage/maria/ma_check.c | 6 | ||||
-rw-r--r-- | storage/maria/ma_ft_update.c | 2 | ||||
-rw-r--r-- | storage/maria/ma_key_recover.c | 3 | ||||
-rw-r--r-- | storage/maria/ma_loghandler.c | 6 | ||||
-rw-r--r-- | storage/maria/ma_open.c | 3 | ||||
-rw-r--r-- | storage/maria/ma_rt_split.c | 2 | ||||
-rw-r--r-- | storage/maria/maria_pack.c | 2 | ||||
-rw-r--r-- | storage/myisam/mi_check.c | 18 | ||||
-rw-r--r-- | storage/pbxt/src/database_xt.cc | 2 | ||||
-rw-r--r-- | storage/pbxt/src/ha_pbxt.cc | 4 | ||||
-rw-r--r-- | storage/pbxt/src/memory_xt.cc | 2 | ||||
-rw-r--r-- | storage/pbxt/src/myxt_xt.cc | 15 | ||||
-rw-r--r-- | storage/pbxt/src/restart_xt.cc | 29 | ||||
-rw-r--r-- | storage/pbxt/src/tabcache_xt.cc | 5 | ||||
-rw-r--r-- | storage/pbxt/src/table_xt.cc | 4 | ||||
-rw-r--r-- | storage/pbxt/src/thread_xt.cc | 2 | ||||
-rw-r--r-- | storage/pbxt/src/xactlog_xt.cc | 4 | ||||
-rw-r--r-- | storage/xtradb/btr/btr0cur.c | 5 | ||||
-rw-r--r-- | storage/xtradb/buf/buf0buf.c | 6 | ||||
-rw-r--r-- | storage/xtradb/os/os0file.c | 4 | ||||
-rw-r--r-- | unittest/mysys/lf-t.c | 3 |
26 files changed, 77 insertions, 77 deletions
diff --git a/client/mysqltest.cc b/client/mysqltest.cc index 0b08564b07a..8fa30f3a13e 100644 --- a/client/mysqltest.cc +++ b/client/mysqltest.cc @@ -5222,7 +5222,8 @@ void do_connect(struct st_command *command) int con_port= opt_port; char *con_options; my_bool con_ssl= 0, con_compress= 0; - my_bool con_pipe= 0, con_shm= 0; + my_bool con_pipe= 0; + my_bool con_shm __attribute__ ((unused))= 0; struct st_connection* con_slot; static DYNAMIC_STRING ds_connection_name; diff --git a/mysys/my_gethwaddr.c b/mysys/my_gethwaddr.c index d02ba822f73..e8e8c15bca1 100644 --- a/mysys/my_gethwaddr.c +++ b/mysys/my_gethwaddr.c @@ -32,8 +32,7 @@ static my_bool memcpy_and_test(uchar *to, uchar *from, uint len) return res; } -#ifdef __FreeBSD__ - +#if defined(__APPLE__) || defined(__FreeBSD__) #include <net/ethernet.h> #include <sys/sysctl.h> #include <net/route.h> @@ -63,7 +62,7 @@ my_bool my_gethwaddr(uchar *to) if (ifm->ifm_type == RTM_IFINFO) { sdl = (struct sockaddr_dl *)(ifm + 1); - addr= LLADDR(sdl); + addr= (uchar *)LLADDR(sdl); res= memcpy_and_test(to, addr, ETHER_ADDR_LEN); } } diff --git a/sql/sql_show.cc b/sql/sql_show.cc index 884d58d3674..3a9595819fa 100644 --- a/sql/sql_show.cc +++ b/sql/sql_show.cc @@ -1215,7 +1215,7 @@ int store_create_info(THD *thd, TABLE_LIST *table_list, String *packet, handler *file= table->file; TABLE_SHARE *share= table->s; HA_CREATE_INFO create_info; - bool show_table_options= FALSE; + bool show_table_options __attribute__ ((unused))= FALSE; bool foreign_db_mode= (thd->variables.sql_mode & (MODE_POSTGRESQL | MODE_ORACLE | MODE_MSSQL | @@ -1432,7 +1432,9 @@ int store_create_info(THD *thd, TABLE_LIST *table_list, String *packet, packet->append(STRING_WITH_LEN("\n)")); if (!(thd->variables.sql_mode & MODE_NO_TABLE_OPTIONS) && !foreign_db_mode) { +#ifdef WITH_PARTITION_STORAGE_ENGINE show_table_options= TRUE; +#endif /* Get possible table space definitions and append them to the CREATE TABLE statement diff --git a/storage/maria/ma_bitmap.c b/storage/maria/ma_bitmap.c index 9853743d574..81b436346b1 100644 --- a/storage/maria/ma_bitmap.c +++ b/storage/maria/ma_bitmap.c @@ -1373,7 +1373,7 @@ static ulong allocate_full_pages(MARIA_FILE_BITMAP *bitmap, uchar *page_end= data + bitmap->total_size; uchar *best_data= 0; uint min_size; - uint best_area_size, best_prefix_area_size, best_suffix_area_size; + uint best_area_size, best_prefix_area_size; uint page, size; ulonglong best_prefix_bits; DBUG_ENTER("allocate_full_pages"); @@ -1382,7 +1382,6 @@ static ulong allocate_full_pages(MARIA_FILE_BITMAP *bitmap, /* Following variables are only used if best_data is set */ LINT_INIT(best_prefix_bits); LINT_INIT(best_prefix_area_size); - LINT_INIT(best_suffix_area_size); min_size= pages_needed; if (!full_page && min_size > BLOB_SEGMENT_MIN_SIZE) @@ -1454,7 +1453,6 @@ static ulong allocate_full_pages(MARIA_FILE_BITMAP *bitmap, best_area_size= area_size; best_prefix_bits= prefix_bits; best_prefix_area_size= prefix_area_size; - best_suffix_area_size= suffix_area_size; /* Prefer to put data in biggest possible area */ if (area_size <= pages_needed) diff --git a/storage/maria/ma_blockrec.c b/storage/maria/ma_blockrec.c index 6f42aa29b03..c7c1a131441 100644 --- a/storage/maria/ma_blockrec.c +++ b/storage/maria/ma_blockrec.c @@ -4997,7 +4997,8 @@ static my_bool read_row_extent_info(MARIA_HA *info, uchar *buff, MARIA_EXTENT_CURSOR extent; MARIA_RECORD_POS *tail_pos; uchar *data, *end_of_data; - uint flag, row_extents, row_extents_size, field_lengths; + uint flag, row_extents, row_extents_size; + uint field_lengths __attribute__ ((unused)); uchar *extents, *end; DBUG_ENTER("read_row_extent_info"); @@ -5032,6 +5033,10 @@ static my_bool read_row_extent_info(MARIA_HA *info, uchar *buff, } info->cur_row.extents_count= row_extents; + /* + field_lengths looks unused but get_key_length will + increment data, which is required as data it's used later. + */ if (share->base.max_field_lengths) get_key_length(field_lengths, data); @@ -6730,11 +6735,11 @@ uint _ma_apply_redo_insert_row_blobs(MARIA_HA *info, uint i; uint res; uint page_range; - pgcache_page_no_t page, start_page; + pgcache_page_no_t page; uchar *buff; uint data_on_page= data_size; - start_page= page= page_korr(header); + page= page_korr(header); header+= PAGE_STORE_SIZE; page_range= pagerange_korr(header); header+= PAGERANGE_STORE_SIZE; diff --git a/storage/maria/ma_check.c b/storage/maria/ma_check.c index ee41723919f..90b1e3f2ee2 100644 --- a/storage/maria/ma_check.c +++ b/storage/maria/ma_check.c @@ -5610,7 +5610,7 @@ static int sort_insert_key(MARIA_SORT_PARAM *sort_param, my_off_t prev_block) { uint a_length,t_length,nod_flag; - my_off_t filepos,key_file_length; + my_off_t filepos; uchar *anc_buff,*lastkey; MARIA_KEY_PARAM s_temp; MARIA_KEYDEF *keyinfo=sort_param->keyinfo; @@ -5678,7 +5678,6 @@ static int sort_insert_key(MARIA_SORT_PARAM *sort_param, _ma_store_page_used(share, anc_buff, key_block->last_length); bzero(anc_buff+key_block->last_length, keyinfo->block_length- key_block->last_length); - key_file_length=share->state.state.key_file_length; if ((filepos= _ma_new(info, DFLT_INIT_HITS, &page_link)) == HA_OFFSET_ERROR) DBUG_RETURN(1); _ma_fast_unlock_key_del(info); @@ -5789,7 +5788,7 @@ static int sort_delete_record(MARIA_SORT_PARAM *sort_param) int _ma_flush_pending_blocks(MARIA_SORT_PARAM *sort_param) { uint nod_flag,length; - my_off_t filepos,key_file_length; + my_off_t filepos; SORT_KEY_BLOCKS *key_block; MARIA_SORT_INFO *sort_info= sort_param->sort_info; myf myf_rw=sort_info->param->myf_rw; @@ -5806,7 +5805,6 @@ int _ma_flush_pending_blocks(MARIA_SORT_PARAM *sort_param) length= _ma_get_page_used(info->s, key_block->buff); if (nod_flag) _ma_kpointer(info,key_block->end_pos,filepos); - key_file_length= info->s->state.state.key_file_length; bzero(key_block->buff+length, keyinfo->block_length-length); if ((filepos= _ma_new(info, DFLT_INIT_HITS, &page_link)) == HA_OFFSET_ERROR) diff --git a/storage/maria/ma_ft_update.c b/storage/maria/ma_ft_update.c index f38990efab9..e99366033b4 100644 --- a/storage/maria/ma_ft_update.c +++ b/storage/maria/ma_ft_update.c @@ -364,7 +364,7 @@ my_bool _ma_ft_convert_to_ft2(MARIA_HA *info, MARIA_KEY *key) for (key_ptr+=length; key_ptr < end; key_ptr+=keyinfo->keylength) { tmp_key.data= key_ptr; - if (_ma_ck_real_write_btree(info, key, &root, SEARCH_SAME)) + if (_ma_ck_real_write_btree(info, &tmp_key, &root, SEARCH_SAME)) DBUG_RETURN(1); } diff --git a/storage/maria/ma_key_recover.c b/storage/maria/ma_key_recover.c index 71af3a011e3..48bb9cb13d0 100644 --- a/storage/maria/ma_key_recover.c +++ b/storage/maria/ma_key_recover.c @@ -944,7 +944,7 @@ uint _ma_apply_redo_index(MARIA_HA *info, uchar *buff; const uchar *header_end= header + head_length; uint page_offset= 0, org_page_length; - uint nod_flag, page_length, keypage_header, keynr; + uint page_length, keypage_header, keynr; uint max_page_size= share->max_index_block_size; int result; MARIA_PAGE page; @@ -972,7 +972,6 @@ uint _ma_apply_redo_index(MARIA_HA *info, keynr= _ma_get_keynr(share, buff); _ma_page_setup(&page, info, share->keyinfo + keynr, page_pos, buff); - nod_flag= page.node; org_page_length= page_length= page.size; keypage_header= share->keypage_header; diff --git a/storage/maria/ma_loghandler.c b/storage/maria/ma_loghandler.c index 3e2d78d1465..7e1943e7c68 100644 --- a/storage/maria/ma_loghandler.c +++ b/storage/maria/ma_loghandler.c @@ -2535,13 +2535,11 @@ static my_bool translog_buffer_flush(struct st_translog_buffer *buffer) i+= TRANSLOG_PAGE_SIZE, pg++) { TRANSLOG_ADDRESS addr= (buffer->offset + i); - TRANSLOG_VALIDATOR_DATA data; DBUG_PRINT("info", ("send log form %lu till %lu address: (%lu,0x%lx) " "page #: %lu buffer size: %lu buffer: 0x%lx", (ulong) i, (ulong) (i + TRANSLOG_PAGE_SIZE), LSN_IN_PARTS(addr), (ulong) pg, (ulong) buffer->size, (ulong) buffer)); - data.addr= &addr; DBUG_ASSERT(log_descriptor.pagecache->block_size == TRANSLOG_PAGE_SIZE); DBUG_ASSERT(i + TRANSLOG_PAGE_SIZE <= buffer->size); if (translog_status != TRANSLOG_OK && translog_status != TRANSLOG_SHUTDOWN) @@ -6429,16 +6427,12 @@ my_bool translog_scanner_init(LSN lsn, TRANSLOG_SCANNER_DATA *scanner, my_bool use_direct) { - TRANSLOG_VALIDATOR_DATA data; DBUG_ENTER("translog_scanner_init"); DBUG_PRINT("enter", ("Scanner: 0x%lx LSN: (%lu,0x%lx)", (ulong) scanner, LSN_IN_PARTS(lsn))); DBUG_ASSERT(translog_status == TRANSLOG_OK || translog_status == TRANSLOG_READONLY); - data.addr= &scanner->page_addr; - data.was_recovered= 0; - scanner->page_offset= LSN_OFFSET(lsn) % TRANSLOG_PAGE_SIZE; scanner->fixed_horizon= fixed_horizon; diff --git a/storage/maria/ma_open.c b/storage/maria/ma_open.c index e1f561b420a..c8e4572b8d4 100644 --- a/storage/maria/ma_open.c +++ b/storage/maria/ma_open.c @@ -1821,8 +1821,7 @@ int _ma_open_datafile(MARIA_HA *info, MARIA_SHARE *share, const char *org_name, } info->dfile.file= share->bitmap.file.file= - my_open(share->data_file_name.str, share->mode | O_SHARE, - MYF(MY_WME)); + my_open(data_name, share->mode | O_SHARE, MYF(MY_WME)); return info->dfile.file >= 0 ? 0 : 1; } diff --git a/storage/maria/ma_rt_split.c b/storage/maria/ma_rt_split.c index 856edc60490..d8224dcbdd5 100644 --- a/storage/maria/ma_rt_split.c +++ b/storage/maria/ma_rt_split.c @@ -380,7 +380,6 @@ int maria_rtree_split_page(const MARIA_KEY *key, MARIA_PAGE *page, SplitStruct *stop; double *coord_buf; double *next_coord; - double *old_coord; int n_dim; uchar *source_cur, *cur1, *cur2; uchar *new_page_buff, *log_internal_copy, *log_internal_copy_ptr, @@ -426,7 +425,6 @@ int maria_rtree_split_page(const MARIA_KEY *key, MARIA_PAGE *page, maria_rtree_d_mbr(keyinfo->seg, key->data, key_data_length, cur->coords); cur->key= key->data; - old_coord= next_coord; if (split_maria_rtree_node(task, max_keys + 1, page->size + full_length + 2, diff --git a/storage/maria/maria_pack.c b/storage/maria/maria_pack.c index c09a6310ff4..ba586c3a882 100644 --- a/storage/maria/maria_pack.c +++ b/storage/maria/maria_pack.c @@ -3070,7 +3070,6 @@ static int mrg_rrnd(PACK_MRG_INFO *info,uchar *buf) { int error; MARIA_HA *isam_info; - my_off_t filepos; if (!info->current) { @@ -3095,7 +3094,6 @@ static int mrg_rrnd(PACK_MRG_INFO *info,uchar *buf) return(HA_ERR_END_OF_FILE); info->current++; isam_info= *info->current; - filepos=isam_info->s->pack.header_length; maria_reset(isam_info); maria_extra(isam_info,HA_EXTRA_CACHE, 0); if ((error= maria_scan_init(isam_info))) diff --git a/storage/myisam/mi_check.c b/storage/myisam/mi_check.c index 310f747a1a8..5ff0837ad5d 100644 --- a/storage/myisam/mi_check.c +++ b/storage/myisam/mi_check.c @@ -938,7 +938,7 @@ static uint isam_key_length(MI_INFO *info, register MI_KEYDEF *keyinfo) int chk_data_link(HA_CHECK *param, MI_INFO *info, my_bool extend) { int error,got_error,flag; - uint key,UNINIT_VAR(left_length),b_type,field; + uint key, UNINIT_VAR(left_length), b_type; ha_rows records,del_blocks; my_off_t used,empty,pos,splits,UNINIT_VAR(start_recpos), del_length,link_used,start_block; @@ -946,7 +946,6 @@ int chk_data_link(HA_CHECK *param, MI_INFO *info, my_bool extend) char llbuff[22],llbuff2[22],llbuff3[22]; ha_checksum intern_record_checksum; ha_checksum key_checksum[HA_MAX_POSSIBLE_KEY]; - my_bool static_row_size; MI_KEYDEF *keyinfo; MI_BLOCK_INFO block_info; DBUG_ENTER("chk_data_link"); @@ -970,21 +969,6 @@ int chk_data_link(HA_CHECK *param, MI_INFO *info, my_bool extend) got_error=error=0; empty=info->s->pack.header_length; - /* Check how to calculate checksum of rows */ - static_row_size=1; - if (info->s->data_file_type == COMPRESSED_RECORD) - { - for (field=0 ; field < info->s->base.fields ; field++) - { - if (info->s->rec[field].base_type == FIELD_BLOB || - info->s->rec[field].base_type == FIELD_VARCHAR) - { - static_row_size=0; - break; - } - } - } - pos=my_b_tell(¶m->read_cache); bzero((char*) key_checksum, info->s->base.keys * sizeof(key_checksum[0])); while (pos < info->state->data_file_length) diff --git a/storage/pbxt/src/database_xt.cc b/storage/pbxt/src/database_xt.cc index 8d1b4e46da9..635cb63224a 100644 --- a/storage/pbxt/src/database_xt.cc +++ b/storage/pbxt/src/database_xt.cc @@ -87,7 +87,7 @@ xtPublic void xt_lock_installation(XTThreadPtr self, char *installation_path) char file_path[PATH_MAX]; char buffer[101]; size_t red_size; - llong pid; + llong pid __attribute__ ((unused)); xtBool cd = pbxt_crash_debug; xt_strcpy(PATH_MAX, file_path, installation_path); diff --git a/storage/pbxt/src/ha_pbxt.cc b/storage/pbxt/src/ha_pbxt.cc index 8640c079a37..584d188a2cd 100644 --- a/storage/pbxt/src/ha_pbxt.cc +++ b/storage/pbxt/src/ha_pbxt.cc @@ -1559,7 +1559,7 @@ static int pbxt_rollback(handlerton *hton, THD *thd, bool all) if (!all) self->st_stat_trans = FALSE; } - return 0; + return err; } #ifdef DRIZZLED @@ -2863,11 +2863,9 @@ int ha_pbxt::update_row(const byte * old_data, byte * new_data) * insert into t1 (val) values (1); */ if (table->found_next_number_field && new_data == table->record[0]) { - MX_LONGLONG_T nr; my_bitmap_map *old_map; old_map = mx_tmp_use_all_columns(table, table->read_set); - nr = table->found_next_number_field->val_int(); ha_set_auto_increment(pb_open_tab, table->found_next_number_field); mx_tmp_restore_column_map(table, old_map); } diff --git a/storage/pbxt/src/memory_xt.cc b/storage/pbxt/src/memory_xt.cc index b2f6c248b3c..d498336e814 100644 --- a/storage/pbxt/src/memory_xt.cc +++ b/storage/pbxt/src/memory_xt.cc @@ -558,7 +558,7 @@ static size_t mm_checkmem(XTThreadPtr self, MissingMemoryPtr mm_ptr, void *p, xt unsigned char *ptr = (unsigned char *) p - MEM_DEBUG_HDR_SIZE; MemoryDebugPtr debug_ptr = (MemoryDebugPtr) ptr; size_t size = debug_ptr->size; - long a_value; /* Added to simplfy debugging. */ + long a_value __attribute__ ((unused)); /* Added to simplfy debugging. */ if (!ASSERT(p)) return(0); diff --git a/storage/pbxt/src/myxt_xt.cc b/storage/pbxt/src/myxt_xt.cc index 410bf2d2f3c..b7b81823383 100644 --- a/storage/pbxt/src/myxt_xt.cc +++ b/storage/pbxt/src/myxt_xt.cc @@ -830,7 +830,10 @@ xtPublic xtBool myxt_create_row_from_key(XTOpenTablePtr XT_UNUSED(ot), XTIndexPt { byte *record = (byte *) dest_buff; register byte *key; - byte *pos,*key_end; + byte *pos; +#ifdef CHECK_KEYS + byte *key_end; +#endif register XTIndexSegRec *keyseg = ind->mi_seg; /* GOTCHA: When selecting from multiple @@ -843,7 +846,9 @@ xtPublic xtBool myxt_create_row_from_key(XTOpenTablePtr XT_UNUSED(ot), XTIndexPt memset(dest_buff, 0xFF, table->s->null_bytes); */ key = (byte *) b_value; +#ifdef CHECK_KEYS key_end = key + key_len; +#endif for (u_int i=0; i<ind->mi_seg_count; i++, keyseg++) { if (keyseg->null_bit) { if (!*key++) @@ -1021,7 +1026,8 @@ xtPublic u_int myxt_get_key_length(XTIndexPtr ind, xtWord1 *key_buf) register XTIndexSegRec *keyseg = ind->mi_seg; register uchar *key_data = (uchar *) key_buf; uint seg_len; - uint pack_len; + uint pack_len + __attribute__ ((unused)); for (u_int i=0; i<ind->mi_seg_count; i++, keyseg++) { /* Handle NULL part */ @@ -1506,7 +1512,7 @@ xtPublic u_int myxt_key_seg_length(XTIndexSegRec *keyseg, u_int key_offset, xtWo xtPublic xtWord4 myxt_store_row_length(XTOpenTablePtr ot, char *rec_buff) { TABLE *table = ot->ot_table->tab_dic.dic_my_table; - char *sdata; + char *sdata __attribute__ ((unused)); xtWord4 dlen; xtWord4 item_size; xtWord4 row_size = 0; @@ -1886,7 +1892,8 @@ xtPublic void myxt_print_key(XTIndexPtr ind, xtWord1 *key_value) register XTIndexSegRec *keyseg = ind->mi_seg; register uchar *b = (uchar *) key_value; uint b_length; - uint pack_len; + uint pack_len + __attribute__ ((unused)); for (u_int i = 0; i < ind->mi_seg_count; i++, keyseg++) { if (i!=0) diff --git a/storage/pbxt/src/restart_xt.cc b/storage/pbxt/src/restart_xt.cc index 93720f2b113..868c97de020 100644 --- a/storage/pbxt/src/restart_xt.cc +++ b/storage/pbxt/src/restart_xt.cc @@ -94,17 +94,21 @@ void xt_print_log_record(xtLogID log, xtLogOffset offset, XTXactLogBufferDPtr re xtBool xn_set = FALSE; xtXactID xn_id = 0; char buffer[200]; +#ifdef TRACE_RECORD_DATA XTTabRecExtDPtr rec_buf; - XTTabRecExtDPtr ext_rec; XTTabRecFixDPtr fix_rec; u_int rec_len; +#endif + XTTabRecExtDPtr ext_rec; xtLogID log_id = 0; xtLogOffset log_offset = 0; +#ifdef TRACE_RECORD_DATA rec_buf = NULL; - ext_rec = NULL; fix_rec = NULL; rec_len = 0; +#endif + ext_rec = NULL; switch (record->xl.xl_status_1) { case XT_LOG_ENT_REC_MODIFIED: case XT_LOG_ENT_UPDATE: @@ -118,10 +122,12 @@ void xt_print_log_record(xtLogID log, xtLogOffset offset, XTXactLogBufferDPtr re rec_id = XT_GET_DISK_4(record->xu.xu_rec_id_4); xn_id = XT_GET_DISK_4(record->xu.xu_xact_id_4); row_id = XT_GET_DISK_4(record->xu.xu_row_id_4); - rec_len = XT_GET_DISK_2(record->xu.xu_size_2); xn_set = TRUE; type="rec"; +#ifdef TRACE_RECORD_DATA + rec_len = XT_GET_DISK_2(record->xu.xu_size_2); rec_buf = (XTTabRecExtDPtr) &record->xu.xu_rec_type_1; +#endif ext_rec = (XTTabRecExtDPtr) &record->xu.xu_rec_type_1; if (XT_REC_IS_EXT_DLOG(ext_rec->tr_rec_type_1)) { log_id = XT_GET_DISK_2(ext_rec->re_log_id_2); @@ -129,7 +135,9 @@ void xt_print_log_record(xtLogID log, xtLogOffset offset, XTXactLogBufferDPtr re } else { ext_rec = NULL; +#ifdef TRACE_RECORD_DATA fix_rec = (XTTabRecFixDPtr) &record->xu.xu_rec_type_1; +#endif } break; case XT_LOG_ENT_UPDATE_FL: @@ -143,10 +151,12 @@ void xt_print_log_record(xtLogID log, xtLogOffset offset, XTXactLogBufferDPtr re rec_id = XT_GET_DISK_4(record->xf.xf_rec_id_4); xn_id = XT_GET_DISK_4(record->xf.xf_xact_id_4); row_id = XT_GET_DISK_4(record->xf.xf_row_id_4); - rec_len = XT_GET_DISK_2(record->xf.xf_size_2); xn_set = TRUE; type="rec"; +#ifdef TRACE_RECORD_DATA + rec_len = XT_GET_DISK_2(record->xf.xf_size_2); rec_buf = (XTTabRecExtDPtr) &record->xf.xf_rec_type_1; +#endif ext_rec = (XTTabRecExtDPtr) &record->xf.xf_rec_type_1; if (XT_REC_IS_EXT_DLOG(ext_rec->tr_rec_type_1)) { log_id = XT_GET_DISK_2(ext_rec->re_log_id_2); @@ -154,7 +164,9 @@ void xt_print_log_record(xtLogID log, xtLogOffset offset, XTXactLogBufferDPtr re } else { ext_rec = NULL; +#ifdef TRACE_RECORD_DATA fix_rec = (XTTabRecFixDPtr) &record->xf.xf_rec_type_1; +#endif } break; case XT_LOG_ENT_REC_FREED: @@ -173,10 +185,12 @@ void xt_print_log_record(xtLogID log, xtLogOffset offset, XTXactLogBufferDPtr re rec_id = XT_GET_DISK_4(record->rb.rb_rec_id_4); xn_id = XT_GET_DISK_4(record->rb.rb_xact_id_4); row_id = XT_GET_DISK_4(record->rb.rb_row_id_4); - rec_len = XT_GET_DISK_2(record->rb.rb_size_2); xn_set = TRUE; type="rec"; +#ifdef TRACE_RECORD_DATA + rec_len = XT_GET_DISK_2(record->rb.rb_size_2); rec_buf = (XTTabRecExtDPtr) &record->rb.rb_rec_type_1; +#endif ext_rec = (XTTabRecExtDPtr) &record->rb.rb_rec_type_1; if (XT_REC_IS_EXT_DLOG(record->rb.rb_rec_type_1)) { log_id = XT_GET_DISK_2(ext_rec->re_log_id_2); @@ -184,7 +198,9 @@ void xt_print_log_record(xtLogID log, xtLogOffset offset, XTXactLogBufferDPtr re } else { ext_rec = NULL; +#ifdef TRACE_RECORD_DATA fix_rec = (XTTabRecFixDPtr) &record->rb.rb_rec_type_1; +#endif } break; case XT_LOG_ENT_REC_MOVED: @@ -967,7 +983,8 @@ static void xres_apply_change(XTThreadPtr self, XTOpenTablePtr ot, XTXactLogBuff xtLogID data_log_id = 0; xtLogOffset data_log_offset = 0; u_int cols_required = 0; - xtBool record_loaded; + xtBool record_loaded + __attribute__ ((unused)); size_t rec_size; rec_id = XT_GET_DISK_4(record->rb.rb_rec_id_4); diff --git a/storage/pbxt/src/tabcache_xt.cc b/storage/pbxt/src/tabcache_xt.cc index 92958f2da49..c5374b400c3 100644 --- a/storage/pbxt/src/tabcache_xt.cc +++ b/storage/pbxt/src/tabcache_xt.cc @@ -393,7 +393,8 @@ void XTTabCache::xt_tc_release_page(XT_ROW_REC_FILE_PTR XT_UNUSED(file), XTTabCa TAB_CAC_WRITE_LOCK(&seg->tcs_lock, thread->t_id); #ifdef DEBUG - XTTabCachePagePtr lpage, ppage; + XTTabCachePagePtr lpage; + XTTabCachePagePtr ppage __attribute__ ((unused)); ppage = NULL; lpage = seg->tcs_hash_table[page->tcp_hash_idx]; @@ -1202,7 +1203,7 @@ static void tabc_fr_main(XTThreadPtr self) static void *tabc_fr_run_thread(XTThreadPtr self) { int count; - void *mysql_thread; + void *mysql_thread __attribute__ ((unused)); myxt_wait_pbxt_plugin_slot_assigned(self); diff --git a/storage/pbxt/src/table_xt.cc b/storage/pbxt/src/table_xt.cc index 35b4ea3be3d..df9c157c2b6 100644 --- a/storage/pbxt/src/table_xt.cc +++ b/storage/pbxt/src/table_xt.cc @@ -1976,8 +1976,10 @@ xtPublic void xt_check_table(XTThreadPtr self, XTOpenTablePtr ot) xtLogOffset log_offset; #endif xtRecordID rec_id; +#ifdef DUMP_CHECK_TABLE xtRecordID prev_rec_id; xtXactID xn_id; +#endif xtRowID row_id; u_llong free_rec_count = 0, free_count2 = 0; u_llong delete_rec_count = 0; @@ -2104,8 +2106,10 @@ xtPublic void xt_check_table(XTThreadPtr self, XTOpenTablePtr ot) else printf(" "); #endif +#ifdef DUMP_CHECK_TABLE prev_rec_id = XT_GET_DISK_4(rec_buf->tr_prev_rec_id_4); xn_id = XT_GET_DISK_4(rec_buf->tr_xact_id_4); +#endif row_id = XT_GET_DISK_4(rec_buf->tr_row_id_4); switch (rec_buf->tr_rec_type_1 & XT_TAB_STATUS_MASK) { case XT_TAB_STATUS_FREED: diff --git a/storage/pbxt/src/thread_xt.cc b/storage/pbxt/src/thread_xt.cc index 52c2c6c29c5..171470f2bba 100644 --- a/storage/pbxt/src/thread_xt.cc +++ b/storage/pbxt/src/thread_xt.cc @@ -485,7 +485,7 @@ static void thr_free_resources(XTThreadPtr self, XTResourcePtr top) xtPublic void xt_bug(XTThreadPtr XT_UNUSED(self)) { - static int *bug_ptr = NULL; + static int *bug_ptr __attribute__ ((unused))= NULL; bug_ptr = NULL; } diff --git a/storage/pbxt/src/xactlog_xt.cc b/storage/pbxt/src/xactlog_xt.cc index addc14ff5d8..69059046067 100644 --- a/storage/pbxt/src/xactlog_xt.cc +++ b/storage/pbxt/src/xactlog_xt.cc @@ -2117,7 +2117,7 @@ xtBool XTDatabaseLog::xlog_seq_next(XTXactSeqReadPtr seq, XTXactLogBufferDPtr *r size_t rec_offset; size_t max_rec_len; size_t size; - u_int check_size = 1; + u_int check_size __attribute__ ((unused))= 1; /* Go to the next record (xseq_record_len must be initialized * to 0 for this to work. @@ -2629,7 +2629,7 @@ static void *xlog_wr_run_thread(XTThreadPtr self) { XTDatabaseHPtr db = (XTDatabaseHPtr) self->t_data; int count; - void *mysql_thread; + void *mysql_thread __attribute__ ((unused)); mysql_thread = myxt_create_thread(); diff --git a/storage/xtradb/btr/btr0cur.c b/storage/xtradb/btr/btr0cur.c index 9b306ea2864..d16522731c4 100644 --- a/storage/xtradb/btr/btr0cur.c +++ b/storage/xtradb/btr/btr0cur.c @@ -3301,7 +3301,7 @@ static void btr_record_not_null_field_in_rec( /*=============================*/ - rec_t* rec, /*!< in: physical record */ + rec_t* rec __attribute__ ((unused)),/*!< in: physical record */ ulint n_unique, /*!< in: dict_index_get_n_unique(index), number of columns uniquely determine an index entry */ @@ -3321,9 +3321,8 @@ btr_record_not_null_field_in_rec( for (i = 0; i < n_unique; i++) { ulint rec_len; - byte* field; - field = rec_get_nth_field(rec, offsets, i, &rec_len); + rec_get_nth_field_offs(offsets, i, &rec_len); if (rec_len != UNIV_SQL_NULL) { n_not_null[i]++; diff --git a/storage/xtradb/buf/buf0buf.c b/storage/xtradb/buf/buf0buf.c index 020896b5739..5616455b289 100644 --- a/storage/xtradb/buf/buf0buf.c +++ b/storage/xtradb/buf/buf0buf.c @@ -3895,7 +3895,6 @@ buf_page_io_complete( enum buf_io_fix io_type; const ibool uncompressed = (buf_page_get_state(bpage) == BUF_BLOCK_FILE_PAGE); - enum buf_flush flush_type; mutex_t* block_mutex; ut_a(buf_page_in_file(bpage)); @@ -4049,9 +4048,10 @@ corrupt: } } - //buf_pool_mutex_enter(); + //enum buf_flush flush_type; + //buf_pool_mutex_enter(); if (io_type == BUF_IO_WRITE) { - flush_type = buf_page_get_flush_type(bpage); + //flush_type = buf_page_get_flush_type(bpage); /* to keep consistency at buf_LRU_insert_zip_clean() */ //if (flush_type == BUF_FLUSH_LRU) { /* optimistic! */ mutex_enter(&LRU_list_mutex); diff --git a/storage/xtradb/os/os0file.c b/storage/xtradb/os/os0file.c index 5b8e656d8b2..716777227eb 100644 --- a/storage/xtradb/os/os0file.c +++ b/storage/xtradb/os/os0file.c @@ -3534,7 +3534,7 @@ os_aio_simulated_wake_handler_thread( { os_aio_array_t* array; os_aio_slot_t* slot; - ulint segment; + ulint segment __attribute__ ((unused)); ulint n; ulint i; @@ -4020,7 +4020,7 @@ os_aio_simulated_handle( ulint* space_id) { os_aio_array_t* array; - ulint segment; + ulint segment __attribute__ ((unused)); os_aio_slot_t* slot; os_aio_slot_t* slot2; os_aio_slot_t* consecutive_ios[OS_AIO_MERGE_N_CONSECUTIVE]; diff --git a/unittest/mysys/lf-t.c b/unittest/mysys/lf-t.c index 61b7ae08cf5..29de0a0e812 100644 --- a/unittest/mysys/lf-t.c +++ b/unittest/mysys/lf-t.c @@ -33,14 +33,13 @@ LF_HASH lf_hash; pthread_handler_t test_lf_pinbox(void *arg) { int m= *(int *)arg; - int32 x= 0; LF_PINS *pins; my_thread_init(); pins= lf_pinbox_get_pins(&lf_allocator.pinbox); - for (x= ((int)(intptr)(&m)); m ; m--) + for (; m ; m--) { lf_pinbox_put_pins(pins); pins= lf_pinbox_get_pins(&lf_allocator.pinbox); |