diff options
Diffstat (limited to 'sql/key.cc')
-rw-r--r-- | sql/key.cc | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/sql/key.cc b/sql/key.cc index 6369faff9d0..5c1afb1f82d 100644 --- a/sql/key.cc +++ b/sql/key.cc @@ -17,7 +17,7 @@ /* Functions to handle keys and fields in forms */ -#include <my_global.h> +#include "mariadb.h" #include "sql_priv.h" #include "key.h" // key_rec_cmp #include "field.h" // Field @@ -319,7 +319,7 @@ bool key_cmp_if_same(TABLE *table,const uchar *key,uint idx,uint key_length) FIELDFLAG_PACK))) { CHARSET_INFO *cs= key_part->field->charset(); - uint char_length= key_part->length / cs->mbmaxlen; + size_t char_length= key_part->length / cs->mbmaxlen; const uchar *pos= table->record[0] + key_part->offset; if (length > char_length) { @@ -385,7 +385,7 @@ void field_unpack(String *to, Field *field, const uchar *rec, uint max_length, which can break a multi-byte characters in the middle. Align, returning not more than "char_length" characters. */ - uint charpos, char_length= max_length / cs->mbmaxlen; + size_t charpos, char_length= max_length / cs->mbmaxlen; if ((charpos= my_charpos(cs, tmp.ptr(), tmp.ptr() + tmp.length(), char_length)) < tmp.length()) @@ -697,7 +697,7 @@ ulong key_hashnr(KEY *key_info, uint used_key_parts, const uchar *key) { uchar *pos= (uchar*)key; CHARSET_INFO *UNINIT_VAR(cs); - uint UNINIT_VAR(length), UNINIT_VAR(pack_length); + size_t UNINIT_VAR(length), UNINIT_VAR(pack_length); bool is_string= TRUE; key+= key_part->length; @@ -754,7 +754,7 @@ ulong key_hashnr(KEY *key_info, uint used_key_parts, const uchar *key) { if (cs->mbmaxlen > 1) { - uint char_length= my_charpos(cs, pos + pack_length, + size_t char_length= my_charpos(cs, pos + pack_length, pos + pack_length + length, length / cs->mbmaxlen); set_if_smaller(length, char_length); @@ -801,7 +801,7 @@ bool key_buf_cmp(KEY *key_info, uint used_key_parts, uchar *pos1= (uchar*)key1; uchar *pos2= (uchar*)key2; CHARSET_INFO *UNINIT_VAR(cs); - uint UNINIT_VAR(length1), UNINIT_VAR(length2), UNINIT_VAR(pack_length); + size_t UNINIT_VAR(length1), UNINIT_VAR(length2), UNINIT_VAR(pack_length); bool is_string= TRUE; key1+= key_part->length; @@ -865,13 +865,13 @@ bool key_buf_cmp(KEY *key_info, uint used_key_parts, Compare the strings taking into account length in characters and collation */ - uint byte_len1= length1, byte_len2= length2; + size_t byte_len1= length1, byte_len2= length2; if (cs->mbmaxlen > 1) { - uint char_length1= my_charpos(cs, pos1 + pack_length, + size_t char_length1= my_charpos(cs, pos1 + pack_length, pos1 + pack_length + length1, length1 / cs->mbmaxlen); - uint char_length2= my_charpos(cs, pos2 + pack_length, + size_t char_length2= my_charpos(cs, pos2 + pack_length, pos2 + pack_length + length2, length2 / cs->mbmaxlen); set_if_smaller(length1, char_length1); |