summaryrefslogtreecommitdiff
path: root/myisam/mi_search.c
diff options
context:
space:
mode:
authorunknown <ingo@mysql.com>2005-09-23 17:27:07 +0200
committerunknown <ingo@mysql.com>2005-09-23 17:27:07 +0200
commit944db06bbb328288d5e9cfc85de86876895b8b62 (patch)
tree48baa8a8836b9aa39f3616c84580cec8a057ba32 /myisam/mi_search.c
parent79b79064fafc92b5b5fcb5402ad7b2bace2cdb77 (diff)
parent9c0d809270a1d74ec33711d94cd65930eab11579 (diff)
downloadmariadb-git-944db06bbb328288d5e9cfc85de86876895b8b62.tar.gz
Merge mysql.com:/home/mydev/mysql-4.1-4100
into mysql.com:/home/mydev/mysql-5.0-5000 myisam/mi_dbug.c: Auto merged myisam/mi_rkey.c: Auto merged myisam/mi_search.c: Auto merged myisam/myisamdef.h: Auto merged mysql-test/r/merge.result: Auto merged mysql-test/t/merge.test: Auto merged
Diffstat (limited to 'myisam/mi_search.c')
-rw-r--r--myisam/mi_search.c16
1 files changed, 13 insertions, 3 deletions
diff --git a/myisam/mi_search.c b/myisam/mi_search.c
index b7360dba7f3..185f196a814 100644
--- a/myisam/mi_search.c
+++ b/myisam/mi_search.c
@@ -915,11 +915,21 @@ uint _mi_get_binary_pack_key(register MI_KEYDEF *keyinfo, uint nod_flag,
reg1 HA_KEYSEG *keyseg;
uchar *start_key,*page,*page_end,*from,*from_end;
uint length,tmp;
+ DBUG_ENTER("_mi_get_binary_pack_key");
page= *page_pos;
page_end=page+MI_MAX_KEY_BUFF+1;
start_key=key;
+ /*
+ Keys are compressed the following way:
+
+ prefix length Packed length of prefix for the prev key. (1 or 3 bytes)
+ for each key segment:
+ [is null] Null indicator if can be null (1 byte, zero means null)
+ [length] Packed length if varlength (1 or 3 bytes)
+ pointer Reference to the data file (last_keyseg->length).
+ */
get_key_length(length,page);
if (length)
{
@@ -930,7 +940,7 @@ uint _mi_get_binary_pack_key(register MI_KEYDEF *keyinfo, uint nod_flag,
DBUG_DUMP("key",(char*) *page_pos,16);
mi_print_error(keyinfo->share, HA_ERR_CRASHED);
my_errno=HA_ERR_CRASHED;
- return 0; /* Wrong key */
+ DBUG_RETURN(0); /* Wrong key */
}
from=key; from_end=key+length;
}
@@ -992,12 +1002,12 @@ uint _mi_get_binary_pack_key(register MI_KEYDEF *keyinfo, uint nod_flag,
DBUG_PRINT("error",("Error when unpacking key"));
mi_print_error(keyinfo->share, HA_ERR_CRASHED);
my_errno=HA_ERR_CRASHED;
- return 0; /* Error */
+ DBUG_RETURN(0); /* Error */
}
memcpy((byte*) key,(byte*) from,(size_t) length);
*page_pos= from+length;
}
- return((uint) (key-start_key)+keyseg->length);
+ DBUG_RETURN((uint) (key-start_key)+keyseg->length);
}