summaryrefslogtreecommitdiff
path: root/myisam/mi_search.c
diff options
context:
space:
mode:
authormonty@mashka.mysql.fi <>2003-04-27 22:12:08 +0300
committermonty@mashka.mysql.fi <>2003-04-27 22:12:08 +0300
commitdd377bfba62b5f9d8bc43b9d2fdaddbc4107d6e9 (patch)
tree9cf8ed6360561508fc24e4f8cc90f56282626854 /myisam/mi_search.c
parent8b20a878cc1f420739a726a9be87d074390b899a (diff)
downloadmariadb-git-dd377bfba62b5f9d8bc43b9d2fdaddbc4107d6e9.tar.gz
Fixed problem when comparing a key for a multi-byte-character set. (bug 152)
Use 0x.... as strings if 'new' mode. (bug 152) Don't report -max on windows when InnoDB is enabled. (bug 332) Reset current_linfo; This could cause a hang when doing PURGE LOGS. Fix for row numbers in EXPLAIN (bug 322) Fix that USE_FRM works for all table types (bug 97)
Diffstat (limited to 'myisam/mi_search.c')
-rw-r--r--myisam/mi_search.c31
1 files changed, 31 insertions, 0 deletions
diff --git a/myisam/mi_search.c b/myisam/mi_search.c
index 41d53e76241..32db69144d8 100644
--- a/myisam/mi_search.c
+++ b/myisam/mi_search.c
@@ -1441,6 +1441,37 @@ uint _mi_keylength(MI_KEYDEF *keyinfo, register uchar *key)
} /* _mi_keylength */
+/*
+ Calculate length of part key.
+
+ Used in mi_rkey() to find the key found for the key-part that was used.
+ This is needed in case of multi-byte character sets where we may search
+ after '0xDF' but find 'ss'
+*/
+
+uint _mi_keylength_part(MI_KEYDEF *keyinfo, register uchar *key,
+ MI_KEYSEG *end)
+{
+ reg1 MI_KEYSEG *keyseg;
+ uchar *start= key;
+
+ for (keyseg=keyinfo->seg ; keyseg != end ; keyseg++)
+ {
+ if (keyseg->flag & HA_NULL_PART)
+ if (!*key++)
+ continue;
+ if (keyseg->flag & (HA_SPACE_PACK | HA_BLOB_PART | HA_VAR_LENGTH))
+ {
+ uint length;
+ get_key_length(length,key);
+ key+=length;
+ }
+ else
+ key+= keyseg->length;
+ }
+ return (uint) (key-start);
+}
+
/* Move a key */
uchar *_mi_move_key(MI_KEYDEF *keyinfo, uchar *to, uchar *from)