diff options
author | unknown <monty@mysql.com> | 2005-10-07 03:12:15 +0300 |
---|---|---|
committer | unknown <monty@mysql.com> | 2005-10-07 03:12:15 +0300 |
commit | 3dcf20566439858cb200ad97368232f4e2d9f943 (patch) | |
tree | f958b70fe8b350986e02f3c229c7f0b5c766ad77 /myisam/mi_search.c | |
parent | e4470578411b9afe207e11fd8781560317d11365 (diff) | |
download | mariadb-git-3dcf20566439858cb200ad97368232f4e2d9f943.tar.gz |
Review of new code since last pull
- Use %lx instead of %p as %p is not portable
- Don't replace ROW item with Item_null
myisam/mi_rkey.c:
Use %lx instead of %p as %p is not portable
myisam/mi_search.c:
Use %lx instead of %p as %p is not portable
mysql-test/r/select.result:
More test for ROW comparison
mysql-test/t/select.test:
More test for ROW comparison
sql/item.cc:
We can't replace a ROW item with Item_null because:
- Arg_comparator is still using the orignal row items and it's not good to have args[0] different from what is actually compared
- If we are using the <=> comparator, NULL can still be compared as true
- We would break things if we would ever use resolve_const_item() for operators like >, < etc.
Diffstat (limited to 'myisam/mi_search.c')
-rw-r--r-- | myisam/mi_search.c | 45 |
1 files changed, 25 insertions, 20 deletions
diff --git a/myisam/mi_search.c b/myisam/mi_search.c index 82177d331b7..71a623dc9c0 100644 --- a/myisam/mi_search.c +++ b/myisam/mi_search.c @@ -257,15 +257,16 @@ int _mi_seq_search(MI_INFO *info, register MI_KEYDEF *keyinfo, uchar *page, if (length == 0 || page > end) { my_errno=HA_ERR_CRASHED; - DBUG_PRINT("error",("Found wrong key: length: %u page: %p end: %p", - length, page, end)); + DBUG_PRINT("error",("Found wrong key: length: %u page: %lx end: %lx", + length, (long) page, (long) end)); DBUG_RETURN(MI_FOUND_WRONG_KEY); } if ((flag=ha_key_cmp(keyinfo->seg,t_buff,key,key_len,comp_flag, ¬_used)) >= 0) break; #ifdef EXTRA_DEBUG - DBUG_PRINT("loop",("page: %p key: '%s' flag: %d", page, t_buff, flag)); + DBUG_PRINT("loop",("page: %lx key: '%s' flag: %d", (long) page, t_buff, + flag)); #endif memcpy(buff,t_buff,length); *ret_pos=page; @@ -273,7 +274,7 @@ int _mi_seq_search(MI_INFO *info, register MI_KEYDEF *keyinfo, uchar *page, if (flag == 0) memcpy(buff,t_buff,length); /* Result is first key */ *last_key= page == end; - DBUG_PRINT("exit",("flag: %d ret_pos: %p", flag, *ret_pos)); + DBUG_PRINT("exit",("flag: %d ret_pos: %lx", flag, (long) *ret_pos)); DBUG_RETURN(flag); } /* _mi_seq_search */ @@ -412,8 +413,8 @@ int _mi_prefix_search(MI_INFO *info, register MI_KEYDEF *keyinfo, uchar *page, if (page > end) { my_errno=HA_ERR_CRASHED; - DBUG_PRINT("error",("Found wrong key: length: %u page: %p end: %p", - length, page, end)); + DBUG_PRINT("error",("Found wrong key: length: %u page: %lx end: %lx", + length, (long) page, (long) end)); DBUG_RETURN(MI_FOUND_WRONG_KEY); } @@ -546,7 +547,7 @@ int _mi_prefix_search(MI_INFO *info, register MI_KEYDEF *keyinfo, uchar *page, *last_key= page == end; - DBUG_PRINT("exit",("flag: %d ret_pos: %p", flag, *ret_pos)); + DBUG_PRINT("exit",("flag: %d ret_pos: %lx", flag, (long) *ret_pos)); DBUG_RETURN(flag); } /* _mi_prefix_search */ @@ -807,8 +808,8 @@ uint _mi_get_pack_key(register MI_KEYDEF *keyinfo, uint nod_flag, if (length > keyseg->length) { DBUG_PRINT("error", - ("Found too long null packed key: %u of %u at %p", - length, keyseg->length, *page_pos)); + ("Found too long null packed key: %u of %u at %lx", + length, keyseg->length, (long) *page_pos)); DBUG_DUMP("key",(char*) *page_pos,16); my_errno=HA_ERR_CRASHED; return 0; @@ -863,8 +864,8 @@ uint _mi_get_pack_key(register MI_KEYDEF *keyinfo, uint nod_flag, } if (length > (uint) keyseg->length) { - DBUG_PRINT("error",("Found too long packed key: %u of %u at %p", - length, keyseg->length, *page_pos)); + DBUG_PRINT("error",("Found too long packed key: %u of %u at %lx", + length, keyseg->length, (long) *page_pos)); DBUG_DUMP("key",(char*) *page_pos,16); my_errno=HA_ERR_CRASHED; return 0; /* Error */ @@ -928,8 +929,8 @@ uint _mi_get_binary_pack_key(register MI_KEYDEF *keyinfo, uint nod_flag, { if (length > keyinfo->maxlength) { - DBUG_PRINT("error",("Found too long binary packed key: %u of %u at %p", - length, keyinfo->maxlength, *page_pos)); + DBUG_PRINT("error",("Found too long binary packed key: %u of %u at %lx", + length, keyinfo->maxlength, (long) *page_pos)); DBUG_DUMP("key",(char*) *page_pos,16); my_errno=HA_ERR_CRASHED; DBUG_RETURN(0); /* Wrong key */ @@ -975,8 +976,8 @@ uint _mi_get_binary_pack_key(register MI_KEYDEF *keyinfo, uint nod_flag, length-=tmp; from=page; from_end=page_end; } - DBUG_PRINT("info",("key: %p from: %p length: %u", - key, from, length)); + DBUG_PRINT("info",("key: %lx from: %lx length: %u", + (long) key, (long) from, length)); memcpy_overlap((byte*) key, (byte*) from, (size_t) length); key+=length; from+=length; @@ -1031,7 +1032,8 @@ uchar *_mi_get_key(MI_INFO *info, MI_KEYDEF *keyinfo, uchar *page, } } } - DBUG_PRINT("exit",("page: %p length: %u", page, *return_key_length)); + DBUG_PRINT("exit",("page: %lx length: %u", (long) page, + *return_key_length)); DBUG_RETURN(page); } /* _mi_get_key */ @@ -1082,7 +1084,7 @@ uchar *_mi_get_last_key(MI_INFO *info, MI_KEYDEF *keyinfo, uchar *page, uint nod_flag; uchar *lastpos; DBUG_ENTER("_mi_get_last_key"); - DBUG_PRINT("enter",("page: %p endpos: %p", page, endpos)); + DBUG_PRINT("enter",("page: %lx endpos: %lx", (long) page, (long) endpos)); nod_flag=mi_test_if_nod(page); if (! (keyinfo->flag & (HA_VAR_LENGTH_KEY | HA_BINARY_PACK_KEY))) @@ -1102,13 +1104,15 @@ uchar *_mi_get_last_key(MI_INFO *info, MI_KEYDEF *keyinfo, uchar *page, *return_key_length=(*keyinfo->get_key)(keyinfo,nod_flag,&page,lastkey); if (*return_key_length == 0) { - DBUG_PRINT("error",("Couldn't find last key: page: %p", page)); + DBUG_PRINT("error",("Couldn't find last key: page: %lx", + (long) page)); my_errno=HA_ERR_CRASHED; DBUG_RETURN(0); } } } - DBUG_PRINT("exit",("lastpos: %p length: %u", lastpos, *return_key_length)); + DBUG_PRINT("exit",("lastpos: %lx length: %u", (long) lastpos, + *return_key_length)); DBUG_RETURN(lastpos); } /* _mi_get_last_key */ @@ -1644,7 +1648,8 @@ _mi_calc_var_pack_key_length(MI_KEYDEF *keyinfo,uint nod_flag,uchar *next_key, ref_length=0; next_length_pack=0; } - DBUG_PRINT("test",("length: %d next_key: %p", length, next_key)); + DBUG_PRINT("test",("length: %d next_key: %lx", length, + (long) next_key)); { uint tmp_length; |