diff options
Diffstat (limited to 'isam')
-rw-r--r-- | isam/_key.c | 12 | ||||
-rw-r--r-- | isam/_search.c | 22 | ||||
-rw-r--r-- | isam/isamlog.c | 6 | ||||
-rw-r--r-- | isam/pack_isam.c | 9 | ||||
-rw-r--r-- | isam/static.c | 2 |
5 files changed, 29 insertions, 22 deletions
diff --git a/isam/_key.c b/isam/_key.c index c0d667cb32d..002ad480c56 100644 --- a/isam/_key.c +++ b/isam/_key.c @@ -54,11 +54,11 @@ uint _nisam_make_key(register N_INFO *info, uint keynr, uchar *key, const char * *key++= (uchar) (length=(uint) (end-pos)); memcpy((byte*) key,(byte*) pos,(size_t) length); #ifdef USE_STRCOLL - if (!use_strcoll(default_charset_info)) + if (!use_strnxfrm(default_charset_info)) #endif { if (type == HA_KEYTYPE_TEXT) - case_sort((byte*) key,length); + my_tosort(default_charset_info,(byte*) key,length); } key+=length; } @@ -67,11 +67,11 @@ uint _nisam_make_key(register N_INFO *info, uint keynr, uchar *key, const char * memcpy((byte*) key,(byte*) record+keyseg->base.start, (size_t) keyseg->base.length); #ifdef USE_STRCOLL - if (!use_strcoll(default_charset_info)) + if (!use_strnxfrm(default_charset_info)) #endif { if (type == HA_KEYTYPE_TEXT) - case_sort((byte*) key,(uint) keyseg->base.length); + my_tosort(default_charset_info,(byte*) key,(uint) keyseg->base.length); } #ifdef NAN_TEST else if (type == HA_KEYTYPE_FLOAT) @@ -150,11 +150,11 @@ uint _nisam_pack_key(register N_INFO *info, uint keynr, uchar *key, uchar *old, else memcpy((byte*) key,old,(size_t) length); #ifdef USE_STRCOLL - if (!use_strcoll(default_charset_info)) + if (!use_strnxfrm(default_charset_info)) #endif { if (type == HA_KEYTYPE_TEXT) - case_sort((byte*) key,length); + my_tosort(default_charset_info,(byte*) key,length); } key+= length; } diff --git a/isam/_search.c b/isam/_search.c index 57787d61818..d5e145ae0bf 100644 --- a/isam/_search.c +++ b/isam/_search.c @@ -118,7 +118,7 @@ int _nisam_search(register N_INFO *info, register N_KEYDEF *keyinfo, uchar *key, if ((nextflag & (SEARCH_SMALLER | SEARCH_LAST)) && flag != 0) { keypos=_nisam_get_last_key(info,keyinfo,buff,lastkey,keypos); - if ((nextflag & SEARCH_LAST) && + if (!(nextflag & SEARCH_SMALLER) && _nisam_key_cmp(keyinfo->seg, info->lastkey, key, key_len, SEARCH_FIND)) { my_errno=HA_ERR_KEY_NOT_FOUND; /* Didn't find key */ @@ -332,7 +332,7 @@ int _nisam_key_cmp(register N_KEYSEG *keyseg, register uchar *a, register uchar end= a+ min(key_length,(uint) length); #ifdef USE_STRCOLL - if (use_strcoll(default_charset_info)) { + if (use_strnxfrm(default_charset_info)) { if (((enum ha_base_keytype) keyseg->base.type) == HA_KEYTYPE_BINARY) { while (a < end) @@ -383,7 +383,7 @@ int _nisam_key_cmp(register N_KEYSEG *keyseg, register uchar *a, register uchar else { #ifdef USE_STRCOLL - if (use_strcoll(default_charset_info)) { + if (use_strnxfrm(default_charset_info)) { if (((enum ha_base_keytype) keyseg->base.type) == HA_KEYTYPE_BINARY) { while (a < end) @@ -515,11 +515,13 @@ int _nisam_key_cmp(register N_KEYSEG *keyseg, register uchar *a, register uchar if (*a++ != *b++) { a--; b--; - if (isdigit((char) *a) && isdigit((char) *b)) + if (my_isdigit(default_charset_info, (char) *a) && + my_isdigit(default_charset_info, (char) *b)) return ((int) *a - (int) *b); - if (*a == '-' || isdigit((char) *b)) + if (*a == '-' || my_isdigit(default_charset_info,(char) *b)) return (-1); - if (*b == '-' || *b++ == ' ' || isdigit((char) *a)) + if (*b == '-' || *b++ == ' ' || + my_isdigit(default_charset_info,(char) *a)) return (1); if (*a++ == ' ') return (-1); @@ -539,11 +541,13 @@ int _nisam_key_cmp(register N_KEYSEG *keyseg, register uchar *a, register uchar if (*a++ != *b++) { a--; b--; - if (isdigit((char) *a) && isdigit((char) *b)) + if (my_isdigit(default_charset_info,(char) *a) && + my_isdigit(default_charset_info,(char) *b)) return ((int) *a - (int) *b); - if (*a == '-' || isdigit((char) *b)) + if (*a == '-' || my_isdigit(default_charset_info,(char) *b)) return (-1); - if (*b == '-' || *b++ == ' ' || isdigit((char) *a)) + if (*b == '-' || *b++ == ' ' || + my_isdigit(default_charset_info,(char) *a)) return (1); if (*a++ == ' ') return -1; diff --git a/isam/isamlog.c b/isam/isamlog.c index 0367c03e08a..ff3bca39e40 100644 --- a/isam/isamlog.c +++ b/isam/isamlog.c @@ -342,7 +342,7 @@ static int examine_log(my_string file_name, char **table_names) file_info.process=0; result=uint2korr(head+7); if ((curr_file_info=(struct isamlog_file_info*) - tree_search(&tree,&file_info))) + tree_search(&tree, &file_info, tree.custom_arg))) { curr_file_info->accessed=access_time; if (update && curr_file_info->used && curr_file_info->closed) @@ -444,7 +444,7 @@ static int examine_log(my_string file_name, char **table_names) files_open++; file_info.closed=0; } - VOID(tree_insert(&tree,(gptr) &file_info,0)); + VOID(tree_insert(&tree, (gptr) &file_info, 0, tree.custom_arg)); if (file_info.used) { if (verbose && !record_pos_file) @@ -463,7 +463,7 @@ static int examine_log(my_string file_name, char **table_names) { if (!curr_file_info->closed) files_open--; - VOID(tree_delete(&tree,(gptr) curr_file_info)); + VOID(tree_delete(&tree, (gptr) curr_file_info, tree.custom_arg)); } break; case LOG_EXTRA: diff --git a/isam/pack_isam.c b/isam/pack_isam.c index b2e21afc743..09825dd137f 100644 --- a/isam/pack_isam.c +++ b/isam/pack_isam.c @@ -687,7 +687,8 @@ static HUFF_COUNTS *init_huff_count(N_INFO *info,my_off_t records) (type == FIELD_NORMAL || type == FIELD_SKIP_ZERO)) count[i].max_zero_fill= count[i].field_length; - init_tree(&count[i].int_tree,0,0,-1,(qsort_cmp2) compare_tree,0,NULL,NULL); + init_tree(&count[i].int_tree,0,0,-1,(qsort_cmp2) compare_tree,0, + NULL, NULL); if (records) count[i].tree_pos=count[i].tree_buff = my_malloc(count[i].field_length > 1 ? tree_buff_length : 2, @@ -765,7 +766,8 @@ static int get_statistic(MRG_INFO *mrg,HUFF_COUNTS *huff_counts) if (count->tree_buff) { global_count=count; - if (!(element=tree_insert(&count->int_tree,pos,0)) || + if (!(element=tree_insert(&count->int_tree, pos, 0, + count->int_tree.custom_arg)) || ((element->count == 1 && count->tree_buff + tree_buff_length < count->tree_pos + count->field_length) || @@ -1736,7 +1738,8 @@ static int compress_isam_file(MRG_INFO *mrg, HUFF_COUNTS *huff_counts) break; case FIELD_INTERVALL: global_count=count; - pos=(byte*) tree_search(&count->int_tree,start_pos); + pos=(byte*) tree_search(&count->int_tree, start_pos, + count->int_tree.custom_arg); intervall=(uint) (pos - count->tree_buff)/field_length; write_bits(tree->code[intervall],(uint) tree->code_len[intervall]); start_pos=end_pos; diff --git a/isam/static.c b/isam/static.c index 9c68a0cfdba..0a8dc809ad7 100644 --- a/isam/static.c +++ b/isam/static.c @@ -41,5 +41,5 @@ uint NEAR nisam_read_vec[]= { SEARCH_FIND, SEARCH_FIND | SEARCH_BIGGER, SEARCH_FIND | SEARCH_SMALLER, SEARCH_NO_FIND | SEARCH_BIGGER, SEARCH_NO_FIND | SEARCH_SMALLER, - SEARCH_FIND, SEARCH_LAST + SEARCH_FIND, SEARCH_LAST,SEARCH_LAST | SEARCH_SMALLER }; |