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 /storage/pbxt | |
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.
Diffstat (limited to 'storage/pbxt')
-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 |
9 files changed, 47 insertions, 20 deletions
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(); |