16 #include <my_global.h>
28 size_t my_strnxfrmlen_simple(
const CHARSET_INFO *cs,
size_t len)
30 return len * (cs->strxfrm_multiply ? cs->strxfrm_multiply : 1);
76 uchar *dst,
size_t dstlen, uint nweights,
77 const uchar *src,
size_t srclen, uint
flags)
79 uchar *map= cs->sort_order;
82 if ((frmlen= MY_MIN(dstlen, nweights)) > srclen)
87 for (end= src + frmlen; src < end;)
93 for (end= dst + frmlen; dst < end; dst++)
94 *dst= map[(uchar) *dst];
96 return my_strxfrm_pad_desc_and_reverse(cs, d0, dst, d0 + dstlen,
97 nweights - frmlen, flags, 0);
101 int my_strnncoll_simple(
const CHARSET_INFO * cs,
const uchar *s,
size_t slen,
102 const uchar *t,
size_t tlen,
105 size_t len = ( slen > tlen ) ? tlen : slen;
106 uchar *map= cs->sort_order;
107 if (t_is_prefix && slen > tlen)
111 if (map[*s++] != map[*t++])
112 return ((
int) map[s[-1]] - (int) map[t[-1]]);
118 return slen > tlen ? 1 : slen < tlen ? -1 : 0 ;
152 int my_strnncollsp_simple(
const CHARSET_INFO *cs,
const uchar *a,
153 size_t a_length,
const uchar *b,
size_t b_length,
154 my_bool diff_if_only_endspace_difference)
156 const uchar *map= cs->sort_order, *end;
160 #ifndef VARCHAR_WITH_DIFF_ENDSPACE_ARE_DIFFERENT_FOR_UNIQUE
161 diff_if_only_endspace_difference= 0;
164 end= a + (length= MY_MIN(a_length, b_length));
167 if (map[*a++] != map[*b++])
168 return ((
int) map[a[-1]] - (int) map[b[-1]]);
171 if (a_length != b_length)
174 if (diff_if_only_endspace_difference)
180 if (a_length < b_length)
188 for (end= a + a_length-length; a < end ; a++)
190 if (map[*a] != map[
' '])
191 return (map[*a] < map[
' ']) ? -swap : swap;
198 size_t my_caseup_str_8bit(
const CHARSET_INFO *cs,
char *str)
200 register uchar *map= cs->to_upper;
202 while ((*str= (
char) map[(uchar) *str]) != 0)
204 return (
size_t) (str - str_orig);
208 size_t my_casedn_str_8bit(
const CHARSET_INFO *cs,
char *str)
210 register uchar *map= cs->to_lower;
212 while ((*str= (
char) map[(uchar) *str]) != 0)
214 return (
size_t) (str - str_orig);
218 size_t my_caseup_8bit(
const CHARSET_INFO *cs,
char *src,
size_t srclen,
219 char *dst __attribute__((unused)),
220 size_t dstlen __attribute__((unused)))
222 char *end= src + srclen;
223 register uchar *map= cs->to_upper;
224 DBUG_ASSERT(src == dst && srclen == dstlen);
225 for ( ; src != end ; src++)
226 *src= (
char) map[(uchar) *src];
231 size_t my_casedn_8bit(
const CHARSET_INFO *cs,
char *src,
size_t srclen,
232 char *dst __attribute__((unused)),
233 size_t dstlen __attribute__((unused)))
235 char *end= src + srclen;
236 register uchar *map=cs->to_lower;
237 DBUG_ASSERT(src == dst && srclen == dstlen);
238 for ( ; src != end ; src++)
239 *src= (
char) map[(uchar) *src];
243 int my_strcasecmp_8bit(
const CHARSET_INFO *cs,
const char *s,
const char *t)
245 register uchar *map=cs->to_upper;
246 while (map[(uchar) *s] == map[(uchar) *t++])
248 return ((
int) map[(uchar) s[0]] - (
int) map[(uchar) t[-1]]);
254 const uchar *end __attribute__((unused)))
257 return MY_CS_TOOSMALL;
259 *wc=cs->tab_to_uni[*str];
260 return (!wc[0] && str[0]) ? -1 : 1;
270 return MY_CS_TOOSMALL;
272 for (idx=cs->tab_from_uni; idx->tab ; idx++)
274 if (idx->from <= wc && idx->to >= wc)
276 str[0]= idx->tab[wc - idx->from];
277 return (!str[0] && wc) ? MY_CS_ILUNI : 1;
291 size_t my_snprintf_8bit(
const CHARSET_INFO *cs __attribute__((unused)),
292 char*
to,
size_t n __attribute__((unused)),
293 const char*
fmt, ...)
298 result= my_vsnprintf(to,
n, fmt, args);
305 const uchar *key,
size_t len,
306 ulong *nr1, ulong *nr2)
308 register uchar *sort_order=cs->sort_order;
315 end= skip_trailing_space(key, len);
317 for (; key < (uchar*) end ; key++)
319 nr1[0]^=(ulong) ((((uint) nr1[0] & 63)+nr2[0]) *
320 ((uint) sort_order[(uint) *key])) + (nr1[0] << 8);
327 const char *nptr,
size_t l,
int base,
328 char **endptr,
int *err)
331 register uint32 cutoff;
332 register uint cutlim;
334 register const char *s;
336 const char *save, *e;
344 for ( ; s<e && my_isspace(cs, *s) ; s++);
366 cutoff = ((uint32)~0L) / (uint32) base;
367 cutlim = (uint) (((uint32)~0L) % (uint32) base);
371 for (c = *s; s != e; c = *++s)
373 if (c>=
'0' && c<=
'9')
375 else if (c>=
'A' && c<=
'Z')
377 else if (c>=
'a' && c<=
'z')
383 if (i > cutoff || (i == cutoff && c > cutlim))
396 *endptr = (
char *) s;
400 if (i > (uint32) INT_MIN32)
403 else if (i > INT_MAX32)
409 return negative ? INT_MIN32 : INT_MAX32;
412 return (negative ? -((
long)
i) : (
long)
i);
417 *endptr = (
char *) nptr;
423 const char *nptr,
size_t l,
int base,
424 char **endptr,
int *err)
427 register uint32 cutoff;
428 register uint cutlim;
430 register const char *s;
432 const char *save, *e;
440 for( ; s<e && my_isspace(cs, *s); s++);
461 cutoff = ((uint32)~0L) / (uint32) base;
462 cutlim = (uint) (((uint32)~0L) % (uint32) base);
466 for (c = *s; s != e; c = *++s)
468 if (c>=
'0' && c<=
'9')
470 else if (c>=
'A' && c<=
'Z')
472 else if (c>=
'a' && c<=
'z')
478 if (i > cutoff || (i == cutoff && c > cutlim))
491 *endptr = (
char *) s;
496 return (~(uint32) 0);
499 return (negative ? -((
long)
i) : (
long)
i);
504 *endptr = (
char *) nptr;
509 longlong my_strntoll_8bit(
const CHARSET_INFO *cs __attribute__((unused)),
510 const char *nptr,
size_t l,
int base,
511 char **endptr,
int *err)
514 register ulonglong cutoff;
515 register uint cutlim;
516 register ulonglong
i;
517 register const char *s, *e;
526 for(; s<e && my_isspace(cs,*s); s++);
548 cutoff = (~(ulonglong) 0) / (
unsigned long int) base;
549 cutlim = (uint) ((~(ulonglong) 0) % (
unsigned long int) base);
555 register uchar c= *s;
556 if (c>=
'0' && c<=
'9')
558 else if (c>=
'A' && c<=
'Z')
560 else if (c>=
'a' && c<=
'z')
566 if (i > cutoff || (i == cutoff && c > cutlim))
570 i *= (ulonglong) base;
579 *endptr = (
char *) s;
583 if (i > (ulonglong) LONGLONG_MIN)
586 else if (i > (ulonglong) LONGLONG_MAX)
592 return negative ? LONGLONG_MIN : LONGLONG_MAX;
595 return (negative ? -((longlong)
i) : (longlong)
i);
600 *endptr = (
char *) nptr;
606 const char *nptr,
size_t l,
int base,
607 char **endptr,
int *err)
610 register ulonglong cutoff;
611 register uint cutlim;
612 register ulonglong
i;
613 register const char *s, *e;
622 for(; s<e && my_isspace(cs,*s); s++);
644 cutoff = (~(ulonglong) 0) / (
unsigned long int) base;
645 cutlim = (uint) ((~(ulonglong) 0) % (
unsigned long int) base);
651 register uchar c= *s;
653 if (c>=
'0' && c<=
'9')
655 else if (c>=
'A' && c<=
'Z')
657 else if (c>=
'a' && c<=
'z')
663 if (i > cutoff || (i == cutoff && c > cutlim))
667 i *= (ulonglong) base;
676 *endptr = (
char *) s;
681 return (~(ulonglong) 0);
684 return (negative ? -((longlong)
i) : (longlong)
i);
689 *endptr = (
char *) nptr;
717 double my_strntod_8bit(
const CHARSET_INFO *cs __attribute__((unused)),
718 char *str,
size_t length,
719 char **end,
int *err)
721 if (length == INT_MAX32)
724 return my_strtod(str, end, err);
734 size_t my_long10_to_str_8bit(
const CHARSET_INFO *cs __attribute__((unused)),
735 char *dst,
size_t len,
int radix,
long int val)
738 register char *p, *e;
741 unsigned long int uval = (
unsigned long int) val;
743 e = p = &buffer[
sizeof(buffer)-1];
751 uval= (
unsigned long int)0 - uval;
758 new_val = (long) (uval / 10);
759 *--p =
'0'+ (char) (uval - (
unsigned long) new_val * 10);
765 *--p =
'0' + (char) (val-new_val*10);
769 len= MY_MIN(len, (
size_t) (e-p));
776 __attribute__((unused)),
777 char *dst,
size_t len,
int radix,
781 register char *p, *e;
784 ulonglong uval = (ulonglong)val;
791 uval = (ulonglong)0 - uval;
798 e = p = &buffer[
sizeof(buffer)-1];
808 while (uval > (ulonglong) LONG_MAX)
810 ulonglong quo= uval/(uint) 10;
811 uint rem= (uint) (uval- quo* (uint) 10);
816 long_val= (long) uval;
817 while (long_val != 0)
819 long quo= long_val/10;
820 *--p = (char) (
'0' + (long_val - quo*10));
824 len= MY_MIN(len, (
size_t) (e-p));
838 #ifdef LIKE_CMP_TOUPPER
839 #define likeconv(s,A) (uchar) my_toupper(s,A)
841 #define likeconv(s,A) (uchar) (s)->sort_order[(uchar) (A)]
844 #define INC_PTR(cs,A,B) (A)++
848 const char *str,
const char *str_end,
849 const char *wildstr,
const char *wildend,
850 int escape,
int w_one,
int w_many,
int recurse_level)
854 if (my_string_stack_guard && my_string_stack_guard(recurse_level))
856 while (wildstr != wildend)
858 while (*wildstr != w_many && *wildstr != w_one)
860 if (*wildstr == escape && wildstr+1 != wildend)
863 if (str == str_end || likeconv(cs,*wildstr++) != likeconv(cs,*str++))
865 if (wildstr == wildend)
866 return(str != str_end);
869 if (*wildstr == w_one)
875 INC_PTR(cs,str,str_end);
876 }
while (++wildstr < wildend && *wildstr == w_one);
877 if (wildstr == wildend)
880 if (*wildstr == w_many)
886 for (; wildstr != wildend ; wildstr++)
888 if (*wildstr == w_many)
890 if (*wildstr == w_one)
894 INC_PTR(cs,str,str_end);
899 if (wildstr == wildend)
904 if ((cmp= *wildstr) == escape && wildstr+1 != wildend)
907 INC_PTR(cs,wildstr,wildend);
908 cmp=likeconv(cs,cmp);
911 while (str != str_end && (uchar) likeconv(cs,*str) != cmp)
913 if (str++ == str_end)
return(-1);
915 int tmp=my_wildcmp_8bit_impl(cs,str,str_end,
916 wildstr,wildend,escape,w_one,
917 w_many, recurse_level + 1);
921 }
while (str != str_end && wildstr[0] != w_many);
925 return(str != str_end ? 1 : 0);
929 const char *str,
const char *str_end,
930 const char *wildstr,
const char *wildend,
931 int escape,
int w_one,
int w_many)
933 return my_wildcmp_8bit_impl(cs, str, str_end,
935 escape, w_one, w_many, 1);
957 const char *ptr,
size_t ptr_length,
958 pbool escape, pbool w_one, pbool w_many,
960 char *min_str,
char *max_str,
961 size_t *min_length,
size_t *max_length)
963 const char *end= ptr + ptr_length;
964 char *min_org=min_str;
965 char *min_end=min_str+res_length;
966 size_t charlen= res_length / cs->mbmaxlen;
968 for (; ptr != end && min_str != min_end && charlen > 0 ; ptr++, charlen--)
970 if (*ptr == escape && ptr+1 != end)
973 *min_str++= *max_str++ = *ptr;
979 *max_str++= (char) cs->max_sort_char;
985 *min_length= ((cs->state & MY_CS_BINSORT) ?
986 (
size_t) (min_str - min_org) :
988 *max_length= res_length;
992 *max_str++= (char) cs->max_sort_char;
993 }
while (min_str != min_end);
996 *min_str++= *max_str++ = *ptr;
999 *min_length= *max_length = (size_t) (min_str - min_org);
1000 while (min_str != min_end)
1001 *min_str++= *max_str++ =
' ';
1006 size_t my_scan_8bit(
const CHARSET_INFO *cs,
const char *str,
const char *end,
1009 const char *str0= str;
1012 case MY_SEQ_INTTAIL:
1015 for(str++ ; str != end && *str ==
'0' ; str++);
1016 return (
size_t) (str - str0);
1021 for ( ; str < end ; str++)
1023 if (!my_isspace(cs,*str))
1026 return (
size_t) (str - str0);
1033 void my_fill_8bit(
const CHARSET_INFO *cs __attribute__((unused)),
1034 char *s,
size_t l,
int fill)
1040 size_t my_numchars_8bit(
const CHARSET_INFO *cs __attribute__((unused)),
1041 const char *b,
const char *e)
1043 return (
size_t) (e - b);
1047 size_t my_numcells_8bit(
const CHARSET_INFO *cs __attribute__((unused)),
1048 const char *b,
const char *e)
1050 return (
size_t) (e - b);
1054 size_t my_charpos_8bit(
const CHARSET_INFO *cs __attribute__((unused)),
1055 const char *b __attribute__((unused)),
1056 const char *e __attribute__((unused)),
1063 size_t my_well_formed_len_8bit(
const CHARSET_INFO *cs __attribute__((unused)),
1064 const char *start,
const char *end,
1065 size_t nchars,
int *error)
1067 size_t nbytes= (size_t) (end-start);
1069 return MY_MIN(nbytes, nchars);
1073 size_t my_lengthsp_8bit(
const CHARSET_INFO *cs __attribute__((unused)),
1074 const char *ptr,
size_t length)
1077 end= (
const char *) skip_trailing_space((
const uchar *)ptr, length);
1078 return (
size_t) (end-ptr);
1083 const char *b,
size_t b_length,
1084 const char *s,
size_t s_length,
1087 register const uchar *str, *search, *end, *search_end;
1089 if (s_length <= b_length)
1102 str= (
const uchar*) b;
1103 search= (
const uchar*) s;
1104 end= (
const uchar*) b+b_length-s_length+1;
1105 search_end= (
const uchar*) s + s_length;
1110 if (cs->sort_order[*str++] == cs->sort_order[*search])
1112 register const uchar *
i,*j;
1117 while (j != search_end)
1118 if (cs->sort_order[*i++] != cs->sort_order[*j++])
1124 match[0].end= (size_t) (str- (
const uchar*)b-1);
1125 match[0].mb_len= match[0].end;
1129 match[1].beg= match[0].end;
1130 match[1].end= match[0].end+s_length;
1131 match[1].mb_len= match[1].end-match[1].beg;
1148 #define PLANE_SIZE 0x100
1149 #define PLANE_NUM 0x100
1150 #define PLANE_NUMBER(x) (((x)>>8) % PLANE_NUM)
1152 static int pcmp(
const void * f,
const void * s)
1158 if (!(res=((S->nchars)-(F->nchars))))
1159 res=((F->uidx.from)-(S->uidx.to));
1176 if (!cs->tab_to_uni)
1180 memset(idx, 0,
sizeof(idx));
1183 for (i=0; i< 0x100; i++)
1185 uint16 wc=cs->tab_to_uni[
i];
1186 int pl= PLANE_NUMBER(wc);
1190 if (!idx[pl].nchars)
1192 idx[pl].uidx.from=wc;
1196 idx[pl].uidx.from=wc<idx[pl].uidx.from?wc:idx[pl].uidx.from;
1197 idx[pl].uidx.to=wc>idx[pl].uidx.to?wc:idx[pl].uidx.to;
1204 qsort(&idx,PLANE_NUM,
sizeof(
uni_idx),&pcmp);
1206 for (i=0; i < PLANE_NUM; i++)
1214 numchars=idx[
i].uidx.to-idx[
i].uidx.from+1;
1215 if (!(idx[i].uidx.tab= (uchar *)
1216 (loader->once_alloc) (numchars *
1217 sizeof(*idx[i].uidx.tab))))
1220 memset(idx[i].uidx.tab, 0, numchars*
sizeof(*idx[i].uidx.tab));
1222 for (ch=1; ch < PLANE_SIZE; ch++)
1224 uint16 wc=cs->tab_to_uni[ch];
1225 if (wc >= idx[i].uidx.from && wc <= idx[i].uidx.to && wc)
1227 int ofs= wc - idx[
i].uidx.from;
1228 idx[
i].uidx.tab[ofs]= ch;
1236 (loader->once_alloc)(
sizeof(
MY_UNI_IDX) * (n + 1))))
1239 for (i=0; i<
n; i++)
1240 cs->tab_from_uni[i]= idx[i].uidx;
1243 memset(&cs->tab_from_uni[i], 0,
sizeof(
MY_UNI_IDX));
1250 cs->caseup_multiply= 1;
1251 cs->casedn_multiply= 1;
1253 return create_fromuni(cs, loader);
1261 if (!cs->sort_order)
1264 max_char=cs->sort_order[(uchar) cs->max_sort_char];
1265 for (i= 0; i < 256; i++)
1267 if ((uchar) cs->sort_order[
i] > max_char)
1269 max_char=(uchar) cs->sort_order[i];
1270 cs->max_sort_char= i;
1279 set_max_sort_char(cs);
1284 longlong my_strtoll10_8bit(
const CHARSET_INFO *cs __attribute__((unused)),
1285 const char *nptr,
char **endptr,
int *error)
1287 return my_strtoll10(nptr, endptr, error);
1291 int my_mb_ctype_8bit(
const CHARSET_INFO *cs,
int *ctype,
1292 const uchar *s,
const uchar *e)
1297 return MY_CS_TOOSMALL;
1299 *ctype= cs->ctype[*s + 1];
1304 #define CUTOFF (ULONGLONG_MAX / 10)
1305 #define CUTLIM (ULONGLONG_MAX % 10)
1306 #define DIGITS_IN_ULONGLONG 20
1308 static ulonglong d10[DIGITS_IN_ULONGLONG]=
1325 1000000000000000ULL,
1326 10000000000000000ULL,
1327 100000000000000000ULL,
1328 1000000000000000000ULL,
1329 10000000000000000000ULL
1390 my_strntoull10rnd_8bit(
const CHARSET_INFO *cs __attribute__((unused)),
1391 const char *str,
size_t length,
int unsigned_flag,
1392 char **endptr,
int *error)
1394 const char *dot, *end9, *beg, *end= str + length;
1398 int shift= 0, digits= 0, negative, addon;
1401 for ( ; str < end && (*str ==
' ' || *str ==
'\t') ; str++);
1406 if ((negative= (*str ==
'-')) || *str==
'+')
1413 end9= (str + 9) > end ? end : (str + 9);
1415 for (ul= 0 ; str < end9 && (ch= (uchar) (*str -
'0')) < 10; str++)
1422 *endptr= (
char*) str;
1427 *error= ul ? MY_ERRNO_ERANGE : 0;
1433 return (ulonglong) (longlong) -(
long) ul;
1439 return (ulonglong) ul;
1446 for (dot= NULL, ull= ul; str < end; str++)
1448 if ((ch= (uchar) (*str -
'0')) < 10)
1450 if (ull < CUTOFF || (ull == CUTOFF && ch <= CUTLIM))
1468 addon= (*str >=
'5');
1471 for ( ; str < end && (ch= (uchar) (*str -
'0')) < 10; shift++, str++);
1472 if (str < end && *str ==
'.')
1475 for ( ; str < end && (ch= (uchar) (*str -
'0')) < 10; str++);
1481 for ( ; str < end && (ch= (uchar) (*str -
'0')) < 10; str++);
1504 shift= dot ? dot - str : 0;
1515 if (str < end && (*str ==
'e' || *str ==
'E'))
1520 int negative_exp, exponent;
1521 if ((negative_exp= (*str ==
'-')) || *str==
'+')
1527 str < end && (ch= (uchar) (*str -
'0')) < 10;
1530 exponent= exponent * 10 + ch;
1532 shift+= negative_exp ? -exponent : exponent;
1540 if (ull == ULONGLONG_MAX)
1551 if (-shift >= DIGITS_IN_ULONGLONG)
1562 if (shift > DIGITS_IN_ULONGLONG)
1569 for ( ; shift > 0; shift--, ull*= 10)
1576 *endptr= (
char*) str;
1582 if (ull > (ulonglong) LONGLONG_MIN)
1584 *error= MY_ERRNO_ERANGE;
1585 return (ulonglong) LONGLONG_MIN;
1588 return (ulonglong) -(longlong) ull;
1592 if (ull > (ulonglong) LONGLONG_MAX)
1594 *error= MY_ERRNO_ERANGE;
1595 return (ulonglong) LONGLONG_MAX;
1603 if (negative && ull)
1605 *error= MY_ERRNO_ERANGE;
1612 *endptr= (
char*) str;
1617 *endptr= (
char*) str;
1618 *error= MY_ERRNO_EDOM;
1622 *endptr= (
char*) str;
1623 *error= MY_ERRNO_ERANGE;
1624 return unsigned_flag ?
1626 negative ? (ulonglong) LONGLONG_MIN : (ulonglong) LONGLONG_MAX;
1668 my_bool my_propagate_simple(const
CHARSET_INFO *cs __attribute__((unused)),
1669 const uchar *str __attribute__((unused)),
1670 size_t length __attribute__((unused)))
1676 my_bool my_propagate_complex(
const CHARSET_INFO *cs __attribute__((unused)),
1677 const uchar *str __attribute__((unused)),
1678 size_t length __attribute__((unused)))
1701 uint my_strxfrm_flag_normalize(uint flags, uint maximum)
1703 DBUG_ASSERT(maximum >= 1 && maximum <= MY_STRXFRM_NLEVELS);
1706 if (!(flags & MY_STRXFRM_LEVEL_ALL))
1708 static uint def_level_flags[]= {0, 0x01, 0x03, 0x07, 0x0F, 0x1F, 0x3F };
1709 uint flag_pad= flags &
1710 (MY_STRXFRM_PAD_WITH_SPACE | MY_STRXFRM_PAD_TO_MAXLEN);
1711 flags= def_level_flags[maximum] | flag_pad;
1716 uint flag_lev= flags & MY_STRXFRM_LEVEL_ALL;
1717 uint flag_dsc= (flags >> MY_STRXFRM_DESC_SHIFT) & MY_STRXFRM_LEVEL_ALL;
1718 uint flag_rev= (flags >> MY_STRXFRM_REVERSE_SHIFT) & MY_STRXFRM_LEVEL_ALL;
1719 uint flag_pad= flags &
1720 (MY_STRXFRM_PAD_WITH_SPACE | MY_STRXFRM_PAD_TO_MAXLEN);
1726 for (maximum--, flags= 0, i= 0; i < MY_STRXFRM_NLEVELS; i++)
1728 uint src_bit= 1 <<
i;
1729 if (flag_lev & src_bit)
1731 uint dst_bit= 1 << MY_MIN(i, maximum);
1733 flags|= (flag_dsc & dst_bit) << MY_STRXFRM_DESC_SHIFT;
1734 flags|= (flag_rev & dst_bit) << MY_STRXFRM_REVERSE_SHIFT;
1769 my_strxfrm_desc_and_reverse(uchar *str, uchar *strend,
1770 uint flags, uint
level)
1772 if (flags & (MY_STRXFRM_DESC_LEVEL1 << level))
1774 if (flags & (MY_STRXFRM_REVERSE_LEVEL1 << level))
1776 for (strend--; str <= strend;)
1785 for (; str < strend; str++)
1789 else if (flags & (MY_STRXFRM_REVERSE_LEVEL1 << level))
1791 for (strend--; str < strend;)
1802 my_strxfrm_pad_desc_and_reverse(
const CHARSET_INFO *cs,
1803 uchar *str, uchar *frmend, uchar *strend,
1804 uint nweights, uint flags, uint level)
1806 if (nweights && frmend < strend && (flags & MY_STRXFRM_PAD_WITH_SPACE))
1808 uint fill_length= MY_MIN((uint) (strend - frmend), nweights * cs->mbminlen);
1809 cs->cset->fill(cs, (
char*) frmend, fill_length, cs->pad_char);
1810 frmend+= fill_length;
1812 my_strxfrm_desc_and_reverse(str, frmend, flags, level);
1813 if ((flags & MY_STRXFRM_PAD_TO_MAXLEN) && frmend < strend)
1815 uint fill_length= strend - frmend;
1816 cs->cset->fill(cs, (
char*) frmend, fill_length, cs->pad_char);
1819 return frmend - str;
1830 my_well_formed_len_8bit,
1841 my_long10_to_str_8bit,
1842 my_longlong10_to_str_8bit,
1850 my_strntoull10rnd_8bit,
1856 my_coll_init_simple,
1857 my_strnncoll_simple,
1858 my_strnncollsp_simple,
1860 my_strnxfrmlen_simple,
1861 my_like_range_simple,
1865 my_hash_sort_simple,