Commit 67d52349 authored by Michael Widenius's avatar Michael Widenius

Fixed build errors/warnings caused by my last push

mysql-test/valgrind.supp:
  Added suppression for not relevant warning for memory leak in dlclose
storage/maria/ma_blockrec.c:
  Fixed build error on Windows
storage/maria/ma_delete_all.c:
  Fixed call to wrong function
storage/maria/ma_state.c:
  Added purcov suppression block
  Removed temporary debug printing
parent cda763f7
...@@ -378,6 +378,15 @@ ...@@ -378,6 +378,15 @@
fun:_Z8udf_freev fun:_Z8udf_freev
} }
{
dlclose memory loss from plugin
Memcheck:Leak
fun:calloc
fun:_dlerror_run
fun:dlclose
fun:plugin_dl_del
}
{ {
dlopen / ptread_cancel_init memory loss on Suse Linux 10.3 64 bit dlopen / ptread_cancel_init memory loss on Suse Linux 10.3 64 bit
Memcheck:Leak Memcheck:Leak
......
...@@ -1437,9 +1437,10 @@ void _ma_compact_block_page(uchar *buff, uint block_size, uint rownr, ...@@ -1437,9 +1437,10 @@ void _ma_compact_block_page(uchar *buff, uint block_size, uint rownr,
Move the current row down to it's right place and extend it Move the current row down to it's right place and extend it
with 0. with 0.
*/ */
DBUG_ASSERT(page_pos != start_of_found_block);
uint row_diff= min_row_length - row_length; uint row_diff= min_row_length - row_length;
uint length= (next_free_pos - start_of_found_block); uint length= (next_free_pos - start_of_found_block);
DBUG_ASSERT(page_pos != start_of_found_block);
bmove(buff + page_pos, buff + start_of_found_block, length); bmove(buff + page_pos, buff + start_of_found_block, length);
bzero(buff+ page_pos + length, row_diff); bzero(buff+ page_pos + length, row_diff);
page_pos+= min_row_length; page_pos+= min_row_length;
...@@ -6673,7 +6674,7 @@ my_bool _ma_apply_undo_row_delete(MARIA_HA *info, LSN undo_lsn, ...@@ -6673,7 +6674,7 @@ my_bool _ma_apply_undo_row_delete(MARIA_HA *info, LSN undo_lsn,
header+= 2 + row.field_lengths_length; header+= 2 + row.field_lengths_length;
} }
if (share->base.blobs) if (share->base.blobs)
row.blob_length= ma_get_length((uchar**) &header); row.blob_length= ma_get_length(&header);
/* We need to build up a record (without blobs) in rec_buff */ /* We need to build up a record (without blobs) in rec_buff */
if (!(record= my_malloc(share->base.reclength, MYF(MY_WME)))) if (!(record= my_malloc(share->base.reclength, MYF(MY_WME))))
...@@ -6888,7 +6889,7 @@ my_bool _ma_apply_undo_row_update(MARIA_HA *info, LSN undo_lsn, ...@@ -6888,7 +6889,7 @@ my_bool _ma_apply_undo_row_update(MARIA_HA *info, LSN undo_lsn,
Set header to point to old field values, generated by Set header to point to old field values, generated by
fill_update_undo_parts() fill_update_undo_parts()
*/ */
field_length_header= ma_get_length((uchar**) &header); field_length_header= ma_get_length(&header);
field_length_data= (uchar*) header; field_length_data= (uchar*) header;
header+= field_length_header; header+= field_length_header;
field_length_data_end= header; field_length_data_end= header;
......
...@@ -91,7 +91,7 @@ int maria_delete_all_rows(MARIA_HA *info) ...@@ -91,7 +91,7 @@ int maria_delete_all_rows(MARIA_HA *info)
#ifdef HAVE_MMAP #ifdef HAVE_MMAP
if (share->file_map) if (share->file_map)
_mi_unmap_file(info); _ma_unmap_file(info);
#endif #endif
if (_ma_flush_table_files(info, MARIA_FLUSH_DATA|MARIA_FLUSH_INDEX, if (_ma_flush_table_files(info, MARIA_FLUSH_DATA|MARIA_FLUSH_INDEX,
......
...@@ -88,10 +88,8 @@ my_bool _ma_setup_live_state(MARIA_HA *info) ...@@ -88,10 +88,8 @@ my_bool _ma_setup_live_state(MARIA_HA *info)
It's enough to compare trids here (instead of calling It's enough to compare trids here (instead of calling
tranman_can_read_from) as history->trid is a commit_trid tranman_can_read_from) as history->trid is a commit_trid
*/ */
DBUG_PRINT("QQ", ("trn->trid: 0x%lu", (long) trn->trid));
while (trn->trid < history->trid) while (trn->trid < history->trid)
history= history->next; history= history->next;
DBUG_PRINT("QQ", ("his->trid: 0x%lu", (long) history->trid));
pthread_mutex_unlock(&share->intern_lock); pthread_mutex_unlock(&share->intern_lock);
/* The current item can't be deleted as it's the first one visible for us */ /* The current item can't be deleted as it's the first one visible for us */
tables->state_start= tables->state_current= history->state; tables->state_start= tables->state_current= history->state;
...@@ -349,10 +347,12 @@ my_bool _ma_trnman_end_trans_hook(TRN *trn, my_bool commit, ...@@ -349,10 +347,12 @@ my_bool _ma_trnman_end_trans_hook(TRN *trn, my_bool commit,
{ {
if (!(history= my_malloc(sizeof(*history), MYF(MY_WME)))) if (!(history= my_malloc(sizeof(*history), MYF(MY_WME))))
{ {
/* purecov: begin inspected */
error= 1;
pthread_mutex_unlock(&share->intern_lock); pthread_mutex_unlock(&share->intern_lock);
my_free(tables, MYF(0)); my_free(tables, MYF(0));
error= 1;
continue; continue;
/* purecov: end */
} }
history->state= share->state_history->state; history->state= share->state_history->state;
history->next= share->state_history; history->next= share->state_history;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment