mirror of
https://github.com/MariaDB/server.git
synced 2025-08-31 22:22:30 +03:00
Move hash_sort and hash_caseup into CHARSET_INFO for all charsets
This commit is contained in:
@@ -6245,8 +6245,8 @@ CHARSET_INFO my_charset_big5 =
|
||||
NULL, /* tosort */
|
||||
my_strcasecmp_mb,
|
||||
my_strncasecmp_mb,
|
||||
NULL, /* hash_caseup */
|
||||
NULL, /* hash_sort */
|
||||
my_hash_caseup_simple,
|
||||
my_hash_sort_simple,
|
||||
0
|
||||
};
|
||||
|
||||
|
@@ -623,8 +623,8 @@ CHARSET_INFO my_charset_czech =
|
||||
NULL, /* tosort */
|
||||
my_strcasecmp_8bit,
|
||||
my_strncasecmp_8bit,
|
||||
NULL, /* hash_caseup */
|
||||
NULL, /* hash_sort */
|
||||
my_hash_caseup_simple,
|
||||
my_hash_sort_simple,
|
||||
0
|
||||
};
|
||||
|
||||
|
@@ -8662,8 +8662,8 @@ CHARSET_INFO my_charset_euc_kr =
|
||||
my_tosort_8bit,
|
||||
my_strcasecmp_mb,
|
||||
my_strncasecmp_mb,
|
||||
NULL, /* hash_caseup */
|
||||
NULL, /* hash_sort */
|
||||
my_hash_caseup_simple,
|
||||
my_hash_sort_simple,
|
||||
0
|
||||
};
|
||||
|
||||
|
@@ -5712,8 +5712,8 @@ CHARSET_INFO my_charset_gb2312 =
|
||||
my_tosort_8bit,
|
||||
my_strcasecmp_mb,
|
||||
my_strncasecmp_mb,
|
||||
NULL, /* hash_caseup */
|
||||
NULL, /* hash_sort */
|
||||
my_hash_caseup_simple,
|
||||
my_hash_sort_simple,
|
||||
0
|
||||
};
|
||||
|
||||
|
@@ -9900,8 +9900,8 @@ CHARSET_INFO my_charset_gbk =
|
||||
NULL, /* tosort */
|
||||
my_strcasecmp_mb,
|
||||
my_strncasecmp_mb,
|
||||
NULL, /* hash_caseup */
|
||||
NULL, /* hash_sort */
|
||||
my_hash_caseup_simple,
|
||||
my_hash_sort_simple,
|
||||
0
|
||||
};
|
||||
|
||||
|
@@ -441,8 +441,8 @@ CHARSET_INFO my_charset_latin1_de =
|
||||
NULL, /* tosort */
|
||||
my_strcasecmp_8bit,
|
||||
my_strncasecmp_8bit,
|
||||
NULL, /* hash_caseup */
|
||||
NULL, /* hash_sort */
|
||||
my_hash_caseup_simple,
|
||||
my_hash_sort_simple,
|
||||
0
|
||||
};
|
||||
|
||||
|
@@ -118,3 +118,56 @@ int my_wc_mb_8bit(CHARSET_INFO *cs,my_wc_t wc,
|
||||
}
|
||||
return MY_CS_ILUNI;
|
||||
}
|
||||
|
||||
|
||||
|
||||
#ifndef NEW_HASH_FUNCTION
|
||||
|
||||
/* Calc hashvalue for a key, case indepenently */
|
||||
|
||||
uint my_hash_caseup_simple(CHARSET_INFO *cs, const byte *key, uint length)
|
||||
{
|
||||
register uint nr=1, nr2=4;
|
||||
register uchar *map=cs->to_upper;
|
||||
|
||||
while (length--)
|
||||
{
|
||||
nr^= (((nr & 63)+nr2)*
|
||||
((uint) (uchar) map[(uchar)*key++])) + (nr << 8);
|
||||
nr2+=3;
|
||||
}
|
||||
return((uint) nr);
|
||||
}
|
||||
|
||||
#else
|
||||
|
||||
uint my_hash_caseup_simple(CHARSET_INFO *cs, const byte *key, uint len)
|
||||
{
|
||||
const byte *end=key+len;
|
||||
uint hash;
|
||||
for (hash = 0; key < end; key++)
|
||||
{
|
||||
hash *= 16777619;
|
||||
hash ^= (uint) (uchar) my_toupper(cs,*key);
|
||||
}
|
||||
return (hash);
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
void my_hash_sort_simple(CHARSET_INFO *cs,
|
||||
const uchar *key, uint len,
|
||||
ulong *nr1, ulong *nr2)
|
||||
{
|
||||
register uchar *sort_order=cs->sort_order;
|
||||
const uchar *pos = key;
|
||||
|
||||
key+= len;
|
||||
|
||||
for (; pos < (uchar*) key ; pos++)
|
||||
{
|
||||
nr1[0]^=(ulong) ((((uint) nr1[0] & 63)+nr2[0]) *
|
||||
((uint) sort_order[(uint) *pos])) + (nr1[0] << 8);
|
||||
nr2[0]+=3;
|
||||
}
|
||||
}
|
||||
|
@@ -4487,8 +4487,8 @@ CHARSET_INFO my_charset_sjis =
|
||||
NULL, /* tosort */
|
||||
my_strcasecmp_8bit,
|
||||
my_strncasecmp_8bit,
|
||||
NULL, /* hash_caseup */
|
||||
NULL, /* hash_sort */
|
||||
my_hash_caseup_simple,
|
||||
my_hash_sort_simple,
|
||||
0
|
||||
};
|
||||
|
||||
|
@@ -715,8 +715,8 @@ CHARSET_INFO my_charset_tis620 =
|
||||
NULL, /* tosort */
|
||||
my_strcasecmp_8bit,
|
||||
my_strncasecmp_8bit,
|
||||
NULL, /* hash_caseup */
|
||||
NULL, /* hash_sort */
|
||||
my_hash_caseup_simple,
|
||||
my_hash_sort_simple,
|
||||
0
|
||||
};
|
||||
|
||||
|
@@ -8456,8 +8456,8 @@ CHARSET_INFO my_charset_ujis =
|
||||
my_tosort_8bit,
|
||||
my_strcasecmp_mb,
|
||||
my_strncasecmp_mb,
|
||||
NULL, /* hash_caseup */
|
||||
NULL, /* hash_sort */
|
||||
my_hash_caseup_simple,
|
||||
my_hash_sort_simple,
|
||||
0
|
||||
};
|
||||
|
||||
|
@@ -649,8 +649,8 @@ CHARSET_INFO my_charset_win1250ch =
|
||||
NULL, /* tosort */
|
||||
my_strcasecmp_8bit,
|
||||
my_strncasecmp_8bit,
|
||||
NULL, /* hash_caseup */
|
||||
NULL, /* hash_sort */
|
||||
my_hash_caseup_simple,
|
||||
my_hash_sort_simple,
|
||||
0
|
||||
};
|
||||
|
||||
|
@@ -2832,8 +2832,8 @@ static CHARSET_INFO compiled_charsets[] = {
|
||||
my_tosort_8bit,
|
||||
my_strcasecmp_8bit,
|
||||
my_strncasecmp_8bit,
|
||||
NULL, /* hash_caseup */
|
||||
NULL, /* hash_sort */
|
||||
my_hash_caseup_simple,
|
||||
my_hash_sort_simple,
|
||||
0
|
||||
},
|
||||
#endif
|
||||
@@ -2868,8 +2868,8 @@ static CHARSET_INFO compiled_charsets[] = {
|
||||
my_tosort_8bit,
|
||||
my_strcasecmp_8bit,
|
||||
my_strncasecmp_8bit,
|
||||
NULL, /* hash_caseup */
|
||||
NULL, /* hash_sort */
|
||||
my_hash_caseup_simple,
|
||||
my_hash_sort_simple,
|
||||
0
|
||||
},
|
||||
#endif
|
||||
@@ -2903,8 +2903,8 @@ static CHARSET_INFO compiled_charsets[] = {
|
||||
my_tosort_8bit,
|
||||
my_strcasecmp_8bit,
|
||||
my_strncasecmp_8bit,
|
||||
NULL, /* hash_caseup */
|
||||
NULL, /* hash_sort */
|
||||
my_hash_caseup_simple,
|
||||
my_hash_sort_simple,
|
||||
0
|
||||
},
|
||||
#endif
|
||||
@@ -2938,8 +2938,8 @@ static CHARSET_INFO compiled_charsets[] = {
|
||||
my_tosort_8bit,
|
||||
my_strcasecmp_8bit,
|
||||
my_strncasecmp_8bit,
|
||||
NULL, /* hash_caseup */
|
||||
NULL, /* hash_sort */
|
||||
my_hash_caseup_simple,
|
||||
my_hash_sort_simple,
|
||||
0
|
||||
},
|
||||
#endif
|
||||
@@ -2974,8 +2974,8 @@ static CHARSET_INFO compiled_charsets[] = {
|
||||
my_tosort_8bit,
|
||||
my_strcasecmp_8bit,
|
||||
my_strncasecmp_8bit,
|
||||
NULL, /* hash_caseup */
|
||||
NULL, /* hash_sort */
|
||||
my_hash_caseup_simple,
|
||||
my_hash_sort_simple,
|
||||
0
|
||||
},
|
||||
#endif
|
||||
@@ -3009,8 +3009,8 @@ static CHARSET_INFO compiled_charsets[] = {
|
||||
my_tosort_8bit,
|
||||
my_strcasecmp_8bit,
|
||||
my_strncasecmp_8bit,
|
||||
NULL, /* hash_caseup */
|
||||
NULL, /* hash_sort */
|
||||
my_hash_caseup_simple,
|
||||
my_hash_sort_simple,
|
||||
0
|
||||
},
|
||||
#endif
|
||||
@@ -3044,8 +3044,8 @@ static CHARSET_INFO compiled_charsets[] = {
|
||||
my_tosort_8bit,
|
||||
my_strcasecmp_8bit,
|
||||
my_strncasecmp_8bit,
|
||||
NULL, /* hash_caseup */
|
||||
NULL, /* hash_sort */
|
||||
my_hash_caseup_simple,
|
||||
my_hash_sort_simple,
|
||||
0
|
||||
},
|
||||
#endif
|
||||
@@ -3079,8 +3079,8 @@ static CHARSET_INFO compiled_charsets[] = {
|
||||
my_tosort_8bit,
|
||||
my_strcasecmp_8bit,
|
||||
my_strncasecmp_8bit,
|
||||
NULL, /* hash_caseup */
|
||||
NULL, /* hash_sort */
|
||||
my_hash_caseup_simple,
|
||||
my_hash_sort_simple,
|
||||
0
|
||||
},
|
||||
#endif
|
||||
@@ -3115,8 +3115,8 @@ static CHARSET_INFO compiled_charsets[] = {
|
||||
my_tosort_8bit,
|
||||
my_strcasecmp_8bit,
|
||||
my_strncasecmp_8bit,
|
||||
NULL, /* hash_caseup */
|
||||
NULL, /* hash_sort */
|
||||
my_hash_caseup_simple,
|
||||
my_hash_sort_simple,
|
||||
0
|
||||
},
|
||||
#endif
|
||||
@@ -3150,8 +3150,8 @@ static CHARSET_INFO compiled_charsets[] = {
|
||||
my_tosort_8bit,
|
||||
my_strcasecmp_8bit,
|
||||
my_strncasecmp_8bit,
|
||||
NULL, /* hash_caseup */
|
||||
NULL, /* hash_sort */
|
||||
my_hash_caseup_simple,
|
||||
my_hash_sort_simple,
|
||||
0
|
||||
},
|
||||
#endif
|
||||
@@ -3185,8 +3185,8 @@ static CHARSET_INFO compiled_charsets[] = {
|
||||
my_tosort_8bit,
|
||||
my_strcasecmp_8bit,
|
||||
my_strncasecmp_8bit,
|
||||
NULL, /* hash_caseup */
|
||||
NULL, /* hash_sort */
|
||||
my_hash_caseup_simple,
|
||||
my_hash_sort_simple,
|
||||
0
|
||||
},
|
||||
#endif
|
||||
@@ -3220,8 +3220,8 @@ static CHARSET_INFO compiled_charsets[] = {
|
||||
my_tosort_8bit,
|
||||
my_strcasecmp_8bit,
|
||||
my_strncasecmp_8bit,
|
||||
NULL, /* hash_caseup */
|
||||
NULL, /* hash_sort */
|
||||
my_hash_caseup_simple,
|
||||
my_hash_sort_simple,
|
||||
0
|
||||
},
|
||||
#endif
|
||||
@@ -3255,8 +3255,8 @@ static CHARSET_INFO compiled_charsets[] = {
|
||||
my_tosort_8bit,
|
||||
my_strcasecmp_8bit,
|
||||
my_strncasecmp_8bit,
|
||||
NULL, /* hash_caseup */
|
||||
NULL, /* hash_sort */
|
||||
my_hash_caseup_simple,
|
||||
my_hash_sort_simple,
|
||||
0
|
||||
},
|
||||
#endif
|
||||
@@ -3290,8 +3290,8 @@ static CHARSET_INFO compiled_charsets[] = {
|
||||
my_tosort_8bit,
|
||||
my_strcasecmp_8bit,
|
||||
my_strncasecmp_8bit,
|
||||
NULL, /* hash_caseup */
|
||||
NULL, /* hash_sort */
|
||||
my_hash_caseup_simple,
|
||||
my_hash_sort_simple,
|
||||
0
|
||||
},
|
||||
#endif
|
||||
@@ -3325,8 +3325,8 @@ static CHARSET_INFO compiled_charsets[] = {
|
||||
my_tosort_8bit,
|
||||
my_strcasecmp_8bit,
|
||||
my_strncasecmp_8bit,
|
||||
NULL, /* hash_caseup */
|
||||
NULL, /* hash_sort */
|
||||
my_hash_caseup_simple,
|
||||
my_hash_sort_simple,
|
||||
0
|
||||
},
|
||||
#endif
|
||||
@@ -3361,8 +3361,8 @@ static CHARSET_INFO compiled_charsets[] = {
|
||||
my_tosort_8bit,
|
||||
my_strcasecmp_8bit,
|
||||
my_strncasecmp_8bit,
|
||||
NULL, /* hash_caseup */
|
||||
NULL, /* hash_sort */
|
||||
my_hash_caseup_simple,
|
||||
my_hash_sort_simple,
|
||||
0
|
||||
},
|
||||
#endif
|
||||
@@ -3396,8 +3396,8 @@ static CHARSET_INFO compiled_charsets[] = {
|
||||
my_tosort_8bit,
|
||||
my_strcasecmp_8bit,
|
||||
my_strncasecmp_8bit,
|
||||
NULL, /* hash_caseup */
|
||||
NULL, /* hash_sort */
|
||||
my_hash_caseup_simple,
|
||||
my_hash_sort_simple,
|
||||
0
|
||||
},
|
||||
#endif
|
||||
@@ -3432,8 +3432,8 @@ static CHARSET_INFO compiled_charsets[] = {
|
||||
my_tosort_8bit,
|
||||
my_strcasecmp_8bit,
|
||||
my_strncasecmp_8bit,
|
||||
NULL, /* hash_caseup */
|
||||
NULL, /* hash_sort */
|
||||
my_hash_caseup_simple,
|
||||
my_hash_sort_simple,
|
||||
0
|
||||
},
|
||||
#endif
|
||||
@@ -3468,8 +3468,8 @@ static CHARSET_INFO compiled_charsets[] = {
|
||||
my_tosort_8bit,
|
||||
my_strcasecmp_8bit,
|
||||
my_strncasecmp_8bit,
|
||||
NULL, /* hash_caseup */
|
||||
NULL, /* hash_sort */
|
||||
my_hash_caseup_simple,
|
||||
my_hash_sort_simple,
|
||||
0
|
||||
},
|
||||
#endif
|
||||
@@ -3503,8 +3503,8 @@ static CHARSET_INFO compiled_charsets[] = {
|
||||
my_tosort_8bit,
|
||||
my_strcasecmp_8bit,
|
||||
my_strncasecmp_8bit,
|
||||
NULL, /* hash_caseup */
|
||||
NULL, /* hash_sort */
|
||||
my_hash_caseup_simple,
|
||||
my_hash_sort_simple,
|
||||
0
|
||||
},
|
||||
#endif
|
||||
@@ -3538,8 +3538,8 @@ static CHARSET_INFO compiled_charsets[] = {
|
||||
my_strcasecmp_8bit,
|
||||
my_tosort_8bit,
|
||||
my_strncasecmp_8bit,
|
||||
NULL, /* hash_caseup */
|
||||
NULL, /* hash_sort */
|
||||
my_hash_caseup_simple,
|
||||
my_hash_sort_simple,
|
||||
0
|
||||
},
|
||||
#endif
|
||||
@@ -3573,8 +3573,8 @@ static CHARSET_INFO compiled_charsets[] = {
|
||||
my_tosort_8bit,
|
||||
my_strcasecmp_8bit,
|
||||
my_strncasecmp_8bit,
|
||||
NULL, /* hash_caseup */
|
||||
NULL, /* hash_sort */
|
||||
my_hash_caseup_simple,
|
||||
my_hash_sort_simple,
|
||||
0
|
||||
},
|
||||
#endif
|
||||
@@ -3608,8 +3608,8 @@ static CHARSET_INFO compiled_charsets[] = {
|
||||
my_tosort_8bit,
|
||||
my_strcasecmp_8bit,
|
||||
my_strncasecmp_8bit,
|
||||
NULL, /* hash_caseup */
|
||||
NULL, /* hash_sort */
|
||||
my_hash_caseup_simple,
|
||||
my_hash_sort_simple,
|
||||
0
|
||||
},
|
||||
#endif
|
||||
|
Reference in New Issue
Block a user