#include <my_global.h>#include "m_string.h"#include "m_ctype.h"Include dependency graph for ctype-bin.c:

Go to the source code of this file.
Defines | |
| #define | likeconv(s, A) (A) |
| #define | INC_PTR(cs, A, B) (A)++ |
Functions | |
| static my_bool | my_coll_init_8bit_bin (CHARSET_INFO *cs, void *(*alloc)(uint) __attribute__((unused))) |
| static int | my_strnncoll_binary (CHARSET_INFO *cs __attribute__((unused)), const uchar *s, uint slen, const uchar *t, uint tlen, my_bool t_is_prefix) |
| uint | my_lengthsp_binary (CHARSET_INFO *cs __attribute__((unused)), const char *ptr __attribute__((unused)), uint length) |
| static int | my_strnncollsp_binary (CHARSET_INFO *cs __attribute__((unused)), const uchar *s, uint slen, const uchar *t, uint tlen, my_bool diff_if_only_endspace_difference __attribute__((unused))) |
| static int | my_strnncoll_8bit_bin (CHARSET_INFO *cs __attribute__((unused)), const uchar *s, uint slen, const uchar *t, uint tlen, my_bool t_is_prefix) |
| static int | my_strnncollsp_8bit_bin (CHARSET_INFO *cs __attribute__((unused)), const uchar *a, uint a_length, const uchar *b, uint b_length, my_bool diff_if_only_endspace_difference) |
| static void | my_case_str_bin (CHARSET_INFO *cs __attribute__((unused)), char *str __attribute__((unused))) |
| static uint | my_case_bin (CHARSET_INFO *cs __attribute__((unused)), char *src __attribute__((unused)), uint srclen, char *dst __attribute__((unused)), uint dstlen __attribute__((unused))) |
| static int | my_strcasecmp_bin (CHARSET_INFO *cs __attribute__((unused)), const char *s, const char *t) |
| int | my_mbcharlen_8bit (CHARSET_INFO *cs __attribute__((unused)), uint c __attribute__((unused))) |
| static int | my_mb_wc_bin (CHARSET_INFO *cs __attribute__((unused)), my_wc_t *wc, const unsigned char *str, const unsigned char *end __attribute__((unused))) |
| static int | my_wc_mb_bin (CHARSET_INFO *cs __attribute__((unused)), my_wc_t wc, unsigned char *s, unsigned char *e __attribute__((unused))) |
| void | my_hash_sort_bin (CHARSET_INFO *cs __attribute__((unused)), const uchar *key, uint len, ulong *nr1, ulong *nr2) |
| int | my_wildcmp_bin (CHARSET_INFO *cs, const char *str, const char *str_end, const char *wildstr, const char *wildend, int escape, int w_one, int w_many) |
| static int | my_strnxfrm_bin (CHARSET_INFO *cs __attribute__((unused)), uchar *dest, uint dstlen, const uchar *src, uint srclen) |
| static int | my_strnxfrm_8bit_bin (CHARSET_INFO *cs __attribute__((unused)), uchar *dest, uint dstlen, const uchar *src, uint srclen) |
| static uint | my_instr_bin (CHARSET_INFO *cs __attribute__((unused)), const char *b, uint b_length, const char *s, uint s_length, my_match_t *match, uint nmatch) |
Variables | |
| static uchar | ctype_bin [] |
| static uchar | bin_char_array [] |
| MY_COLLATION_HANDLER | my_collation_8bit_bin_handler |
| static MY_COLLATION_HANDLER | my_collation_binary_handler |
| static MY_CHARSET_HANDLER | my_charset_handler |
| CHARSET_INFO | my_charset_bin |
Definition at line 294 of file ctype-bin.c.
Referenced by my_wildcmp_8bit(), my_wildcmp_bin(), Item_func_like::turboBM_compute_suffixes(), and Item_func_like::turboBM_matches().
| static uint my_case_bin | ( | CHARSET_INFO *cs | __attribute__((unused)), | |
| char *src | __attribute__((unused)), | |||
| uint | srclen, | |||
| char *dst | __attribute__((unused)), | |||
| uint dstlen | __attribute__((unused)) | |||
| ) | [static] |
| static void my_case_str_bin | ( | CHARSET_INFO *cs | __attribute__((unused)), | |
| char *str | __attribute__((unused)) | |||
| ) | [static] |
| static my_bool my_coll_init_8bit_bin | ( | CHARSET_INFO * | cs, | |
| void * | (*)(uint) __attribute__ alloc((unused)) | |||
| ) | [static] |
Definition at line 71 of file ctype-bin.c.
References FALSE, and charset_info_st::max_sort_char.
00073 { 00074 cs->max_sort_char=255; 00075 return FALSE; 00076 }
| void my_hash_sort_bin | ( | CHARSET_INFO *cs | __attribute__((unused)), | |
| const uchar * | key, | |||
| uint | len, | |||
| ulong * | nr1, | |||
| ulong * | nr2 | |||
| ) |
Definition at line 273 of file ctype-bin.c.
References pos().
00275 { 00276 const uchar *pos = key; 00277 00278 key+= len; 00279 00280 for (; pos < (uchar*) key ; pos++) 00281 { 00282 nr1[0]^=(ulong) ((((uint) nr1[0] & 63)+nr2[0]) * 00283 ((uint)*pos)) + (nr1[0] << 8); 00284 nr2[0]+=3; 00285 } 00286 }
Here is the call graph for this function:

| static uint my_instr_bin | ( | CHARSET_INFO *cs | __attribute__((unused)), | |
| const char * | b, | |||
| uint | b_length, | |||
| const char * | s, | |||
| uint | s_length, | |||
| my_match_t * | match, | |||
| uint | nmatch | |||
| ) | [static] |
Definition at line 402 of file ctype-bin.c.
References my_match_t::beg, my_match_t::end, my_match_t::mblen, search_end(), and skip().
00406 { 00407 register const uchar *str, *search, *end, *search_end; 00408 00409 if (s_length <= b_length) 00410 { 00411 if (!s_length) 00412 { 00413 if (nmatch) 00414 { 00415 match->beg= 0; 00416 match->end= 0; 00417 match->mblen= 0; 00418 } 00419 return 1; /* Empty string is always found */ 00420 } 00421 00422 str= (const uchar*) b; 00423 search= (const uchar*) s; 00424 end= (const uchar*) b+b_length-s_length+1; 00425 search_end= (const uchar*) s + s_length; 00426 00427 skip: 00428 while (str != end) 00429 { 00430 if ( (*str++) == (*search)) 00431 { 00432 register const uchar *i,*j; 00433 00434 i= str; 00435 j= search+1; 00436 00437 while (j != search_end) 00438 if ((*i++) != (*j++)) 00439 goto skip; 00440 00441 if (nmatch > 0) 00442 { 00443 match[0].beg= 0; 00444 match[0].end= (uint) (str- (const uchar*)b-1); 00445 match[0].mblen= match[0].end; 00446 00447 if (nmatch > 1) 00448 { 00449 match[1].beg= match[0].end; 00450 match[1].end= match[0].end+s_length; 00451 match[1].mblen= match[1].end-match[1].beg; 00452 } 00453 } 00454 return 2; 00455 } 00456 } 00457 } 00458 return 0; 00459 }
Here is the call graph for this function:

| uint my_lengthsp_binary | ( | CHARSET_INFO *cs | __attribute__((unused)), | |
| const char *ptr | __attribute__((unused)), | |||
| uint | length | |||
| ) |
| static int my_mb_wc_bin | ( | CHARSET_INFO *cs | __attribute__((unused)), | |
| my_wc_t * | wc, | |||
| const unsigned char * | str, | |||
| const unsigned char *end | __attribute__((unused)) | |||
| ) | [static] |
Definition at line 243 of file ctype-bin.c.
References MY_CS_TOOSMALL.
00247 { 00248 if (str >= end) 00249 return MY_CS_TOOSMALL; 00250 00251 *wc=str[0]; 00252 return 1; 00253 }
| int my_mbcharlen_8bit | ( | CHARSET_INFO *cs | __attribute__((unused)), | |
| uint c | __attribute__((unused)) | |||
| ) |
| static int my_strcasecmp_bin | ( | CHARSET_INFO *cs | __attribute__((unused)), | |
| const char * | s, | |||
| const char * | t | |||
| ) | [static] |
Definition at line 229 of file ctype-bin.c.
References strcmp().
00231 { 00232 return strcmp(s,t); 00233 }
Here is the call graph for this function:

| static int my_strnncoll_binary | ( | CHARSET_INFO *cs | __attribute__((unused)), | |
| const uchar * | s, | |||
| uint | slen, | |||
| const uchar * | t, | |||
| uint | tlen, | |||
| my_bool | t_is_prefix | |||
| ) | [static] |
Definition at line 78 of file ctype-bin.c.
References cmp, int(), memcmp(), and min.
Referenced by my_strnncollsp_binary().
00082 { 00083 uint len=min(slen,tlen); 00084 int cmp= memcmp(s,t,len); 00085 return cmp ? cmp : (int)((t_is_prefix ? len : slen) - tlen); 00086 }
Here is the call graph for this function:

Here is the caller graph for this function:

| static int my_strnncollsp_8bit_bin | ( | CHARSET_INFO *cs | __attribute__((unused)), | |
| const uchar * | a, | |||
| uint | a_length, | |||
| const uchar * | b, | |||
| uint | b_length, | |||
| my_bool | diff_if_only_endspace_difference | |||
| ) | [static] |
Definition at line 165 of file ctype-bin.c.
References min, and mySTL::swap().
00169 { 00170 const uchar *end; 00171 uint length; 00172 int res; 00173 00174 #ifndef VARCHAR_WITH_DIFF_ENDSPACE_ARE_DIFFERENT_FOR_UNIQUE 00175 diff_if_only_endspace_difference= 0; 00176 #endif 00177 00178 end= a + (length= min(a_length, b_length)); 00179 while (a < end) 00180 { 00181 if (*a++ != *b++) 00182 return ((int) a[-1] - (int) b[-1]); 00183 } 00184 res= 0; 00185 if (a_length != b_length) 00186 { 00187 int swap= 1; 00188 /* 00189 Check the next not space character of the longer key. If it's < ' ', 00190 then it's smaller than the other key. 00191 */ 00192 if (diff_if_only_endspace_difference) 00193 res= 1; /* Assume 'a' is bigger */ 00194 if (a_length < b_length) 00195 { 00196 /* put shorter key in s */ 00197 a_length= b_length; 00198 a= b; 00199 swap= -1; /* swap sign of result */ 00200 res= -res; 00201 } 00202 for (end= a + a_length-length; a < end ; a++) 00203 { 00204 if (*a != ' ') 00205 return (*a < ' ') ? -swap : swap; 00206 } 00207 } 00208 return res; 00209 }
Here is the call graph for this function:

| static int my_strnncollsp_binary | ( | CHARSET_INFO *cs | __attribute__((unused)), | |
| const uchar * | s, | |||
| uint | slen, | |||
| const uchar * | t, | |||
| uint | tlen, | |||
| my_bool diff_if_only_endspace_difference | __attribute__((unused)) | |||
| ) | [static] |
Definition at line 119 of file ctype-bin.c.
References my_strnncoll_binary().
00124 { 00125 return my_strnncoll_binary(cs,s,slen,t,tlen,0); 00126 }
Here is the call graph for this function:

| static int my_strnxfrm_8bit_bin | ( | CHARSET_INFO *cs | __attribute__((unused)), | |
| uchar * | dest, | |||
| uint | dstlen, | |||
| const uchar * | src, | |||
| uint | srclen | |||
| ) | [static] |
| static int my_strnxfrm_bin | ( | CHARSET_INFO *cs | __attribute__((unused)), | |
| uchar * | dest, | |||
| uint | dstlen, | |||
| const uchar * | src, | |||
| uint | srclen | |||
| ) | [static] |
| static int my_wc_mb_bin | ( | CHARSET_INFO *cs | __attribute__((unused)), | |
| my_wc_t | wc, | |||
| unsigned char * | s, | |||
| unsigned char *e | __attribute__((unused)) | |||
| ) | [static] |
Definition at line 256 of file ctype-bin.c.
References e, MY_CS_ILUNI, and MY_CS_TOOSMALL.
00260 { 00261 if (s >= e) 00262 return MY_CS_TOOSMALL; 00263 00264 if (wc < 256) 00265 { 00266 s[0]= (char) wc; 00267 return 1; 00268 } 00269 return MY_CS_ILUNI; 00270 }
| int my_wildcmp_bin | ( | CHARSET_INFO * | cs, | |
| const char * | str, | |||
| const char * | str_end, | |||
| const char * | wildstr, | |||
| const char * | wildend, | |||
| int | escape, | |||
| int | w_one, | |||
| int | w_many | |||
| ) |
Definition at line 298 of file ctype-bin.c.
References cmp, INC_PTR, likeconv, and my_wildcmp_bin().
00302 { 00303 int result= -1; /* Not found, using wildcards */ 00304 00305 while (wildstr != wildend) 00306 { 00307 while (*wildstr != w_many && *wildstr != w_one) 00308 { 00309 if (*wildstr == escape && wildstr+1 != wildend) 00310 wildstr++; 00311 if (str == str_end || likeconv(cs,*wildstr++) != likeconv(cs,*str++)) 00312 return(1); /* No match */ 00313 if (wildstr == wildend) 00314 return(str != str_end); /* Match if both are at end */ 00315 result=1; /* Found an anchor char */ 00316 } 00317 if (*wildstr == w_one) 00318 { 00319 do 00320 { 00321 if (str == str_end) /* Skip one char if possible */ 00322 return(result); 00323 INC_PTR(cs,str,str_end); 00324 } while (++wildstr < wildend && *wildstr == w_one); 00325 if (wildstr == wildend) 00326 break; 00327 } 00328 if (*wildstr == w_many) 00329 { /* Found w_many */ 00330 uchar cmp; 00331 wildstr++; 00332 /* Remove any '%' and '_' from the wild search string */ 00333 for (; wildstr != wildend ; wildstr++) 00334 { 00335 if (*wildstr == w_many) 00336 continue; 00337 if (*wildstr == w_one) 00338 { 00339 if (str == str_end) 00340 return(-1); 00341 INC_PTR(cs,str,str_end); 00342 continue; 00343 } 00344 break; /* Not a wild character */ 00345 } 00346 if (wildstr == wildend) 00347 return(0); /* match if w_many is last */ 00348 if (str == str_end) 00349 return(-1); 00350 00351 if ((cmp= *wildstr) == escape && wildstr+1 != wildend) 00352 cmp= *++wildstr; 00353 00354 INC_PTR(cs,wildstr,wildend); /* This is compared through cmp */ 00355 cmp=likeconv(cs,cmp); 00356 do 00357 { 00358 while (str != str_end && (uchar) likeconv(cs,*str) != cmp) 00359 str++; 00360 if (str++ == str_end) 00361 return(-1); 00362 { 00363 int tmp=my_wildcmp_bin(cs,str,str_end,wildstr,wildend,escape,w_one, 00364 w_many); 00365 if (tmp <= 0) 00366 return(tmp); 00367 } 00368 } while (str != str_end && wildstr[0] != w_many); 00369 return(-1); 00370 } 00371 } 00372 return(str != str_end ? 1 : 0); 00373 }
Here is the call graph for this function:

uchar bin_char_array[] [static] |
Initial value:
{
0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31,
32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47,
48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63,
64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79,
80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95,
96, 97, 98, 99,100,101,102,103,104,105,106,107,108,109,110,111,
112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,
128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,
144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,
160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,
176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191,
192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207,
208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223,
224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,239,
240,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255
}
Definition at line 49 of file ctype-bin.c.
Initial value:
{
0,
32, 32, 32, 32, 32, 32, 32, 32, 32, 40, 40, 40, 40, 40, 32, 32,
32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32,
72, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
132,132,132,132,132,132,132,132,132,132, 16, 16, 16, 16, 16, 16,
16,129,129,129,129,129,129, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 16, 16, 16, 16, 16,
16,130,130,130,130,130,130, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 16, 16, 16, 16, 32,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
}
Definition at line 25 of file ctype-bin.c.
Definition at line 525 of file ctype-bin.c.
MY_CHARSET_HANDLER my_charset_handler [static] |
Initial value:
{
NULL,
NULL,
my_mbcharlen_8bit,
my_numchars_8bit,
my_charpos_8bit,
my_well_formed_len_8bit,
my_lengthsp_binary,
my_numcells_8bit,
my_mb_wc_bin,
my_wc_mb_bin,
my_mb_ctype_8bit,
my_case_str_bin,
my_case_str_bin,
my_case_bin,
my_case_bin,
my_snprintf_8bit,
my_long10_to_str_8bit,
my_longlong10_to_str_8bit,
my_fill_8bit,
my_strntol_8bit,
my_strntoul_8bit,
my_strntoll_8bit,
my_strntoull_8bit,
my_strntod_8bit,
my_strtoll10_8bit,
my_scan_8bit
}
Definition at line 494 of file ctype-bin.c.
Initial value:
{
my_coll_init_8bit_bin,
my_strnncoll_8bit_bin,
my_strnncollsp_8bit_bin,
my_strnxfrm_8bit_bin,
my_strnxfrmlen_simple,
my_like_range_simple,
my_wildcmp_bin,
my_strcasecmp_bin,
my_instr_bin,
my_hash_sort_bin,
my_propagate_simple
}
Definition at line 462 of file ctype-bin.c.
Initial value:
{
NULL,
my_strnncoll_binary,
my_strnncollsp_binary,
my_strnxfrm_bin,
my_strnxfrmlen_simple,
my_like_range_simple,
my_wildcmp_bin,
my_strcasecmp_bin,
my_instr_bin,
my_hash_sort_bin,
my_propagate_simple
}
Definition at line 478 of file ctype-bin.c.
1.4.7

