MySQL  8.0.16
Source Code Documentation
m_ctype.h
Go to the documentation of this file.
1 /* Copyright (c) 2000, 2019, Oracle and/or its affiliates. All rights reserved.
2 
3  This program is free software; you can redistribute it and/or modify
4  it under the terms of the GNU General Public License, version 2.0,
5  as published by the Free Software Foundation.
6 
7  This program is also distributed with certain software (including
8  but not limited to OpenSSL) that is licensed under separate terms,
9  as designated in a particular file or component or in included license
10  documentation. The authors of MySQL hereby grant you an additional
11  permission to link the program and your derivative works with the
12  separately licensed software that they have included with MySQL.
13 
14  This program is distributed in the hope that it will be useful,
15  but WITHOUT ANY WARRANTY; without even the implied warranty of
16  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17  GNU General Public License, version 2.0, for more details.
18 
19  You should have received a copy of the GNU General Public License
20  along with this program; if not, write to the Free Software
21  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
22 
23 /**
24  @file include/m_ctype.h
25  A better implementation of the UNIX ctype(3) library.
26 */
27 
28 #ifndef _m_ctype_h
29 #define _m_ctype_h
30 
31 #ifndef __cplusplus
32 #include <stdbool.h>
33 #endif
34 #include <stddef.h>
35 #include <sys/types.h>
36 
37 #include "my_compiler.h"
38 #include "my_inttypes.h"
39 #include "my_loglevel.h"
40 #include "my_macros.h"
41 #include "my_sharedlib.h"
42 
43 #define MY_CS_NAME_SIZE 32
44 #define MY_CS_CTYPE_TABLE_SIZE 257
45 #define MY_CS_TO_LOWER_TABLE_SIZE 256
46 #define MY_CS_TO_UPPER_TABLE_SIZE 256
47 #define MY_CS_SORT_ORDER_TABLE_SIZE 256
48 #define MY_CS_TO_UNI_TABLE_SIZE 256
49 
50 #define CHARSET_DIR "charsets/"
51 
52 /**
53  Our own version of wchar_t, ie., a type that holds a single Unicode code point
54  ("wide character"). ulong is always big enough to hold any character
55  in the BMP.
56 */
57 typedef ulong my_wc_t;
58 
59 #define MY_CS_REPLACEMENT_CHARACTER 0xFFFD
60 
61 static inline void MY_PUT_MB2(unsigned char *s, uint16 code) {
62  s[0] = code >> 8;
63  s[1] = code & 0xFF;
64 }
65 
66 typedef struct MY_UNICASE_CHARACTER {
67  uint32 toupper;
68  uint32 tolower;
69  uint32 sort;
71 
72 typedef struct MY_UNICASE_INFO {
76 
81 
82 struct MY_UCA_INFO;
83 
84 typedef struct MY_UNI_CTYPE {
87 } MY_UNI_CTYPE;
88 
89 extern MY_UNI_CTYPE my_uni_ctype[256];
90 
91 /* wm_wc and wc_mb return codes */
92 #define MY_CS_ILSEQ 0 /* Wrong by sequence: wb_wc */
93 #define MY_CS_ILUNI 0 /* Cannot encode Unicode to charset: wc_mb */
94 #define MY_CS_TOOSMALL -101 /* Need at least one byte: wc_mb and mb_wc */
95 #define MY_CS_TOOSMALL2 -102 /* Need at least two bytes: wc_mb and mb_wc */
96 #define MY_CS_TOOSMALL3 -103 /* Need at least three bytes: wc_mb and mb_wc */
97 /* These following three are currently not really used */
98 #define MY_CS_TOOSMALL4 -104 /* Need at least 4 bytes: wc_mb and mb_wc */
99 #define MY_CS_TOOSMALL5 -105 /* Need at least 5 bytes: wc_mb and mb_wc */
100 #define MY_CS_TOOSMALL6 -106 /* Need at least 6 bytes: wc_mb and mb_wc */
101 /* A helper macros for "need at least n bytes" */
102 #define MY_CS_TOOSMALLN(n) (-100 - (n))
103 
104 #define MY_SEQ_INTTAIL 1
105 #define MY_SEQ_SPACES 2
106 
107 /* My charsets_list flags */
108 #define MY_CS_COMPILED 1 /* compiled-in sets */
109 #define MY_CS_CONFIG 2 /* sets that have a *.conf file */
110 #define MY_CS_INDEX 4 /* sets listed in the Index file */
111 #define MY_CS_LOADED 8 /* sets that are currently loaded */
112 #define MY_CS_BINSORT 16 /* if binary sort order */
113 #define MY_CS_PRIMARY 32 /* if primary collation */
114 #define MY_CS_STRNXFRM \
115  64 /* \
116  if _not_ set, sort_order will \
117  give same result as strnxfrm -- \
118  all new collations should have this \
119  flag set, do not check it in new code \
120  */
121 #define MY_CS_UNICODE 128 /* is a charset is BMP Unicode */
122 #define MY_CS_READY 256 /* if a charset is initialized */
123 #define MY_CS_AVAILABLE 512 /* If either compiled-in or loaded*/
124 #define MY_CS_CSSORT 1024 /* if case sensitive sort order */
125 #define MY_CS_HIDDEN 2048 /* don't display in SHOW */
126 #define MY_CS_PUREASCII 4096 /* if a charset is pure ascii */
127 #define MY_CS_NONASCII 8192 /* if not ASCII-compatible */
128 #define MY_CS_UNICODE_SUPPLEMENT 16384 /* Non-BMP Unicode characters */
129 #define MY_CS_LOWER_SORT 32768 /* If use lower case as weight */
130 #define MY_CHARSET_UNDEFINED 0
131 
132 /* Character repertoire flags */
133 #define MY_REPERTOIRE_ASCII 1 /* Pure ASCII U+0000..U+007F */
134 #define MY_REPERTOIRE_EXTENDED 2 /* Extended characters: U+0080..U+FFFF */
135 #define MY_REPERTOIRE_UNICODE30 3 /* ASCII | EXTENDED: U+0000..U+FFFF */
136 
137 /* Flags for strxfrm */
138 #define MY_STRXFRM_PAD_TO_MAXLEN 0x00000080 /* if pad tail(for filesort) */
139 
140 typedef struct MY_UNI_IDX {
143  const uchar *tab;
144 } MY_UNI_IDX;
145 
146 typedef struct {
150 } my_match_t;
151 
152 struct CHARSET_INFO;
153 #ifndef __cplusplus
154 typedef struct CHARSET_INFO CHARSET_INFO;
155 #endif
157 
158 typedef struct MY_CHARSET_LOADER {
160  char errarg[192];
161  void *(*once_alloc)(size_t);
162  void *(*mem_malloc)(size_t);
163  void *(*mem_realloc)(void *, size_t);
164  void (*mem_free)(void *);
165  void (*reporter)(enum loglevel, uint errcode, ...);
168 
169 extern int (*my_string_stack_guard)(int);
170 
172 
173 /* See strings/CHARSET_INFO.txt for information about this structure */
174 typedef struct MY_COLLATION_HANDLER {
176  void (*uninit)(CHARSET_INFO *);
177  /* Collation routines */
178  int (*strnncoll)(const CHARSET_INFO *, const uchar *, size_t, const uchar *,
179  size_t, bool);
180  /**
181  Compare the two strings under the pad rules given by the collation.
182 
183  Thus, for NO PAD collations, this is identical to strnncoll with is_prefix
184  set to false. For PAD SPACE collations, the two strings are conceptually
185  extended infinitely at the end using space characters (0x20) and then
186  compared under the collation's normal comparison rules, so that e.g 'a' is
187  equal to 'a '.
188  */
189  int (*strnncollsp)(const CHARSET_INFO *, const uchar *, size_t, const uchar *,
190  size_t);
191  /**
192  Transform the string into a form such that memcmp() between transformed
193  strings yields the correct collation order.
194 
195  @param [out] dst Buffer for the transformed string.
196  @param [out] dstlen Number of bytes available in dstlen.
197  Must be even.
198  @param num_codepoints Treat the string as if it were of type
199  CHAR(num_codepoints). In particular, this means that if the
200  collation is a pad collation (pad_attribute is PAD_SPACE) and
201  string has fewer than "num_codepoints" codepoints, the string
202  will be transformed as if it ended in (num_codepoints-n) extra spaces.
203  If the string has more than "num_codepoints" codepoints,
204  behavior is undefined; may truncate, may crash, or do something
205  else entirely. Note that MY_STRXFRM_PAD_TO_MAXLEN overrides this;
206  if it is given for a PAD SPACE collation, this value is taken to be
207  effectively infinity.
208  @param src The source string, in the required character set
209  for the collation.
210  @param srclen Number of bytes in src.
211  @param flags ORed bitmask of MY_STRXFRM_* flags.
212 
213  @return Number of bytes written to dst.
214  */
215  size_t (*strnxfrm)(const CHARSET_INFO *, uchar *dst, size_t dstlen,
216  uint num_codepoints, const uchar *src, size_t srclen,
217  uint flags);
218 
219  /**
220  Return the maximum number of output bytes needed for strnxfrm()
221  to output all weights for any string of the given input length.
222  You can use this to e.g. size buffers for sort keys.
223 
224  @param num_bytes Number of bytes in the input string. Note that for
225  multibyte character sets, this _must_ be a pessimistic estimate,
226  ie., one that's cs->mbmaxlen * max_num_codepoints. So for e.g.
227  the utf8mb4 string "foo", you will need to give in 12, not 3.
228  */
229  size_t (*strnxfrmlen)(const CHARSET_INFO *, size_t num_bytes);
230  bool (*like_range)(const CHARSET_INFO *, const char *s, size_t s_length,
231  char w_prefix, char w_one, char w_many, size_t res_length,
232  char *min_str, char *max_str, size_t *min_len,
233  size_t *max_len);
234  int (*wildcmp)(const CHARSET_INFO *, const char *str, const char *str_end,
235  const char *wildstr, const char *wildend, int escape,
236  int w_one, int w_many);
237 
238  int (*strcasecmp)(const CHARSET_INFO *, const char *, const char *);
239 
240  uint (*strstr)(const CHARSET_INFO *, const char *b, size_t b_length,
241  const char *s, size_t s_length, my_match_t *match,
242  uint nmatch);
243 
244  /**
245  Compute a sort hash for the given key. This hash must preserve equality
246  under the given collation, so that a=b => H(a)=H(b). Note that this hash
247  is used for hash-based partitioning (PARTITION KEY), so you cannot change
248  it except when writing a new collation; it needs to be unchanged across
249  releases, so that the on-disk format does not change. (It is also used
250  for testing equality in the MEMORY storage engine.)
251 
252  nr1 and nr2 are both in/out parameters. nr1 is the actual hash value;
253  nr2 holds extra state between invocations.
254  */
255  void (*hash_sort)(const CHARSET_INFO *cs, const uchar *key, size_t len,
256  uint64 *nr1, uint64 *nr2);
257  bool (*propagate)(const CHARSET_INFO *cs, const uchar *str, size_t len);
259 
264 
265 /* Some typedef to make it easy for C++ to make function pointers */
266 typedef int (*my_charset_conv_mb_wc)(const CHARSET_INFO *, my_wc_t *,
267  const uchar *, const uchar *);
268 typedef int (*my_charset_conv_wc_mb)(const CHARSET_INFO *, my_wc_t, uchar *,
269  uchar *);
270 typedef size_t (*my_charset_conv_case)(const CHARSET_INFO *, char *, size_t,
271  char *, size_t);
272 
273 /* See strings/CHARSET_INFO.txt about information on this structure */
274 typedef struct MY_CHARSET_HANDLER {
276  /* Multibyte routines */
277  uint (*ismbchar)(const CHARSET_INFO *, const char *, const char *);
278  uint (*mbcharlen)(const CHARSET_INFO *, uint c);
279  size_t (*numchars)(const CHARSET_INFO *, const char *b, const char *e);
280 
281  /**
282  Return at which byte codepoint number "pos" begins, relative to
283  the start of the string. If the string is shorter than or is
284  exactly "pos" codepoints long, returns a value equal or greater to
285  (e-b).
286  */
287  size_t (*charpos)(const CHARSET_INFO *, const char *b, const char *e,
288  size_t pos);
289  size_t (*well_formed_len)(const CHARSET_INFO *, const char *b, const char *e,
290  size_t nchars, int *error);
291  /**
292  Given a pointer and a length in bytes, returns a new length in bytes where
293  all trailing space characters are stripped. This holds even for NO PAD
294  collations.
295 
296  Exception: The "binary" collation, which is used behind-the-scenes to
297  implement the BINARY type (by mapping it to CHAR(n) COLLATE "binary"),
298  returns just the length back with no stripping. It's done that way so that
299  Field_string (implementing CHAR(n)) returns the full padded width on read
300  (as opposed to a normal CHAR, where we usually strip the spaces on read),
301  but it's suboptimal, since lengthsp() is also used in a number of other
302  places, e.g. stripping trailing spaces from enum values given in by the
303  user. If you call this function, be aware of this special exception and
304  consider the implications.
305  */
306  size_t (*lengthsp)(const CHARSET_INFO *, const char *ptr, size_t length);
307  size_t (*numcells)(const CHARSET_INFO *, const char *b, const char *e);
308 
309  /* Unicode conversion */
312 
313  /* CTYPE scanner */
314  int (*ctype)(const CHARSET_INFO *cs, int *ctype, const uchar *s,
315  const uchar *e);
316 
317  /* Functions for case and sort conversion */
318  size_t (*caseup_str)(const CHARSET_INFO *, char *);
319  size_t (*casedn_str)(const CHARSET_INFO *, char *);
320 
323 
324  /* Charset dependant snprintf() */
325  size_t (*snprintf)(const CHARSET_INFO *, char *to, size_t n, const char *fmt,
326  ...) MY_ATTRIBUTE((format(printf, 4, 5)));
327  size_t (*long10_to_str)(const CHARSET_INFO *, char *to, size_t n, int radix,
328  long int val);
329  size_t (*longlong10_to_str)(const CHARSET_INFO *, char *to, size_t n,
330  int radix, longlong val);
331 
332  void (*fill)(const CHARSET_INFO *, char *to, size_t len, int fill);
333 
334  /* String-to-number conversion routines */
335  long (*strntol)(const CHARSET_INFO *, const char *s, size_t l, int base,
336  const char **e, int *err);
337  ulong (*strntoul)(const CHARSET_INFO *, const char *s, size_t l, int base,
338  const char **e, int *err);
339  longlong (*strntoll)(const CHARSET_INFO *, const char *s, size_t l, int base,
340  const char **e, int *err);
341  ulonglong (*strntoull)(const CHARSET_INFO *, const char *s, size_t l,
342  int base, const char **e, int *err);
343  double (*strntod)(const CHARSET_INFO *, char *s, size_t l, const char **e,
344  int *err);
345  longlong (*strtoll10)(const CHARSET_INFO *cs, const char *nptr,
346  const char **endptr, int *error);
347  ulonglong (*strntoull10rnd)(const CHARSET_INFO *cs, const char *str,
348  size_t length, int unsigned_fl,
349  const char **endptr, int *error);
350  size_t (*scan)(const CHARSET_INFO *, const char *b, const char *e, int sq);
352 
356 
357 /* See strings/CHARSET_INFO.txt about information on this structure */
358 struct CHARSET_INFO {
363  const char *csname;
364  const char *name;
365  const char *comment;
366  const char *tailoring;
368  const uchar *ctype;
369  const uchar *to_lower;
370  const uchar *to_upper;
372  struct MY_UCA_INFO *uca; /* This can be changed in apply_one_rule() */
376  const struct lex_state_maps_st *state_maps; /* parser internal data */
377  const uchar *ident_map; /* parser internal data */
385  my_wc_t max_sort_char; /* For LIKE optimization */
389 
392 
393  /**
394  If this collation is PAD_SPACE, it collates as if all inputs were
395  padded with a given number of spaces at the end (see the "num_codepoints"
396  flag to strnxfrm). NO_PAD simply compares unextended strings.
397 
398  Note that this is fundamentally about the behavior of coll->strnxfrm.
399  */
401 };
402 #define ILLEGAL_CHARSET_INFO_NUMBER (~0U)
403 
404 /*
405  NOTE: You cannot use a CHARSET_INFO without it having been initialized first.
406  In particular, they are not initialized when a unit test starts; do not use
407  these globals indiscriminately from there, and do not add more. Instead,
408  load them through a MY_CHARSET_LOADER, using my_collation_get_by_name().
409 */
410 
417 
426 
427 #define MY_UTF8MB3 "utf8"
428 #define MY_UTF8MB4 "utf8mb4"
429 
430 /* declarations for simple charsets */
431 extern size_t my_strnxfrm_simple(const CHARSET_INFO *, uchar *dst,
432  size_t dstlen, uint nweights, const uchar *src,
433  size_t srclen, uint flags);
434 size_t my_strnxfrmlen_simple(const CHARSET_INFO *, size_t);
435 extern int my_strnncoll_simple(const CHARSET_INFO *, const uchar *, size_t,
436  const uchar *, size_t, bool);
437 
438 extern int my_strnncollsp_simple(const CHARSET_INFO *, const uchar *, size_t,
439  const uchar *, size_t);
440 
441 extern void my_hash_sort_simple(const CHARSET_INFO *cs, const uchar *key,
442  size_t len, uint64 *nr1, uint64 *nr2);
443 
444 extern size_t my_lengthsp_8bit(const CHARSET_INFO *cs, const char *ptr,
445  size_t length);
446 
447 extern uint my_instr_simple(const CHARSET_INFO *, const char *b,
448  size_t b_length, const char *s, size_t s_length,
449  my_match_t *match, uint nmatch);
450 
451 /* Functions for 8bit */
452 extern size_t my_caseup_str_8bit(const CHARSET_INFO *, char *);
453 extern size_t my_casedn_str_8bit(const CHARSET_INFO *, char *);
454 extern size_t my_caseup_8bit(const CHARSET_INFO *, char *src, size_t srclen,
455  char *dst, size_t dstlen);
456 extern size_t my_casedn_8bit(const CHARSET_INFO *, char *src, size_t srclen,
457  char *dst, size_t dstlen);
458 
459 extern int my_strcasecmp_8bit(const CHARSET_INFO *cs, const char *,
460  const char *);
461 
462 int my_mb_wc_8bit(const CHARSET_INFO *cs, my_wc_t *wc, const uchar *s,
463  const uchar *e);
464 int my_wc_mb_8bit(const CHARSET_INFO *cs, my_wc_t wc, uchar *s, uchar *e);
465 
466 int my_mb_ctype_8bit(const CHARSET_INFO *, int *, const uchar *, const uchar *);
467 int my_mb_ctype_mb(const CHARSET_INFO *, int *, const uchar *, const uchar *);
468 
469 size_t my_scan_8bit(const CHARSET_INFO *cs, const char *b, const char *e,
470  int sq);
471 
472 size_t my_snprintf_8bit(const CHARSET_INFO *, char *to, size_t n,
473  const char *fmt, ...)
474  MY_ATTRIBUTE((format(printf, 4, 5)));
475 
476 long my_strntol_8bit(const CHARSET_INFO *, const char *s, size_t l, int base,
477  const char **e, int *err);
478 ulong my_strntoul_8bit(const CHARSET_INFO *, const char *s, size_t l, int base,
479  const char **e, int *err);
480 longlong my_strntoll_8bit(const CHARSET_INFO *, const char *s, size_t l,
481  int base, const char **e, int *err);
482 ulonglong my_strntoull_8bit(const CHARSET_INFO *, const char *s, size_t l,
483  int base, const char **e, int *err);
484 double my_strntod_8bit(const CHARSET_INFO *, char *s, size_t l, const char **e,
485  int *err);
486 size_t my_long10_to_str_8bit(const CHARSET_INFO *, char *to, size_t l,
487  int radix, long int val);
488 size_t my_longlong10_to_str_8bit(const CHARSET_INFO *, char *to, size_t l,
489  int radix, longlong val);
490 
491 longlong my_strtoll10_8bit(const CHARSET_INFO *cs, const char *nptr,
492  const char **endptr, int *error);
493 longlong my_strtoll10_ucs2(const CHARSET_INFO *cs, const char *nptr,
494  char **endptr, int *error);
495 
496 ulonglong my_strntoull10rnd_8bit(const CHARSET_INFO *cs, const char *str,
497  size_t length, int unsigned_fl,
498  const char **endptr, int *error);
499 ulonglong my_strntoull10rnd_ucs2(const CHARSET_INFO *cs, const char *str,
500  size_t length, int unsigned_fl, char **endptr,
501  int *error);
502 
503 void my_fill_8bit(const CHARSET_INFO *cs, char *to, size_t l, int fill);
504 
505 /* For 8-bit character set */
506 bool my_like_range_simple(const CHARSET_INFO *cs, const char *ptr,
507  size_t ptr_length, char escape, char w_one,
508  char w_many, size_t res_length, char *min_str,
509  char *max_str, size_t *min_length,
510  size_t *max_length);
511 
512 /* For ASCII-based multi-byte character sets with mbminlen=1 */
513 bool my_like_range_mb(const CHARSET_INFO *cs, const char *ptr,
514  size_t ptr_length, char escape, char w_one, char w_many,
515  size_t res_length, char *min_str, char *max_str,
516  size_t *min_length, size_t *max_length);
517 
518 /* For other character sets, with arbitrary mbminlen and mbmaxlen numbers */
519 bool my_like_range_generic(const CHARSET_INFO *cs, const char *ptr,
520  size_t ptr_length, char escape, char w_one,
521  char w_many, size_t res_length, char *min_str,
522  char *max_str, size_t *min_length,
523  size_t *max_length);
524 
525 int my_wildcmp_8bit(const CHARSET_INFO *, const char *str, const char *str_end,
526  const char *wildstr, const char *wildend, int escape,
527  int w_one, int w_many);
528 
529 int my_wildcmp_bin(const CHARSET_INFO *, const char *str, const char *str_end,
530  const char *wildstr, const char *wildend, int escape,
531  int w_one, int w_many);
532 
533 size_t my_numchars_8bit(const CHARSET_INFO *, const char *b, const char *e);
534 size_t my_numcells_8bit(const CHARSET_INFO *, const char *b, const char *e);
535 size_t my_charpos_8bit(const CHARSET_INFO *, const char *b, const char *e,
536  size_t pos);
537 size_t my_well_formed_len_8bit(const CHARSET_INFO *, const char *b,
538  const char *e, size_t pos, int *error);
540 
541 /* Functions for multibyte charsets */
542 extern size_t my_caseup_str_mb(const CHARSET_INFO *, char *);
543 extern size_t my_casedn_str_mb(const CHARSET_INFO *, char *);
544 extern size_t my_caseup_mb(const CHARSET_INFO *, char *src, size_t srclen,
545  char *dst, size_t dstlen);
546 extern size_t my_casedn_mb(const CHARSET_INFO *, char *src, size_t srclen,
547  char *dst, size_t dstlen);
548 extern size_t my_caseup_mb_varlen(const CHARSET_INFO *, char *src,
549  size_t srclen, char *dst, size_t dstlen);
550 extern size_t my_casedn_mb_varlen(const CHARSET_INFO *, char *src,
551  size_t srclen, char *dst, size_t dstlen);
552 extern size_t my_caseup_ujis(const CHARSET_INFO *, char *src, size_t srclen,
553  char *dst, size_t dstlen);
554 extern size_t my_casedn_ujis(const CHARSET_INFO *, char *src, size_t srclen,
555  char *dst, size_t dstlen);
556 extern int my_strcasecmp_mb(const CHARSET_INFO *cs, const char *, const char *);
557 
558 int my_wildcmp_mb(const CHARSET_INFO *, const char *str, const char *str_end,
559  const char *wildstr, const char *wildend, int escape,
560  int w_one, int w_many);
561 size_t my_numchars_mb(const CHARSET_INFO *, const char *b, const char *e);
562 size_t my_numcells_mb(const CHARSET_INFO *, const char *b, const char *e);
563 size_t my_charpos_mb(const CHARSET_INFO *, const char *b, const char *e,
564  size_t pos);
565 size_t my_well_formed_len_mb(const CHARSET_INFO *, const char *b, const char *e,
566  size_t pos, int *error);
567 uint my_instr_mb(const CHARSET_INFO *, const char *b, size_t b_length,
568  const char *s, size_t s_length, my_match_t *match,
569  uint nmatch);
570 
571 int my_strnncoll_mb_bin(const CHARSET_INFO *cs, const uchar *s, size_t slen,
572  const uchar *t, size_t tlen, bool t_is_prefix);
573 
574 int my_strnncollsp_mb_bin(const CHARSET_INFO *cs, const uchar *a,
575  size_t a_length, const uchar *b, size_t b_length);
576 
577 int my_wildcmp_mb_bin(const CHARSET_INFO *cs, const char *str,
578  const char *str_end, const char *wildstr,
579  const char *wildend, int escape, int w_one, int w_many);
580 
581 int my_strcasecmp_mb_bin(const CHARSET_INFO *cs MY_ATTRIBUTE((unused)),
582  const char *s, const char *t);
583 
584 void my_hash_sort_mb_bin(const CHARSET_INFO *cs MY_ATTRIBUTE((unused)),
585  const uchar *key, size_t len, uint64 *nr1,
586  uint64 *nr2);
587 
588 size_t my_strnxfrm_mb(const CHARSET_INFO *, uchar *dst, size_t dstlen,
589  uint nweights, const uchar *src, size_t srclen,
590  uint flags);
591 
592 size_t my_strnxfrm_unicode(const CHARSET_INFO *, uchar *dst, size_t dstlen,
593  uint nweights, const uchar *src, size_t srclen,
594  uint flags);
595 
596 size_t my_strnxfrm_unicode_full_bin(const CHARSET_INFO *, uchar *dst,
597  size_t dstlen, uint nweights,
598  const uchar *src, size_t srclen,
599  uint flags);
600 size_t my_strnxfrmlen_unicode_full_bin(const CHARSET_INFO *, size_t);
601 
602 int my_wildcmp_unicode(const CHARSET_INFO *cs, const char *str,
603  const char *str_end, const char *wildstr,
604  const char *wildend, int escape, int w_one, int w_many,
605  const MY_UNICASE_INFO *weights);
606 
607 extern bool my_parse_charset_xml(MY_CHARSET_LOADER *loader, const char *buf,
608  size_t buflen);
609 extern size_t my_strcspn(const CHARSET_INFO *cs, const char *str,
610  const char *end, const char *reject,
611  size_t reject_length);
612 
613 bool my_propagate_simple(const CHARSET_INFO *cs, const uchar *str, size_t len);
614 bool my_propagate_complex(const CHARSET_INFO *cs, const uchar *str, size_t len);
615 
616 uint my_string_repertoire(const CHARSET_INFO *cs, const char *str, size_t len);
620 
622 size_t my_strxfrm_pad(const CHARSET_INFO *cs, uchar *str, uchar *frmend,
623  uchar *strend, uint nweights, uint flags);
624 
626 
627 size_t my_convert(char *to, size_t to_length, const CHARSET_INFO *to_cs,
628  const char *from, size_t from_length,
629  const CHARSET_INFO *from_cs, uint *errors);
630 
631 uint my_mbcharlen_ptr(const CHARSET_INFO *cs, const char *s, const char *e);
632 
633 bool my_is_prefixidx_cand(const CHARSET_INFO *cs, const char *wildstr,
634  const char *wildend, int escape, int w_many,
635  size_t *prefix_len);
636 
637 #define _MY_U 01 /* Upper case */
638 #define _MY_L 02 /* Lower case */
639 #define _MY_NMR 04 /* Numeral (digit) */
640 #define _MY_SPC 010 /* Spacing character */
641 #define _MY_PNT 020 /* Punctuation */
642 #define _MY_CTR 040 /* Control character */
643 #define _MY_B 0100 /* Blank */
644 #define _MY_X 0200 /* heXadecimal digit */
645 
646 /* The following macros makes sense only for one-byte character sets.
647 They will not fail for multibyte character sets, but will not produce
648 the expected results. They may have som limited usability like
649 e.g. for utf8mb3/utf8mb4, meaningful results will be produced for
650 values < 0x7F. */
651 #define my_isascii(c) (!((c) & ~0177))
652 #define my_toupper(s, c) (char)((s)->to_upper[(uchar)(c)])
653 #define my_tolower(s, c) (char)((s)->to_lower[(uchar)(c)])
654 #define my_isalpha(s, c) (((s)->ctype + 1)[(uchar)(c)] & (_MY_U | _MY_L))
655 #define my_isupper(s, c) (((s)->ctype + 1)[(uchar)(c)] & _MY_U)
656 #define my_islower(s, c) (((s)->ctype + 1)[(uchar)(c)] & _MY_L)
657 #define my_isdigit(s, c) (((s)->ctype + 1)[(uchar)(c)] & _MY_NMR)
658 #define my_isxdigit(s, c) (((s)->ctype + 1)[(uchar)(c)] & _MY_X)
659 #define my_isalnum(s, c) \
660  (((s)->ctype + 1)[(uchar)(c)] & (_MY_U | _MY_L | _MY_NMR))
661 #define my_isspace(s, c) (((s)->ctype + 1)[(uchar)(c)] & _MY_SPC)
662 #define my_ispunct(s, c) (((s)->ctype + 1)[(uchar)(c)] & _MY_PNT)
663 #define my_isprint(s, c) \
664  (((s)->ctype + 1)[(uchar)(c)] & (_MY_PNT | _MY_U | _MY_L | _MY_NMR | _MY_B))
665 #define my_isgraph(s, c) \
666  (((s)->ctype + 1)[(uchar)(c)] & (_MY_PNT | _MY_U | _MY_L | _MY_NMR))
667 #define my_iscntrl(s, c) (((s)->ctype + 1)[(uchar)(c)] & _MY_CTR)
668 
669 /* Some macros that should be cleaned up a little */
670 #define my_isvar(s, c) (my_isalnum(s, c) || (c) == '_')
671 #define my_isvar_start(s, c) (my_isalpha(s, c) || (c) == '_')
672 
673 #define my_binary_compare(s) ((s)->state & MY_CS_BINSORT)
674 #define use_strnxfrm(s) ((s)->state & MY_CS_STRNXFRM)
675 #define my_strnxfrm(cs, d, dl, s, sl) \
676  ((cs)->coll->strnxfrm((cs), (d), (dl), (dl), (s), (sl), 0))
677 #define my_strnncoll(s, a, b, c, d) \
678  ((s)->coll->strnncoll((s), (a), (b), (c), (d), 0))
679 #define my_like_range(s, a, b, c, d, e, f, g, h, i, j) \
680  ((s)->coll->like_range((s), (a), (b), (c), (d), (e), (f), (g), (h), (i), (j)))
681 #define my_wildcmp(cs, s, se, w, we, e, o, m) \
682  ((cs)->coll->wildcmp((cs), (s), (se), (w), (we), (e), (o), (m)))
683 #define my_strcasecmp(s, a, b) ((s)->coll->strcasecmp((s), (a), (b)))
684 #define my_charpos(cs, b, e, num) \
685  (cs)->cset->charpos((cs), (const char *)(b), (const char *)(e), (num))
686 
687 #define use_mb(s) ((s)->cset->ismbchar != NULL)
688 #define my_ismbchar(s, a, b) ((s)->cset->ismbchar((s), (a), (b)))
689 #define my_mbcharlen(s, a) ((s)->cset->mbcharlen((s), (a)))
690 /**
691  Get the length of gb18030 code by the given two leading bytes
692 
693  @param[in] s charset_info
694  @param[in] a first byte of gb18030 code
695  @param[in] b second byte of gb18030 code
696  @return the length of gb18030 code starting with given two bytes,
697  the length would be 2 or 4 for valid gb18030 code,
698  or 0 for invalid gb18030 code
699 */
700 #define my_mbcharlen_2(s, a, b) \
701  ((s)->cset->mbcharlen((s), ((((a)&0xFF) << 8) + ((b)&0xFF))))
702 /**
703  Get the maximum length of leading bytes needed to determine the length of a
704  multi-byte gb18030 code
705 
706  @param[in] s charset_info
707  @return number of leading bytes we need, would be 2 for gb18030
708  and 1 for all other charsets
709 */
710 #define my_mbmaxlenlen(s) ((s)->mbmaxlenlen)
711 /**
712  Judge if the given byte is a possible leading byte for a charset.
713  For gb18030 whose mbmaxlenlen is 2, we can't determine the length of
714  a multi-byte character by looking at the first byte only
715 
716  @param[in] s charset_info
717  @param[in] i possible leading byte
718  @return true if it is, otherwise false
719 */
720 #define my_ismb1st(s, i) \
721  (my_mbcharlen((s), (i)) > 1 || \
722  (my_mbmaxlenlen((s)) == 2 && my_mbcharlen((s), (i)) == 0))
723 
724 #define my_caseup_str(s, a) ((s)->cset->caseup_str((s), (a)))
725 #define my_casedn_str(s, a) ((s)->cset->casedn_str((s), (a)))
726 #define my_strntol(s, a, b, c, d, e) \
727  ((s)->cset->strntol((s), (a), (b), (c), (d), (e)))
728 #define my_strntoul(s, a, b, c, d, e) \
729  ((s)->cset->strntoul((s), (a), (b), (c), (d), (e)))
730 #define my_strntoll(s, a, b, c, d, e) \
731  ((s)->cset->strntoll((s), (a), (b), (c), (d), (e)))
732 #define my_strntoull(s, a, b, c, d, e) \
733  ((s)->cset->strntoull((s), (a), (b), (c), (d), (e)))
734 #define my_strntod(s, a, b, c, d) ((s)->cset->strntod((s), (a), (b), (c), (d)))
735 
736 #endif /* _m_ctype_h */
longlong my_strtoll10_ucs2(const CHARSET_INFO *cs, const char *nptr, char **endptr, int *error)
const uchar * ctype
Definition: m_ctype.h:368
size_t(* casedn_str)(const CHARSET_INFO *, char *)
Definition: m_ctype.h:319
ulonglong uint64
Definition: my_inttypes.h:72
Some common macros.
struct MY_UNICASE_CHARACTER MY_UNICASE_CHARACTER
unsigned long long int ulonglong
Definition: my_inttypes.h:69
size_t my_caseup_str_mb(const CHARSET_INFO *, char *)
Definition: ctype-mb.cc:40
uint mbminlen
Definition: m_ctype.h:381
const uint16 * tab_to_uni
Definition: m_ctype.h:373
size_t my_strnxfrmlen_unicode_full_bin(const CHARSET_INFO *, size_t)
Definition: ctype-utf8.cc:5389
my_charset_conv_mb_wc mb_wc
Definition: m_ctype.h:310
unsigned char uchar
Definition: my_inttypes.h:49
bool escape_with_backslash_is_dangerous
Definition: m_ctype.h:387
MY_UNICASE_INFO my_unicase_turkish
Definition: ctype-utf8.cc:2094
t pos
Definition: dbug_analyze.cc:148
size_t my_numchars_8bit(const CHARSET_INFO *, const char *b, const char *e)
Definition: ctype-simple.cc:896
const MY_UNICASE_INFO * caseinfo
Definition: m_ctype.h:375
uint state
Definition: m_ctype.h:362
ulong my_strntoul_8bit(const CHARSET_INFO *, const char *s, size_t l, int base, const char **e, int *err)
Definition: ctype-simple.cc:383
const uchar * to_lower
Definition: m_ctype.h:369
bool my_propagate_simple(const CHARSET_INFO *cs, const uchar *str, size_t len)
Definition: ctype-simple.cc:1463
size_t my_numchars_mb(const CHARSET_INFO *, const char *b, const char *e)
Definition: ctype-mb.cc:314
longlong my_strntoll_8bit(const CHARSET_INFO *, const char *s, size_t l, int base, const char **e, int *err)
Definition: ctype-simple.cc:456
int my_mb_ctype_mb(const CHARSET_INFO *, int *, const uchar *, const uchar *)
Definition: ctype-mb.cc:1299
size_t(* long10_to_str)(const CHARSET_INFO *, char *to, size_t n, int radix, long int val)
Definition: m_ctype.h:327
long(* strntol)(const CHARSET_INFO *, const char *s, size_t l, int base, const char **e, int *err)
Definition: m_ctype.h:335
MYSQL_PLUGIN_IMPORT CHARSET_INFO my_charset_filename
Definition: ctype-utf8.cc:7253
uint my_string_repertoire(const CHARSET_INFO *cs, const char *str, size_t len)
Definition: ctype.cc:765
MY_UNICASE_INFO my_unicase_unicode520
Definition: ctype-utf8.cc:5002
uint my_mbcharlen_8bit(const CHARSET_INFO *, uint c)
Definition: ctype-bin.cc:226
Definition: sql_chars.h:88
size_t my_strnxfrm_mb(const CHARSET_INFO *, uchar *dst, size_t dstlen, uint nweights, const uchar *src, size_t srclen, uint flags)
Definition: ctype-mb.cc:495
size_t my_longlong10_to_str_8bit(const CHARSET_INFO *, char *to, size_t l, int radix, longlong val)
Definition: ctype-simple.cc:681
size_t my_strnxfrm_simple(const CHARSET_INFO *, uchar *dst, size_t dstlen, uint nweights, const uchar *src, size_t srclen, uint flags)
Definition: ctype-simple.cc:93
Some integer typedefs for easier portability.
uchar pctype
Definition: m_ctype.h:85
#define bool
Definition: config_static.h:42
char errarg[192]
Definition: m_ctype.h:160
bool(* init)(CHARSET_INFO *, MY_CHARSET_LOADER *loader)
Definition: m_ctype.h:275
int my_wildcmp_mb_bin(const 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: ctype-mb.cc:1032
int my_wildcmp_8bit(const CHARSET_INFO *, const char *str, const char *str_end, const char *wildstr, const char *wildend, int escape, int w_one, int w_many)
Definition: ctype-simple.cc:802
my_charset_conv_case caseup
Definition: m_ctype.h:321
int my_strcasecmp_8bit(const CHARSET_INFO *cs, const char *, const char *)
Definition: ctype-simple.cc:231
MY_CHARSET_HANDLER my_charset_ascii_handler
Definition: ctype-simple.cc:1535
#define MYSQL_PLUGIN_IMPORT
Definition: my_sharedlib.h:70
struct MY_UNI_CTYPE MY_UNI_CTYPE
uchar levels_for_compare
Definition: m_ctype.h:388
Definition: m_ctype.h:274
size_t(* my_charset_conv_case)(const CHARSET_INFO *, char *, size_t, char *, size_t)
Definition: m_ctype.h:270
int(* wildcmp)(const CHARSET_INFO *, const char *str, const char *str_end, const char *wildstr, const char *wildend, int escape, int w_one, int w_many)
Definition: m_ctype.h:234
struct MY_CHARSET_LOADER MY_CHARSET_LOADER
int(* strnncoll)(const CHARSET_INFO *, const uchar *, size_t, const uchar *, size_t, bool)
Definition: m_ctype.h:178
int my_strnncollsp_simple(const CHARSET_INFO *, const uchar *, size_t, const uchar *, size_t)
Definition: ctype-simple.cc:165
my_charset_conv_wc_mb wc_mb
Definition: m_ctype.h:311
size_t my_caseup_ujis(const CHARSET_INFO *, char *src, size_t srclen, char *dst, size_t dstlen)
Definition: ctype-ujis.cc:35741
#define C_MODE_START
Definition: my_macros.h:39
size_t my_lengthsp_8bit(const CHARSET_INFO *cs, const char *ptr, size_t length)
Definition: ctype-simple.cc:920
Definition: m_ctype.h:84
MYSQL_PLUGIN_IMPORT CHARSET_INFO my_charset_utf8mb4_0900_ai_ci
Definition: ctype-uca.cc:9571
ulonglong my_strntoull10rnd_8bit(const CHARSET_INFO *cs, const char *str, size_t length, int unsigned_fl, const char **endptr, int *error)
Definition: ctype-simple.cc:1222
uint32 toupper
Definition: m_ctype.h:67
bool my_charset_is_8bit_pure_ascii(const CHARSET_INFO *cs)
Definition: ctype.cc:831
size_t my_charpos_mb(const CHARSET_INFO *, const char *b, const char *e, size_t pos)
Definition: ctype-mb.cc:325
uint my_charset_repertoire(const CHARSET_INFO *cs)
Definition: ctype.cc:787
int(* add_collation)(CHARSET_INFO *cs)
Definition: m_ctype.h:166
int my_mb_ctype_8bit(const CHARSET_INFO *, int *, const uchar *, const uchar *)
Definition: ctype-simple.cc:1131
longlong(* strntoll)(const CHARSET_INFO *, const char *s, size_t l, int base, const char **e, int *err)
Definition: m_ctype.h:339
MY_UNICASE_INFO my_unicase_default
Definition: ctype-utf8.cc:1658
printf("== done ==\)
int my_strnncoll_simple(const CHARSET_INFO *, const uchar *, size_t, const uchar *, size_t, bool)
Definition: ctype-simple.cc:123
Definition: m_ctype.h:140
size_t(* numchars)(const CHARSET_INFO *, const char *b, const char *e)
Definition: m_ctype.h:279
int(* strnncollsp)(const CHARSET_INFO *, const uchar *, size_t, const uchar *, size_t)
Compare the two strings under the pad rules given by the collation.
Definition: m_ctype.h:189
uint my_instr_simple(const CHARSET_INFO *, const char *b, size_t b_length, const char *s, size_t s_length, my_match_t *match, uint nmatch)
Definition: ctype-simple.cc:927
struct MY_COLLATION_HANDLER MY_COLLATION_HANDLER
bool(* propagate)(const CHARSET_INFO *cs, const uchar *str, size_t len)
Definition: m_ctype.h:257
MY_COLLATION_HANDLER * coll
Definition: m_ctype.h:391
size_t(* snprintf)(const CHARSET_INFO *, char *to, size_t n, const char *fmt,...)
Definition: m_ctype.h:325
const MY_UNI_IDX * tab_from_uni
Definition: m_ctype.h:374
uchar * ctype
Definition: m_ctype.h:86
int(* ctype)(const CHARSET_INFO *cs, int *ctype, const uchar *s, const uchar *e)
Definition: m_ctype.h:314
void(* mem_free)(void *)
Definition: m_ctype.h:164
void(* hash_sort)(const CHARSET_INFO *cs, const uchar *key, size_t len, uint64 *nr1, uint64 *nr2)
Compute a sort hash for the given key.
Definition: m_ctype.h:255
int my_wildcmp_mb(const CHARSET_INFO *, const char *str, const char *str_end, const char *wildstr, const char *wildend, int escape, int w_one, int w_many)
Definition: ctype-mb.cc:307
size_t my_caseup_mb_varlen(const CHARSET_INFO *, char *src, size_t srclen, char *dst, size_t dstlen)
Definition: ctype-mb.cc:182
size_t(* well_formed_len)(const CHARSET_INFO *, const char *b, const char *e, size_t nchars, int *error)
Definition: m_ctype.h:289
uint beg
Definition: m_ctype.h:147
size_t my_strnxfrm_unicode(const CHARSET_INFO *, uchar *dst, size_t dstlen, uint nweights, const uchar *src, size_t srclen, uint flags)
Definition: ctype-utf8.cc:5323
bool my_like_range_simple(const CHARSET_INFO *cs, const char *ptr, size_t ptr_length, char escape, char w_one, char w_many, size_t res_length, char *min_str, char *max_str, size_t *min_length, size_t *max_length)
Definition: ctype-simple.cc:826
uint end
Definition: m_ctype.h:148
void my_hash_sort_mb_bin(const CHARSET_INFO *cs, const uchar *key, size_t len, uint64 *nr1, uint64 *nr2)
Definition: ctype-mb.cc:559
MY_UNICASE_INFO my_unicase_mysql500
Definition: ctype-utf8.cc:1923
Functions related to handling of plugins and other dynamically loaded libraries.
struct MY_CHARSET_HANDLER MY_CHARSET_HANDLER
uchar casedn_multiply
Definition: m_ctype.h:380
CHARSET_INFO my_charset_utf32_unicode_ci
Definition: ctype-uca.cc:7797
Pad_attribute
Definition: m_ctype.h:171
MYSQL_PLUGIN_IMPORT CHARSET_INFO my_charset_utf8mb4_general_ci
Definition: ctype-utf8.cc:8009
Definition: str_uca_type.h:68
MYSQL_PLUGIN_IMPORT CHARSET_INFO * system_charset_info
Definition: mysqld.cc:1274
Definition: m_ctype.h:174
bool(* like_range)(const CHARSET_INFO *, const char *s, size_t s_length, char w_prefix, char w_one, char w_many, size_t res_length, char *min_str, char *max_str, size_t *min_len, size_t *max_len)
Definition: m_ctype.h:230
size_t my_strnxfrm_unicode_full_bin(const CHARSET_INFO *, uchar *dst, size_t dstlen, uint nweights, const uchar *src, size_t srclen, uint flags)
Definition: ctype-utf8.cc:5344
int my_strcasecmp_mb_bin(const CHARSET_INFO *cs, const char *s, const char *t)
Definition: ctype-mb.cc:554
bool my_charset_is_ascii_based(const CHARSET_INFO *cs)
Definition: ctype.cc:818
size_t my_casedn_str_mb(const CHARSET_INFO *, char *)
Definition: ctype-mb.cc:57
Definition: m_ctype.h:72
double(* strntod)(const CHARSET_INFO *, char *s, size_t l, const char **e, int *err)
Definition: m_ctype.h:343
uint mbmaxlen
Definition: m_ctype.h:382
int my_wc_mb_8bit(const CHARSET_INFO *cs, my_wc_t wc, uchar *s, uchar *e)
Definition: ctype-simple.cc:246
CHARSET_INFO my_charset_utf8_tolower_ci
Definition: ctype-utf8.cc:6026
enum Pad_attribute pad_attribute
If this collation is PAD_SPACE, it collates as if all inputs were padded with a given number of space...
Definition: m_ctype.h:400
my_charset_conv_case casedn
Definition: m_ctype.h:322
int(* my_charset_conv_mb_wc)(const CHARSET_INFO *, my_wc_t *, const uchar *, const uchar *)
Definition: m_ctype.h:266
size_t my_caseup_mb(const CHARSET_INFO *, char *src, size_t srclen, char *dst, size_t dstlen)
Definition: ctype-mb.cc:84
CHARSET_INFO my_charset_utf8_bin
Definition: ctype-utf8.cc:6096
size_t my_scan_8bit(const CHARSET_INFO *cs, const char *b, const char *e, int sq)
Definition: ctype-simple.cc:869
my_wc_t maxchar
Definition: m_ctype.h:73
size_t my_well_formed_len_mb(const CHARSET_INFO *, const char *b, const char *e, size_t pos, int *error)
Definition: ctype-mb.cc:337
struct MY_UNI_IDX MY_UNI_IDX
uint my_instr_mb(const CHARSET_INFO *, const char *b, size_t b_length, const char *s, size_t s_length, my_match_t *match, uint nmatch)
Definition: ctype-mb.cc:356
size_t my_casedn_8bit(const CHARSET_INFO *, char *src, size_t srclen, char *dst, size_t dstlen)
Definition: ctype-simple.cc:221
ulonglong(* strntoull)(const CHARSET_INFO *, const char *s, size_t l, int base, const char **e, int *err)
Definition: m_ctype.h:341
Definition: str_uca_type.h:119
const uchar * tab
Definition: m_ctype.h:143
const MY_UNICASE_CHARACTER ** page
Definition: m_ctype.h:74
struct MY_UCA_INFO * uca
Definition: m_ctype.h:372
uint errcode
Definition: m_ctype.h:159
uint mb_len
Definition: m_ctype.h:149
uint my_strxfrm_flag_normalize(uint flags)
Definition: ctype-simple.cc:1486
Cursor end()
A past-the-end Cursor.
Definition: rules_table_service.cc:191
MY_COLLATION_HANDLER my_collation_mb_bin_handler
Definition: ctype-mb.cc:1312
size_t my_charpos_8bit(const CHARSET_INFO *, const char *b, const char *e, size_t pos)
Definition: ctype-simple.cc:906
void(* reporter)(enum loglevel, uint errcode,...)
Definition: m_ctype.h:165
struct MY_UNICASE_INFO MY_UNICASE_INFO
int(* strcasecmp)(const CHARSET_INFO *, const char *, const char *)
Definition: m_ctype.h:238
Header for compiler-dependent features.
uint(* strstr)(const CHARSET_INFO *, const char *b, size_t b_length, const char *s, size_t s_length, my_match_t *match, uint nmatch)
Definition: m_ctype.h:240
int my_strnncollsp_mb_bin(const CHARSET_INFO *cs, const uchar *a, size_t a_length, const uchar *b, size_t b_length)
Definition: ctype-mb.cc:433
bool my_like_range_generic(const CHARSET_INFO *cs, const char *ptr, size_t ptr_length, char escape, char w_one, char w_many, size_t res_length, char *min_str, char *max_str, size_t *min_length, size_t *max_length)
Calculate min_str and max_str that ranges a LIKE string.
Definition: ctype-mb.cc:802
my_wc_t min_sort_char
Definition: m_ctype.h:384
size_t my_casedn_str_8bit(const CHARSET_INFO *, char *)
Definition: ctype-simple.cc:204
uint strxfrm_multiply
Definition: m_ctype.h:378
ulonglong my_strntoull10rnd_ucs2(const CHARSET_INFO *cs, const char *str, size_t length, int unsigned_fl, char **endptr, int *error)
unsigned int len
Definition: dbug_analyze.cc:216
unsigned int uint
Definition: uca-dump.cc:29
const struct lex_state_maps_st * state_maps
Definition: m_ctype.h:376
MY_COLLATION_HANDLER my_collation_ucs2_uca_handler
Definition: ctype-uca.cc:5194
MY_CHARSET_HANDLER my_charset_8bit_handler
Definition: ctype-simple.cc:1507
void(* uninit)(CHARSET_INFO *)
Definition: m_ctype.h:176
const char * name
Definition: m_ctype.h:364
long long int longlong
Definition: my_inttypes.h:70
int my_wildcmp_unicode(const CHARSET_INFO *cs, const char *str, const char *str_end, const char *wildstr, const char *wildend, int escape, int w_one, int w_many, const MY_UNICASE_INFO *weights)
Definition: ctype-utf8.cc:5145
const uchar * ident_map
Definition: m_ctype.h:377
t
Definition: dbug_analyze.cc:147
size_t(* scan)(const CHARSET_INFO *, const char *b, const char *e, int sq)
Definition: m_ctype.h:350
const uchar * sort_order
Definition: m_ctype.h:371
static Value err()
Create a Value object that represents an error condition.
Definition: json_binary.cc:910
longlong(* strtoll10)(const CHARSET_INFO *cs, const char *nptr, const char **endptr, int *error)
Definition: m_ctype.h:345
long my_strntol_8bit(const CHARSET_INFO *, const char *s, size_t l, int base, const char **e, int *err)
Definition: ctype-simple.cc:304
MYSQL_PLUGIN_IMPORT CHARSET_INFO my_charset_latin1
Definition: ctype-latin1.cc:358
MY_COLLATION_HANDLER my_collation_8bit_simple_ci_handler
Definition: ctype-simple.cc:1564
uint mbmaxlenlen
Definition: m_ctype.h:383
Definition: m_ctype.h:358
size_t my_caseup_8bit(const CHARSET_INFO *, char *src, size_t srclen, char *dst, size_t dstlen)
Definition: ctype-simple.cc:211
static std::string escape(const std::string &str)
Escapes (only) apostrophes.
Definition: st_units_of_measure.cc:36
uint32 tolower
Definition: m_ctype.h:68
size_t my_numcells_mb(const CHARSET_INFO *, const char *b, const char *e)
Definition: ctype-mb.cc:1267
size_t my_strnxfrmlen_simple(const CHARSET_INFO *, size_t)
Definition: ctype-simple.cc:50
size_t my_casedn_mb(const CHARSET_INFO *, char *src, size_t srclen, char *dst, size_t dstlen)
Definition: ctype-mb.cc:111
size_t my_casedn_mb_varlen(const CHARSET_INFO *, char *src, size_t srclen, char *dst, size_t dstlen)
Definition: ctype-mb.cc:175
static const char * key
Definition: suite_stubs.c:14
Definition of the global "loglevel" enumeration.
bool my_like_range_mb(const CHARSET_INFO *cs, const char *ptr, size_t ptr_length, char escape, char w_one, char w_many, size_t res_length, char *min_str, char *max_str, size_t *min_length, size_t *max_length)
Definition: ctype-mb.cc:654
ulong(* strntoul)(const CHARSET_INFO *, const char *s, size_t l, int base, const char **e, int *err)
Definition: m_ctype.h:337
uint number
Definition: m_ctype.h:359
uint(* ismbchar)(const CHARSET_INFO *, const char *, const char *)
Definition: m_ctype.h:277
const uchar * to_upper
Definition: m_ctype.h:370
size_t my_strcspn(const CHARSET_INFO *cs, const char *str, const char *end, const char *reject, size_t reject_length)
Calculate the length of the initial segment of &#39;str&#39; which consists entirely of characters not in &#39;re...
Definition: my_strchr.cc:64
size_t my_caseup_str_8bit(const CHARSET_INFO *, char *)
Definition: ctype-simple.cc:197
MY_CHARSET_HANDLER my_charset_ucs2_handler
Definition: ctype-ucs2.cc:2842
void(* fill)(const CHARSET_INFO *, char *to, size_t len, int fill)
Definition: m_ctype.h:332
Definition: m_ctype.h:171
struct Coll_param * coll_param
Definition: m_ctype.h:367
size_t(* charpos)(const CHARSET_INFO *, const char *b, const char *e, size_t pos)
Return at which byte codepoint number "pos" begins, relative to the start of the string.
Definition: m_ctype.h:287
static const char * strend(const char *s)
Definition: m_string.h:88
const char * comment
Definition: m_ctype.h:365
size_t my_snprintf_8bit(const CHARSET_INFO *, char *to, size_t n, const char *fmt,...)
Definition: ctype-simple.cc:267
MY_UNI_CTYPE my_uni_ctype[256]
Definition: my_uctype.h:934
int(* my_charset_conv_wc_mb)(const CHARSET_INFO *, my_wc_t, uchar *, uchar *)
Definition: m_ctype.h:268
size_t(* strnxfrmlen)(const CHARSET_INFO *, size_t num_bytes)
Return the maximum number of output bytes needed for strnxfrm() to output all weights for any string ...
Definition: m_ctype.h:229
longlong my_strtoll10_8bit(const CHARSET_INFO *cs, const char *nptr, const char **endptr, int *error)
Definition: ctype-simple.cc:1126
Definition: m_ctype.h:171
Definition: m_ctype.h:158
const char * csname
Definition: m_ctype.h:363
uchar pad_char
Definition: m_ctype.h:386
ulonglong(* strntoull10rnd)(const CHARSET_INFO *cs, const char *str, size_t length, int unsigned_fl, const char **endptr, int *error)
Definition: m_ctype.h:347
bool my_charset_is_ascii_compatible(const CHARSET_INFO *cs)
Definition: ctype.cc:845
MY_COLLATION_HANDLER my_collation_8bit_bin_handler
Definition: ctype-bin.cc:453
bool my_parse_charset_xml(MY_CHARSET_LOADER *loader, const char *buf, size_t buflen)
Definition: ctype.cc:735
CHARSET_INFO my_charset_utf8mb4_bin
Definition: ctype-utf8.cc:8045
int my_strnncoll_mb_bin(const CHARSET_INFO *cs, const uchar *s, size_t slen, const uchar *t, size_t tlen, bool t_is_prefix)
Definition: ctype-mb.cc:403
uint32 sort
Definition: m_ctype.h:69
ulonglong my_strntoull_8bit(const CHARSET_INFO *, const char *s, size_t l, int base, const char **e, int *err)
Definition: ctype-simple.cc:535
const char * tailoring
Definition: m_ctype.h:366
uint binary_number
Definition: m_ctype.h:361
#define C_MODE_END
Definition: my_macros.h:40
loglevel
Definition: my_loglevel.h:32
int my_mb_wc_8bit(const CHARSET_INFO *cs, my_wc_t *wc, const uchar *s, const uchar *e)
Definition: ctype-simple.cc:238
uchar caseup_multiply
Definition: m_ctype.h:379
size_t my_casedn_ujis(const CHARSET_INFO *, char *src, size_t srclen, char *dst, size_t dstlen)
Definition: ctype-ujis.cc:35731
my_wc_t max_sort_char
Definition: m_ctype.h:385
MYSQL_PLUGIN_IMPORT CHARSET_INFO my_charset_utf8_general_ci
Definition: ctype-utf8.cc:5991
MYSQL_PLUGIN_IMPORT CHARSET_INFO my_charset_bin
Definition: ctype-bin.cc:510
size_t(* longlong10_to_str)(const CHARSET_INFO *, char *to, size_t n, int radix, longlong val)
Definition: m_ctype.h:329
int my_wildcmp_bin(const CHARSET_INFO *, const char *str, const char *str_end, const char *wildstr, const char *wildend, int escape, int w_one, int w_many)
Definition: ctype-bin.cc:369
size_t my_strxfrm_pad(const CHARSET_INFO *cs, uchar *str, uchar *frmend, uchar *strend, uint nweights, uint flags)
Definition: ctype-simple.cc:1491
size_t my_convert(char *to, size_t to_length, const CHARSET_INFO *to_cs, const char *from, size_t from_length, const CHARSET_INFO *from_cs, uint *errors)
Convert a string between two character sets.
Definition: ctype.cc:931
bool(* init)(CHARSET_INFO *, MY_CHARSET_LOADER *)
Definition: m_ctype.h:175
uint(* mbcharlen)(const CHARSET_INFO *, uint c)
Definition: m_ctype.h:278
size_t(* caseup_str)(const CHARSET_INFO *, char *)
Definition: m_ctype.h:318
size_t my_long10_to_str_8bit(const CHARSET_INFO *, char *to, size_t l, int radix, long int val)
Definition: ctype-simple.cc:645
CHARSET_INFO my_charset_utf8_unicode_ci
Definition: ctype-uca.cc:6092
uint16 from
Definition: m_ctype.h:141
MY_CHARSET_HANDLER * cset
Definition: m_ctype.h:390
static int flags[50]
Definition: hp_test1.cc:39
void my_hash_sort_simple(const CHARSET_INFO *cs, const uchar *key, size_t len, uint64 *nr1, uint64 *nr2)
Definition: ctype-simple.cc:277
size_t my_numcells_8bit(const CHARSET_INFO *, const char *b, const char *e)
Definition: ctype-simple.cc:901
int my_strcasecmp_mb(const CHARSET_INFO *cs, const char *, const char *)
Definition: ctype-mb.cc:193
double my_strntod_8bit(const CHARSET_INFO *, char *s, size_t l, const char **e, int *err)
Definition: ctype-simple.cc:632
Definition: m_ctype.h:66
unsigned short uint16
Definition: my_inttypes.h:53
size_t(* strnxfrm)(const CHARSET_INFO *, uchar *dst, size_t dstlen, uint num_codepoints, const uchar *src, size_t srclen, uint flags)
Transform the string into a form such that memcmp() between transformed strings yields the correct co...
Definition: m_ctype.h:215
size_t(* lengthsp)(const CHARSET_INFO *, const char *ptr, size_t length)
Given a pointer and a length in bytes, returns a new length in bytes where all trailing space charact...
Definition: m_ctype.h:306
bool my_is_prefixidx_cand(const CHARSET_INFO *cs, const char *wildstr, const char *wildend, int escape, int w_many, size_t *prefix_len)
Identify whether given like pattern looks like a prefix pattern, which can become candidate for index...
Definition: ctype.cc:1016
size_t my_well_formed_len_8bit(const CHARSET_INFO *, const char *b, const char *e, size_t pos, int *error)
Definition: ctype-simple.cc:912
size_t(* numcells)(const CHARSET_INFO *, const char *b, const char *e)
Definition: m_ctype.h:307
unsigned long ulong
Definition: my_inttypes.h:46
CHARSET_INFO my_charset_latin1_bin
Definition: ctype-latin1.cc:661
bool length(const dd::Spatial_reference_system *srs, const Geometry *g1, double *length, bool *null) noexcept
Computes the length of linestrings and multilinestrings.
Definition: length.cc:75
uint my_mbcharlen_ptr(const CHARSET_INFO *cs, const char *s, const char *e)
Get the length of the first code in given sequence of chars.
Definition: ctype.cc:989
Definition: m_ctype.h:146
void my_fill_8bit(const CHARSET_INFO *cs, char *to, size_t l, int fill)
Definition: ctype-simple.cc:891
ulong my_wc_t
Our own version of wchar_t, ie., a type that holds a single Unicode code point ("wide character")...
Definition: m_ctype.h:57
bool my_propagate_complex(const CHARSET_INFO *cs, const uchar *str, size_t len)
Definition: ctype-simple.cc:1469
int(* my_string_stack_guard)(int)
Definition: ctype.cc:60
uint16 to
Definition: m_ctype.h:142
uint primary_number
Definition: m_ctype.h:360
static void MY_PUT_MB2(unsigned char *s, uint16 code)
Definition: m_ctype.h:61
Log error(cerr, "ERROR")