Commit 4b42225c authored by ingo@mysql.com's avatar ingo@mysql.com

Fixed some DBUG_PRINT format problems.

parent d2c8d8d6
...@@ -63,8 +63,8 @@ int _mi_search(register MI_INFO *info, register MI_KEYDEF *keyinfo, ...@@ -63,8 +63,8 @@ int _mi_search(register MI_INFO *info, register MI_KEYDEF *keyinfo,
uchar *keypos,*maxpos; uchar *keypos,*maxpos;
uchar lastkey[MI_MAX_KEY_BUFF],*buff; uchar lastkey[MI_MAX_KEY_BUFF],*buff;
DBUG_ENTER("_mi_search"); DBUG_ENTER("_mi_search");
DBUG_PRINT("enter",("pos: %ld nextflag: %d lastpos: %ld", DBUG_PRINT("enter",("pos: %lu nextflag: %u lastpos: %lu",
pos,nextflag,info->lastpos)); (ulong) pos, nextflag, (ulong) info->lastpos));
DBUG_EXECUTE("key",_mi_print_key(DBUG_FILE,keyinfo->seg,key,key_len);); DBUG_EXECUTE("key",_mi_print_key(DBUG_FILE,keyinfo->seg,key,key_len););
if (pos == HA_OFFSET_ERROR) if (pos == HA_OFFSET_ERROR)
...@@ -235,15 +235,15 @@ int _mi_seq_search(MI_INFO *info, register MI_KEYDEF *keyinfo, uchar *page, ...@@ -235,15 +235,15 @@ int _mi_seq_search(MI_INFO *info, register MI_KEYDEF *keyinfo, uchar *page,
if (length == 0 || page > end) if (length == 0 || page > end)
{ {
my_errno=HA_ERR_CRASHED; my_errno=HA_ERR_CRASHED;
DBUG_PRINT("error",("Found wrong key: length: %d page: %lx end: %lx", DBUG_PRINT("error",("Found wrong key: length: %u page: %p end: %p",
length,page,end)); length, page, end));
DBUG_RETURN(MI_FOUND_WRONG_KEY); DBUG_RETURN(MI_FOUND_WRONG_KEY);
} }
if ((flag=_mi_key_cmp(keyinfo->seg,t_buff,key,key_len,comp_flag, if ((flag=_mi_key_cmp(keyinfo->seg,t_buff,key,key_len,comp_flag,
&not_used)) >= 0) &not_used)) >= 0)
break; break;
#ifdef EXTRA_DEBUG #ifdef EXTRA_DEBUG
DBUG_PRINT("loop",("page: %lx key: '%s' flag: %d",page,t_buff,flag)); DBUG_PRINT("loop",("page: %p key: '%s' flag: %d", page, t_buff, flag));
#endif #endif
memcpy(buff,t_buff,length); memcpy(buff,t_buff,length);
*ret_pos=page; *ret_pos=page;
...@@ -251,7 +251,7 @@ int _mi_seq_search(MI_INFO *info, register MI_KEYDEF *keyinfo, uchar *page, ...@@ -251,7 +251,7 @@ int _mi_seq_search(MI_INFO *info, register MI_KEYDEF *keyinfo, uchar *page,
if (flag == 0) if (flag == 0)
memcpy(buff,t_buff,length); /* Result is first key */ memcpy(buff,t_buff,length); /* Result is first key */
*last_key= page == end; *last_key= page == end;
DBUG_PRINT("exit",("flag: %d ret_pos: %lx",flag,*ret_pos)); DBUG_PRINT("exit",("flag: %d ret_pos: %p", flag, *ret_pos));
DBUG_RETURN(flag); DBUG_RETURN(flag);
} /* _mi_seq_search */ } /* _mi_seq_search */
...@@ -350,7 +350,8 @@ int _mi_prefix_search(MI_INFO *info, register MI_KEYDEF *keyinfo, uchar *page, ...@@ -350,7 +350,8 @@ int _mi_prefix_search(MI_INFO *info, register MI_KEYDEF *keyinfo, uchar *page,
saved_vseg=vseg; saved_vseg=vseg;
saved_prefix_len=prefix_len; saved_prefix_len=prefix_len;
DBUG_PRINT("loop",("page: '%.*s%.*s'",prefix_len,t_buff+seg_len_pack,suffix_len,vseg)); DBUG_PRINT("loop",("page: '%.*s%.*s'", prefix_len, t_buff + seg_len_pack,
suffix_len, vseg));
{ {
uchar *from=vseg+suffix_len; uchar *from=vseg+suffix_len;
MI_KEYSEG *keyseg; MI_KEYSEG *keyseg;
...@@ -381,8 +382,8 @@ int _mi_prefix_search(MI_INFO *info, register MI_KEYDEF *keyinfo, uchar *page, ...@@ -381,8 +382,8 @@ int _mi_prefix_search(MI_INFO *info, register MI_KEYDEF *keyinfo, uchar *page,
if (page > end) if (page > end)
{ {
my_errno=HA_ERR_CRASHED; my_errno=HA_ERR_CRASHED;
DBUG_PRINT("error",("Found wrong key: length: %d page: %lx end: %lx", DBUG_PRINT("error",("Found wrong key: length: %u page: %p end: %p",
length,page,end)); length, page, end));
DBUG_RETURN(MI_FOUND_WRONG_KEY); DBUG_RETURN(MI_FOUND_WRONG_KEY);
} }
...@@ -463,7 +464,7 @@ int _mi_prefix_search(MI_INFO *info, register MI_KEYDEF *keyinfo, uchar *page, ...@@ -463,7 +464,7 @@ int _mi_prefix_search(MI_INFO *info, register MI_KEYDEF *keyinfo, uchar *page,
*last_key= page == end; *last_key= page == end;
DBUG_PRINT("exit",("flag: %d ret_pos: %lx",flag,*ret_pos)); DBUG_PRINT("exit",("flag: %d ret_pos: %p", flag, *ret_pos));
DBUG_RETURN(flag); DBUG_RETURN(flag);
} /* _mi_prefix_search */ } /* _mi_prefix_search */
...@@ -1134,8 +1135,9 @@ uint _mi_get_pack_key(register MI_KEYDEF *keyinfo, uint nod_flag, ...@@ -1134,8 +1135,9 @@ uint _mi_get_pack_key(register MI_KEYDEF *keyinfo, uint nod_flag,
key+= length; /* Same diff_key as prev */ key+= length; /* Same diff_key as prev */
if (length > keyseg->length) if (length > keyseg->length)
{ {
DBUG_PRINT("error",("Found too long null packed key: %d of %d at %lx", DBUG_PRINT("error",
length, keyseg->length, *page_pos)); ("Found too long null packed key: %u of %u at %p",
length, keyseg->length, *page_pos));
DBUG_DUMP("key",(char*) *page_pos,16); DBUG_DUMP("key",(char*) *page_pos,16);
my_errno=HA_ERR_CRASHED; my_errno=HA_ERR_CRASHED;
return 0; return 0;
...@@ -1190,7 +1192,7 @@ uint _mi_get_pack_key(register MI_KEYDEF *keyinfo, uint nod_flag, ...@@ -1190,7 +1192,7 @@ uint _mi_get_pack_key(register MI_KEYDEF *keyinfo, uint nod_flag,
} }
if (length > (uint) keyseg->length) if (length > (uint) keyseg->length)
{ {
DBUG_PRINT("error",("Found too long packed key: %d of %d at %lx", DBUG_PRINT("error",("Found too long packed key: %u of %u at %p",
length, keyseg->length, *page_pos)); length, keyseg->length, *page_pos));
DBUG_DUMP("key",(char*) *page_pos,16); DBUG_DUMP("key",(char*) *page_pos,16);
my_errno=HA_ERR_CRASHED; my_errno=HA_ERR_CRASHED;
...@@ -1245,7 +1247,7 @@ uint _mi_get_binary_pack_key(register MI_KEYDEF *keyinfo, uint nod_flag, ...@@ -1245,7 +1247,7 @@ uint _mi_get_binary_pack_key(register MI_KEYDEF *keyinfo, uint nod_flag,
{ {
if (length > keyinfo->maxlength) if (length > keyinfo->maxlength)
{ {
DBUG_PRINT("error",("Found too long binary packed key: %d of %d at %lx", DBUG_PRINT("error",("Found too long binary packed key: %u of %u at %p",
length, keyinfo->maxlength, *page_pos)); length, keyinfo->maxlength, *page_pos));
DBUG_DUMP("key",(char*) *page_pos,16); DBUG_DUMP("key",(char*) *page_pos,16);
my_errno=HA_ERR_CRASHED; my_errno=HA_ERR_CRASHED;
...@@ -1292,7 +1294,7 @@ uint _mi_get_binary_pack_key(register MI_KEYDEF *keyinfo, uint nod_flag, ...@@ -1292,7 +1294,7 @@ uint _mi_get_binary_pack_key(register MI_KEYDEF *keyinfo, uint nod_flag,
length-=tmp; length-=tmp;
from=page; from_end=page_end; from=page; from_end=page_end;
} }
DBUG_PRINT("info",("key: %lx from: %lx length: %u", DBUG_PRINT("info",("key: %p from: %p length: %u",
key, from, length)); key, from, length));
memcpy_overlap((byte*) key, (byte*) from, (size_t) length); memcpy_overlap((byte*) key, (byte*) from, (size_t) length);
key+=length; key+=length;
...@@ -1348,7 +1350,7 @@ uchar *_mi_get_key(MI_INFO *info, MI_KEYDEF *keyinfo, uchar *page, ...@@ -1348,7 +1350,7 @@ uchar *_mi_get_key(MI_INFO *info, MI_KEYDEF *keyinfo, uchar *page,
} }
} }
} }
DBUG_PRINT("exit",("page: %lx length: %d",page,*return_key_length)); DBUG_PRINT("exit",("page: %p length: %u", page, *return_key_length));
DBUG_RETURN(page); DBUG_RETURN(page);
} /* _mi_get_key */ } /* _mi_get_key */
...@@ -1399,7 +1401,7 @@ uchar *_mi_get_last_key(MI_INFO *info, MI_KEYDEF *keyinfo, uchar *page, ...@@ -1399,7 +1401,7 @@ uchar *_mi_get_last_key(MI_INFO *info, MI_KEYDEF *keyinfo, uchar *page,
uint nod_flag; uint nod_flag;
uchar *lastpos; uchar *lastpos;
DBUG_ENTER("_mi_get_last_key"); DBUG_ENTER("_mi_get_last_key");
DBUG_PRINT("enter",("page: %lx endpos: %lx",page,endpos)); DBUG_PRINT("enter",("page: %p endpos: %p", page, endpos));
nod_flag=mi_test_if_nod(page); nod_flag=mi_test_if_nod(page);
if (! (keyinfo->flag & (HA_VAR_LENGTH_KEY | HA_BINARY_PACK_KEY))) if (! (keyinfo->flag & (HA_VAR_LENGTH_KEY | HA_BINARY_PACK_KEY)))
...@@ -1419,13 +1421,13 @@ uchar *_mi_get_last_key(MI_INFO *info, MI_KEYDEF *keyinfo, uchar *page, ...@@ -1419,13 +1421,13 @@ uchar *_mi_get_last_key(MI_INFO *info, MI_KEYDEF *keyinfo, uchar *page,
*return_key_length=(*keyinfo->get_key)(keyinfo,nod_flag,&page,lastkey); *return_key_length=(*keyinfo->get_key)(keyinfo,nod_flag,&page,lastkey);
if (*return_key_length == 0) if (*return_key_length == 0)
{ {
DBUG_PRINT("error",("Couldn't find last key: page: %lx",page)); DBUG_PRINT("error",("Couldn't find last key: page: %p", page));
my_errno=HA_ERR_CRASHED; my_errno=HA_ERR_CRASHED;
DBUG_RETURN(0); DBUG_RETURN(0);
} }
} }
} }
DBUG_PRINT("exit",("lastpos: %lx length: %d",lastpos,*return_key_length)); DBUG_PRINT("exit",("lastpos: %p length: %u", lastpos, *return_key_length));
DBUG_RETURN(lastpos); DBUG_RETURN(lastpos);
} /* _mi_get_last_key */ } /* _mi_get_last_key */
...@@ -1510,8 +1512,9 @@ int _mi_search_next(register MI_INFO *info, register MI_KEYDEF *keyinfo, ...@@ -1510,8 +1512,9 @@ int _mi_search_next(register MI_INFO *info, register MI_KEYDEF *keyinfo,
uint nod_flag; uint nod_flag;
uchar lastkey[MI_MAX_KEY_BUFF]; uchar lastkey[MI_MAX_KEY_BUFF];
DBUG_ENTER("_mi_search_next"); DBUG_ENTER("_mi_search_next");
DBUG_PRINT("enter",("nextflag: %d lastpos: %ld int_keypos: %lx", DBUG_PRINT("enter",("nextflag: %u lastpos: %lu int_keypos: %lu",
nextflag,(long) info->lastpos,info->int_keypos)); nextflag, (ulong) info->lastpos,
(ulong) info->int_keypos));
DBUG_EXECUTE("key",_mi_print_key(DBUG_FILE,keyinfo->seg,key,key_length);); DBUG_EXECUTE("key",_mi_print_key(DBUG_FILE,keyinfo->seg,key,key_length););
/* Force full read if we are at last key or if we are not on a leaf /* Force full read if we are at last key or if we are not on a leaf
...@@ -1618,7 +1621,7 @@ int _mi_search_first(register MI_INFO *info, register MI_KEYDEF *keyinfo, ...@@ -1618,7 +1621,7 @@ int _mi_search_first(register MI_INFO *info, register MI_KEYDEF *keyinfo,
info->page_changed=info->buff_used=0; info->page_changed=info->buff_used=0;
info->lastpos=_mi_dpos(info,0,info->lastkey+info->lastkey_length); info->lastpos=_mi_dpos(info,0,info->lastkey+info->lastkey_length);
DBUG_PRINT("exit",("found key at %ld",(ulong) info->lastpos)); DBUG_PRINT("exit",("found key at %lu", (ulong) info->lastpos));
DBUG_RETURN(0); DBUG_RETURN(0);
} /* _mi_search_first */ } /* _mi_search_first */
...@@ -1852,8 +1855,8 @@ _mi_calc_var_pack_key_length(MI_KEYDEF *keyinfo,uint nod_flag,uchar *next_key, ...@@ -1852,8 +1855,8 @@ _mi_calc_var_pack_key_length(MI_KEYDEF *keyinfo,uint nod_flag,uchar *next_key,
} }
s_temp->totlength=(uint) length; s_temp->totlength=(uint) length;
s_temp->prev_length=0; s_temp->prev_length=0;
DBUG_PRINT("test",("tot_length: %d length: %d uniq_key_length: %d", DBUG_PRINT("test",("tot_length: %u length: %d uniq_key_length: %u",
key_length,length,s_temp->key_length)); key_length, length, s_temp->key_length));
/* If something after that hasn't length=0, test if we can combine */ /* If something after that hasn't length=0, test if we can combine */
if ((s_temp->next_key_pos=next_key)) if ((s_temp->next_key_pos=next_key))
...@@ -1959,7 +1962,7 @@ _mi_calc_var_pack_key_length(MI_KEYDEF *keyinfo,uint nod_flag,uchar *next_key, ...@@ -1959,7 +1962,7 @@ _mi_calc_var_pack_key_length(MI_KEYDEF *keyinfo,uint nod_flag,uchar *next_key,
ref_length=0; ref_length=0;
next_length_pack=0; next_length_pack=0;
} }
DBUG_PRINT("test",("length: %d next_key: %lx",length,next_key)); DBUG_PRINT("test",("length: %d next_key: %p", length, next_key));
{ {
uint tmp_length; uint tmp_length;
......
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