diff options
author | unknown <monty@mysql.com/narttu.mysql.fi> | 2007-06-09 14:52:17 +0300 |
---|---|---|
committer | unknown <monty@mysql.com/narttu.mysql.fi> | 2007-06-09 14:52:17 +0300 |
commit | fdfb51484c9b1e239fd9eb738051020967c99c7f (patch) | |
tree | cf92f9d802e5a9debd930bebc56f835d598aa6e3 /storage/maria/ma_delete.c | |
parent | e30e21f070b998a0a932f2dbc4da91e05108045a (diff) | |
download | mariadb-git-fdfb51484c9b1e239fd9eb738051020967c99c7f.tar.gz |
Fixed compiler warnings
Fixed bug in ma_dbug.c that gave valgrind warning (only relevant when using --debug)
Fixed bug in blob logging (Fixes valgrind warning)
maria_getint() -> maria_data_on_page()
mysys/safemalloc.c:
Added debug function to print out where a piece of memory was allocated
sql/opt_range.cc:
Remove DBUG_PRINT of unitailized memory
storage/maria/ma_blockrec.c:
Fixed bug in blob logging
storage/maria/ma_check.c:
Fixed compiler warning
storage/maria/ma_dbug.c:
Added missed end++; Caused usage of unitialized memory for nullable keys that was not NULL
storage/maria/ma_delete.c:
maria_getint() -> maria_data_on_page()
storage/maria/ma_init.c:
Added header file to get rid of warning
storage/maria/ma_key.c:
More debugging
storage/maria/ma_loghandler.c:
Removed some wrong ';' to get rid of compiler errors when compiling without debugging
Indentation fixes
Removed not needed 'break's
Fixed some compiler warnings
Added code to detect logging of unitialized memory
storage/maria/ma_page.c:
maria_getint() -> maria_data_on_page()
Clear rest of index page before writing when used with valgrind
(Fixes warning of writing pages with unitialized data)
storage/maria/ma_range.c:
maria_getint() -> maria_data_on_page()
storage/maria/ma_rt_index.c:
maria_getint() -> maria_data_on_page()
storage/maria/ma_rt_index.h:
maria_getint() -> maria_data_on_page()
storage/maria/ma_rt_key.c:
maria_getint() -> maria_data_on_page()
storage/maria/ma_rt_split.c:
maria_getint() -> maria_data_on_page()
storage/maria/ma_search.c:
maria_getint() -> maria_data_on_page()
storage/maria/ma_test1.c:
Fixed compiler warning
storage/maria/ma_write.c:
maria_getint() -> maria_data_on_page()
storage/maria/maria_chk.c:
maria_getint() -> maria_data_on_page()
storage/maria/maria_def.h:
maria_getint() -> maria_data_on_page()
storage/maria/unittest/ma_pagecache_consist.c:
Fixed compiler warning
storage/maria/unittest/ma_pagecache_single.c:
Fixed compiler warning
storage/maria/unittest/ma_test_loghandler-t.c:
Fixed compiler warning
storage/maria/unittest/ma_test_loghandler_multigroup-t.c:
Fixed compiler warning
storage/maria/unittest/ma_test_loghandler_multithread-t.c:
Fixed compiler warning
storage/maria/unittest/ma_test_loghandler_pagecache-t.c:
Fixed compiler warning
storage/myisam/mi_dbug.c:
Added missed end++; Caused usage of unitialized memory for nullable keys that was not NULL
Diffstat (limited to 'storage/maria/ma_delete.c')
-rw-r--r-- | storage/maria/ma_delete.c | 38 |
1 files changed, 19 insertions, 19 deletions
diff --git a/storage/maria/ma_delete.c b/storage/maria/ma_delete.c index 436a65a52ce..54c6b7aaefc 100644 --- a/storage/maria/ma_delete.c +++ b/storage/maria/ma_delete.c @@ -187,7 +187,7 @@ static int _ma_ck_real_delete(register MARIA_HA *info, MARIA_KEYDEF *keyinfo, } else /* error == 1 */ { - if (maria_getint(root_buff) <= (nod_flag=_ma_test_if_nod(root_buff))+3) + if (maria_data_on_page(root_buff) <= (nod_flag=_ma_test_if_nod(root_buff))+3) { error=0; if (nod_flag) @@ -228,7 +228,7 @@ static int d_search(register MARIA_HA *info, register MARIA_KEYDEF *keyinfo, my_off_t leaf_page,next_block; byte lastkey[HA_MAX_KEY_BUFF]; DBUG_ENTER("d_search"); - DBUG_DUMP("page",anc_buff,maria_getint(anc_buff)); + DBUG_DUMP("page",anc_buff,maria_data_on_page(anc_buff)); search_key_length= (comp_flag & SEARCH_FIND) ? key_length : USE_WHOLE_KEY; flag=(*keyinfo->bin_search)(info,keyinfo,anc_buff,key, search_key_length, @@ -338,7 +338,7 @@ static int d_search(register MARIA_HA *info, register MARIA_KEYDEF *keyinfo, else { /* Found key */ uint tmp; - length=maria_getint(anc_buff); + length= maria_data_on_page(anc_buff); if (!(tmp= remove_key(keyinfo,nod_flag,keypos,lastkey,anc_buff+length, &next_block))) goto err; @@ -375,7 +375,7 @@ static int d_search(register MARIA_HA *info, register MARIA_KEYDEF *keyinfo, (byte*) 0,(byte*) 0,(my_off_t) 0,(my_bool) 0); } } - if (ret_value == 0 && maria_getint(anc_buff) > keyinfo->block_length) + if (ret_value == 0 && maria_data_on_page(anc_buff) > keyinfo->block_length) { save_flag=1; ret_value= _ma_split_page(info,keyinfo,key,anc_buff,lastkey,0) | 2; @@ -384,7 +384,7 @@ static int d_search(register MARIA_HA *info, register MARIA_KEYDEF *keyinfo, ret_value|= _ma_write_keypage(info,keyinfo,page,DFLT_INIT_HITS,anc_buff); else { - DBUG_DUMP("page",anc_buff,maria_getint(anc_buff)); + DBUG_DUMP("page",anc_buff,maria_data_on_page(anc_buff)); } my_afree(leaf_buff); DBUG_PRINT("exit",("Return: %d",ret_value)); @@ -415,9 +415,9 @@ static int del(register MARIA_HA *info, register MARIA_KEYDEF *keyinfo, DBUG_ENTER("del"); DBUG_PRINT("enter",("leaf_page: %ld keypos: 0x%lx", (long) leaf_page, (ulong) keypos)); - DBUG_DUMP("leaf_buff",leaf_buff,maria_getint(leaf_buff)); + DBUG_DUMP("leaf_buff",leaf_buff,maria_data_on_page(leaf_buff)); - endpos= leaf_buff+ maria_getint(leaf_buff); + endpos= leaf_buff+ maria_data_on_page(leaf_buff); if (!(key_start= _ma_get_last_key(info,keyinfo,leaf_buff,keybuff,endpos, &tmp))) DBUG_RETURN(-1); @@ -432,16 +432,16 @@ static int del(register MARIA_HA *info, register MARIA_KEYDEF *keyinfo, ret_value= -1; else { - DBUG_DUMP("next_page",next_buff,maria_getint(next_buff)); + DBUG_DUMP("next_page",next_buff,maria_data_on_page(next_buff)); if ((ret_value=del(info,keyinfo,key,anc_buff,next_page,next_buff, keypos,next_block,ret_key)) >0) { - endpos=leaf_buff+maria_getint(leaf_buff); + endpos=leaf_buff+maria_data_on_page(leaf_buff); if (ret_value == 1) { ret_value=underflow(info,keyinfo,leaf_buff,next_page, next_buff,endpos); - if (ret_value == 0 && maria_getint(leaf_buff) > keyinfo->block_length) + if (ret_value == 0 && maria_data_on_page(leaf_buff) > keyinfo->block_length) { ret_value= _ma_split_page(info,keyinfo,key,leaf_buff,ret_key,0) | 2; } @@ -471,7 +471,7 @@ static int del(register MARIA_HA *info, register MARIA_KEYDEF *keyinfo, /* Place last key in ancestor page on deleted key position */ - a_length=maria_getint(anc_buff); + a_length= maria_data_on_page(anc_buff); endpos=anc_buff+a_length; if (keypos != anc_buff+2+share->base.key_reflength && !_ma_get_last_key(info,keyinfo,anc_buff,ret_key,keypos,&tmp)) @@ -493,7 +493,7 @@ static int del(register MARIA_HA *info, register MARIA_KEYDEF *keyinfo, _ma_kpointer(info,keypos - share->base.key_reflength,next_block); maria_putint(anc_buff,a_length+length,share->base.key_reflength); - DBUG_RETURN( maria_getint(leaf_buff) <= + DBUG_RETURN( maria_data_on_page(leaf_buff) <= (info->quick_mode ? MARIA_MIN_KEYBLOCK_LENGTH : (uint) keyinfo->underflow_block_length)); err: @@ -521,16 +521,16 @@ static int underflow(register MARIA_HA *info, register MARIA_KEYDEF *keyinfo, DBUG_ENTER("underflow"); DBUG_PRINT("enter",("leaf_page: %ld keypos: 0x%lx",(long) leaf_page, (ulong) keypos)); - DBUG_DUMP("anc_buff",anc_buff,maria_getint(anc_buff)); - DBUG_DUMP("leaf_buff",leaf_buff,maria_getint(leaf_buff)); + DBUG_DUMP("anc_buff",anc_buff,maria_data_on_page(anc_buff)); + DBUG_DUMP("leaf_buff",leaf_buff,maria_data_on_page(leaf_buff)); buff=info->buff; info->keyread_buff_used=1; next_keypos=keypos; nod_flag=_ma_test_if_nod(leaf_buff); p_length=nod_flag+2; - anc_length=maria_getint(anc_buff); - leaf_length=maria_getint(leaf_buff); + anc_length= maria_data_on_page(anc_buff); + leaf_length= maria_data_on_page(leaf_buff); key_reflength=share->base.key_reflength; if (info->s->keyinfo+info->lastinx == keyinfo) info->page_changed=1; @@ -557,7 +557,7 @@ static int underflow(register MARIA_HA *info, register MARIA_KEYDEF *keyinfo, next_page= _ma_kpos(key_reflength,next_keypos); if (!_ma_fetch_keypage(info,keyinfo,next_page,DFLT_INIT_HITS,buff,0)) goto err; - buff_length=maria_getint(buff); + buff_length= maria_data_on_page(buff); DBUG_DUMP("next",buff,buff_length); /* find keys to make a big key-page */ @@ -637,7 +637,7 @@ static int underflow(register MARIA_HA *info, register MARIA_KEYDEF *keyinfo, (byte*) 0, (byte*) 0, leaf_key, &s_temp); /* t_length will always be > 0 for a new page !*/ - length=(uint) ((buff+maria_getint(buff))-half_pos); + length=(uint) ((buff+maria_data_on_page(buff))-half_pos); bmove(buff+p_length+t_length, half_pos, (size_t) length); (*keyinfo->store_key)(keyinfo,buff+p_length,&s_temp); maria_putint(buff,length+t_length+p_length,nod_flag); @@ -659,7 +659,7 @@ static int underflow(register MARIA_HA *info, register MARIA_KEYDEF *keyinfo, next_page= _ma_kpos(key_reflength,keypos); if (!_ma_fetch_keypage(info,keyinfo,next_page,DFLT_INIT_HITS,buff,0)) goto err; - buff_length=maria_getint(buff); + buff_length= maria_data_on_page(buff); endpos=buff+buff_length; DBUG_DUMP("prev",buff,buff_length); |