| m_ctype.h | | m_ctype.h | |
|
| /* Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reser
ved. | | /* Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reser
ved. | |
| | | | |
| This program is free software; you can redistribute it and/or modify | | This program is free software; you can redistribute it and/or modify | |
| it under the terms of the GNU General Public License as published by | | it under the terms of the GNU General Public License as published by | |
| the Free Software Foundation; version 2 of the License. | | the Free Software Foundation; version 2 of the License. | |
| | | | |
| This program is distributed in the hope that it will be useful, | | This program is distributed in the hope that it will be useful, | |
| but WITHOUT ANY WARRANTY; without even the implied warranty of | | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
| GNU General Public License for more details. | | GNU General Public License for more details. | |
| | | | |
| | | | |
| skipping to change at line 57 | | skipping to change at line 57 | |
| This gives some performance improvement. | | This gives some performance improvement. | |
| */ | | */ | |
| #ifdef __i386__ | | #ifdef __i386__ | |
| #define MB2(x) (((x) >> 8) + (((x) & 0xFF) << 8)) | | #define MB2(x) (((x) >> 8) + (((x) & 0xFF) << 8)) | |
| #define MY_PUT_MB2(s, code) { *((uint16*)(s))= (code); } | | #define MY_PUT_MB2(s, code) { *((uint16*)(s))= (code); } | |
| #else | | #else | |
| #define MB2(x) (x) | | #define MB2(x) (x) | |
| #define MY_PUT_MB2(s, code) { (s)[0]= code >> 8; (s)[1]= code & 0xFF; } | | #define MY_PUT_MB2(s, code) { (s)[0]= code >> 8; (s)[1]= code & 0xFF; } | |
| #endif | | #endif | |
| | | | |
|
| typedef struct unicase_info_st | | typedef struct unicase_info_char_st | |
| { | | { | |
| uint32 toupper; | | uint32 toupper; | |
| uint32 tolower; | | uint32 tolower; | |
| uint32 sort; | | uint32 sort; | |
|
| | | } MY_UNICASE_CHARACTER; | |
| | | | |
| | | typedef struct unicase_info_st | |
| | | { | |
| | | my_wc_t maxchar; | |
| | | MY_UNICASE_CHARACTER **page; | |
| } MY_UNICASE_INFO; | | } MY_UNICASE_INFO; | |
| | | | |
|
| extern MY_UNICASE_INFO *my_unicase_default[256]; | | extern MY_UNICASE_INFO my_unicase_default; | |
| extern MY_UNICASE_INFO *my_unicase_turkish[256]; | | extern MY_UNICASE_INFO my_unicase_turkish; | |
| extern MY_UNICASE_INFO *my_unicase_mysql500[256]; | | extern MY_UNICASE_INFO my_unicase_mysql500; | |
| | | extern MY_UNICASE_INFO my_unicase_unicode520; | |
| | | | |
| | | #define MY_UCA_MAX_CONTRACTION 6 | |
| | | #define MY_UCA_MAX_WEIGHT_SIZE 8 | |
| | | #define MY_UCA_WEIGHT_LEVELS 1 | |
| | | | |
| | | typedef struct my_contraction_t | |
| | | { | |
| | | my_wc_t ch[MY_UCA_MAX_CONTRACTION]; /* Character sequence | |
| | | */ | |
| | | uint16 weight[MY_UCA_MAX_WEIGHT_SIZE];/* Its weight string, 0-terminated | |
| | | */ | |
| | | my_bool with_context; | |
| | | } MY_CONTRACTION; | |
| | | | |
| | | typedef struct my_contraction_list_t | |
| | | { | |
| | | size_t nitems; /* Number of items in the list */ | |
| | | MY_CONTRACTION *item; /* List of contractions */ | |
| | | char *flags; /* Character flags, e.g. "is contraction head") */ | |
| | | } MY_CONTRACTIONS; | |
| | | | |
| | | my_bool my_uca_can_be_contraction_head(const MY_CONTRACTIONS *c, my_wc_t wc | |
| | | ); | |
| | | my_bool my_uca_can_be_contraction_tail(const MY_CONTRACTIONS *c, my_wc_t wc | |
| | | ); | |
| | | uint16 *my_uca_contraction2_weight(const MY_CONTRACTIONS *c, | |
| | | my_wc_t wc1, my_wc_t wc2); | |
| | | | |
| | | /* Collation weights on a single level (e.g. primary, secondary, tertiarty) | |
| | | */ | |
| | | typedef struct my_uca_level_info_st | |
| | | { | |
| | | my_wc_t maxchar; | |
| | | uchar *lengths; | |
| | | uint16 **weights; | |
| | | MY_CONTRACTIONS contractions; | |
| | | } MY_UCA_WEIGHT_LEVEL; | |
| | | | |
| | | typedef struct uca_info_st | |
| | | { | |
| | | MY_UCA_WEIGHT_LEVEL level[MY_UCA_WEIGHT_LEVELS]; | |
| | | | |
| | | /* Logical positions */ | |
| | | my_wc_t first_non_ignorable; | |
| | | my_wc_t last_non_ignorable; | |
| | | my_wc_t first_primary_ignorable; | |
| | | my_wc_t last_primary_ignorable; | |
| | | my_wc_t first_secondary_ignorable; | |
| | | my_wc_t last_secondary_ignorable; | |
| | | my_wc_t first_tertiary_ignorable; | |
| | | my_wc_t last_tertiary_ignorable; | |
| | | my_wc_t first_trailing; | |
| | | my_wc_t last_trailing; | |
| | | my_wc_t first_variable; | |
| | | my_wc_t last_variable; | |
| | | | |
| | | } MY_UCA_INFO; | |
| | | | |
| | | extern MY_UCA_INFO my_uca_v400; | |
| | | | |
| typedef struct uni_ctype_st | | typedef struct uni_ctype_st | |
| { | | { | |
| uchar pctype; | | uchar pctype; | |
| uchar *ctype; | | uchar *ctype; | |
| } MY_UNI_CTYPE; | | } MY_UNI_CTYPE; | |
| | | | |
| extern MY_UNI_CTYPE my_uni_ctype[256]; | | extern MY_UNI_CTYPE my_uni_ctype[256]; | |
| | | | |
| /* wm_wc and wc_mb return codes */ | | /* wm_wc and wc_mb return codes */ | |
| | | | |
| skipping to change at line 108 | | skipping to change at line 169 | |
| #define MY_CS_PRIMARY 32 /* if primary collation */ | | #define MY_CS_PRIMARY 32 /* if primary collation */ | |
| #define MY_CS_STRNXFRM 64 /* if strnxfrm is used for sort */ | | #define MY_CS_STRNXFRM 64 /* if strnxfrm is used for sort */ | |
| #define MY_CS_UNICODE 128 /* is a charset is BMP Unicode */ | | #define MY_CS_UNICODE 128 /* is a charset is BMP Unicode */ | |
| #define MY_CS_READY 256 /* if a charset is initialized */ | | #define MY_CS_READY 256 /* if a charset is initialized */ | |
| #define MY_CS_AVAILABLE 512 /* If either compiled-in or loaded*/ | | #define MY_CS_AVAILABLE 512 /* If either compiled-in or loaded*/ | |
| #define MY_CS_CSSORT 1024 /* if case sensitive sort order */ | | #define MY_CS_CSSORT 1024 /* if case sensitive sort order */ | |
| #define MY_CS_HIDDEN 2048 /* don't display in SHOW */ | | #define MY_CS_HIDDEN 2048 /* don't display in SHOW */ | |
| #define MY_CS_PUREASCII 4096 /* if a charset is pure ascii */ | | #define MY_CS_PUREASCII 4096 /* if a charset is pure ascii */ | |
| #define MY_CS_NONASCII 8192 /* if not ASCII-compatible */ | | #define MY_CS_NONASCII 8192 /* if not ASCII-compatible */ | |
| #define MY_CS_UNICODE_SUPPLEMENT 16384 /* Non-BMP Unicode characters */ | | #define MY_CS_UNICODE_SUPPLEMENT 16384 /* Non-BMP Unicode characters */ | |
|
| | | #define MY_CS_LOWER_SORT 32768 /* If use lower case as weight */ | |
| #define MY_CHARSET_UNDEFINED 0 | | #define MY_CHARSET_UNDEFINED 0 | |
| | | | |
| /* Character repertoire flags */ | | /* Character repertoire flags */ | |
| #define MY_REPERTOIRE_ASCII 1 /* Pure ASCII U+0000..U+007F
*/ | | #define MY_REPERTOIRE_ASCII 1 /* Pure ASCII U+0000..U+007F
*/ | |
| #define MY_REPERTOIRE_EXTENDED 2 /* Extended characters: U+0080..U+FFFF
*/ | | #define MY_REPERTOIRE_EXTENDED 2 /* Extended characters: U+0080..U+FFFF
*/ | |
| #define MY_REPERTOIRE_UNICODE30 3 /* ASCII | EXTENDED: U+0000..U+FFFF
*/ | | #define MY_REPERTOIRE_UNICODE30 3 /* ASCII | EXTENDED: U+0000..U+FFFF
*/ | |
| | | | |
|
| | | /* Flags for strxfrm */ | |
| | | #define MY_STRXFRM_LEVEL1 0x00000001 /* for primary weights */ | |
| | | #define MY_STRXFRM_LEVEL2 0x00000002 /* for secondary weights */ | |
| | | #define MY_STRXFRM_LEVEL3 0x00000004 /* for tertiary weights */ | |
| | | #define MY_STRXFRM_LEVEL4 0x00000008 /* fourth level weights */ | |
| | | #define MY_STRXFRM_LEVEL5 0x00000010 /* fifth level weights */ | |
| | | #define MY_STRXFRM_LEVEL6 0x00000020 /* sixth level weights */ | |
| | | #define MY_STRXFRM_LEVEL_ALL 0x0000003F /* Bit OR for the above six * | |
| | | / | |
| | | #define MY_STRXFRM_NLEVELS 6 /* Number of possible levels* | |
| | | / | |
| | | | |
| | | #define MY_STRXFRM_PAD_WITH_SPACE 0x00000040 /* if pad result with spaces | |
| | | */ | |
| | | #define MY_STRXFRM_PAD_TO_MAXLEN 0x00000080 /* if pad tail(for filesort) | |
| | | */ | |
| | | | |
| | | #define MY_STRXFRM_DESC_LEVEL1 0x00000100 /* if desc order for level1 * | |
| | | / | |
| | | #define MY_STRXFRM_DESC_LEVEL2 0x00000200 /* if desc order for level2 * | |
| | | / | |
| | | #define MY_STRXFRM_DESC_LEVEL3 0x00000300 /* if desc order for level3 * | |
| | | / | |
| | | #define MY_STRXFRM_DESC_LEVEL4 0x00000800 /* if desc order for level4 * | |
| | | / | |
| | | #define MY_STRXFRM_DESC_LEVEL5 0x00001000 /* if desc order for level5 * | |
| | | / | |
| | | #define MY_STRXFRM_DESC_LEVEL6 0x00002000 /* if desc order for level6 * | |
| | | / | |
| | | #define MY_STRXFRM_DESC_SHIFT 8 | |
| | | | |
| | | #define MY_STRXFRM_UNUSED_00004000 0x00004000 /* for future extensions | |
| | | */ | |
| | | #define MY_STRXFRM_UNUSED_00008000 0x00008000 /* for future extensions | |
| | | */ | |
| | | | |
| | | #define MY_STRXFRM_REVERSE_LEVEL1 0x00010000 /* if reverse order for level | |
| | | 1 */ | |
| | | #define MY_STRXFRM_REVERSE_LEVEL2 0x00020000 /* if reverse order for level | |
| | | 2 */ | |
| | | #define MY_STRXFRM_REVERSE_LEVEL3 0x00040000 /* if reverse order for level | |
| | | 3 */ | |
| | | #define MY_STRXFRM_REVERSE_LEVEL4 0x00080000 /* if reverse order for level | |
| | | 4 */ | |
| | | #define MY_STRXFRM_REVERSE_LEVEL5 0x00100000 /* if reverse order for level | |
| | | 5 */ | |
| | | #define MY_STRXFRM_REVERSE_LEVEL6 0x00200000 /* if reverse order for level | |
| | | 6 */ | |
| | | #define MY_STRXFRM_REVERSE_SHIFT 16 | |
| | | | |
| typedef struct my_uni_idx_st | | typedef struct my_uni_idx_st | |
| { | | { | |
| uint16 from; | | uint16 from; | |
| uint16 to; | | uint16 to; | |
| uchar *tab; | | uchar *tab; | |
| } MY_UNI_IDX; | | } MY_UNI_IDX; | |
| | | | |
| typedef struct | | typedef struct | |
| { | | { | |
| uint beg; | | uint beg; | |
| | | | |
| skipping to change at line 147 | | skipping to change at line 241 | |
| MY_LEX_LONG_COMMENT, MY_LEX_END_LONG_COMMENT, MY_LEX_SEMICOLON, | | MY_LEX_LONG_COMMENT, MY_LEX_END_LONG_COMMENT, MY_LEX_SEMICOLON, | |
| MY_LEX_SET_VAR, MY_LEX_USER_END, MY_LEX_HOSTNAME, MY_LEX_SKIP, | | MY_LEX_SET_VAR, MY_LEX_USER_END, MY_LEX_HOSTNAME, MY_LEX_SKIP, | |
| MY_LEX_USER_VARIABLE_DELIMITER, MY_LEX_SYSTEM_VAR, | | MY_LEX_USER_VARIABLE_DELIMITER, MY_LEX_SYSTEM_VAR, | |
| MY_LEX_IDENT_OR_KEYWORD, | | MY_LEX_IDENT_OR_KEYWORD, | |
| MY_LEX_IDENT_OR_HEX, MY_LEX_IDENT_OR_BIN, MY_LEX_IDENT_OR_NCHAR, | | MY_LEX_IDENT_OR_HEX, MY_LEX_IDENT_OR_BIN, MY_LEX_IDENT_OR_NCHAR, | |
| MY_LEX_STRING_OR_DELIMITER | | MY_LEX_STRING_OR_DELIMITER | |
| }; | | }; | |
| | | | |
| struct charset_info_st; | | struct charset_info_st; | |
| | | | |
|
| | | typedef struct my_charset_loader_st | |
| | | { | |
| | | char error[128]; | |
| | | void *(*once_alloc)(size_t); | |
| | | void *(*malloc)(size_t); | |
| | | void *(*realloc)(void *, size_t); | |
| | | void (*free)(void *); | |
| | | void (*reporter)(enum loglevel, const char *format, ...); | |
| | | int (*add_collation)(struct charset_info_st *cs); | |
| | | } MY_CHARSET_LOADER; | |
| | | | |
| extern int (*my_string_stack_guard)(int); | | extern int (*my_string_stack_guard)(int); | |
| | | | |
| /* See strings/CHARSET_INFO.txt for information about this structure */ | | /* See strings/CHARSET_INFO.txt for information about this structure */ | |
| typedef struct my_collation_handler_st | | typedef struct my_collation_handler_st | |
| { | | { | |
|
| my_bool (*init)(struct charset_info_st *, void *(*alloc)(size_t)); | | my_bool (*init)(struct charset_info_st *, MY_CHARSET_LOADER *); | |
| /* Collation routines */ | | /* Collation routines */ | |
|
| int (*strnncoll)(struct charset_info_st *, | | int (*strnncoll)(const struct charset_info_st *, | |
| const uchar *, size_t, const uchar *, size_t, my_bool
); | | const uchar *, size_t, const uchar *, size_t, my_bool
); | |
|
| int (*strnncollsp)(struct charset_info_st *, | | int (*strnncollsp)(const struct charset_info_st *, | |
| const uchar *, size_t, const uchar *, size_t, | | const uchar *, size_t, const uchar *, size_t, | |
| my_bool diff_if_only_endspace_difference); | | my_bool diff_if_only_endspace_difference); | |
|
| size_t (*strnxfrm)(struct charset_info_st *, | | size_t (*strnxfrm)(const struct charset_info_st *, | |
| uchar *, size_t, const uchar *, size_t); | | uchar *dst, size_t dstlen, uint nweights, | |
| size_t (*strnxfrmlen)(struct charset_info_st *, size_t); | | const uchar *src, size_t srclen, uint flags); | |
| my_bool (*like_range)(struct charset_info_st *, | | size_t (*strnxfrmlen)(const struct charset_info_st *, size_t); | |
| | | my_bool (*like_range)(const struct charset_info_st *, | |
| const char *s, size_t s_length, | | const char *s, size_t s_length, | |
| pchar w_prefix, pchar w_one, pchar w_many, | | pchar w_prefix, pchar w_one, pchar w_many, | |
| size_t res_length, | | size_t res_length, | |
| char *min_str, char *max_str, | | char *min_str, char *max_str, | |
| size_t *min_len, size_t *max_len); | | size_t *min_len, size_t *max_len); | |
|
| int (*wildcmp)(struct charset_info_st *, | | int (*wildcmp)(const struct charset_info_st *, | |
| const char *str,const char *str_end, | | const char *str,const char *str_end, | |
| const char *wildstr,const char *wildend, | | const char *wildstr,const char *wildend, | |
| int escape,int w_one, int w_many); | | int escape,int w_one, int w_many); | |
| | | | |
|
| int (*strcasecmp)(struct charset_info_st *, const char *, const char *); | | int (*strcasecmp)(const struct charset_info_st *, const char *, | |
| | | const char *); | |
| | | | |
|
| uint (*instr)(struct charset_info_st *, | | uint (*instr)(const struct charset_info_st *, | |
| const char *b, size_t b_length, | | const char *b, size_t b_length, | |
| const char *s, size_t s_length, | | const char *s, size_t s_length, | |
| my_match_t *match, uint nmatch); | | my_match_t *match, uint nmatch); | |
| | | | |
| /* Hash calculation */ | | /* Hash calculation */ | |
|
| void (*hash_sort)(struct charset_info_st *cs, const uchar *key, size_t le | | void (*hash_sort)(const struct charset_info_st *cs, const uchar *key, | |
| n, | | size_t len, ulong *nr1, ulong *nr2); | |
| ulong *nr1, ulong *nr2); | | my_bool (*propagate)(const struct charset_info_st *cs, const uchar *str, | |
| my_bool (*propagate)(struct charset_info_st *cs, const uchar *str, size_t | | size_t len); | |
| len); | | | |
| } MY_COLLATION_HANDLER; | | } MY_COLLATION_HANDLER; | |
| | | | |
| extern MY_COLLATION_HANDLER my_collation_mb_bin_handler; | | extern MY_COLLATION_HANDLER my_collation_mb_bin_handler; | |
| extern MY_COLLATION_HANDLER my_collation_8bit_bin_handler; | | extern MY_COLLATION_HANDLER my_collation_8bit_bin_handler; | |
| extern MY_COLLATION_HANDLER my_collation_8bit_simple_ci_handler; | | extern MY_COLLATION_HANDLER my_collation_8bit_simple_ci_handler; | |
| extern MY_COLLATION_HANDLER my_collation_ucs2_uca_handler; | | extern MY_COLLATION_HANDLER my_collation_ucs2_uca_handler; | |
| | | | |
| /* Some typedef to make it easy for C++ to make function pointers */ | | /* Some typedef to make it easy for C++ to make function pointers */ | |
|
| typedef int (*my_charset_conv_mb_wc)(struct charset_info_st *, my_wc_t *, | | typedef int (*my_charset_conv_mb_wc)(const struct charset_info_st *, | |
| const uchar *, const uchar *); | | my_wc_t *, const uchar *, const uchar | |
| typedef int (*my_charset_conv_wc_mb)(struct charset_info_st *, my_wc_t, | | *); | |
| | | typedef int (*my_charset_conv_wc_mb)(const struct charset_info_st *, my_wc_ | |
| | | t, | |
| uchar *, uchar *); | | uchar *, uchar *); | |
|
| typedef size_t (*my_charset_conv_case)(struct charset_info_st *, | | typedef size_t (*my_charset_conv_case)(const struct charset_info_st *, | |
| char *, size_t, char *, size_t); | | char *, size_t, char *, size_t); | |
| | | | |
| /* See strings/CHARSET_INFO.txt about information on this structure */ | | /* See strings/CHARSET_INFO.txt about information on this structure */ | |
| typedef struct my_charset_handler_st | | typedef struct my_charset_handler_st | |
| { | | { | |
|
| my_bool (*init)(struct charset_info_st *, void *(*alloc)(size_t)); | | my_bool (*init)(struct charset_info_st *, MY_CHARSET_LOADER *loader); | |
| /* Multibyte routines */ | | /* Multibyte routines */ | |
|
| uint (*ismbchar)(struct charset_info_st *, const char *, const char *) | | uint (*ismbchar)(const struct charset_info_st *, const char *, | |
| ; | | const char *); | |
| uint (*mbcharlen)(struct charset_info_st *, uint c); | | uint (*mbcharlen)(const struct charset_info_st *, uint c); | |
| size_t (*numchars)(struct charset_info_st *, const char *b, const char * | | size_t (*numchars)(const struct charset_info_st *, const char *b, | |
| e); | | const char *e); | |
| size_t (*charpos)(struct charset_info_st *, const char *b, const char *e | | size_t (*charpos)(const struct charset_info_st *, const char *b, | |
| , | | const char *e, size_t pos); | |
| size_t pos); | | size_t (*well_formed_len)(const struct charset_info_st *, | |
| size_t (*well_formed_len)(struct charset_info_st *, | | | |
| const char *b,const char *e, | | const char *b,const char *e, | |
| size_t nchars, int *error); | | size_t nchars, int *error); | |
|
| size_t (*lengthsp)(struct charset_info_st *, const char *ptr, size_t len | | size_t (*lengthsp)(const struct charset_info_st *, const char *ptr, | |
| gth); | | size_t length); | |
| size_t (*numcells)(struct charset_info_st *, const char *b, const char * | | size_t (*numcells)(const struct charset_info_st *, const char *b, | |
| e); | | const char *e); | |
| | | | |
| /* Unicode conversion */ | | /* Unicode conversion */ | |
| my_charset_conv_mb_wc mb_wc; | | my_charset_conv_mb_wc mb_wc; | |
| my_charset_conv_wc_mb wc_mb; | | my_charset_conv_wc_mb wc_mb; | |
| | | | |
| /* CTYPE scanner */ | | /* CTYPE scanner */ | |
|
| int (*ctype)(struct charset_info_st *cs, int *ctype, | | int (*ctype)(const struct charset_info_st *cs, int *ctype, | |
| const uchar *s, const uchar *e); | | const uchar *s, const uchar *e); | |
| | | | |
| /* Functions for case and sort conversion */ | | /* Functions for case and sort conversion */ | |
|
| size_t (*caseup_str)(struct charset_info_st *, char *); | | size_t (*caseup_str)(const struct charset_info_st *, char *); | |
| size_t (*casedn_str)(struct charset_info_st *, char *); | | size_t (*casedn_str)(const struct charset_info_st *, char *); | |
| | | | |
| my_charset_conv_case caseup; | | my_charset_conv_case caseup; | |
| my_charset_conv_case casedn; | | my_charset_conv_case casedn; | |
| | | | |
| /* Charset dependant snprintf() */ | | /* Charset dependant snprintf() */ | |
|
| size_t (*snprintf)(struct charset_info_st *, char *to, size_t n, | | size_t (*snprintf)(const struct charset_info_st *, char *to, size_t n, | |
| const char *fmt, | | const char *fmt, | |
| ...) ATTRIBUTE_FORMAT_FPTR(printf, 4, 5); | | ...) ATTRIBUTE_FORMAT_FPTR(printf, 4, 5); | |
|
| size_t (*long10_to_str)(struct charset_info_st *, char *to, size_t n, | | size_t (*long10_to_str)(const struct charset_info_st *, char *to, size_t
n, | |
| int radix, long int val); | | int radix, long int val); | |
|
| size_t (*longlong10_to_str)(struct charset_info_st *, char *to, size_t n, | | size_t (*longlong10_to_str)(const struct charset_info_st *, char *to, | |
| int radix, longlong val); | | size_t n, int radix, longlong val); | |
| | | | |
|
| void (*fill)(struct charset_info_st *, char *to, size_t len, int fill); | | void (*fill)(const struct charset_info_st *, char *to, size_t len, | |
| | | int fill); | |
| | | | |
| /* String-to-number conversion routines */ | | /* String-to-number conversion routines */ | |
|
| long (*strntol)(struct charset_info_st *, const char *s, size_t l, | | long (*strntol)(const struct charset_info_st *, const char *s, | |
| int base, char **e, int *err); | | size_t l, int base, char **e, int *err); | |
| ulong (*strntoul)(struct charset_info_st *, const char *s, size_t l, | | ulong (*strntoul)(const struct charset_info_st *, const char *s, | |
| int base, char **e, int *err); | | size_t l, int base, char **e, int *err); | |
| longlong (*strntoll)(struct charset_info_st *, const char *s, size_t l, | | longlong (*strntoll)(const struct charset_info_st *, const char *s, | |
| int base, char **e, int *err); | | size_t l, int base, char **e, int *err); | |
| ulonglong (*strntoull)(struct charset_info_st *, const char *s, size_t l, | | ulonglong (*strntoull)(const struct charset_info_st *, const char *s, | |
| int base, char **e, int *err); | | size_t l, int base, char **e, int *err); | |
| double (*strntod)(struct charset_info_st *, char *s, size_t l, char | | double (*strntod)(const struct charset_info_st *, char *s, | |
| **e, | | size_t l, char **e, int *err); | |
| int *err); | | longlong (*strtoll10)(const struct charset_info_st *cs, | |
| longlong (*strtoll10)(struct charset_info_st *cs, | | | |
| const char *nptr, char **endptr, int *error); | | const char *nptr, char **endptr, int *error); | |
|
| ulonglong (*strntoull10rnd)(struct charset_info_st *cs, | | ulonglong (*strntoull10rnd)(const struct charset_info_st *cs, | |
| const char *str, size_t length, | | const char *str, size_t length, | |
| int unsigned_fl, | | int unsigned_fl, | |
| char **endptr, int *error); | | char **endptr, int *error); | |
|
| size_t (*scan)(struct charset_info_st *, const char *b, const char | | size_t (*scan)(const struct charset_info_st *, const char *b, | |
| *e, | | const char *e, int sq); | |
| int sq); | | | |
| } MY_CHARSET_HANDLER; | | } MY_CHARSET_HANDLER; | |
| | | | |
| extern MY_CHARSET_HANDLER my_charset_8bit_handler; | | extern MY_CHARSET_HANDLER my_charset_8bit_handler; | |
| extern MY_CHARSET_HANDLER my_charset_ucs2_handler; | | extern MY_CHARSET_HANDLER my_charset_ucs2_handler; | |
| | | | |
| /* | | /* | |
| We define this CHARSET_INFO_DEFINED here to prevent a repeat of the | | We define this CHARSET_INFO_DEFINED here to prevent a repeat of the | |
| typedef in hash.c, which will cause a compiler error. | | typedef in hash.c, which will cause a compiler error. | |
| */ | | */ | |
| #define CHARSET_INFO_DEFINED | | #define CHARSET_INFO_DEFINED | |
| | | | |
| skipping to change at line 286 | | skipping to change at line 399 | |
| uint binary_number; | | uint binary_number; | |
| uint state; | | uint state; | |
| const char *csname; | | const char *csname; | |
| const char *name; | | const char *name; | |
| const char *comment; | | const char *comment; | |
| const char *tailoring; | | const char *tailoring; | |
| uchar *ctype; | | uchar *ctype; | |
| uchar *to_lower; | | uchar *to_lower; | |
| uchar *to_upper; | | uchar *to_upper; | |
| uchar *sort_order; | | uchar *sort_order; | |
|
| uint16 *contractions; | | MY_UCA_INFO *uca; | |
| uint16 **sort_order_big; | | | |
| uint16 *tab_to_uni; | | uint16 *tab_to_uni; | |
| MY_UNI_IDX *tab_from_uni; | | MY_UNI_IDX *tab_from_uni; | |
|
| MY_UNICASE_INFO **caseinfo; | | MY_UNICASE_INFO *caseinfo; | |
| uchar *state_map; | | uchar *state_map; | |
| uchar *ident_map; | | uchar *ident_map; | |
| uint strxfrm_multiply; | | uint strxfrm_multiply; | |
| uchar caseup_multiply; | | uchar caseup_multiply; | |
| uchar casedn_multiply; | | uchar casedn_multiply; | |
| uint mbminlen; | | uint mbminlen; | |
| uint mbmaxlen; | | uint mbmaxlen; | |
|
| uint16 min_sort_char; | | my_wc_t min_sort_char; | |
| uint16 max_sort_char; /* For LIKE optimization */ | | my_wc_t max_sort_char; /* For LIKE optimization */ | |
| uchar pad_char; | | uchar pad_char; | |
| my_bool escape_with_backslash_is_dangerous; | | my_bool escape_with_backslash_is_dangerous; | |
|
| | | uchar levels_for_compare; | |
| | | uchar levels_for_order; | |
| | | | |
| MY_CHARSET_HANDLER *cset; | | MY_CHARSET_HANDLER *cset; | |
| MY_COLLATION_HANDLER *coll; | | MY_COLLATION_HANDLER *coll; | |
| | | | |
| } CHARSET_INFO; | | } CHARSET_INFO; | |
| #define ILLEGAL_CHARSET_INFO_NUMBER (~0U) | | #define ILLEGAL_CHARSET_INFO_NUMBER (~0U) | |
| | | | |
| extern MYSQL_PLUGIN_IMPORT CHARSET_INFO my_charset_bin; | | extern MYSQL_PLUGIN_IMPORT CHARSET_INFO my_charset_bin; | |
| extern MYSQL_PLUGIN_IMPORT CHARSET_INFO my_charset_latin1; | | extern MYSQL_PLUGIN_IMPORT CHARSET_INFO my_charset_latin1; | |
| extern MYSQL_PLUGIN_IMPORT CHARSET_INFO my_charset_filename; | | extern MYSQL_PLUGIN_IMPORT CHARSET_INFO my_charset_filename; | |
| | | | |
| skipping to change at line 342 | | skipping to change at line 456 | |
| extern CHARSET_INFO my_charset_tis620_bin; | | extern CHARSET_INFO my_charset_tis620_bin; | |
| extern CHARSET_INFO my_charset_ucs2_general_ci; | | extern CHARSET_INFO my_charset_ucs2_general_ci; | |
| extern CHARSET_INFO my_charset_ucs2_bin; | | extern CHARSET_INFO my_charset_ucs2_bin; | |
| extern CHARSET_INFO my_charset_ucs2_unicode_ci; | | extern CHARSET_INFO my_charset_ucs2_unicode_ci; | |
| extern CHARSET_INFO my_charset_ucs2_general_mysql500_ci; | | extern CHARSET_INFO my_charset_ucs2_general_mysql500_ci; | |
| extern CHARSET_INFO my_charset_ujis_japanese_ci; | | extern CHARSET_INFO my_charset_ujis_japanese_ci; | |
| extern CHARSET_INFO my_charset_ujis_bin; | | extern CHARSET_INFO my_charset_ujis_bin; | |
| extern CHARSET_INFO my_charset_utf16_bin; | | extern CHARSET_INFO my_charset_utf16_bin; | |
| extern CHARSET_INFO my_charset_utf16_general_ci; | | extern CHARSET_INFO my_charset_utf16_general_ci; | |
| extern CHARSET_INFO my_charset_utf16_unicode_ci; | | extern CHARSET_INFO my_charset_utf16_unicode_ci; | |
|
| | | extern CHARSET_INFO my_charset_utf16le_bin; | |
| | | extern CHARSET_INFO my_charset_utf16le_general_ci; | |
| extern CHARSET_INFO my_charset_utf32_bin; | | extern CHARSET_INFO my_charset_utf32_bin; | |
| extern CHARSET_INFO my_charset_utf32_general_ci; | | extern CHARSET_INFO my_charset_utf32_general_ci; | |
| extern CHARSET_INFO my_charset_utf32_unicode_ci; | | extern CHARSET_INFO my_charset_utf32_unicode_ci; | |
| | | | |
| extern MYSQL_PLUGIN_IMPORT CHARSET_INFO my_charset_utf8_general_ci; | | extern MYSQL_PLUGIN_IMPORT CHARSET_INFO my_charset_utf8_general_ci; | |
|
| | | extern CHARSET_INFO my_charset_utf8_tolower_ci; | |
| extern CHARSET_INFO my_charset_utf8_unicode_ci; | | extern CHARSET_INFO my_charset_utf8_unicode_ci; | |
| extern CHARSET_INFO my_charset_utf8_bin; | | extern CHARSET_INFO my_charset_utf8_bin; | |
| extern CHARSET_INFO my_charset_utf8_general_mysql500_ci; | | extern CHARSET_INFO my_charset_utf8_general_mysql500_ci; | |
| extern CHARSET_INFO my_charset_utf8mb4_bin; | | extern CHARSET_INFO my_charset_utf8mb4_bin; | |
| extern CHARSET_INFO my_charset_utf8mb4_general_ci; | | extern CHARSET_INFO my_charset_utf8mb4_general_ci; | |
| extern CHARSET_INFO my_charset_utf8mb4_unicode_ci; | | extern CHARSET_INFO my_charset_utf8mb4_unicode_ci; | |
| #define MY_UTF8MB3 "utf8" | | #define MY_UTF8MB3 "utf8" | |
| #define MY_UTF8MB4 "utf8mb4" | | #define MY_UTF8MB4 "utf8mb4" | |
| | | | |
|
| /* Helper functions to handle contraction */ | | | |
| static inline my_bool | | | |
| my_cs_have_contractions(CHARSET_INFO *cs) | | | |
| { | | | |
| return cs->contractions != NULL; | | | |
| } | | | |
| | | | |
| static inline my_bool | | | |
| my_cs_can_be_contraction_head(CHARSET_INFO *cs, my_wc_t wc) | | | |
| { | | | |
| return ((const char *) cs->contractions)[0x40 * 0x40 * 2 + (wc & 0xFF)]; | | | |
| } | | | |
| | | | |
| static inline my_bool | | | |
| my_cs_can_be_contraction_tail(CHARSET_INFO *cs, my_wc_t wc) | | | |
| { | | | |
| return ((const char *) cs->contractions)[0x40 * 0x40 * 2 + (wc & 0xFF)]; | | | |
| } | | | |
| | | | |
| static inline uint16* | | | |
| my_cs_contraction2_weight(CHARSET_INFO *cs, my_wc_t wc1, my_wc_t wc2) | | | |
| { | | | |
| return &cs->contractions[(wc1 - 0x40) * 0x40 + wc2 - 0x40]; | | | |
| } | | | |
| | | | |
| /* declarations for simple charsets */ | | /* declarations for simple charsets */ | |
|
| extern size_t my_strnxfrm_simple(CHARSET_INFO *, uchar *, size_t, | | extern size_t my_strnxfrm_simple(const CHARSET_INFO *, | |
| const uchar *, size_t); | | uchar *dst, size_t dstlen, uint nweights, | |
| size_t my_strnxfrmlen_simple(CHARSET_INFO *, size_t); | | const uchar *src, size_t srclen, uint flag | |
| extern int my_strnncoll_simple(CHARSET_INFO *, const uchar *, size_t, | | s); | |
| | | size_t my_strnxfrmlen_simple(const CHARSET_INFO *, size_t); | |
| | | extern int my_strnncoll_simple(const CHARSET_INFO *, const uchar *, size_t | |
| | | , | |
| const uchar *, size_t, my_bool); | | const uchar *, size_t, my_bool); | |
| | | | |
|
| extern int my_strnncollsp_simple(CHARSET_INFO *, const uchar *, size_t, | | extern int my_strnncollsp_simple(const CHARSET_INFO *, const uchar *, size
_t, | |
| const uchar *, size_t, | | const uchar *, size_t, | |
| my_bool diff_if_only_endspace_difference)
; | | my_bool diff_if_only_endspace_difference)
; | |
| | | | |
|
| extern void my_hash_sort_simple(CHARSET_INFO *cs, | | extern void my_hash_sort_simple(const CHARSET_INFO *cs, | |
| const uchar *key, size_t len, | | const uchar *key, size_t len, | |
| ulong *nr1, ulong *nr2); | | ulong *nr1, ulong *nr2); | |
| | | | |
|
| extern size_t my_lengthsp_8bit(CHARSET_INFO *cs, const char *ptr, size_t le | | extern size_t my_lengthsp_8bit(const CHARSET_INFO *cs, const char *ptr, | |
| ngth); | | size_t length); | |
| | | | |
|
| extern uint my_instr_simple(struct charset_info_st *, | | extern uint my_instr_simple(const struct charset_info_st *, | |
| const char *b, size_t b_length, | | const char *b, size_t b_length, | |
| const char *s, size_t s_length, | | const char *s, size_t s_length, | |
| my_match_t *match, uint nmatch); | | my_match_t *match, uint nmatch); | |
| | | | |
| /* Functions for 8bit */ | | /* Functions for 8bit */ | |
|
| extern size_t my_caseup_str_8bit(CHARSET_INFO *, char *); | | extern size_t my_caseup_str_8bit(const CHARSET_INFO *, char *); | |
| extern size_t my_casedn_str_8bit(CHARSET_INFO *, char *); | | extern size_t my_casedn_str_8bit(const CHARSET_INFO *, char *); | |
| extern size_t my_caseup_8bit(CHARSET_INFO *, char *src, size_t srclen, | | extern size_t my_caseup_8bit(const CHARSET_INFO *, char *src, size_t srclen | |
| | | , | |
| char *dst, size_t dstlen); | | char *dst, size_t dstlen); | |
|
| extern size_t my_casedn_8bit(CHARSET_INFO *, char *src, size_t srclen, | | extern size_t my_casedn_8bit(const CHARSET_INFO *, char *src, size_t srclen
, | |
| char *dst, size_t dstlen); | | char *dst, size_t dstlen); | |
| | | | |
|
| extern int my_strcasecmp_8bit(CHARSET_INFO * cs, const char *, const char * | | extern int my_strcasecmp_8bit(const CHARSET_INFO * cs, const char *, | |
| ); | | const char *); | |
| | | | |
|
| int my_mb_wc_8bit(CHARSET_INFO *cs,my_wc_t *wc, const uchar *s,const uchar | | int my_mb_wc_8bit(const CHARSET_INFO *cs,my_wc_t *wc, const uchar *s, | |
| *e); | | const uchar *e); | |
| int my_wc_mb_8bit(CHARSET_INFO *cs,my_wc_t wc, uchar *s, uchar *e); | | int my_wc_mb_8bit(const CHARSET_INFO *cs,my_wc_t wc, uchar *s, uchar *e); | |
| | | | |
|
| int my_mb_ctype_8bit(CHARSET_INFO *,int *, const uchar *,const uchar *); | | int my_mb_ctype_8bit(const CHARSET_INFO *,int *, const uchar *,const uchar | |
| int my_mb_ctype_mb(CHARSET_INFO *,int *, const uchar *,const uchar *); | | *); | |
| | | int my_mb_ctype_mb(const CHARSET_INFO *,int *, const uchar *,const uchar *) | |
| | | ; | |
| | | | |
|
| size_t my_scan_8bit(CHARSET_INFO *cs, const char *b, const char *e, int sq) | | size_t my_scan_8bit(const CHARSET_INFO *cs, const char *b, const char *e, | |
| ; | | int sq); | |
| | | | |
|
| size_t my_snprintf_8bit(struct charset_info_st *, char *to, size_t n, | | size_t my_snprintf_8bit(const struct charset_info_st *, char *to, size_t n, | |
| const char *fmt, ...) | | const char *fmt, ...) | |
| ATTRIBUTE_FORMAT(printf, 4, 5); | | ATTRIBUTE_FORMAT(printf, 4, 5); | |
| | | | |
|
| long my_strntol_8bit(CHARSET_INFO *, const char *s, size_t l, int bas | | long my_strntol_8bit(const CHARSET_INFO *, const char *s, size_t l, | |
| e, | | int base, char **e, int *err); | |
| char **e, int *err); | | ulong my_strntoul_8bit(const CHARSET_INFO *, const char *s, size_t l, | |
| ulong my_strntoul_8bit(CHARSET_INFO *, const char *s, size_t l, int ba | | int base, char **e, int *err); | |
| se, | | longlong my_strntoll_8bit(const CHARSET_INFO *, const char *s, size_t l, | |
| char **e, int *err); | | int base, char **e, int *err); | |
| longlong my_strntoll_8bit(CHARSET_INFO *, const char *s, size_t l, int ba | | ulonglong my_strntoull_8bit(const CHARSET_INFO *, const char *s, size_t l, | |
| se, | | int base, char **e, int *err); | |
| char **e, int *err); | | double my_strntod_8bit(const CHARSET_INFO *, char *s, size_t l, char * | |
| ulonglong my_strntoull_8bit(CHARSET_INFO *, const char *s, size_t l, int ba | | *e, | |
| se, | | | |
| char **e, int *err); | | | |
| double my_strntod_8bit(CHARSET_INFO *, char *s, size_t l,char **e, | | | |
| int *err); | | int *err); | |
|
| size_t my_long10_to_str_8bit(CHARSET_INFO *, char *to, size_t l, int radix, | | size_t my_long10_to_str_8bit(const CHARSET_INFO *, char *to, size_t l, | |
| long int val); | | int radix, long int val); | |
| size_t my_longlong10_to_str_8bit(CHARSET_INFO *, char *to, size_t l, int ra | | size_t my_longlong10_to_str_8bit(const CHARSET_INFO *, char *to, size_t l, | |
| dix, | | int radix, longlong val); | |
| longlong val); | | | |
| | | | |
|
| longlong my_strtoll10_8bit(CHARSET_INFO *cs, | | longlong my_strtoll10_8bit(const CHARSET_INFO *cs, | |
| const char *nptr, char **endptr, int *error); | | const char *nptr, char **endptr, int *error); | |
|
| longlong my_strtoll10_ucs2(CHARSET_INFO *cs, | | longlong my_strtoll10_ucs2(const CHARSET_INFO *cs, | |
| const char *nptr, char **endptr, int *error); | | const char *nptr, char **endptr, int *error); | |
| | | | |
|
| ulonglong my_strntoull10rnd_8bit(CHARSET_INFO *cs, | | ulonglong my_strntoull10rnd_8bit(const CHARSET_INFO *cs, | |
| const char *str, size_t length, int | | const char *str, size_t length, int | |
| unsigned_fl, char **endptr, int *error); | | unsigned_fl, char **endptr, int *error); | |
|
| ulonglong my_strntoull10rnd_ucs2(CHARSET_INFO *cs, | | ulonglong my_strntoull10rnd_ucs2(const CHARSET_INFO *cs, | |
| const char *str, size_t length, | | const char *str, size_t length, | |
| int unsigned_fl, char **endptr, int *error
); | | int unsigned_fl, char **endptr, int *error
); | |
| | | | |
|
| void my_fill_8bit(CHARSET_INFO *cs, char* to, size_t l, int fill); | | void my_fill_8bit(const CHARSET_INFO *cs, char* to, size_t l, int fill); | |
| | | | |
| /* For 8-bit character set */ | | /* For 8-bit character set */ | |
|
| my_bool my_like_range_simple(CHARSET_INFO *cs, | | my_bool my_like_range_simple(const CHARSET_INFO *cs, | |
| const char *ptr, size_t ptr_length, | | const char *ptr, size_t ptr_length, | |
| pbool escape, pbool w_one, pbool w_many, | | pbool escape, pbool w_one, pbool w_many, | |
| size_t res_length, | | size_t res_length, | |
| char *min_str, char *max_str, | | char *min_str, char *max_str, | |
| size_t *min_length, size_t *max_length); | | size_t *min_length, size_t *max_length); | |
| | | | |
| /* For ASCII-based multi-byte character sets with mbminlen=1 */ | | /* For ASCII-based multi-byte character sets with mbminlen=1 */ | |
|
| my_bool my_like_range_mb(CHARSET_INFO *cs, | | my_bool my_like_range_mb(const CHARSET_INFO *cs, | |
| const char *ptr, size_t ptr_length, | | const char *ptr, size_t ptr_length, | |
| pbool escape, pbool w_one, pbool w_many, | | pbool escape, pbool w_one, pbool w_many, | |
| size_t res_length, | | size_t res_length, | |
| char *min_str, char *max_str, | | char *min_str, char *max_str, | |
| size_t *min_length, size_t *max_length); | | size_t *min_length, size_t *max_length); | |
| | | | |
| /* For other character sets, with arbitrary mbminlen and mbmaxlen numbers *
/ | | /* For other character sets, with arbitrary mbminlen and mbmaxlen numbers *
/ | |
|
| my_bool my_like_range_generic(CHARSET_INFO *cs, | | my_bool my_like_range_generic(const CHARSET_INFO *cs, | |
| const char *ptr, size_t ptr_length, | | const char *ptr, size_t ptr_length, | |
| pbool escape, pbool w_one, pbool w_many, | | pbool escape, pbool w_one, pbool w_many, | |
| size_t res_length, | | size_t res_length, | |
| char *min_str, char *max_str, | | char *min_str, char *max_str, | |
| size_t *min_length, size_t *max_length); | | size_t *min_length, size_t *max_length); | |
| | | | |
|
| int my_wildcmp_8bit(CHARSET_INFO *, | | int my_wildcmp_8bit(const CHARSET_INFO *, | |
| const char *str,const char *str_end, | | const char *str,const char *str_end, | |
| const char *wildstr,const char *wildend, | | const char *wildstr,const char *wildend, | |
| int escape, int w_one, int w_many); | | int escape, int w_one, int w_many); | |
| | | | |
|
| int my_wildcmp_bin(CHARSET_INFO *, | | int my_wildcmp_bin(const CHARSET_INFO *, | |
| const char *str,const char *str_end, | | const char *str,const char *str_end, | |
| const char *wildstr,const char *wildend, | | const char *wildstr,const char *wildend, | |
| int escape, int w_one, int w_many); | | int escape, int w_one, int w_many); | |
| | | | |
|
| size_t my_numchars_8bit(CHARSET_INFO *, const char *b, const char *e); | | size_t my_numchars_8bit(const CHARSET_INFO *, const char *b, const char *e) | |
| size_t my_numcells_8bit(CHARSET_INFO *, const char *b, const char *e); | | ; | |
| size_t my_charpos_8bit(CHARSET_INFO *, const char *b, const char *e, size_t | | size_t my_numcells_8bit(const CHARSET_INFO *, const char *b, const char *e) | |
| pos); | | ; | |
| size_t my_well_formed_len_8bit(CHARSET_INFO *, const char *b, const char *e | | size_t my_charpos_8bit(const CHARSET_INFO *, const char *b, const char *e, | |
| , | | size_t pos); | |
| size_t pos, int *error); | | size_t my_well_formed_len_8bit(const CHARSET_INFO *, const char *b, | |
| uint my_mbcharlen_8bit(CHARSET_INFO *, uint c); | | const char *e, size_t pos, int *error); | |
| | | uint my_mbcharlen_8bit(const CHARSET_INFO *, uint c); | |
| | | | |
| /* Functions for multibyte charsets */ | | /* Functions for multibyte charsets */ | |
|
| extern size_t my_caseup_str_mb(CHARSET_INFO *, char *); | | extern size_t my_caseup_str_mb(const CHARSET_INFO *, char *); | |
| extern size_t my_casedn_str_mb(CHARSET_INFO *, char *); | | extern size_t my_casedn_str_mb(const CHARSET_INFO *, char *); | |
| extern size_t my_caseup_mb(CHARSET_INFO *, char *src, size_t srclen, | | extern size_t my_caseup_mb(const CHARSET_INFO *, char *src, size_t srclen, | |
| char *dst, size_t dstlen); | | char *dst, size_t dstlen); | |
|
| extern size_t my_casedn_mb(CHARSET_INFO *, char *src, size_t srclen, | | extern size_t my_casedn_mb(const CHARSET_INFO *, char *src, size_t srclen, | |
| char *dst, size_t dstlen); | | char *dst, size_t dstlen); | |
|
| extern size_t my_caseup_mb_varlen(CHARSET_INFO *, char *src, size_t srclen, | | extern size_t my_caseup_mb_varlen(const CHARSET_INFO *, char *src, | |
| char *dst, size_t dstlen); | | size_t srclen, char *dst, size_t dstlen); | |
| extern size_t my_casedn_mb_varlen(CHARSET_INFO *, char *src, size_t srclen, | | extern size_t my_casedn_mb_varlen(const CHARSET_INFO *, char *src, | |
| char *dst, size_t dstlen); | | size_t srclen, char *dst, size_t dstlen); | |
| extern size_t my_caseup_ujis(CHARSET_INFO *, char *src, size_t srclen, | | extern size_t my_caseup_ujis(const CHARSET_INFO *, char *src, size_t srclen | |
| | | , | |
| char *dst, size_t dstlen); | | char *dst, size_t dstlen); | |
|
| extern size_t my_casedn_ujis(CHARSET_INFO *, char *src, size_t srclen, | | extern size_t my_casedn_ujis(const CHARSET_INFO *, char *src, size_t srclen
, | |
| char *dst, size_t dstlen); | | char *dst, size_t dstlen); | |
|
| extern int my_strcasecmp_mb(CHARSET_INFO * cs,const char *, const char *); | | extern int my_strcasecmp_mb(const CHARSET_INFO * cs,const char *, | |
| | | const char *); | |
| | | | |
|
| int my_wildcmp_mb(CHARSET_INFO *, | | int my_wildcmp_mb(const CHARSET_INFO *, | |
| const char *str,const char *str_end, | | const char *str,const char *str_end, | |
| const char *wildstr,const char *wildend, | | const char *wildstr,const char *wildend, | |
| int escape, int w_one, int w_many); | | int escape, int w_one, int w_many); | |
|
| size_t my_numchars_mb(CHARSET_INFO *, const char *b, const char *e); | | size_t my_numchars_mb(const CHARSET_INFO *, const char *b, const char *e); | |
| size_t my_numcells_mb(CHARSET_INFO *, const char *b, const char *e); | | size_t my_numcells_mb(const CHARSET_INFO *, const char *b, const char *e); | |
| size_t my_charpos_mb(CHARSET_INFO *, const char *b, const char *e, size_t p | | size_t my_charpos_mb(const CHARSET_INFO *, const char *b, const char *e, | |
| os); | | size_t pos); | |
| size_t my_well_formed_len_mb(CHARSET_INFO *, const char *b, const char *e, | | size_t my_well_formed_len_mb(const CHARSET_INFO *, const char *b, | |
| size_t pos, int *error); | | const char *e, size_t pos, int *error); | |
| uint my_instr_mb(struct charset_info_st *, | | uint my_instr_mb(const struct charset_info_st *, | |
| const char *b, size_t b_length, | | const char *b, size_t b_length, | |
| const char *s, size_t s_length, | | const char *s, size_t s_length, | |
| my_match_t *match, uint nmatch); | | my_match_t *match, uint nmatch); | |
| | | | |
|
| int my_strnncoll_mb_bin(CHARSET_INFO * cs, | | int my_strnncoll_mb_bin(const CHARSET_INFO * cs, | |
| const uchar *s, size_t slen, | | const uchar *s, size_t slen, | |
| const uchar *t, size_t tlen, | | const uchar *t, size_t tlen, | |
| my_bool t_is_prefix); | | my_bool t_is_prefix); | |
| | | | |
|
| int my_strnncollsp_mb_bin(CHARSET_INFO *cs, | | int my_strnncollsp_mb_bin(const CHARSET_INFO *cs, | |
| const uchar *a, size_t a_length, | | const uchar *a, size_t a_length, | |
| const uchar *b, size_t b_length, | | const uchar *b, size_t b_length, | |
| my_bool diff_if_only_endspace_difference); | | my_bool diff_if_only_endspace_difference); | |
| | | | |
|
| int my_wildcmp_mb_bin(CHARSET_INFO *cs, | | int my_wildcmp_mb_bin(const CHARSET_INFO *cs, | |
| const char *str,const char *str_end, | | const char *str,const char *str_end, | |
| const char *wildstr,const char *wildend, | | const char *wildstr,const char *wildend, | |
| int escape, int w_one, int w_many); | | int escape, int w_one, int w_many); | |
| | | | |
|
| int my_strcasecmp_mb_bin(CHARSET_INFO * cs __attribute__((unused)), | | int my_strcasecmp_mb_bin(const CHARSET_INFO * cs __attribute__((unused)), | |
| const char *s, const char *t); | | const char *s, const char *t); | |
| | | | |
|
| void my_hash_sort_mb_bin(CHARSET_INFO *cs __attribute__((unused)), | | void my_hash_sort_mb_bin(const CHARSET_INFO *cs __attribute__((unused)), | |
| const uchar *key, size_t len,ulong *nr1, ulong *nr
2); | | const uchar *key, size_t len,ulong *nr1, ulong *nr
2); | |
| | | | |
|
| size_t my_strnxfrm_unicode(CHARSET_INFO *, | | size_t my_strnxfrm_mb(const CHARSET_INFO *, | |
| uchar *dst, size_t dstlen, | | uchar *dst, size_t dstlen, uint nweights, | |
| const uchar *src, size_t srclen); | | const uchar *src, size_t srclen, uint flags); | |
| | | | |
| size_t my_strnxfrm_unicode_full_bin(CHARSET_INFO *, | | size_t my_strnxfrm_unicode(const CHARSET_INFO *, | |
| uchar *dst, size_t dstlen, | | uchar *dst, size_t dstlen, uint nweights, | |
| const uchar *src, size_t srclen); | | const uchar *src, size_t srclen, uint flags); | |
| size_t my_strnxfrmlen_unicode_full_bin(CHARSET_INFO *, size_t); | | | |
| | | size_t my_strnxfrm_unicode_full_bin(const CHARSET_INFO *, | |
| | | uchar *dst, size_t dstlen, uint nweight | |
| | | s, | |
| | | const uchar *src, size_t srclen, uint f | |
| | | lags); | |
| | | size_t my_strnxfrmlen_unicode_full_bin(const CHARSET_INFO *, size_t); | |
| | | | |
|
| int my_wildcmp_unicode(CHARSET_INFO *cs, | | int my_wildcmp_unicode(const CHARSET_INFO *cs, | |
| const char *str, const char *str_end, | | const char *str, const char *str_end, | |
| const char *wildstr, const char *wildend, | | const char *wildstr, const char *wildend, | |
| int escape, int w_one, int w_many, | | int escape, int w_one, int w_many, | |
|
| MY_UNICASE_INFO **weights); | | MY_UNICASE_INFO *weights); | |
| | | | |
|
| extern my_bool my_parse_charset_xml(const char *bug, size_t len, | | extern my_bool my_parse_charset_xml(MY_CHARSET_LOADER *loader, | |
| int (*add)(CHARSET_INFO *cs)); | | const char *buf, size_t buflen); | |
| extern char *my_strchr(CHARSET_INFO *cs, const char *str, const char *end, | | extern char *my_strchr(const CHARSET_INFO *cs, const char *str, | |
| pchar c); | | const char *end, pchar c); | |
| extern size_t my_strcspn(CHARSET_INFO *cs, const char *str, const char *end | | extern size_t my_strcspn(const CHARSET_INFO *cs, const char *str, | |
| , | | const char *end, const char *accept); | |
| const char *accept); | | | |
| | | my_bool my_propagate_simple(const CHARSET_INFO *cs, const uchar *str, | |
| my_bool my_propagate_simple(CHARSET_INFO *cs, const uchar *str, size_t len) | | size_t len); | |
| ; | | my_bool my_propagate_complex(const CHARSET_INFO *cs, const uchar *str, | |
| my_bool my_propagate_complex(CHARSET_INFO *cs, const uchar *str, size_t len | | size_t len); | |
| ); | | | |
| | | uint my_string_repertoire(const CHARSET_INFO *cs, const char *str, ulong le | |
| uint my_string_repertoire(CHARSET_INFO *cs, const char *str, ulong len); | | n); | |
| my_bool my_charset_is_ascii_based(CHARSET_INFO *cs); | | my_bool my_charset_is_ascii_based(const CHARSET_INFO *cs); | |
| my_bool my_charset_is_8bit_pure_ascii(CHARSET_INFO *cs); | | my_bool my_charset_is_8bit_pure_ascii(const CHARSET_INFO *cs); | |
| uint my_charset_repertoire(CHARSET_INFO *cs); | | uint my_charset_repertoire(const CHARSET_INFO *cs); | |
| | | | |
| | | uint my_strxfrm_flag_normalize(uint flags, uint nlevels); | |
| | | void my_strxfrm_desc_and_reverse(uchar *str, uchar *strend, | |
| | | uint flags, uint level); | |
| | | size_t my_strxfrm_pad_desc_and_reverse(const CHARSET_INFO *cs, | |
| | | uchar *str, uchar *frmend, uchar *st | |
| | | rend, | |
| | | uint nweights, uint flags, uint leve | |
| | | l); | |
| | | | |
|
| my_bool my_charset_is_ascii_compatible(CHARSET_INFO *cs); | | my_bool my_charset_is_ascii_compatible(const CHARSET_INFO *cs); | |
| | | | |
|
| extern size_t my_vsnprintf_ex(CHARSET_INFO *cs, char *to, size_t n, | | const MY_CONTRACTIONS *my_charset_get_contractions(const CHARSET_INFO *cs, | |
| | | int level); | |
| | | | |
| | | extern size_t my_vsnprintf_ex(const CHARSET_INFO *cs, char *to, size_t n, | |
| const char* fmt, va_list ap); | | const char* fmt, va_list ap); | |
| | | | |
|
| | | uint32 my_convert(char *to, uint32 to_length, const CHARSET_INFO *to_cs, | |
| | | const char *from, uint32 from_length, | |
| | | const CHARSET_INFO *from_cs, uint *errors); | |
| | | | |
| #define _MY_U 01 /* Upper case */ | | #define _MY_U 01 /* Upper case */ | |
| #define _MY_L 02 /* Lower case */ | | #define _MY_L 02 /* Lower case */ | |
| #define _MY_NMR 04 /* Numeral (digit) */ | | #define _MY_NMR 04 /* Numeral (digit) */ | |
| #define _MY_SPC 010 /* Spacing character */ | | #define _MY_SPC 010 /* Spacing character */ | |
| #define _MY_PNT 020 /* Punctuation */ | | #define _MY_PNT 020 /* Punctuation */ | |
| #define _MY_CTR 040 /* Control character */ | | #define _MY_CTR 040 /* Control character */ | |
| #define _MY_B 0100 /* Blank */ | | #define _MY_B 0100 /* Blank */ | |
| #define _MY_X 0200 /* heXadecimal digit */ | | #define _MY_X 0200 /* heXadecimal digit */ | |
| | | | |
| #define my_isascii(c) (!((c) & ~0177)) | | #define my_isascii(c) (!((c) & ~0177)) | |
| | | | |
| skipping to change at line 615 | | skipping to change at line 735 | |
| #define my_isprint(s, c) (((s)->ctype+1)[(uchar) (c)] & (_MY_PNT |
_MY_U | _MY_L | _MY_NMR | _MY_B)) | | #define my_isprint(s, c) (((s)->ctype+1)[(uchar) (c)] & (_MY_PNT |
_MY_U | _MY_L | _MY_NMR | _MY_B)) | |
| #define my_isgraph(s, c) (((s)->ctype+1)[(uchar) (c)] & (_MY_PNT |
_MY_U | _MY_L | _MY_NMR)) | | #define my_isgraph(s, c) (((s)->ctype+1)[(uchar) (c)] & (_MY_PNT |
_MY_U | _MY_L | _MY_NMR)) | |
| #define my_iscntrl(s, c) (((s)->ctype+1)[(uchar) (c)] & _MY_CTR) | | #define my_iscntrl(s, c) (((s)->ctype+1)[(uchar) (c)] & _MY_CTR) | |
| | | | |
| /* Some macros that should be cleaned up a little */ | | /* Some macros that should be cleaned up a little */ | |
| #define my_isvar(s,c) (my_isalnum(s,c) || (c) == '_') | | #define my_isvar(s,c) (my_isalnum(s,c) || (c) == '_') | |
| #define my_isvar_start(s,c) (my_isalpha(s,c) || (c) == '_') | | #define my_isvar_start(s,c) (my_isalpha(s,c) || (c) == '_') | |
| | | | |
| #define my_binary_compare(s) ((s)->state & MY_CS_BINSORT) | | #define my_binary_compare(s) ((s)->state & MY_CS_BINSORT) | |
| #define use_strnxfrm(s) ((s)->state & MY_CS_STRNXFRM) | | #define use_strnxfrm(s) ((s)->state & MY_CS_STRNXFRM) | |
|
| #define my_strnxfrm(s, a, b, c, d) ((s)->coll->strnxfrm((s), (a), (b), ( | | #define my_strnxfrm(cs, d, dl, s, sl) \ | |
| c), (d))) | | ((cs)->coll->strnxfrm((cs), (d), (dl), (dl), (s), (sl), MY_STRXFRM_PAD_W | |
| | | ITH_SPACE)) | |
| #define my_strnncoll(s, a, b, c, d) ((s)->coll->strnncoll((s), (a), (b), (c
), (d), 0)) | | #define my_strnncoll(s, a, b, c, d) ((s)->coll->strnncoll((s), (a), (b), (c
), (d), 0)) | |
| #define my_like_range(s, a, b, c, d, e, f, g, h, i, j) \ | | #define my_like_range(s, a, b, c, d, e, f, g, h, i, j) \ | |
| ((s)->coll->like_range((s), (a), (b), (c), (d), (e), (f), (g), (h), (i),
(j))) | | ((s)->coll->like_range((s), (a), (b), (c), (d), (e), (f), (g), (h), (i),
(j))) | |
| #define my_wildcmp(cs,s,se,w,we,e,o,m) ((cs)->coll->wildcmp((cs),(s),(se),(
w),(we),(e),(o),(m))) | | #define my_wildcmp(cs,s,se,w,we,e,o,m) ((cs)->coll->wildcmp((cs),(s),(se),(
w),(we),(e),(o),(m))) | |
| #define my_strcasecmp(s, a, b) ((s)->coll->strcasecmp((s), (a), (b))
) | | #define my_strcasecmp(s, a, b) ((s)->coll->strcasecmp((s), (a), (b))
) | |
| #define my_charpos(cs, b, e, num) (cs)->cset->charpos((cs), (const char
*) (b), (const char *)(e), (num)) | | #define my_charpos(cs, b, e, num) (cs)->cset->charpos((cs), (const char
*) (b), (const char *)(e), (num)) | |
| | | | |
| #define use_mb(s) ((s)->cset->ismbchar != NULL) | | #define use_mb(s) ((s)->cset->ismbchar != NULL) | |
| #define my_ismbchar(s, a, b) ((s)->cset->ismbchar((s), (a), (b))) | | #define my_ismbchar(s, a, b) ((s)->cset->ismbchar((s), (a), (b))) | |
| #ifdef USE_MB | | #ifdef USE_MB | |
| | | | |
End of changes. 81 change blocks. |
| 206 lines changed or deleted | | 342 lines changed or added | |
|
| my_global.h | | my_global.h | |
| /* | | /* | |
|
| Copyright (c) 2001, 2013, Oracle and/or its affiliates. All rights reser
ved. | | Copyright (c) 2001, 2012, Oracle and/or its affiliates. All rights reser
ved. | |
| | | | |
| This program is free software; you can redistribute it and/or modify | | This program is free software; you can redistribute it and/or modify | |
| it under the terms of the GNU General Public License as published by | | it under the terms of the GNU General Public License as published by | |
| the Free Software Foundation; version 2 of the License. | | the Free Software Foundation; version 2 of the License. | |
| | | | |
| This program is distributed in the hope that it will be useful, | | This program is distributed in the hope that it will be useful, | |
| but WITHOUT ANY WARRANTY; without even the implied warranty of | | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
| GNU General Public License for more details. | | GNU General Public License for more details. | |
| | | | |
| You should have received a copy of the GNU General Public License | | You should have received a copy of the GNU General Public License | |
| along with this program; if not, write to the Free Software | | along with this program; if not, write to the Free Software | |
|
| Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-130
1, USA */ | | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 US
A */ | |
| | | | |
|
| /* This is the include file that should be included 'first' in every C file | | #ifndef MY_GLOBAL_INCLUDED | |
| . */ | | #define MY_GLOBAL_INCLUDED | |
| | | | |
|
| #ifndef _global_h | | /* This is the include file that should be included 'first' in every C file | |
| #define _global_h | | . */ | |
| | | | |
| /* Client library users on Windows need this macro defined here. */ | | /* Client library users on Windows need this macro defined here. */ | |
| #if !defined(__WIN__) && defined(_WIN32) | | #if !defined(__WIN__) && defined(_WIN32) | |
| #define __WIN__ | | #define __WIN__ | |
| #endif | | #endif | |
| | | | |
| /* | | /* | |
| InnoDB depends on some MySQL internals which other plugins should not | | InnoDB depends on some MySQL internals which other plugins should not | |
| need. This is because of InnoDB's foreign key support, "safe" binlog | | need. This is because of InnoDB's foreign key support, "safe" binlog | |
| truncation, and other similar legacy features. | | truncation, and other similar legacy features. | |
| | | | |
| skipping to change at line 50 | | skipping to change at line 50 | |
| #undef WIN | | #undef WIN | |
| #undef WIN32 | | #undef WIN32 | |
| #undef _WIN | | #undef _WIN | |
| #undef _WIN32 | | #undef _WIN32 | |
| #undef _WIN64 | | #undef _WIN64 | |
| #undef __WIN__ | | #undef __WIN__ | |
| #undef __WIN32__ | | #undef __WIN32__ | |
| #define HAVE_ERRNO_AS_DEFINE | | #define HAVE_ERRNO_AS_DEFINE | |
| #endif /* __CYGWIN__ */ | | #endif /* __CYGWIN__ */ | |
| | | | |
|
| /* to make command line shorter we'll define USE_PRAGMA_INTERFACE here */ | | | |
| #ifdef USE_PRAGMA_IMPLEMENTATION | | | |
| #define USE_PRAGMA_INTERFACE | | | |
| #endif | | | |
| | | | |
| #if defined(__OpenBSD__) && (OpenBSD >= 200411) | | #if defined(__OpenBSD__) && (OpenBSD >= 200411) | |
| #define HAVE_ERRNO_AS_DEFINE | | #define HAVE_ERRNO_AS_DEFINE | |
| #endif | | #endif | |
| | | | |
| #if defined(i386) && !defined(__i386__) | | #if defined(i386) && !defined(__i386__) | |
| #define __i386__ | | #define __i386__ | |
| #endif | | #endif | |
| | | | |
| /* Macros to make switching between C and C++ mode easier */ | | /* Macros to make switching between C and C++ mode easier */ | |
| #ifdef __cplusplus | | #ifdef __cplusplus | |
| | | | |
| skipping to change at line 135 | | skipping to change at line 130 | |
| #include <winsock2.h> | | #include <winsock2.h> | |
| #include <ws2tcpip.h> /* SOCKET */ | | #include <ws2tcpip.h> /* SOCKET */ | |
| #include <io.h> /* access(), chmod() */ | | #include <io.h> /* access(), chmod() */ | |
| #include <process.h> /* getpid() */ | | #include <process.h> /* getpid() */ | |
| | | | |
| #define sleep(a) Sleep((a)*1000) | | #define sleep(a) Sleep((a)*1000) | |
| | | | |
| /* Define missing access() modes. */ | | /* Define missing access() modes. */ | |
| #define F_OK 0 | | #define F_OK 0 | |
| #define W_OK 2 | | #define W_OK 2 | |
|
| | | #define R_OK 4 /* Test for read permission. */ | |
| | | | |
| /* Define missing file locking constants. */ | | /* Define missing file locking constants. */ | |
| #define F_RDLCK 1 | | #define F_RDLCK 1 | |
| #define F_WRLCK 2 | | #define F_WRLCK 2 | |
| #define F_UNLCK 3 | | #define F_UNLCK 3 | |
| #define F_TO_EOF 0x3FFFFFFF | | #define F_TO_EOF 0x3FFFFFFF | |
| | | | |
| /* Shared memory and named pipe connections are supported. */ | | /* Shared memory and named pipe connections are supported. */ | |
| #define HAVE_SMEM 1 | | #define HAVE_SMEM 1 | |
| #define HAVE_NAMED_PIPE 1 | | #define HAVE_NAMED_PIPE 1 | |
| | | | |
| skipping to change at line 307 | | skipping to change at line 303 | |
| installing the kernel patch PHKL_20349 or greater | | installing the kernel patch PHKL_20349 or greater | |
| */ | | */ | |
| #undef HAVE_PREAD | | #undef HAVE_PREAD | |
| #undef HAVE_PWRITE | | #undef HAVE_PWRITE | |
| #endif | | #endif | |
| | | | |
| #ifdef UNDEF_HAVE_INITGROUPS /* For AIX 4.3 */ | | #ifdef UNDEF_HAVE_INITGROUPS /* For AIX 4.3 */ | |
| #undef HAVE_INITGROUPS | | #undef HAVE_INITGROUPS | |
| #endif | | #endif | |
| | | | |
|
| /* gcc/egcs issues */ | | | |
| | | | |
| #if defined(__GNUC) && defined(__EXCEPTIONS) | | | |
| #error "Please add -fno-exceptions to CXXFLAGS and reconfigure/recompile" | | | |
| #endif | | | |
| | | | |
| #if defined(_lint) && !defined(lint) | | #if defined(_lint) && !defined(lint) | |
| #define lint | | #define lint | |
| #endif | | #endif | |
| #if SIZEOF_LONG_LONG > 4 && !defined(_LONG_LONG) | | #if SIZEOF_LONG_LONG > 4 && !defined(_LONG_LONG) | |
| #define _LONG_LONG 1 /* For AIX string library */ | | #define _LONG_LONG 1 /* For AIX string library */ | |
| #endif | | #endif | |
| | | | |
| #ifndef stdin | | #ifndef stdin | |
| #include <stdio.h> | | #include <stdio.h> | |
| #endif | | #endif | |
| | | | |
| skipping to change at line 386 | | skipping to change at line 376 | |
| #endif | | #endif | |
| | | | |
| /* | | /* | |
| A lot of our programs uses asserts, so better to always include it | | A lot of our programs uses asserts, so better to always include it | |
| This also fixes a problem when people uses DBUG_ASSERT without including | | This also fixes a problem when people uses DBUG_ASSERT without including | |
| assert.h | | assert.h | |
| */ | | */ | |
| #include <assert.h> | | #include <assert.h> | |
| | | | |
| /* an assert that works at compile-time. only for constant expression */ | | /* an assert that works at compile-time. only for constant expression */ | |
|
| #ifndef __GNUC__ | | #ifdef _some_old_compiler_that_does_not_understand_the_construct_below_ | |
| #define compile_time_assert(X) do { } while(0) | | #define compile_time_assert(X) do { } while(0) | |
| #else | | #else | |
| #define compile_time_assert(X) \ | | #define compile_time_assert(X) \ | |
| do \ | | do \ | |
| { \ | | { \ | |
|
| typedef char compile_time_assert[(X) ? 1 : -1] __attribute__((unused));
\ | | typedef char compile_time_assert[(X) ? 1 : -1]; \ | |
| } while(0) | | } while(0) | |
| #endif | | #endif | |
| | | | |
| /* Go around some bugs in different OS and compilers */ | | /* Go around some bugs in different OS and compilers */ | |
| #if defined (HPUX11) && defined(_LARGEFILE_SOURCE) | | #if defined (HPUX11) && defined(_LARGEFILE_SOURCE) | |
| #ifndef _LARGEFILE64_SOURCE | | #ifndef _LARGEFILE64_SOURCE | |
| #define _LARGEFILE64_SOURCE | | #define _LARGEFILE64_SOURCE | |
| #endif | | #endif | |
| #endif | | #endif | |
| | | | |
| | | | |
| skipping to change at line 490 | | skipping to change at line 480 | |
| #define array_elements(A) ((uint) (sizeof(A)/sizeof(A[0]))) | | #define array_elements(A) ((uint) (sizeof(A)/sizeof(A[0]))) | |
| | | | |
| /* Define some general constants */ | | /* Define some general constants */ | |
| #ifndef TRUE | | #ifndef TRUE | |
| #define TRUE (1) /* Logical true */ | | #define TRUE (1) /* Logical true */ | |
| #define FALSE (0) /* Logical false */ | | #define FALSE (0) /* Logical false */ | |
| #endif | | #endif | |
| | | | |
| #include <my_compiler.h> | | #include <my_compiler.h> | |
| | | | |
|
| /* | | | |
| Wen using the embedded library, users might run into link problems, | | | |
| duplicate declaration of __cxa_pure_virtual, solved by declaring it a | | | |
| weak symbol. | | | |
| */ | | | |
| #if defined(USE_MYSYS_NEW) && ! defined(DONT_DECLARE_CXA_PURE_VIRTUAL) | | | |
| C_MODE_START | | | |
| int __cxa_pure_virtual () __attribute__ ((weak)); | | | |
| C_MODE_END | | | |
| #endif | | | |
| | | | |
| /* The DBUG_ON flag always takes precedence over default DBUG_OFF */ | | /* The DBUG_ON flag always takes precedence over default DBUG_OFF */ | |
| #if defined(DBUG_ON) && defined(DBUG_OFF) | | #if defined(DBUG_ON) && defined(DBUG_OFF) | |
| #undef DBUG_OFF | | #undef DBUG_OFF | |
| #endif | | #endif | |
| | | | |
| /* We might be forced to turn debug off, if not turned off already */ | | /* We might be forced to turn debug off, if not turned off already */ | |
| #if (defined(FORCE_DBUG_OFF) || defined(_lint)) && !defined(DBUG_OFF) | | #if (defined(FORCE_DBUG_OFF) || defined(_lint)) && !defined(DBUG_OFF) | |
| # define DBUG_OFF | | # define DBUG_OFF | |
| # ifdef DBUG_ON | | # ifdef DBUG_ON | |
| # undef DBUG_ON | | # undef DBUG_ON | |
| | | | |
| skipping to change at line 543 | | skipping to change at line 522 | |
| typedef float pfloat; /* Mixed prototypes can take float */ | | typedef float pfloat; /* Mixed prototypes can take float */ | |
| #else | | #else | |
| typedef int pchar; /* Mixed prototypes can't take char */ | | typedef int pchar; /* Mixed prototypes can't take char */ | |
| typedef uint puchar; /* Mixed prototypes can't take char */ | | typedef uint puchar; /* Mixed prototypes can't take char */ | |
| typedef int pbool; /* Mixed prototypes can't take char */ | | typedef int pbool; /* Mixed prototypes can't take char */ | |
| typedef int pshort; /* Mixed prototypes can't take short int */ | | typedef int pshort; /* Mixed prototypes can't take short int */ | |
| typedef double pfloat; /* Mixed prototypes can't take float */ | | typedef double pfloat; /* Mixed prototypes can't take float */ | |
| #endif | | #endif | |
| C_MODE_START | | C_MODE_START | |
| typedef int (*qsort_cmp)(const void *,const void *); | | typedef int (*qsort_cmp)(const void *,const void *); | |
|
| typedef int (*qsort_cmp2)(void*, const void *,const void *); | | typedef int (*qsort_cmp2)(const void*, const void *,const void *); | |
| C_MODE_END | | C_MODE_END | |
| #define qsort_t RETQSORTTYPE /* Broken GCC cant handle typedef !!!! */ | | #define qsort_t RETQSORTTYPE /* Broken GCC cant handle typedef !!!! */ | |
| #ifdef HAVE_SYS_SOCKET_H | | #ifdef HAVE_SYS_SOCKET_H | |
| #include <sys/socket.h> | | #include <sys/socket.h> | |
| #endif | | #endif | |
| typedef SOCKET_SIZE_TYPE size_socket; | | typedef SOCKET_SIZE_TYPE size_socket; | |
| | | | |
| #ifndef SOCKOPT_OPTLEN_TYPE | | #ifndef SOCKOPT_OPTLEN_TYPE | |
| #define SOCKOPT_OPTLEN_TYPE size_socket | | #define SOCKOPT_OPTLEN_TYPE size_socket | |
| #endif | | #endif | |
| | | | |
| skipping to change at line 795 | | skipping to change at line 774 | |
| #endif | | #endif | |
| | | | |
| #ifndef isfinite | | #ifndef isfinite | |
| #ifdef HAVE_FINITE | | #ifdef HAVE_FINITE | |
| #define isfinite(x) finite(x) | | #define isfinite(x) finite(x) | |
| #else | | #else | |
| #define finite(x) (1.0 / fabs(x) > 0.0) | | #define finite(x) (1.0 / fabs(x) > 0.0) | |
| #endif /* HAVE_FINITE */ | | #endif /* HAVE_FINITE */ | |
| #endif /* isfinite */ | | #endif /* isfinite */ | |
| | | | |
|
| | | #include <math.h> | |
| #ifndef HAVE_ISNAN | | #ifndef HAVE_ISNAN | |
| #define isnan(x) ((x) != (x)) | | #define isnan(x) ((x) != (x)) | |
| #endif | | #endif | |
|
| | | C_MODE_START | |
| | | extern double my_double_isnan(double x); | |
| | | C_MODE_END | |
| | | | |
| #ifdef HAVE_ISINF | | #ifdef HAVE_ISINF | |
| /* Check if C compiler is affected by GCC bug #39228 */ | | /* Check if C compiler is affected by GCC bug #39228 */ | |
| #if !defined(__cplusplus) && defined(HAVE_BROKEN_ISINF) | | #if !defined(__cplusplus) && defined(HAVE_BROKEN_ISINF) | |
| /* Force store/reload of the argument to/from a 64-bit double */ | | /* Force store/reload of the argument to/from a 64-bit double */ | |
| static inline double my_isinf(double x) | | static inline double my_isinf(double x) | |
| { | | { | |
| volatile double t= x; | | volatile double t= x; | |
| return isinf(t); | | return isinf(t); | |
| } | | } | |
| | | | |
| skipping to change at line 973 | | skipping to change at line 956 | |
| /* | | /* | |
| TODO Convert these to use Bitmap class. | | TODO Convert these to use Bitmap class. | |
| */ | | */ | |
| typedef ulonglong table_map; /* Used for table bits in join */ | | typedef ulonglong table_map; /* Used for table bits in join */ | |
| typedef ulong nesting_map; /* Used for flags of nesting constructs */ | | typedef ulong nesting_map; /* Used for flags of nesting constructs */ | |
| | | | |
| #if defined(__WIN__) | | #if defined(__WIN__) | |
| #define socket_errno WSAGetLastError() | | #define socket_errno WSAGetLastError() | |
| #define SOCKET_EINTR WSAEINTR | | #define SOCKET_EINTR WSAEINTR | |
| #define SOCKET_EAGAIN WSAEINPROGRESS | | #define SOCKET_EAGAIN WSAEINPROGRESS | |
|
| #define SOCKET_ETIMEDOUT WSAETIMEDOUT | | | |
| #define SOCKET_EWOULDBLOCK WSAEWOULDBLOCK | | #define SOCKET_EWOULDBLOCK WSAEWOULDBLOCK | |
| #define SOCKET_EADDRINUSE WSAEADDRINUSE | | #define SOCKET_EADDRINUSE WSAEADDRINUSE | |
|
| | | #define SOCKET_ETIMEDOUT WSAETIMEDOUT | |
| | | #define SOCKET_ECONNRESET WSAECONNRESET | |
| #define SOCKET_ENFILE ENFILE | | #define SOCKET_ENFILE ENFILE | |
| #define SOCKET_EMFILE EMFILE | | #define SOCKET_EMFILE EMFILE | |
| #else /* Unix */ | | #else /* Unix */ | |
| #define socket_errno errno | | #define socket_errno errno | |
| #define closesocket(A) close(A) | | #define closesocket(A) close(A) | |
| #define SOCKET_EINTR EINTR | | #define SOCKET_EINTR EINTR | |
| #define SOCKET_EAGAIN EAGAIN | | #define SOCKET_EAGAIN EAGAIN | |
|
| #define SOCKET_ETIMEDOUT SOCKET_EINTR | | | |
| #define SOCKET_EWOULDBLOCK EWOULDBLOCK | | #define SOCKET_EWOULDBLOCK EWOULDBLOCK | |
| #define SOCKET_EADDRINUSE EADDRINUSE | | #define SOCKET_EADDRINUSE EADDRINUSE | |
|
| | | #define SOCKET_ETIMEDOUT ETIMEDOUT | |
| | | #define SOCKET_ECONNRESET ECONNRESET | |
| #define SOCKET_ENFILE ENFILE | | #define SOCKET_ENFILE ENFILE | |
| #define SOCKET_EMFILE EMFILE | | #define SOCKET_EMFILE EMFILE | |
| #endif | | #endif | |
| | | | |
| typedef int myf; /* Type of MyFlags in my_funcs */ | | typedef int myf; /* Type of MyFlags in my_funcs */ | |
| typedef char my_bool; /* Small bool */ | | typedef char my_bool; /* Small bool */ | |
| | | | |
| /* Macros for converting *constants* to the right type */ | | /* Macros for converting *constants* to the right type */ | |
| #define MYF(v) (myf) (v) | | #define MYF(v) (myf) (v) | |
| | | | |
| | | | |
| skipping to change at line 1043 | | skipping to change at line 1028 | |
| #endif | | #endif | |
| | | | |
| #include <my_dbug.h> | | #include <my_dbug.h> | |
| | | | |
| /* Some helper macros */ | | /* Some helper macros */ | |
| #define YESNO(X) ((X) ? "yes" : "no") | | #define YESNO(X) ((X) ? "yes" : "no") | |
| | | | |
| #define MY_HOW_OFTEN_TO_ALARM 2 /* How often we want info on screen
*/ | | #define MY_HOW_OFTEN_TO_ALARM 2 /* How often we want info on screen
*/ | |
| #define MY_HOW_OFTEN_TO_WRITE 1000 /* How often we want info on screen
*/ | | #define MY_HOW_OFTEN_TO_WRITE 1000 /* How often we want info on screen
*/ | |
| | | | |
|
| /* | | #include <my_byteorder.h> | |
| Define-funktions for reading and storing in machine independent format | | | |
| (low byte first) | | | |
| */ | | | |
| | | | |
| /* Optimized store functions for Intel x86 */ | | | |
| #if defined(__i386__) || defined(_WIN32) | | | |
| #define sint2korr(A) (*((int16 *) (A))) | | | |
| #define sint3korr(A) ((int32) ((((uchar) (A)[2]) & 128) ? \ | | | |
| (((uint32) 255L << 24) | \ | | | |
| (((uint32) (uchar) (A)[2]) << 16) |\ | | | |
| (((uint32) (uchar) (A)[1]) << 8) | \ | | | |
| ((uint32) (uchar) (A)[0])) : \ | | | |
| (((uint32) (uchar) (A)[2]) << 16) |\ | | | |
| (((uint32) (uchar) (A)[1]) << 8) | \ | | | |
| ((uint32) (uchar) (A)[0]))) | | | |
| #define sint4korr(A) (*((long *) (A))) | | | |
| #define uint2korr(A) (*((uint16 *) (A))) | | | |
| #if defined(HAVE_purify) && !defined(_WIN32) | | | |
| #define uint3korr(A) (uint32) (((uint32) ((uchar) (A)[0])) +\ | | | |
| (((uint32) ((uchar) (A)[1])) << 8) +\ | | | |
| (((uint32) ((uchar) (A)[2])) << 16)) | | | |
| #else | | | |
| /* | | | |
| ATTENTION ! | | | |
| | | | |
| Please, note, uint3korr reads 4 bytes (not 3) ! | | | |
| It means, that you have to provide enough allocated space ! | | | |
| */ | | | |
| #define uint3korr(A) (long) (*((unsigned int *) (A)) & 0xFFFFFF) | | | |
| #endif /* HAVE_purify && !_WIN32 */ | | | |
| #define uint4korr(A) (*((uint32 *) (A))) | | | |
| #define uint5korr(A) ((ulonglong)(((uint32) ((uchar) (A)[0])) +\ | | | |
| (((uint32) ((uchar) (A)[1])) << 8) +\ | | | |
| (((uint32) ((uchar) (A)[2])) << 16) +\ | | | |
| (((uint32) ((uchar) (A)[3])) << 24)) +\ | | | |
| (((ulonglong) ((uchar) (A)[4])) << 32)) | | | |
| #define uint6korr(A) ((ulonglong)(((uint32) ((uchar) (A)[0])) | | | |
| + \ | | | |
| (((uint32) ((uchar) (A)[1])) << 8) | | | |
| + \ | | | |
| (((uint32) ((uchar) (A)[2])) << 16) | | | |
| + \ | | | |
| (((uint32) ((uchar) (A)[3])) << 24) | | | |
| ) + \ | | | |
| (((ulonglong) ((uchar) (A)[4])) << 32) + \ | | | |
| (((ulonglong) ((uchar) (A)[5])) << 40)) | | | |
| #define uint8korr(A) (*((ulonglong *) (A))) | | | |
| #define sint8korr(A) (*((longlong *) (A))) | | | |
| #define int2store(T,A) *((uint16*) (T))= (uint16) (A) | | | |
| #define int3store(T,A) do { *(T)= (uchar) ((A));\ | | | |
| *(T+1)=(uchar) (((uint) (A) >> 8));\ | | | |
| *(T+2)=(uchar) (((A) >> 16)); } while (0) | | | |
| #define int4store(T,A) *((long *) (T))= (long) (A) | | | |
| #define int5store(T,A) do { *(T)= (uchar)((A));\ | | | |
| *((T)+1)=(uchar) (((A) >> 8));\ | | | |
| *((T)+2)=(uchar) (((A) >> 16));\ | | | |
| *((T)+3)=(uchar) (((A) >> 24)); \ | | | |
| *((T)+4)=(uchar) (((A) >> 32)); } while(0) | | | |
| #define int6store(T,A) do { *(T)= (uchar)((A)); \ | | | |
| *((T)+1)=(uchar) (((A) >> 8)); \ | | | |
| *((T)+2)=(uchar) (((A) >> 16)); \ | | | |
| *((T)+3)=(uchar) (((A) >> 24)); \ | | | |
| *((T)+4)=(uchar) (((A) >> 32)); \ | | | |
| *((T)+5)=(uchar) (((A) >> 40)); } while(0) | | | |
| #define int8store(T,A) *((ulonglong *) (T))= (ulonglong) (A) | | | |
| | | | |
| typedef union { | | | |
| double v; | | | |
| long m[2]; | | | |
| } doubleget_union; | | | |
| #define doubleget(V,M) \ | | | |
| do { doubleget_union _tmp; \ | | | |
| _tmp.m[0] = *((long*)(M)); \ | | | |
| _tmp.m[1] = *(((long*) (M))+1); \ | | | |
| (V) = _tmp.v; } while(0) | | | |
| #define doublestore(T,V) do { *((long *) T) = ((doubleget_union *)&V)->m[0] | | | |
| ; \ | | | |
| *(((long *) T)+1) = ((doubleget_union *)&V)->m[ | | | |
| 1]; \ | | | |
| } while (0) | | | |
| #define float4get(V,M) do { *((float *) &(V)) = *((float*) (M)); } while( | | | |
| 0) | | | |
| #define float8get(V,M) doubleget((V),(M)) | | | |
| #define float4store(V,M) memcpy((uchar*) V,(uchar*) (&M),sizeof(float)) | | | |
| #define floatstore(T,V) memcpy((uchar*)(T), (uchar*)(&V),sizeof(float)) | | | |
| #define floatget(V,M) memcpy((uchar*) &V,(uchar*) (M),sizeof(float)) | | | |
| #define float8store(V,M) doublestore((V),(M)) | | | |
| #else | | | |
| | | | |
| /* | | | |
| We're here if it's not a IA-32 architecture (Win32 and UNIX IA-32 defines | | | |
| were done before) | | | |
| */ | | | |
| #define sint2korr(A) (int16) (((int16) ((uchar) (A)[0])) +\ | | | |
| ((int16) ((int16) (A)[1]) << 8)) | | | |
| #define sint3korr(A) ((int32) ((((uchar) (A)[2]) & 128) ? \ | | | |
| (((uint32) 255L << 24) | \ | | | |
| (((uint32) (uchar) (A)[2]) << 16) |\ | | | |
| (((uint32) (uchar) (A)[1]) << 8) | \ | | | |
| ((uint32) (uchar) (A)[0])) : \ | | | |
| (((uint32) (uchar) (A)[2]) << 16) |\ | | | |
| (((uint32) (uchar) (A)[1]) << 8) | \ | | | |
| ((uint32) (uchar) (A)[0]))) | | | |
| #define sint4korr(A) (int32) (((int32) ((uchar) (A)[0])) +\ | | | |
| (((int32) ((uchar) (A)[1]) << 8)) +\ | | | |
| (((int32) ((uchar) (A)[2]) << 16)) +\ | | | |
| (((int32) ((int16) (A)[3]) << 24))) | | | |
| #define sint8korr(A) (longlong) uint8korr(A) | | | |
| #define uint2korr(A) (uint16) (((uint16) ((uchar) (A)[0])) +\ | | | |
| ((uint16) ((uchar) (A)[1]) << 8)) | | | |
| #define uint3korr(A) (uint32) (((uint32) ((uchar) (A)[0])) +\ | | | |
| (((uint32) ((uchar) (A)[1])) << 8) +\ | | | |
| (((uint32) ((uchar) (A)[2])) << 16)) | | | |
| #define uint4korr(A) (uint32) (((uint32) ((uchar) (A)[0])) +\ | | | |
| (((uint32) ((uchar) (A)[1])) << 8) +\ | | | |
| (((uint32) ((uchar) (A)[2])) << 16) +\ | | | |
| (((uint32) ((uchar) (A)[3])) << 24)) | | | |
| #define uint5korr(A) ((ulonglong)(((uint32) ((uchar) (A)[0])) +\ | | | |
| (((uint32) ((uchar) (A)[1])) << 8) +\ | | | |
| (((uint32) ((uchar) (A)[2])) << 16) +\ | | | |
| (((uint32) ((uchar) (A)[3])) << 24)) +\ | | | |
| (((ulonglong) ((uchar) (A)[4])) << 32)) | | | |
| #define uint6korr(A) ((ulonglong)(((uint32) ((uchar) (A)[0])) | | | |
| + \ | | | |
| (((uint32) ((uchar) (A)[1])) << 8) | | | |
| + \ | | | |
| (((uint32) ((uchar) (A)[2])) << 16) | | | |
| + \ | | | |
| (((uint32) ((uchar) (A)[3])) << 24) | | | |
| ) + \ | | | |
| (((ulonglong) ((uchar) (A)[4])) << 32) + \ | | | |
| (((ulonglong) ((uchar) (A)[5])) << 40)) | | | |
| #define uint8korr(A) ((ulonglong)(((uint32) ((uchar) (A)[0])) +\ | | | |
| (((uint32) ((uchar) (A)[1])) << 8) +\ | | | |
| (((uint32) ((uchar) (A)[2])) << 16) +\ | | | |
| (((uint32) ((uchar) (A)[3])) << 24)) +\ | | | |
| (((ulonglong) (((uint32) ((uchar) (A)[4])) +\ | | | |
| (((uint32) ((uchar) (A)[5])) << 8) +\ | | | |
| (((uint32) ((uchar) (A)[6])) << 16) +\ | | | |
| (((uint32) ((uchar) (A)[7])) << 24))) << | | | |
| \ | | | |
| 32)) | | | |
| #define int2store(T,A) do { uint def_temp= (uint) (A) ;\ | | | |
| *((uchar*) (T))= (uchar)(def_temp); \ | | | |
| *((uchar*) (T)+1)=(uchar)((def_temp >> 8 | | | |
| )); \ | | | |
| } while(0) | | | |
| #define int3store(T,A) do { /*lint -save -e734 */\ | | | |
| *((uchar*)(T))=(uchar) ((A));\ | | | |
| *((uchar*) (T)+1)=(uchar) (((A) >> 8));\ | | | |
| *((uchar*)(T)+2)=(uchar) (((A) >> 16)); \ | | | |
| /*lint -restore */} while(0) | | | |
| #define int4store(T,A) do { *((char *)(T))=(char) ((A));\ | | | |
| *(((char *)(T))+1)=(char) (((A) >> 8));\ | | | |
| *(((char *)(T))+2)=(char) (((A) >> 16));\ | | | |
| *(((char *)(T))+3)=(char) (((A) >> 24)); | | | |
| } while(0) | | | |
| #define int5store(T,A) do { *((char *)(T))= (char)((A)); \ | | | |
| *(((char *)(T))+1)= (char)(((A) >> 8)); \ | | | |
| *(((char *)(T))+2)= (char)(((A) >> 16)); | | | |
| \ | | | |
| *(((char *)(T))+3)= (char)(((A) >> 24)); | | | |
| \ | | | |
| *(((char *)(T))+4)= (char)(((A) >> 32)); | | | |
| \ | | | |
| } while(0) | | | |
| #define int6store(T,A) do { *((char *)(T))= (char)((A)); \ | | | |
| *(((char *)(T))+1)= (char)(((A) >> 8)); \ | | | |
| *(((char *)(T))+2)= (char)(((A) >> 16)); | | | |
| \ | | | |
| *(((char *)(T))+3)= (char)(((A) >> 24)); | | | |
| \ | | | |
| *(((char *)(T))+4)= (char)(((A) >> 32)); | | | |
| \ | | | |
| *(((char *)(T))+5)= (char)(((A) >> 40)); | | | |
| \ | | | |
| } while(0) | | | |
| #define int8store(T,A) do { uint def_temp= (uint) (A), def_temp2= (ui | | | |
| nt) ((A) >> 32); \ | | | |
| int4store((T),def_temp); \ | | | |
| int4store((T+4),def_temp2); } while(0) | | | |
| #ifdef WORDS_BIGENDIAN | | | |
| #define float4store(T,A) do { *(T)= ((uchar *) &A)[3];\ | | | |
| *((T)+1)=(char) ((uchar *) &A)[2];\ | | | |
| *((T)+2)=(char) ((uchar *) &A)[1];\ | | | |
| *((T)+3)=(char) ((uchar *) &A)[0]; } while(0) | | | |
| | | | |
| #define float4get(V,M) do { float def_temp;\ | | | |
| ((uchar*) &def_temp)[0]=(M)[3];\ | | | |
| ((uchar*) &def_temp)[1]=(M)[2];\ | | | |
| ((uchar*) &def_temp)[2]=(M)[1];\ | | | |
| ((uchar*) &def_temp)[3]=(M)[0];\ | | | |
| (V)=def_temp; } while(0) | | | |
| #define float8store(T,V) do { *(T)= ((uchar *) &V)[7];\ | | | |
| *((T)+1)=(char) ((uchar *) &V)[6];\ | | | |
| *((T)+2)=(char) ((uchar *) &V)[5];\ | | | |
| *((T)+3)=(char) ((uchar *) &V)[4];\ | | | |
| *((T)+4)=(char) ((uchar *) &V)[3];\ | | | |
| *((T)+5)=(char) ((uchar *) &V)[2];\ | | | |
| *((T)+6)=(char) ((uchar *) &V)[1];\ | | | |
| *((T)+7)=(char) ((uchar *) &V)[0]; } while(0) | | | |
| | | | |
| #define float8get(V,M) do { double def_temp;\ | | | |
| ((uchar*) &def_temp)[0]=(M)[7];\ | | | |
| ((uchar*) &def_temp)[1]=(M)[6];\ | | | |
| ((uchar*) &def_temp)[2]=(M)[5];\ | | | |
| ((uchar*) &def_temp)[3]=(M)[4];\ | | | |
| ((uchar*) &def_temp)[4]=(M)[3];\ | | | |
| ((uchar*) &def_temp)[5]=(M)[2];\ | | | |
| ((uchar*) &def_temp)[6]=(M)[1];\ | | | |
| ((uchar*) &def_temp)[7]=(M)[0];\ | | | |
| (V) = def_temp; } while(0) | | | |
| #else | | | |
| #define float4get(V,M) memcpy(&V, (M), sizeof(float)) | | | |
| #define float4store(V,M) memcpy(V, (&M), sizeof(float)) | | | |
| | | | |
| #if defined(__FLOAT_WORD_ORDER) && (__FLOAT_WORD_ORDER == __BIG_ENDIAN) | | | |
| #define doublestore(T,V) do { *(((char*)T)+0)=(char) ((uchar *) &V)[4];\ | | | |
| *(((char*)T)+1)=(char) ((uchar *) &V)[5];\ | | | |
| *(((char*)T)+2)=(char) ((uchar *) &V)[6];\ | | | |
| *(((char*)T)+3)=(char) ((uchar *) &V)[7];\ | | | |
| *(((char*)T)+4)=(char) ((uchar *) &V)[0];\ | | | |
| *(((char*)T)+5)=(char) ((uchar *) &V)[1];\ | | | |
| *(((char*)T)+6)=(char) ((uchar *) &V)[2];\ | | | |
| *(((char*)T)+7)=(char) ((uchar *) &V)[3]; }\ | | | |
| while(0) | | | |
| #define doubleget(V,M) do { double def_temp;\ | | | |
| ((uchar*) &def_temp)[0]=(M)[4];\ | | | |
| ((uchar*) &def_temp)[1]=(M)[5];\ | | | |
| ((uchar*) &def_temp)[2]=(M)[6];\ | | | |
| ((uchar*) &def_temp)[3]=(M)[7];\ | | | |
| ((uchar*) &def_temp)[4]=(M)[0];\ | | | |
| ((uchar*) &def_temp)[5]=(M)[1];\ | | | |
| ((uchar*) &def_temp)[6]=(M)[2];\ | | | |
| ((uchar*) &def_temp)[7]=(M)[3];\ | | | |
| (V) = def_temp; } while(0) | | | |
| #endif /* __FLOAT_WORD_ORDER */ | | | |
| | | | |
| #define float8get(V,M) doubleget((V),(M)) | | | |
| #define float8store(V,M) doublestore((V),(M)) | | | |
| #endif /* WORDS_BIGENDIAN */ | | | |
| | | | |
| #endif /* __i386__ OR _WIN32 */ | | | |
| | | | |
| /* | | | |
| Macro for reading 32-bit integer from network byte order (big-endian) | | | |
| from unaligned memory location. | | | |
| */ | | | |
| #define int4net(A) (int32) (((uint32) ((uchar) (A)[3])) |\ | | | |
| (((uint32) ((uchar) (A)[2])) << 8) |\ | | | |
| (((uint32) ((uchar) (A)[1])) << 16) |\ | | | |
| (((uint32) ((uchar) (A)[0])) << 24)) | | | |
| /* | | | |
| Define-funktions for reading and storing in machine format from/to | | | |
| short/long to/from some place in memory V should be a (not | | | |
| register) variable, M is a pointer to byte | | | |
| */ | | | |
| | | | |
| #ifdef WORDS_BIGENDIAN | | | |
| | | | |
| #define ushortget(V,M) do { V = (uint16) (((uint16) ((uchar) (M)[1]))+\ | | | |
| ((uint16) ((uint16) (M)[0]) << 8)); } whil | | | |
| e(0) | | | |
| #define shortget(V,M) do { V = (short) (((short) ((uchar) (M)[1]))+\ | | | |
| ((short) ((short) (M)[0]) << 8)); } while( | | | |
| 0) | | | |
| #define longget(V,M) do { int32 def_temp;\ | | | |
| ((uchar*) &def_temp)[0]=(M)[0];\ | | | |
| ((uchar*) &def_temp)[1]=(M)[1];\ | | | |
| ((uchar*) &def_temp)[2]=(M)[2];\ | | | |
| ((uchar*) &def_temp)[3]=(M)[3];\ | | | |
| (V)=def_temp; } while(0) | | | |
| #define ulongget(V,M) do { uint32 def_temp;\ | | | |
| ((uchar*) &def_temp)[0]=(M)[0];\ | | | |
| ((uchar*) &def_temp)[1]=(M)[1];\ | | | |
| ((uchar*) &def_temp)[2]=(M)[2];\ | | | |
| ((uchar*) &def_temp)[3]=(M)[3];\ | | | |
| (V)=def_temp; } while(0) | | | |
| #define shortstore(T,A) do { uint def_temp=(uint) (A) ;\ | | | |
| *(((char*)T)+1)=(char)(def_temp); \ | | | |
| *(((char*)T)+0)=(char)(def_temp >> 8); } while | | | |
| (0) | | | |
| #define longstore(T,A) do { *(((char*)T)+3)=((A));\ | | | |
| *(((char*)T)+2)=(((A) >> 8));\ | | | |
| *(((char*)T)+1)=(((A) >> 16));\ | | | |
| *(((char*)T)+0)=(((A) >> 24)); } while(0) | | | |
| | | | |
| #define floatget(V,M) memcpy(&V, (M), sizeof(float)) | | | |
| #define floatstore(T,V) memcpy((T), (void*) (&V), sizeof(float)) | | | |
| #define doubleget(V,M) memcpy(&V, (M), sizeof(double)) | | | |
| #define doublestore(T,V) memcpy((T), (void *) &V, sizeof(double)) | | | |
| #define longlongget(V,M) memcpy(&V, (M), sizeof(ulonglong)) | | | |
| #define longlongstore(T,V) memcpy((T), &V, sizeof(ulonglong)) | | | |
| | | | |
| #else | | | |
| | | | |
| #define ushortget(V,M) do { V = uint2korr(M); } while(0) | | | |
| #define shortget(V,M) do { V = sint2korr(M); } while(0) | | | |
| #define longget(V,M) do { V = sint4korr(M); } while(0) | | | |
| #define ulongget(V,M) do { V = uint4korr(M); } while(0) | | | |
| #define shortstore(T,V) int2store(T,V) | | | |
| #define longstore(T,V) int4store(T,V) | | | |
| #ifndef floatstore | | | |
| #define floatstore(T,V) memcpy((T), (void *) (&V), sizeof(float)) | | | |
| #define floatget(V,M) memcpy(&V, (M), sizeof(float)) | | | |
| #endif | | | |
| #ifndef doubleget | | | |
| #define doubleget(V,M) memcpy(&V, (M), sizeof(double)) | | | |
| #define doublestore(T,V) memcpy((T), (void *) &V, sizeof(double)) | | | |
| #endif /* doubleget */ | | | |
| #define longlongget(V,M) memcpy(&V, (M), sizeof(ulonglong)) | | | |
| #define longlongstore(T,V) memcpy((T), &V, sizeof(ulonglong)) | | | |
| | | | |
| #endif /* WORDS_BIGENDIAN */ | | | |
| | | | |
| #ifdef HAVE_CHARSET_utf8 | | #ifdef HAVE_CHARSET_utf8 | |
| #define MYSQL_UNIVERSAL_CLIENT_CHARSET "utf8" | | #define MYSQL_UNIVERSAL_CLIENT_CHARSET "utf8" | |
| #else | | #else | |
| #define MYSQL_UNIVERSAL_CLIENT_CHARSET MYSQL_DEFAULT_CHARSET_NAME | | #define MYSQL_UNIVERSAL_CLIENT_CHARSET MYSQL_DEFAULT_CHARSET_NAME | |
| #endif | | #endif | |
| | | | |
| #if defined(EMBEDDED_LIBRARY) && !defined(HAVE_EMBEDDED_PRIVILEGE_CONTROL) | | #if defined(EMBEDDED_LIBRARY) && !defined(HAVE_EMBEDDED_PRIVILEGE_CONTROL) | |
| #define NO_EMBEDDED_ACCESS_CHECKS | | #define NO_EMBEDDED_ACCESS_CHECKS | |
| #endif | | #endif | |
| | | | |
| skipping to change at line 1395 | | skipping to change at line 1091 | |
| #endif /* HAVE_DLERROR */ | | #endif /* HAVE_DLERROR */ | |
| | | | |
| /* | | /* | |
| * Include standard definitions of operator new and delete. | | * Include standard definitions of operator new and delete. | |
| */ | | */ | |
| #ifdef __cplusplus | | #ifdef __cplusplus | |
| #include <new> | | #include <new> | |
| #endif | | #endif | |
| | | | |
| /* Length of decimal number represented by INT32. */ | | /* Length of decimal number represented by INT32. */ | |
|
| #define MY_INT32_NUM_DECIMAL_DIGITS 11 | | #define MY_INT32_NUM_DECIMAL_DIGITS 11U | |
| | | | |
| /* Length of decimal number represented by INT64. */ | | /* Length of decimal number represented by INT64. */ | |
|
| #define MY_INT64_NUM_DECIMAL_DIGITS 21 | | #define MY_INT64_NUM_DECIMAL_DIGITS 21U | |
| | | | |
| /* Define some useful general macros (should be done after all headers). */ | | /* Define some useful general macros (should be done after all headers). */ | |
|
| #if !defined(max) | | #define MY_MAX(a, b) ((a) > (b) ? (a) : (b)) | |
| #define max(a, b) ((a) > (b) ? (a) : (b)) | | #define MY_MIN(a, b) ((a) < (b) ? (a) : (b)) | |
| #define min(a, b) ((a) < (b) ? (a) : (b)) | | | |
| #endif | | | |
| | | | |
| /* | | /* | |
| Only Linux is known to need an explicit sync of the directory to make sur
e a | | Only Linux is known to need an explicit sync of the directory to make sur
e a | |
| file creation/deletion/renaming in(from,to) this directory durable. | | file creation/deletion/renaming in(from,to) this directory durable. | |
| */ | | */ | |
| #ifdef TARGET_OS_LINUX | | #ifdef TARGET_OS_LINUX | |
| #define NEED_EXPLICIT_SYNC_DIR 1 | | #define NEED_EXPLICIT_SYNC_DIR 1 | |
|
| | | #else | |
| | | /* | |
| | | On linux default rwlock scheduling policy is good enough for | |
| | | waiting_threads.c, on other systems use our special implementation | |
| | | (which is slower). | |
| | | | |
| | | QQ perhaps this should be tested in configure ? how ? | |
| | | */ | |
| | | #define WT_RWLOCKS_USE_MUTEXES 1 | |
| #endif | | #endif | |
| | | | |
| #if !defined(__cplusplus) && !defined(bool) | | #if !defined(__cplusplus) && !defined(bool) | |
| #define bool In_C_you_should_use_my_bool_instead() | | #define bool In_C_you_should_use_my_bool_instead() | |
| #endif | | #endif | |
| | | | |
| /* Provide __func__ macro definition for platforms that miss it. */ | | /* Provide __func__ macro definition for platforms that miss it. */ | |
| #if __STDC_VERSION__ < 199901L | | #if __STDC_VERSION__ < 199901L | |
| # if __GNUC__ >= 2 | | # if __GNUC__ >= 2 | |
| # define __func__ __FUNCTION__ | | # define __func__ __FUNCTION__ | |
| | | | |
| skipping to change at line 1497 | | skipping to change at line 1200 | |
| #ifdef EMBEDDED_LIBRARY | | #ifdef EMBEDDED_LIBRARY | |
| | | | |
| /* Things we don't need in the embedded version of MySQL */ | | /* Things we don't need in the embedded version of MySQL */ | |
| /* TODO HF add #undef HAVE_VIO if we don't want client in embedded library
*/ | | /* TODO HF add #undef HAVE_VIO if we don't want client in embedded library
*/ | |
| | | | |
| #undef HAVE_OPENSSL | | #undef HAVE_OPENSSL | |
| #undef HAVE_SMEM /* No shared memory */ | | #undef HAVE_SMEM /* No shared memory */ | |
| | | | |
| #endif /* EMBEDDED_LIBRARY */ | | #endif /* EMBEDDED_LIBRARY */ | |
| | | | |
|
| #endif /* my_global_h */ | | enum loglevel { | |
| | | ERROR_LEVEL= 0, | |
| | | WARNING_LEVEL= 1, | |
| | | INFORMATION_LEVEL= 2 | |
| | | }; | |
| | | | |
| | | /* | |
| | | Visual Studio before the version 2010 did not have lldiv_t. | |
| | | In Visual Studio 2010, _MSC_VER is defined as 1600. | |
| | | */ | |
| | | #if defined(_MSC_VER) && (_MSC_VER < 1600) | |
| | | typedef struct | |
| | | { | |
| | | long long int quot; /* Quotient. */ | |
| | | long long int rem; /* Remainder. */ | |
| | | } lldiv_t; | |
| | | #endif | |
| | | | |
| | | #endif // MY_GLOBAL_INCLUDED | |
| | | | |
End of changes. 23 change blocks. |
| 354 lines changed or deleted | | 32 lines changed or added | |
|
| my_sys.h | | my_sys.h | |
|
| /* Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reser
ved. | | /* Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reser
ved. | |
| | | | |
| This program is free software; you can redistribute it and/or modify | | This program is free software; you can redistribute it and/or modify | |
| it under the terms of the GNU General Public License as published by | | it under the terms of the GNU General Public License as published by | |
| the Free Software Foundation; version 2 of the License. | | the Free Software Foundation; version 2 of the License. | |
| | | | |
| This program is distributed in the hope that it will be useful, | | This program is distributed in the hope that it will be useful, | |
| but WITHOUT ANY WARRANTY; without even the implied warranty of | | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
| GNU General Public License for more details. | | GNU General Public License for more details. | |
| | | | |
| You should have received a copy of the GNU General Public License | | You should have received a copy of the GNU General Public License | |
| along with this program; if not, write to the Free Software | | along with this program; if not, write to the Free Software | |
|
| Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-130
1, USA */ | | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 US
A */ | |
| | | | |
| #ifndef _my_sys_h | | #ifndef _my_sys_h | |
| #define _my_sys_h | | #define _my_sys_h | |
| | | | |
| #include "my_global.h" /* C_MODE_START, C_MODE_END */ | | #include "my_global.h" /* C_MODE_START, C_MODE_END */ | |
| | | | |
| C_MODE_START | | C_MODE_START | |
| | | | |
| #ifdef HAVE_AIOWAIT | | #ifdef HAVE_AIOWAIT | |
| #include <sys/asynch.h> /* Used by record-cache */ | | #include <sys/asynch.h> /* Used by record-cache */ | |
| | | | |
| skipping to change at line 65 | | skipping to change at line 65 | |
| /** | | /** | |
| Max length of an error message generated by mysys utilities. | | Max length of an error message generated by mysys utilities. | |
| Some mysys functions produce error messages. These mostly go | | Some mysys functions produce error messages. These mostly go | |
| to stderr. | | to stderr. | |
| This constant defines the size of the buffer used to format | | This constant defines the size of the buffer used to format | |
| the message. It should be kept in sync with MYSQL_ERRMSG_SIZE, | | the message. It should be kept in sync with MYSQL_ERRMSG_SIZE, | |
| since sometimes mysys errors are stored in the server diagnostics | | since sometimes mysys errors are stored in the server diagnostics | |
| area, and we would like to avoid unexpected truncation. | | area, and we would like to avoid unexpected truncation. | |
| */ | | */ | |
| #define MYSYS_ERRMSG_SIZE (512) | | #define MYSYS_ERRMSG_SIZE (512) | |
|
| | | #define MYSYS_STRERROR_SIZE (128) | |
| | | | |
| #define MY_FILE_ERROR ((size_t) -1) | | #define MY_FILE_ERROR ((size_t) -1) | |
| | | | |
| /* General bitmaps for my_func's */ | | /* General bitmaps for my_func's */ | |
| #define MY_FFNF 1 /* Fatal if file not found */ | | #define MY_FFNF 1 /* Fatal if file not found */ | |
| #define MY_FNABP 2 /* Fatal if not all bytes read/writen */ | | #define MY_FNABP 2 /* Fatal if not all bytes read/writen */ | |
| #define MY_NABP 4 /* Error if not all bytes read/write
n */ | | #define MY_NABP 4 /* Error if not all bytes read/write
n */ | |
| #define MY_FAE 8 /* Fatal if any error */ | | #define MY_FAE 8 /* Fatal if any error */ | |
| #define MY_WME 16 /* Write message on error */ | | #define MY_WME 16 /* Write message on error */ | |
| #define MY_WAIT_IF_FULL 32 /* Wait and try again if disk full error */ | | #define MY_WAIT_IF_FULL 32 /* Wait and try again if disk full error */ | |
| | | | |
| skipping to change at line 160 | | skipping to change at line 161 | |
| | | | |
| /* defines when allocating data */ | | /* defines when allocating data */ | |
| extern void *my_malloc(size_t Size,myf MyFlags); | | extern void *my_malloc(size_t Size,myf MyFlags); | |
| extern void *my_multi_malloc(myf MyFlags, ...); | | extern void *my_multi_malloc(myf MyFlags, ...); | |
| extern void *my_realloc(void *oldpoint, size_t Size, myf MyFlags); | | extern void *my_realloc(void *oldpoint, size_t Size, myf MyFlags); | |
| extern void my_free(void *ptr); | | extern void my_free(void *ptr); | |
| extern void *my_memdup(const void *from,size_t length,myf MyFlags); | | extern void *my_memdup(const void *from,size_t length,myf MyFlags); | |
| extern char *my_strdup(const char *from,myf MyFlags); | | extern char *my_strdup(const char *from,myf MyFlags); | |
| extern char *my_strndup(const char *from, size_t length, | | extern char *my_strndup(const char *from, size_t length, | |
| myf MyFlags); | | myf MyFlags); | |
|
| #define TRASH(A,B) do{MEM_CHECK_ADDRESSABLE(A,B);MEM_UNDEFINED(A,B);} while | | | |
| (0) | | /* | |
| | | Switch to my_malloc() if the memory block to be allocated is bigger than | |
| | | max_alloca_sz. | |
| | | */ | |
| | | #ifndef HAVE_ALLOCA | |
| | | #define my_safe_alloca(size, max_alloca_sz) my_alloca(size) | |
| | | #define my_safe_afree(ptr, size, max_alloca_sz) my_afree(ptr) | |
| | | #else | |
| | | #define my_safe_alloca(size, max_alloca_sz) ((size <= max_alloca_sz) ? \ | |
| | | my_alloca(size) : \ | |
| | | my_malloc(size, MYF(0))) | |
| | | #define my_safe_afree(ptr, size, max_alloca_sz) if (size > max_alloca_sz) \ | |
| | | my_free(ptr) | |
| | | #endif /* #ifndef HAVE_ALLOCA */ | |
| | | | |
| | | #if !defined(DBUG_OFF) || defined(HAVE_VALGRIND) | |
| | | /** | |
| | | Put bad content in memory to be sure it will segfault if dereferenced. | |
| | | With Valgrind, verify that memory is addressable, and mark it undefined. | |
| | | We cache value of B because if B is expression which depends on A, memset | |
| | | () | |
| | | trashes value of B. | |
| | | */ | |
| | | #define TRASH(A,B) do { \ | |
| | | const size_t l= (B); \ | |
| | | MEM_CHECK_ADDRESSABLE(A, l); \ | |
| | | memset(A, 0x8F, l); \ | |
| | | MEM_UNDEFINED(A, l); \ | |
| | | } while (0) | |
| | | #else | |
| | | #define TRASH(A,B) do {} while(0) | |
| | | #endif | |
| #if defined(ENABLED_DEBUG_SYNC) | | #if defined(ENABLED_DEBUG_SYNC) | |
| extern void (*debug_sync_C_callback_ptr)(const char *, size_t); | | extern void (*debug_sync_C_callback_ptr)(const char *, size_t); | |
| #define DEBUG_SYNC_C(_sync_point_name_) do { \ | | #define DEBUG_SYNC_C(_sync_point_name_) do { \ | |
| if (debug_sync_C_callback_ptr != NULL) \ | | if (debug_sync_C_callback_ptr != NULL) \ | |
| (*debug_sync_C_callback_ptr)(STRING_WITH_LEN(_sync_point_name_)); } \ | | (*debug_sync_C_callback_ptr)(STRING_WITH_LEN(_sync_point_name_)); } \ | |
| while(0) | | while(0) | |
|
| | | #define DEBUG_SYNC_C_IF_THD(thd, _sync_point_name_) do { \ | |
| | | if (debug_sync_C_callback_ptr != NULL && thd) \ | |
| | | (*debug_sync_C_callback_ptr)(STRING_WITH_LEN(_sync_point_name_)); } \ | |
| | | while(0) | |
| #else | | #else | |
| #define DEBUG_SYNC_C(_sync_point_name_) | | #define DEBUG_SYNC_C(_sync_point_name_) | |
|
| | | #define DEBUG_SYNC_C_IF_THD(thd, _sync_point_name_) | |
| #endif /* defined(ENABLED_DEBUG_SYNC) */ | | #endif /* defined(ENABLED_DEBUG_SYNC) */ | |
| | | | |
| #ifdef HAVE_LARGE_PAGES | | #ifdef HAVE_LARGE_PAGES | |
| extern uint my_get_large_page_size(void); | | extern uint my_get_large_page_size(void); | |
| extern uchar * my_large_malloc(size_t size, myf my_flags); | | extern uchar * my_large_malloc(size_t size, myf my_flags); | |
| extern void my_large_free(uchar *ptr); | | extern void my_large_free(uchar *ptr); | |
| #else | | #else | |
| #define my_get_large_page_size() (0) | | #define my_get_large_page_size() (0) | |
| #define my_large_malloc(A,B) my_malloc_lock((A),(B)) | | #define my_large_malloc(A,B) my_malloc_lock((A),(B)) | |
| #define my_large_free(A) my_free_lock((A)) | | #define my_large_free(A) my_free_lock((A)) | |
| | | | |
| skipping to change at line 212 | | skipping to change at line 249 | |
| #else | | #else | |
| extern int errno; /* declare errno */ | | extern int errno; /* declare errno */ | |
| #endif | | #endif | |
| #endif /* #ifndef errno */ | | #endif /* #ifndef errno */ | |
| extern char *home_dir; /* Home directory for user */ | | extern char *home_dir; /* Home directory for user */ | |
| extern const char *my_progname; /* program-name (printed in
errors) */ | | extern const char *my_progname; /* program-name (printed in
errors) */ | |
| extern char curr_dir[]; /* Current directory for user */ | | extern char curr_dir[]; /* Current directory for user */ | |
| extern void (*error_handler_hook)(uint my_err, const char *str,myf MyFlags)
; | | extern void (*error_handler_hook)(uint my_err, const char *str,myf MyFlags)
; | |
| extern void (*fatal_error_handler_hook)(uint my_err, const char *str, | | extern void (*fatal_error_handler_hook)(uint my_err, const char *str, | |
| myf MyFlags); | | myf MyFlags); | |
|
| extern void(*sql_print_warning_hook)(const char *format,...); | | | |
| extern uint my_file_limit; | | extern uint my_file_limit; | |
| extern ulong my_thread_stack_size; | | extern ulong my_thread_stack_size; | |
| | | | |
|
| extern const char *(*proc_info_hook)(void *, const char *, const char *, | | extern void (*proc_info_hook)(void *, const PSI_stage_info *, PSI_stage_inf | |
| const char *, const unsigned int); | | o *, | |
| | | const char *, const char *, const unsigned in | |
| | | t); | |
| | | | |
| #ifdef HAVE_LARGE_PAGES | | #ifdef HAVE_LARGE_PAGES | |
| extern my_bool my_use_large_pages; | | extern my_bool my_use_large_pages; | |
| extern uint my_large_page_size; | | extern uint my_large_page_size; | |
| #endif | | #endif | |
| | | | |
| /* charsets */ | | /* charsets */ | |
| #define MY_ALL_CHARSETS_SIZE 2048 | | #define MY_ALL_CHARSETS_SIZE 2048 | |
| extern MYSQL_PLUGIN_IMPORT CHARSET_INFO *default_charset_info; | | extern MYSQL_PLUGIN_IMPORT CHARSET_INFO *default_charset_info; | |
| extern MYSQL_PLUGIN_IMPORT CHARSET_INFO *all_charsets[MY_ALL_CHARSETS_SIZE]
; | | extern MYSQL_PLUGIN_IMPORT CHARSET_INFO *all_charsets[MY_ALL_CHARSETS_SIZE]
; | |
| extern CHARSET_INFO compiled_charsets[]; | | extern CHARSET_INFO compiled_charsets[]; | |
| | | | |
| /* statistics */ | | /* statistics */ | |
| extern ulong my_file_opened,my_stream_opened, my_tmp_file_created; | | extern ulong my_file_opened,my_stream_opened, my_tmp_file_created; | |
| extern ulong my_file_total_opened; | | extern ulong my_file_total_opened; | |
|
| extern uint mysys_usage_id; | | | |
| extern my_bool my_init_done; | | extern my_bool my_init_done; | |
| | | | |
| /* Point to current my_message() */ | | /* Point to current my_message() */ | |
| extern void (*my_sigtstp_cleanup)(void), | | extern void (*my_sigtstp_cleanup)(void), | |
| /* Executed before jump to shell */ | | /* Executed before jump to shell */ | |
| (*my_sigtstp_restart)(void), | | (*my_sigtstp_restart)(void), | |
| (*my_abort_hook)(int); | | (*my_abort_hook)(int); | |
| /* Executed when comming from shell
*/ | | /* Executed when comming from shell
*/ | |
| extern MYSQL_PLUGIN_IMPORT int my_umask; /* Default creation
mask */ | | extern MYSQL_PLUGIN_IMPORT int my_umask; /* Default creation
mask */ | |
| extern int my_umask_dir, | | extern int my_umask_dir, | |
| my_recived_signals, /* Signals we have got */ | | my_recived_signals, /* Signals we have got */ | |
| my_safe_to_handle_signal, /* Set when allowed to SIGTSTP */ | | my_safe_to_handle_signal, /* Set when allowed to SIGTSTP */ | |
| my_dont_interrupt; /* call remember_intr when set */ | | my_dont_interrupt; /* call remember_intr when set */ | |
| extern my_bool my_use_symdir; | | extern my_bool my_use_symdir; | |
| | | | |
| extern ulong my_default_record_cache_size; | | extern ulong my_default_record_cache_size; | |
| extern my_bool my_disable_locking, my_disable_async_io, | | extern my_bool my_disable_locking, my_disable_async_io, | |
| my_disable_flush_key_blocks, my_disable_symlinks; | | my_disable_flush_key_blocks, my_disable_symlinks; | |
| extern char wild_many,wild_one,wild_prefix; | | extern char wild_many,wild_one,wild_prefix; | |
| extern const char *charsets_dir; | | extern const char *charsets_dir; | |
|
| /* from default.c */ | | | |
| extern const char *my_defaults_extra_file; | | | |
| extern const char *my_defaults_group_suffix; | | | |
| extern const char *my_defaults_file; | | | |
| | | | |
| extern my_bool timed_mutexes; | | extern my_bool timed_mutexes; | |
| | | | |
|
| enum loglevel { | | | |
| ERROR_LEVEL, | | | |
| WARNING_LEVEL, | | | |
| INFORMATION_LEVEL | | | |
| }; | | | |
| | | | |
| enum cache_type | | enum cache_type | |
| { | | { | |
| TYPE_NOT_SET= 0, READ_CACHE, WRITE_CACHE, | | TYPE_NOT_SET= 0, READ_CACHE, WRITE_CACHE, | |
| SEQ_READ_APPEND /* sequential read or append */, | | SEQ_READ_APPEND /* sequential read or append */, | |
| READ_FIFO, READ_NET,WRITE_NET}; | | READ_FIFO, READ_NET,WRITE_NET}; | |
| | | | |
| enum flush_type | | enum flush_type | |
| { | | { | |
| FLUSH_KEEP, /* flush block and keep it in the cache */ | | FLUSH_KEEP, /* flush block and keep it in the cache */ | |
| FLUSH_RELEASE, /* flush block and remove it from the cache */ | | FLUSH_RELEASE, /* flush block and remove it from the cache */ | |
| | | | |
| skipping to change at line 492 | | skipping to change at line 517 | |
| used (because it's not reliable on all systems) | | used (because it's not reliable on all systems) | |
| */ | | */ | |
| uint inited; | | uint inited; | |
| my_off_t aio_read_pos; | | my_off_t aio_read_pos; | |
| my_aio_result aio_result; | | my_aio_result aio_result; | |
| #endif | | #endif | |
| } IO_CACHE; | | } IO_CACHE; | |
| | | | |
| typedef int (*qsort2_cmp)(const void *, const void *, const void *); | | typedef int (*qsort2_cmp)(const void *, const void *, const void *); | |
| | | | |
|
| | | typedef void (*my_error_reporter)(enum loglevel level, const char *format, | |
| | | ...) | |
| | | ATTRIBUTE_FORMAT_FPTR(printf, 2, 3); | |
| | | | |
| | | extern my_error_reporter my_charset_error_reporter; | |
| | | | |
| /* defines for mf_iocache */ | | /* defines for mf_iocache */ | |
| | | | |
| /* Test if buffer is inited */ | | /* Test if buffer is inited */ | |
| #define my_b_clear(info) (info)->buffer=0 | | #define my_b_clear(info) (info)->buffer=0 | |
| #define my_b_inited(info) (info)->buffer | | #define my_b_inited(info) (info)->buffer | |
| #define my_b_EOF INT_MIN | | #define my_b_EOF INT_MIN | |
| | | | |
| #define my_b_read(info,Buffer,Count) \ | | #define my_b_read(info,Buffer,Count) \ | |
| ((info)->read_pos + (Count) <= (info)->read_end ?\ | | ((info)->read_pos + (Count) <= (info)->read_end ?\ | |
| (memcpy(Buffer,(info)->read_pos,(size_t) (Count)), \ | | (memcpy(Buffer,(info)->read_pos,(size_t) (Count)), \ | |
| | | | |
| skipping to change at line 543 | | skipping to change at line 573 | |
| /* tell write offset in the SEQ_APPEND cache */ | | /* tell write offset in the SEQ_APPEND cache */ | |
| int my_b_copy_to_file(IO_CACHE *cache, FILE *file); | | int my_b_copy_to_file(IO_CACHE *cache, FILE *file); | |
| my_off_t my_b_append_tell(IO_CACHE* info); | | my_off_t my_b_append_tell(IO_CACHE* info); | |
| my_off_t my_b_safe_tell(IO_CACHE* info); /* picks the correct tell() */ | | my_off_t my_b_safe_tell(IO_CACHE* info); /* picks the correct tell() */ | |
| | | | |
| #define my_b_bytes_in_cache(info) (size_t) (*(info)->current_end - \ | | #define my_b_bytes_in_cache(info) (size_t) (*(info)->current_end - \ | |
| *(info)->current_pos) | | *(info)->current_pos) | |
| | | | |
| typedef uint32 ha_checksum; | | typedef uint32 ha_checksum; | |
| | | | |
|
| /* Define the type of function to be passed to process_default_option_files | | | |
| */ | | | |
| typedef int (*Process_option_func)(void *ctx, const char *group_name, | | | |
| const char *option); | | | |
| | | | |
| #include <my_alloc.h> | | #include <my_alloc.h> | |
| | | | |
| /* Prototypes for mysys and my_func functions */ | | /* Prototypes for mysys and my_func functions */ | |
| | | | |
| extern int my_copy(const char *from,const char *to,myf MyFlags); | | extern int my_copy(const char *from,const char *to,myf MyFlags); | |
| extern int my_delete(const char *name,myf MyFlags); | | extern int my_delete(const char *name,myf MyFlags); | |
| extern int my_getwd(char * buf,size_t size,myf MyFlags); | | extern int my_getwd(char * buf,size_t size,myf MyFlags); | |
| extern int my_setwd(const char *dir,myf MyFlags); | | extern int my_setwd(const char *dir,myf MyFlags); | |
| extern int my_lock(File fd,int op,my_off_t start, my_off_t length,myf MyFla
gs); | | extern int my_lock(File fd,int op,my_off_t start, my_off_t length,myf MyFla
gs); | |
| extern void *my_once_alloc(size_t Size,myf MyFlags); | | extern void *my_once_alloc(size_t Size,myf MyFlags); | |
| | | | |
| skipping to change at line 605 | | skipping to change at line 631 | |
| const void *needle, size_t needlelen); | | const void *needle, size_t needlelen); | |
| | | | |
| #ifdef _WIN32 | | #ifdef _WIN32 | |
| extern int my_access(const char *path, int amode); | | extern int my_access(const char *path, int amode); | |
| #else | | #else | |
| #define my_access access | | #define my_access access | |
| #endif | | #endif | |
| | | | |
| extern int check_if_legal_filename(const char *path); | | extern int check_if_legal_filename(const char *path); | |
| extern int check_if_legal_tablename(const char *path); | | extern int check_if_legal_tablename(const char *path); | |
|
| extern my_bool is_filename_allowed(const char *name, size_t length); | | | |
| | | #ifdef __WIN__ | |
| | | extern my_bool is_filename_allowed(const char *name, size_t length, | |
| | | my_bool allow_current_dir); | |
| | | #else /* __WIN__ */ | |
| | | # define is_filename_allowed(name, length, allow_cwd) (TRUE) | |
| | | #endif /* __WIN__ */ | |
| | | | |
| #ifdef _WIN32 | | #ifdef _WIN32 | |
| extern int nt_share_delete(const char *name,myf MyFlags); | | extern int nt_share_delete(const char *name,myf MyFlags); | |
| #define my_delete_allow_opened(fname,flags) nt_share_delete((fname),(flags
)) | | #define my_delete_allow_opened(fname,flags) nt_share_delete((fname),(flags
)) | |
| #else | | #else | |
| #define my_delete_allow_opened(fname,flags) my_delete((fname),(flags)) | | #define my_delete_allow_opened(fname,flags) my_delete((fname),(flags)) | |
| #endif | | #endif | |
| | | | |
| #ifdef _WIN32 | | #ifdef _WIN32 | |
| /* Windows-only functions (CRT equivalents)*/ | | /* Windows-only functions (CRT equivalents)*/ | |
| | | | |
| skipping to change at line 634 | | skipping to change at line 666 | |
| extern FILE *my_fdopen(File Filedes,const char *name, int Flags,myf MyFlags
); | | extern FILE *my_fdopen(File Filedes,const char *name, int Flags,myf MyFlags
); | |
| extern FILE *my_freopen(const char *path, const char *mode, FILE *stream); | | extern FILE *my_freopen(const char *path, const char *mode, FILE *stream); | |
| extern int my_fclose(FILE *fd,myf MyFlags); | | extern int my_fclose(FILE *fd,myf MyFlags); | |
| extern File my_fileno(FILE *fd); | | extern File my_fileno(FILE *fd); | |
| extern int my_chsize(File fd,my_off_t newlength, int filler, myf MyFlags); | | extern int my_chsize(File fd,my_off_t newlength, int filler, myf MyFlags); | |
| extern void thr_set_sync_wait_callback(void (*before_sync)(void), | | extern void thr_set_sync_wait_callback(void (*before_sync)(void), | |
| void (*after_sync)(void)); | | void (*after_sync)(void)); | |
| extern int my_sync(File fd, myf my_flags); | | extern int my_sync(File fd, myf my_flags); | |
| extern int my_sync_dir(const char *dir_name, myf my_flags); | | extern int my_sync_dir(const char *dir_name, myf my_flags); | |
| extern int my_sync_dir_by_file(const char *file_name, myf my_flags); | | extern int my_sync_dir_by_file(const char *file_name, myf my_flags); | |
|
| | | extern char *my_strerror(char *buf, size_t len, int errnum); | |
| | | extern const char *my_get_err_msg(int nr); | |
| extern void my_error(int nr,myf MyFlags, ...); | | extern void my_error(int nr,myf MyFlags, ...); | |
| extern void my_printf_error(uint my_err, const char *format, | | extern void my_printf_error(uint my_err, const char *format, | |
| myf MyFlags, ...) | | myf MyFlags, ...) | |
| ATTRIBUTE_FORMAT(printf, 2, 4); | | ATTRIBUTE_FORMAT(printf, 2, 4); | |
| extern void my_printv_error(uint error, const char *format, myf MyFlags, | | extern void my_printv_error(uint error, const char *format, myf MyFlags, | |
| va_list ap); | | va_list ap); | |
| extern int my_error_register(const char** (*get_errmsgs) (), | | extern int my_error_register(const char** (*get_errmsgs) (), | |
| int first, int last); | | int first, int last); | |
|
| extern void my_printf_warning (const char * format, ...); | | | |
| extern const char **my_error_unregister(int first, int last); | | extern const char **my_error_unregister(int first, int last); | |
| extern void my_message(uint my_err, const char *str,myf MyFlags); | | extern void my_message(uint my_err, const char *str,myf MyFlags); | |
| extern void my_message_stderr(uint my_err, const char *str, myf MyFlags); | | extern void my_message_stderr(uint my_err, const char *str, myf MyFlags); | |
| extern my_bool my_init(void); | | extern my_bool my_init(void); | |
| extern void my_end(int infoflag); | | extern void my_end(int infoflag); | |
| extern int my_redel(const char *from, const char *to, int MyFlags); | | extern int my_redel(const char *from, const char *to, int MyFlags); | |
| extern int my_copystat(const char *from, const char *to, int MyFlags); | | extern int my_copystat(const char *from, const char *to, int MyFlags); | |
| extern char * my_filename(File fd); | | extern char * my_filename(File fd); | |
| | | | |
| #ifdef EXTRA_DEBUG | | #ifdef EXTRA_DEBUG | |
| | | | |
| skipping to change at line 677 | | skipping to change at line 710 | |
| extern my_bool has_path(const char *name); | | extern my_bool has_path(const char *name); | |
| extern char *convert_dirname(char *to, const char *from, const char *from_e
nd); | | extern char *convert_dirname(char *to, const char *from, const char *from_e
nd); | |
| extern void to_unix_path(char * name); | | extern void to_unix_path(char * name); | |
| extern char * fn_ext(const char *name); | | extern char * fn_ext(const char *name); | |
| extern char * fn_same(char * toname,const char *name,int flag); | | extern char * fn_same(char * toname,const char *name,int flag); | |
| extern char * fn_format(char * to,const char *name,const char *dir, | | extern char * fn_format(char * to,const char *name,const char *dir, | |
| const char *form, uint flag); | | const char *form, uint flag); | |
| extern size_t strlength(const char *str); | | extern size_t strlength(const char *str); | |
| extern void pack_dirname(char * to,const char *from); | | extern void pack_dirname(char * to,const char *from); | |
| extern size_t normalize_dirname(char * to, const char *from); | | extern size_t normalize_dirname(char * to, const char *from); | |
|
| extern size_t unpack_dirname(char * to,const char *from); | | extern size_t unpack_dirname(char * to,const char *from, my_bool *is_symdir
); | |
| extern size_t cleanup_dirname(char * to,const char *from); | | extern size_t cleanup_dirname(char * to,const char *from); | |
| extern size_t system_filename(char * to,const char *from); | | extern size_t system_filename(char * to,const char *from); | |
| extern size_t unpack_filename(char * to,const char *from); | | extern size_t unpack_filename(char * to,const char *from); | |
| extern char * intern_filename(char * to,const char *from); | | extern char * intern_filename(char * to,const char *from); | |
| extern char * directory_file_name(char * dst, const char *src); | | extern char * directory_file_name(char * dst, const char *src); | |
| extern int pack_filename(char * to, const char *name, size_t max_length); | | extern int pack_filename(char * to, const char *name, size_t max_length); | |
| extern char * my_path(char * to,const char *progname, | | extern char * my_path(char * to,const char *progname, | |
| const char *own_pathname_part); | | const char *own_pathname_part); | |
| extern char * my_load_path(char * to, const char *path, | | extern char * my_load_path(char * to, const char *path, | |
| const char *own_path_prefix); | | const char *own_path_prefix); | |
| | | | |
| skipping to change at line 706 | | skipping to change at line 739 | |
| size_t reclength,enum cache_type type, | | size_t reclength,enum cache_type type, | |
| pbool use_async_io); | | pbool use_async_io); | |
| extern int read_cache_record(RECORD_CACHE *info,uchar *to); | | extern int read_cache_record(RECORD_CACHE *info,uchar *to); | |
| extern int end_record_cache(RECORD_CACHE *info); | | extern int end_record_cache(RECORD_CACHE *info); | |
| extern int write_cache_record(RECORD_CACHE *info,my_off_t filepos, | | extern int write_cache_record(RECORD_CACHE *info,my_off_t filepos, | |
| const uchar *record,size_t length); | | const uchar *record,size_t length); | |
| extern int flush_write_cache(RECORD_CACHE *info); | | extern int flush_write_cache(RECORD_CACHE *info); | |
| extern void handle_recived_signals(void); | | extern void handle_recived_signals(void); | |
| | | | |
| extern sig_handler my_set_alarm_variable(int signo); | | extern sig_handler my_set_alarm_variable(int signo); | |
|
| | | extern my_bool radixsort_is_appliccable(uint n_items, size_t size_of_elemen
t); | |
| extern void my_string_ptr_sort(uchar *base,uint items,size_t size); | | extern void my_string_ptr_sort(uchar *base,uint items,size_t size); | |
| extern void radixsort_for_str_ptr(uchar* base[], uint number_of_elements, | | extern void radixsort_for_str_ptr(uchar* base[], uint number_of_elements, | |
| size_t size_of_element,uchar *buffer[]); | | size_t size_of_element,uchar *buffer[]); | |
| extern qsort_t my_qsort(void *base_ptr, size_t total_elems, size_t size, | | extern qsort_t my_qsort(void *base_ptr, size_t total_elems, size_t size, | |
| qsort_cmp cmp); | | qsort_cmp cmp); | |
| extern qsort_t my_qsort2(void *base_ptr, size_t total_elems, size_t size, | | extern qsort_t my_qsort2(void *base_ptr, size_t total_elems, size_t size, | |
|
| qsort2_cmp cmp, void *cmp_argument); | | qsort2_cmp cmp, const void *cmp_argument); | |
| extern qsort2_cmp get_ptr_compare(size_t); | | extern qsort2_cmp get_ptr_compare(size_t); | |
| void my_store_ptr(uchar *buff, size_t pack_length, my_off_t pos); | | void my_store_ptr(uchar *buff, size_t pack_length, my_off_t pos); | |
| my_off_t my_get_ptr(uchar *ptr, size_t pack_length); | | my_off_t my_get_ptr(uchar *ptr, size_t pack_length); | |
| extern int init_io_cache(IO_CACHE *info,File file,size_t cachesize, | | extern int init_io_cache(IO_CACHE *info,File file,size_t cachesize, | |
| enum cache_type type,my_off_t seek_offset, | | enum cache_type type,my_off_t seek_offset, | |
| pbool use_async_io, myf cache_myflags); | | pbool use_async_io, myf cache_myflags); | |
| extern my_bool reinit_io_cache(IO_CACHE *info,enum cache_type type, | | extern my_bool reinit_io_cache(IO_CACHE *info,enum cache_type type, | |
| my_off_t seek_offset,pbool use_async_io, | | my_off_t seek_offset,pbool use_async_io, | |
| pbool clear_cache); | | pbool clear_cache); | |
| extern void setup_io_cache(IO_CACHE* info); | | extern void setup_io_cache(IO_CACHE* info); | |
| | | | |
| skipping to change at line 747 | | skipping to change at line 781 | |
| size_t Count, my_off_t pos); | | size_t Count, my_off_t pos); | |
| extern int my_b_flush_io_cache(IO_CACHE *info, int need_append_buffer_lock)
; | | extern int my_b_flush_io_cache(IO_CACHE *info, int need_append_buffer_lock)
; | |
| | | | |
| #define flush_io_cache(info) my_b_flush_io_cache((info),1) | | #define flush_io_cache(info) my_b_flush_io_cache((info),1) | |
| | | | |
| extern int end_io_cache(IO_CACHE *info); | | extern int end_io_cache(IO_CACHE *info); | |
| extern size_t my_b_fill(IO_CACHE *info); | | extern size_t my_b_fill(IO_CACHE *info); | |
| extern void my_b_seek(IO_CACHE *info,my_off_t pos); | | extern void my_b_seek(IO_CACHE *info,my_off_t pos); | |
| extern size_t my_b_gets(IO_CACHE *info, char *to, size_t max_length); | | extern size_t my_b_gets(IO_CACHE *info, char *to, size_t max_length); | |
| extern my_off_t my_b_filelength(IO_CACHE *info); | | extern my_off_t my_b_filelength(IO_CACHE *info); | |
|
| extern size_t my_b_printf(IO_CACHE *info, const char* fmt, ...); | | extern size_t my_b_printf(IO_CACHE *info, const char* fmt, ...) | |
| | | ATTRIBUTE_FORMAT(printf, 2, 3); | |
| extern size_t my_b_vprintf(IO_CACHE *info, const char* fmt, va_list ap); | | extern size_t my_b_vprintf(IO_CACHE *info, const char* fmt, va_list ap); | |
| extern my_bool open_cached_file(IO_CACHE *cache,const char *dir, | | extern my_bool open_cached_file(IO_CACHE *cache,const char *dir, | |
| const char *prefix, size_t cache_size, | | const char *prefix, size_t cache_size, | |
| myf cache_myflags); | | myf cache_myflags); | |
| extern my_bool real_open_cached_file(IO_CACHE *cache); | | extern my_bool real_open_cached_file(IO_CACHE *cache); | |
| extern void close_cached_file(IO_CACHE *cache); | | extern void close_cached_file(IO_CACHE *cache); | |
| File create_temp_file(char *to, const char *dir, const char *pfx, | | File create_temp_file(char *to, const char *dir, const char *pfx, | |
| int mode, myf MyFlags); | | int mode, myf MyFlags); | |
| #define my_init_dynamic_array(A,B,C,D) init_dynamic_array2(A,B,NULL,C,D) | | #define my_init_dynamic_array(A,B,C,D) init_dynamic_array2(A,B,NULL,C,D) | |
| #define my_init_dynamic_array_ci(A,B,C,D) init_dynamic_array2(A,B,NULL,C,D) | | #define my_init_dynamic_array_ci(A,B,C,D) init_dynamic_array2(A,B,NULL,C,D) | |
| #define my_init_dynamic_array2(A,B,C,D,E) init_dynamic_array2(A,B,C,D,E) | | #define my_init_dynamic_array2(A,B,C,D,E) init_dynamic_array2(A,B,C,D,E) | |
| #define my_init_dynamic_array2_ci(A,B,C,D,E) init_dynamic_array2(A,B,C,D,E) | | #define my_init_dynamic_array2_ci(A,B,C,D,E) init_dynamic_array2(A,B,C,D,E) | |
| extern my_bool init_dynamic_array2(DYNAMIC_ARRAY *array, uint element_size, | | extern my_bool init_dynamic_array2(DYNAMIC_ARRAY *array, uint element_size, | |
| void *init_buffer, uint init_alloc, | | void *init_buffer, uint init_alloc, | |
| uint alloc_increment); | | uint alloc_increment); | |
| /* init_dynamic_array() function is deprecated */ | | /* init_dynamic_array() function is deprecated */ | |
| extern my_bool init_dynamic_array(DYNAMIC_ARRAY *array, uint element_size, | | extern my_bool init_dynamic_array(DYNAMIC_ARRAY *array, uint element_size, | |
| uint init_alloc, uint alloc_increment); | | uint init_alloc, uint alloc_increment); | |
|
| extern my_bool insert_dynamic(DYNAMIC_ARRAY *array,uchar * element); | | extern my_bool insert_dynamic(DYNAMIC_ARRAY *array, const void *element); | |
| extern uchar *alloc_dynamic(DYNAMIC_ARRAY *array); | | extern void *alloc_dynamic(DYNAMIC_ARRAY *array); | |
| extern uchar *pop_dynamic(DYNAMIC_ARRAY*); | | extern void *pop_dynamic(DYNAMIC_ARRAY*); | |
| extern my_bool set_dynamic(DYNAMIC_ARRAY *array,uchar * element,uint array_ | | extern my_bool set_dynamic(DYNAMIC_ARRAY *array, const void *element, | |
| index); | | uint array_index); | |
| extern my_bool allocate_dynamic(DYNAMIC_ARRAY *array, uint max_elements); | | extern my_bool allocate_dynamic(DYNAMIC_ARRAY *array, uint max_elements); | |
|
| extern void get_dynamic(DYNAMIC_ARRAY *array,uchar * element,uint array_ind | | extern void get_dynamic(DYNAMIC_ARRAY *array, void *element, | |
| ex); | | uint array_index); | |
| extern void delete_dynamic(DYNAMIC_ARRAY *array); | | extern void delete_dynamic(DYNAMIC_ARRAY *array); | |
| extern void delete_dynamic_element(DYNAMIC_ARRAY *array, uint array_index); | | extern void delete_dynamic_element(DYNAMIC_ARRAY *array, uint array_index); | |
| extern void freeze_size(DYNAMIC_ARRAY *array); | | extern void freeze_size(DYNAMIC_ARRAY *array); | |
|
| extern int get_index_dynamic(DYNAMIC_ARRAY *array, uchar * element); | | | |
| #define dynamic_array_ptr(array,array_index) ((array)->buffer+(array_index)
*(array)->size_of_element) | | #define dynamic_array_ptr(array,array_index) ((array)->buffer+(array_index)
*(array)->size_of_element) | |
| #define dynamic_element(array,array_index,type) ((type)((array)->buffer) +(
array_index)) | | #define dynamic_element(array,array_index,type) ((type)((array)->buffer) +(
array_index)) | |
| #define push_dynamic(A,B) insert_dynamic((A),(B)) | | #define push_dynamic(A,B) insert_dynamic((A),(B)) | |
| #define reset_dynamic(array) ((array)->elements= 0) | | #define reset_dynamic(array) ((array)->elements= 0) | |
| #define sort_dynamic(A,cmp) my_qsort((A)->buffer, (A)->elements, (A)->size_
of_element, (cmp)) | | #define sort_dynamic(A,cmp) my_qsort((A)->buffer, (A)->elements, (A)->size_
of_element, (cmp)) | |
| | | | |
| extern my_bool init_dynamic_string(DYNAMIC_STRING *str, const char *init_st
r, | | extern my_bool init_dynamic_string(DYNAMIC_STRING *str, const char *init_st
r, | |
| size_t init_alloc,size_t alloc_increment)
; | | size_t init_alloc,size_t alloc_increment)
; | |
| extern my_bool dynstr_append(DYNAMIC_STRING *str, const char *append); | | extern my_bool dynstr_append(DYNAMIC_STRING *str, const char *append); | |
| my_bool dynstr_append_mem(DYNAMIC_STRING *str, const char *append, | | my_bool dynstr_append_mem(DYNAMIC_STRING *str, const char *append, | |
| | | | |
| skipping to change at line 818 | | skipping to change at line 854 | |
| extern void set_prealloc_root(MEM_ROOT *root, char *ptr); | | extern void set_prealloc_root(MEM_ROOT *root, char *ptr); | |
| extern void reset_root_defaults(MEM_ROOT *mem_root, size_t block_size, | | extern void reset_root_defaults(MEM_ROOT *mem_root, size_t block_size, | |
| size_t prealloc_size); | | size_t prealloc_size); | |
| extern char *strdup_root(MEM_ROOT *root,const char *str); | | extern char *strdup_root(MEM_ROOT *root,const char *str); | |
| static inline char *safe_strdup_root(MEM_ROOT *root, const char *str) | | static inline char *safe_strdup_root(MEM_ROOT *root, const char *str) | |
| { | | { | |
| return str ? strdup_root(root, str) : 0; | | return str ? strdup_root(root, str) : 0; | |
| } | | } | |
| extern char *strmake_root(MEM_ROOT *root,const char *str,size_t len); | | extern char *strmake_root(MEM_ROOT *root,const char *str,size_t len); | |
| extern void *memdup_root(MEM_ROOT *root,const void *str, size_t len); | | extern void *memdup_root(MEM_ROOT *root,const void *str, size_t len); | |
|
| extern int get_defaults_options(int argc, char **argv, | | | |
| char **defaults, char **extra_defaults, | | | |
| char **group_suffix); | | | |
| extern my_bool my_getopt_use_args_separator; | | | |
| extern my_bool my_getopt_is_args_separator(const char* arg); | | | |
| extern int my_load_defaults(const char *conf_file, const char **groups, | | | |
| int *argc, char ***argv, const char ***); | | | |
| extern int load_defaults(const char *conf_file, const char **groups, | | | |
| int *argc, char ***argv); | | | |
| extern int my_search_option_files(const char *conf_file, int *argc, | | | |
| char ***argv, uint *args_used, | | | |
| Process_option_func func, void *func_ctx, | | | |
| const char **default_directories); | | | |
| extern void free_defaults(char **argv); | | | |
| extern void my_print_default_files(const char *conf_file); | | | |
| extern void print_defaults(const char *conf_file, const char **groups); | | | |
| extern my_bool my_compress(uchar *, size_t *, size_t *); | | extern my_bool my_compress(uchar *, size_t *, size_t *); | |
| extern my_bool my_uncompress(uchar *, size_t , size_t *); | | extern my_bool my_uncompress(uchar *, size_t , size_t *); | |
| extern uchar *my_compress_alloc(const uchar *packet, size_t *len, | | extern uchar *my_compress_alloc(const uchar *packet, size_t *len, | |
| size_t *complen); | | size_t *complen); | |
| extern int packfrm(uchar *, size_t, uchar **, size_t *); | | extern int packfrm(uchar *, size_t, uchar **, size_t *); | |
| extern int unpackfrm(uchar **, size_t *, const uchar *); | | extern int unpackfrm(uchar **, size_t *, const uchar *); | |
| | | | |
| extern ha_checksum my_checksum(ha_checksum crc, const uchar *mem, | | extern ha_checksum my_checksum(ha_checksum crc, const uchar *mem, | |
| size_t count); | | size_t count); | |
| extern void my_sleep(ulong m_seconds); | | extern void my_sleep(ulong m_seconds); | |
| | | | |
| skipping to change at line 899 | | skipping to change at line 919 | |
| /* my_getpagesize */ | | /* my_getpagesize */ | |
| #ifdef HAVE_GETPAGESIZE | | #ifdef HAVE_GETPAGESIZE | |
| #define my_getpagesize() getpagesize() | | #define my_getpagesize() getpagesize() | |
| #else | | #else | |
| int my_getpagesize(void); | | int my_getpagesize(void); | |
| #endif | | #endif | |
| | | | |
| int my_msync(int, void *, size_t, int); | | int my_msync(int, void *, size_t, int); | |
| | | | |
| /* character sets */ | | /* character sets */ | |
|
| | | extern void my_charset_loader_init_mysys(MY_CHARSET_LOADER *loader); | |
| extern uint get_charset_number(const char *cs_name, uint cs_flags); | | extern uint get_charset_number(const char *cs_name, uint cs_flags); | |
| extern uint get_collation_number(const char *name); | | extern uint get_collation_number(const char *name); | |
| extern const char *get_charset_name(uint cs_number); | | extern const char *get_charset_name(uint cs_number); | |
| | | | |
| extern CHARSET_INFO *get_charset(uint cs_number, myf flags); | | extern CHARSET_INFO *get_charset(uint cs_number, myf flags); | |
| extern CHARSET_INFO *get_charset_by_name(const char *cs_name, myf flags); | | extern CHARSET_INFO *get_charset_by_name(const char *cs_name, myf flags); | |
|
| | | extern CHARSET_INFO *my_collation_get_by_name(MY_CHARSET_LOADER *loader, | |
| | | const char *name, myf flags); | |
| extern CHARSET_INFO *get_charset_by_csname(const char *cs_name, | | extern CHARSET_INFO *get_charset_by_csname(const char *cs_name, | |
| uint cs_flags, myf my_flags); | | uint cs_flags, myf my_flags); | |
|
| | | extern CHARSET_INFO *my_charset_get_by_name(MY_CHARSET_LOADER *loader, | |
| | | const char *name, | |
| | | uint cs_flags, myf my_flags); | |
| extern my_bool resolve_charset(const char *cs_name, | | extern my_bool resolve_charset(const char *cs_name, | |
|
| CHARSET_INFO *default_cs, | | const CHARSET_INFO *default_cs, | |
| CHARSET_INFO **cs); | | const CHARSET_INFO **cs); | |
| extern my_bool resolve_collation(const char *cl_name, | | extern my_bool resolve_collation(const char *cl_name, | |
|
| CHARSET_INFO *default_cl, | | const CHARSET_INFO *default_cl, | |
| CHARSET_INFO **cl); | | const CHARSET_INFO **cl); | |
| extern void free_charsets(void); | | extern void free_charsets(void); | |
| extern char *get_charsets_dir(char *buf); | | extern char *get_charsets_dir(char *buf); | |
|
| extern my_bool my_charset_same(CHARSET_INFO *cs1, CHARSET_INFO *cs2); | | extern my_bool my_charset_same(const CHARSET_INFO *cs1, | |
| | | const CHARSET_INFO *cs2); | |
| extern my_bool init_compiled_charsets(myf flags); | | extern my_bool init_compiled_charsets(myf flags); | |
| extern void add_compiled_collation(CHARSET_INFO *cs); | | extern void add_compiled_collation(CHARSET_INFO *cs); | |
|
| extern size_t escape_string_for_mysql(CHARSET_INFO *charset_info, | | extern size_t escape_string_for_mysql(const CHARSET_INFO *charset_info, | |
| char *to, size_t to_length, | | char *to, size_t to_length, | |
| const char *from, size_t length); | | const char *from, size_t length); | |
| #ifdef __WIN__ | | #ifdef __WIN__ | |
| #define BACKSLASH_MBTAIL | | #define BACKSLASH_MBTAIL | |
| /* File system character set */ | | /* File system character set */ | |
| extern CHARSET_INFO *fs_character_set(void); | | extern CHARSET_INFO *fs_character_set(void); | |
| #endif | | #endif | |
| extern size_t escape_quotes_for_mysql(CHARSET_INFO *charset_info, | | extern size_t escape_quotes_for_mysql(CHARSET_INFO *charset_info, | |
| char *to, size_t to_length, | | char *to, size_t to_length, | |
| const char *from, size_t length); | | const char *from, size_t length); | |
| | | | |
| extern void thd_increment_bytes_sent(ulong length); | | extern void thd_increment_bytes_sent(ulong length); | |
| extern void thd_increment_bytes_received(ulong length); | | extern void thd_increment_bytes_received(ulong length); | |
|
| extern void thd_increment_net_big_packet_count(ulong length); | | | |
| | | | |
| #ifdef __WIN__ | | #ifdef __WIN__ | |
| extern my_bool have_tcpip; /* Is set if tcpip is used */ | | extern my_bool have_tcpip; /* Is set if tcpip is used */ | |
| | | | |
| /* implemented in my_windac.c */ | | /* implemented in my_windac.c */ | |
| | | | |
| int my_security_attr_create(SECURITY_ATTRIBUTES **psa, const char **perror, | | int my_security_attr_create(SECURITY_ATTRIBUTES **psa, const char **perror, | |
| DWORD owner_rights, DWORD everybody_rights); | | DWORD owner_rights, DWORD everybody_rights); | |
| | | | |
| void my_security_attr_free(SECURITY_ATTRIBUTES *sa); | | void my_security_attr_free(SECURITY_ATTRIBUTES *sa); | |
| | | | |
| /* implemented in my_conio.c */ | | /* implemented in my_conio.c */ | |
|
| char* my_cgets(char *string, size_t clen, size_t* plen); | | my_bool my_win_is_console(FILE *file); | |
| | | char *my_win_console_readline(const CHARSET_INFO *cs, char *mbbuf, size_t m | |
| #endif | | bbufsize); | |
| | | void my_win_console_write(const CHARSET_INFO *cs, const char *data, size_t | |
| | | datalen); | |
| | | void my_win_console_fputs(const CHARSET_INFO *cs, const char *data); | |
| | | void my_win_console_putc(const CHARSET_INFO *cs, int c); | |
| | | void my_win_console_vfprintf(const CHARSET_INFO *cs, const char *fmt, va_li | |
| | | st args); | |
| | | int my_win_translate_command_line_args(const CHARSET_INFO *cs, int *ac, cha | |
| | | r ***av); | |
| | | #endif /* __WIN__ */ | |
| | | | |
| #include <mysql/psi/psi.h> | | #include <mysql/psi/psi.h> | |
| | | | |
| #ifdef HAVE_PSI_INTERFACE | | #ifdef HAVE_PSI_INTERFACE | |
| extern MYSQL_PLUGIN_IMPORT struct PSI_bootstrap *PSI_hook; | | extern MYSQL_PLUGIN_IMPORT struct PSI_bootstrap *PSI_hook; | |
|
| | | extern void set_psi_server(PSI *psi); | |
| void my_init_mysys_psi_keys(void); | | void my_init_mysys_psi_keys(void); | |
| #endif | | #endif | |
| | | | |
| struct st_mysql_file; | | struct st_mysql_file; | |
| extern struct st_mysql_file *mysql_stdin; | | extern struct st_mysql_file *mysql_stdin; | |
| | | | |
|
| | | enum durability_properties | |
| | | { | |
| | | /* | |
| | | Preserves the durability properties defined by the engine */ | |
| | | HA_REGULAR_DURABILITY= 0, | |
| | | /* | |
| | | Ignore the durability properties defined by the engine and | |
| | | write only in-memory entries. | |
| | | */ | |
| | | HA_IGNORE_DURABILITY= 1 | |
| | | }; | |
| | | | |
| C_MODE_END | | C_MODE_END | |
| #endif /* _my_sys_h */ | | #endif /* _my_sys_h */ | |
| | | | |
End of changes. 35 change blocks. |
| 63 lines changed or deleted | | 110 lines changed or added | |
|
| mysql_com.h | | mysql_com.h | |
|
| /* Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reser
ved. | | /* Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reser
ved. | |
| | | | |
| This program is free software; you can redistribute it and/or modify | | This program is free software; you can redistribute it and/or modify | |
| it under the terms of the GNU General Public License as published by | | it under the terms of the GNU General Public License as published by | |
| the Free Software Foundation; version 2 of the License. | | the Free Software Foundation; version 2 of the License. | |
| | | | |
| This program is distributed in the hope that it will be useful, | | This program is distributed in the hope that it will be useful, | |
| but WITHOUT ANY WARRANTY; without even the implied warranty of | | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
| GNU General Public License for more details. | | GNU General Public License for more details. | |
| | | | |
| | | | |
| skipping to change at line 42 | | skipping to change at line 42 | |
| #define SERVER_VERSION_LENGTH 60 | | #define SERVER_VERSION_LENGTH 60 | |
| #define SQLSTATE_LENGTH 5 | | #define SQLSTATE_LENGTH 5 | |
| | | | |
| /* | | /* | |
| Maximum length of comments | | Maximum length of comments | |
| */ | | */ | |
| #define TABLE_COMMENT_INLINE_MAXLEN 180 /* pre 6.0: 60 characters */ | | #define TABLE_COMMENT_INLINE_MAXLEN 180 /* pre 6.0: 60 characters */ | |
| #define TABLE_COMMENT_MAXLEN 2048 | | #define TABLE_COMMENT_MAXLEN 2048 | |
| #define COLUMN_COMMENT_MAXLEN 1024 | | #define COLUMN_COMMENT_MAXLEN 1024 | |
| #define INDEX_COMMENT_MAXLEN 1024 | | #define INDEX_COMMENT_MAXLEN 1024 | |
|
| | | #define TABLE_PARTITION_COMMENT_MAXLEN 1024 | |
| | | | |
| /* | | /* | |
| USER_HOST_BUFF_SIZE -- length of string buffer, that is enough to contain | | USER_HOST_BUFF_SIZE -- length of string buffer, that is enough to contain | |
| username and hostname parts of the user identifier with trailing zero in | | username and hostname parts of the user identifier with trailing zero in | |
| MySQL standard format: | | MySQL standard format: | |
| user_name_part@host_name_part\0 | | user_name_part@host_name_part\0 | |
| */ | | */ | |
| #define USER_HOST_BUFF_SIZE HOSTNAME_LENGTH + USERNAME_LENGTH + 2 | | #define USER_HOST_BUFF_SIZE HOSTNAME_LENGTH + USERNAME_LENGTH + 2 | |
| | | | |
| #define LOCAL_HOST "localhost" | | #define LOCAL_HOST "localhost" | |
| | | | |
| skipping to change at line 73 | | skipping to change at line 74 | |
| | | | |
| enum enum_server_command | | enum enum_server_command | |
| { | | { | |
| COM_SLEEP, COM_QUIT, COM_INIT_DB, COM_QUERY, COM_FIELD_LIST, | | COM_SLEEP, COM_QUIT, COM_INIT_DB, COM_QUERY, COM_FIELD_LIST, | |
| COM_CREATE_DB, COM_DROP_DB, COM_REFRESH, COM_SHUTDOWN, COM_STATISTICS, | | COM_CREATE_DB, COM_DROP_DB, COM_REFRESH, COM_SHUTDOWN, COM_STATISTICS, | |
| COM_PROCESS_INFO, COM_CONNECT, COM_PROCESS_KILL, COM_DEBUG, COM_PING, | | COM_PROCESS_INFO, COM_CONNECT, COM_PROCESS_KILL, COM_DEBUG, COM_PING, | |
| COM_TIME, COM_DELAYED_INSERT, COM_CHANGE_USER, COM_BINLOG_DUMP, | | COM_TIME, COM_DELAYED_INSERT, COM_CHANGE_USER, COM_BINLOG_DUMP, | |
| COM_TABLE_DUMP, COM_CONNECT_OUT, COM_REGISTER_SLAVE, | | COM_TABLE_DUMP, COM_CONNECT_OUT, COM_REGISTER_SLAVE, | |
| COM_STMT_PREPARE, COM_STMT_EXECUTE, COM_STMT_SEND_LONG_DATA, COM_STMT_CLO
SE, | | COM_STMT_PREPARE, COM_STMT_EXECUTE, COM_STMT_SEND_LONG_DATA, COM_STMT_CLO
SE, | |
| COM_STMT_RESET, COM_SET_OPTION, COM_STMT_FETCH, COM_DAEMON, | | COM_STMT_RESET, COM_SET_OPTION, COM_STMT_FETCH, COM_DAEMON, | |
|
| | | COM_BINLOG_DUMP_GTID, | |
| /* don't forget to update const char *command_name[] in sql_parse.cc */ | | /* don't forget to update const char *command_name[] in sql_parse.cc */ | |
| | | | |
| /* Must be last */ | | /* Must be last */ | |
| COM_END | | COM_END | |
| }; | | }; | |
| | | | |
| /* | | /* | |
| Length of random string sent by server on handshake; this is also length
of | | Length of random string sent by server on handshake; this is also length
of | |
| obfuscated password, recieved from client | | obfuscated password, recieved from client | |
| */ | | */ | |
| | | | |
| skipping to change at line 112 | | skipping to change at line 114 | |
| #define SET_FLAG 2048 /* field is a set */ | | #define SET_FLAG 2048 /* field is a set */ | |
| #define NO_DEFAULT_VALUE_FLAG 4096 /* Field doesn't have default value
*/ | | #define NO_DEFAULT_VALUE_FLAG 4096 /* Field doesn't have default value
*/ | |
| #define ON_UPDATE_NOW_FLAG 8192 /* Field is set to NOW on UPDATE */ | | #define ON_UPDATE_NOW_FLAG 8192 /* Field is set to NOW on UPDATE */ | |
| #define NUM_FLAG 32768 /* Field is num (for clients) */ | | #define NUM_FLAG 32768 /* Field is num (for clients) */ | |
| #define PART_KEY_FLAG 16384 /* Intern; Part of some key */ | | #define PART_KEY_FLAG 16384 /* Intern; Part of some key */ | |
| #define GROUP_FLAG 32768 /* Intern: Group field */ | | #define GROUP_FLAG 32768 /* Intern: Group field */ | |
| #define UNIQUE_FLAG 65536 /* Intern: Used by sql_yacc */ | | #define UNIQUE_FLAG 65536 /* Intern: Used by sql_yacc */ | |
| #define BINCMP_FLAG 131072 /* Intern: Used by sql_yacc */ | | #define BINCMP_FLAG 131072 /* Intern: Used by sql_yacc */ | |
| #define GET_FIXED_FIELDS_FLAG (1 << 18) /* Used to get fields in item tree
*/ | | #define GET_FIXED_FIELDS_FLAG (1 << 18) /* Used to get fields in item tree
*/ | |
| #define FIELD_IN_PART_FUNC_FLAG (1 << 19)/* Field part of partition func */ | | #define FIELD_IN_PART_FUNC_FLAG (1 << 19)/* Field part of partition func */ | |
|
| #define FIELD_IN_ADD_INDEX (1<< 20) /* Intern: Field used in ADD INDEX * | | /** | |
| / | | Intern: Field in TABLE object for new version of altered table, | |
| | | which participates in a newly added index. | |
| | | */ | |
| | | #define FIELD_IN_ADD_INDEX (1 << 20) | |
| #define FIELD_IS_RENAMED (1<< 21) /* Intern: Field is being renamed *
/ | | #define FIELD_IS_RENAMED (1<< 21) /* Intern: Field is being renamed *
/ | |
|
| #define FIELD_FLAGS_STORAGE_MEDIA 22 /* Field storage media, bit 22-23, | | #define FIELD_FLAGS_STORAGE_MEDIA 22 /* Field storage media, bit 22-23 * | |
| reserved by MySQL Cluster */ | | / | |
| #define FIELD_FLAGS_COLUMN_FORMAT 24 /* Field column format, bit 24-25, | | #define FIELD_FLAGS_STORAGE_MEDIA_MASK (3 << FIELD_FLAGS_STORAGE_MEDIA) | |
| reserved by MySQL Cluster */ | | #define FIELD_FLAGS_COLUMN_FORMAT 24 /* Field column format, bit 24-25 * | |
| | | / | |
| | | #define FIELD_FLAGS_COLUMN_FORMAT_MASK (3 << FIELD_FLAGS_COLUMN_FORMAT) | |
| | | #define FIELD_IS_DROPPED (1<< 26) /* Intern: Field is being dropped * | |
| | | / | |
| | | | |
| #define REFRESH_GRANT 1 /* Refresh grant tables */ | | #define REFRESH_GRANT 1 /* Refresh grant tables */ | |
| #define REFRESH_LOG 2 /* Start on new log file */ | | #define REFRESH_LOG 2 /* Start on new log file */ | |
| #define REFRESH_TABLES 4 /* close all tables */ | | #define REFRESH_TABLES 4 /* close all tables */ | |
| #define REFRESH_HOSTS 8 /* Flush host cache */ | | #define REFRESH_HOSTS 8 /* Flush host cache */ | |
| #define REFRESH_STATUS 16 /* Flush status variables */ | | #define REFRESH_STATUS 16 /* Flush status variables */ | |
| #define REFRESH_THREADS 32 /* Flush thread cache */ | | #define REFRESH_THREADS 32 /* Flush thread cache */ | |
| #define REFRESH_SLAVE 64 /* Reset master info and restart sl
ave | | #define REFRESH_SLAVE 64 /* Reset master info and restart sl
ave | |
| thread */ | | thread */ | |
| #define REFRESH_MASTER 128 /* Remove all bin logs in the index | | #define REFRESH_MASTER 128 /* Remove all bin logs in the index | |
| | | | |
| skipping to change at line 145 | | skipping to change at line 152 | |
| | | | |
| /* The following can't be set with mysql_refresh() */ | | /* The following can't be set with mysql_refresh() */ | |
| #define REFRESH_READ_LOCK 16384 /* Lock tables for read */ | | #define REFRESH_READ_LOCK 16384 /* Lock tables for read */ | |
| #define REFRESH_FAST 32768 /* Intern flag */ | | #define REFRESH_FAST 32768 /* Intern flag */ | |
| | | | |
| /* RESET (remove all queries) from query cache */ | | /* RESET (remove all queries) from query cache */ | |
| #define REFRESH_QUERY_CACHE 65536 | | #define REFRESH_QUERY_CACHE 65536 | |
| #define REFRESH_QUERY_CACHE_FREE 0x20000L /* pack query cache */ | | #define REFRESH_QUERY_CACHE_FREE 0x20000L /* pack query cache */ | |
| #define REFRESH_DES_KEY_FILE 0x40000L | | #define REFRESH_DES_KEY_FILE 0x40000L | |
| #define REFRESH_USER_RESOURCES 0x80000L | | #define REFRESH_USER_RESOURCES 0x80000L | |
|
| | | #define REFRESH_FOR_EXPORT 0x100000L /* FLUSH TABLES ... FOR EXPORT */ | |
| | | | |
| #define CLIENT_LONG_PASSWORD 1 /* new more secure passwords */ | | #define CLIENT_LONG_PASSWORD 1 /* new more secure passwords */ | |
| #define CLIENT_FOUND_ROWS 2 /* Found instead of affected rows */ | | #define CLIENT_FOUND_ROWS 2 /* Found instead of affected rows */ | |
| #define CLIENT_LONG_FLAG 4 /* Get all column flags */ | | #define CLIENT_LONG_FLAG 4 /* Get all column flags */ | |
| #define CLIENT_CONNECT_WITH_DB 8 /* One can specify db on connect */ | | #define CLIENT_CONNECT_WITH_DB 8 /* One can specify db on connect */ | |
| #define CLIENT_NO_SCHEMA 16 /* Don't allow database.table.column
*/ | | #define CLIENT_NO_SCHEMA 16 /* Don't allow database.table.column
*/ | |
| #define CLIENT_COMPRESS 32 /* Can use compression proto
col */ | | #define CLIENT_COMPRESS 32 /* Can use compression proto
col */ | |
| #define CLIENT_ODBC 64 /* Odbc client */ | | #define CLIENT_ODBC 64 /* Odbc client */ | |
| #define CLIENT_LOCAL_FILES 128 /* Can use LOAD DATA LOCAL */ | | #define CLIENT_LOCAL_FILES 128 /* Can use LOAD DATA LOCAL */ | |
| #define CLIENT_IGNORE_SPACE 256 /* Ignore spaces before '(' */ | | #define CLIENT_IGNORE_SPACE 256 /* Ignore spaces before '(' */ | |
| | | | |
| skipping to change at line 167 | | skipping to change at line 175 | |
| #define CLIENT_SSL 2048 /* Switch to SSL after handshake */ | | #define CLIENT_SSL 2048 /* Switch to SSL after handshake */ | |
| #define CLIENT_IGNORE_SIGPIPE 4096 /* IGNORE sigpipes */ | | #define CLIENT_IGNORE_SIGPIPE 4096 /* IGNORE sigpipes */ | |
| #define CLIENT_TRANSACTIONS 8192 /* Client knows about transactions *
/ | | #define CLIENT_TRANSACTIONS 8192 /* Client knows about transactions *
/ | |
| #define CLIENT_RESERVED 16384 /* Old flag for 4.1 protocol */ | | #define CLIENT_RESERVED 16384 /* Old flag for 4.1 protocol */ | |
| #define CLIENT_SECURE_CONNECTION 32768 /* New 4.1 authentication */ | | #define CLIENT_SECURE_CONNECTION 32768 /* New 4.1 authentication */ | |
| #define CLIENT_MULTI_STATEMENTS (1UL << 16) /* Enable/disable multi-stmt su
pport */ | | #define CLIENT_MULTI_STATEMENTS (1UL << 16) /* Enable/disable multi-stmt su
pport */ | |
| #define CLIENT_MULTI_RESULTS (1UL << 17) /* Enable/disable multi-results
*/ | | #define CLIENT_MULTI_RESULTS (1UL << 17) /* Enable/disable multi-results
*/ | |
| #define CLIENT_PS_MULTI_RESULTS (1UL << 18) /* Multi-results in PS-protocol
*/ | | #define CLIENT_PS_MULTI_RESULTS (1UL << 18) /* Multi-results in PS-protocol
*/ | |
| | | | |
| #define CLIENT_PLUGIN_AUTH (1UL << 19) /* Client supports plugin authentic
ation */ | | #define CLIENT_PLUGIN_AUTH (1UL << 19) /* Client supports plugin authentic
ation */ | |
|
| | | #define CLIENT_CONNECT_ATTRS (1UL << 20) /* Client supports connection attr | |
| | | ibutes */ | |
| | | | |
| | | /* Enable authentication response packet to be larger than 255 bytes. */ | |
| | | #define CLIENT_PLUGIN_AUTH_LENENC_CLIENT_DATA (1UL << 21) | |
| | | | |
| | | /* Don't close the connection for a connection with expired password. */ | |
| | | #define CLIENT_CAN_HANDLE_EXPIRED_PASSWORDS (1UL << 22) | |
| | | | |
| #define CLIENT_SSL_VERIFY_SERVER_CERT (1UL << 30) | | #define CLIENT_SSL_VERIFY_SERVER_CERT (1UL << 30) | |
| #define CLIENT_REMEMBER_OPTIONS (1UL << 31) | | #define CLIENT_REMEMBER_OPTIONS (1UL << 31) | |
| | | | |
| #ifdef HAVE_COMPRESS | | #ifdef HAVE_COMPRESS | |
| #define CAN_CLIENT_COMPRESS CLIENT_COMPRESS | | #define CAN_CLIENT_COMPRESS CLIENT_COMPRESS | |
| #else | | #else | |
| #define CAN_CLIENT_COMPRESS 0 | | #define CAN_CLIENT_COMPRESS 0 | |
| #endif | | #endif | |
| | | | |
| /* Gather all possible capabilites (flags) supported by the server */ | | /* Gather all possible capabilites (flags) supported by the server */ | |
|
| #define CLIENT_ALL_FLAGS (CLIENT_LONG_PASSWORD | \ | | #define CLIENT_ALL_FLAGS (CLIENT_LONG_PASSWORD \ | |
| CLIENT_FOUND_ROWS | \ | | | CLIENT_FOUND_ROWS \ | |
| CLIENT_LONG_FLAG | \ | | | CLIENT_LONG_FLAG \ | |
| CLIENT_CONNECT_WITH_DB | \ | | | CLIENT_CONNECT_WITH_DB \ | |
| CLIENT_NO_SCHEMA | \ | | | CLIENT_NO_SCHEMA \ | |
| CLIENT_COMPRESS | \ | | | CLIENT_COMPRESS \ | |
| CLIENT_ODBC | \ | | | CLIENT_ODBC \ | |
| CLIENT_LOCAL_FILES | \ | | | CLIENT_LOCAL_FILES \ | |
| CLIENT_IGNORE_SPACE | \ | | | CLIENT_IGNORE_SPACE \ | |
| CLIENT_PROTOCOL_41 | \ | | | CLIENT_PROTOCOL_41 \ | |
| CLIENT_INTERACTIVE | \ | | | CLIENT_INTERACTIVE \ | |
| CLIENT_SSL | \ | | | CLIENT_SSL \ | |
| CLIENT_IGNORE_SIGPIPE | \ | | | CLIENT_IGNORE_SIGPIPE \ | |
| CLIENT_TRANSACTIONS | \ | | | CLIENT_TRANSACTIONS \ | |
| CLIENT_RESERVED | \ | | | CLIENT_RESERVED \ | |
| CLIENT_SECURE_CONNECTION | \ | | | CLIENT_SECURE_CONNECTION \ | |
| CLIENT_MULTI_STATEMENTS | \ | | | CLIENT_MULTI_STATEMENTS \ | |
| CLIENT_MULTI_RESULTS | \ | | | CLIENT_MULTI_RESULTS \ | |
| CLIENT_PS_MULTI_RESULTS | \ | | | CLIENT_PS_MULTI_RESULTS \ | |
| CLIENT_SSL_VERIFY_SERVER_CERT | \ | | | CLIENT_SSL_VERIFY_SERVER_CERT \ | |
| CLIENT_REMEMBER_OPTIONS | \ | | | CLIENT_REMEMBER_OPTIONS \ | |
| CLIENT_PLUGIN_AUTH) | | | CLIENT_PLUGIN_AUTH \ | |
| | | | CLIENT_CONNECT_ATTRS \ | |
| | | | CLIENT_PLUGIN_AUTH_LENENC_CLIENT_DATA \ | |
| | | | CLIENT_CAN_HANDLE_EXPIRED_PASSWORDS \ | |
| | | ) | |
| | | | |
| /* | | /* | |
| Switch off the flags that are optional and depending on build flags | | Switch off the flags that are optional and depending on build flags | |
| If any of the optional flags is supported by the build it will be switche
d | | If any of the optional flags is supported by the build it will be switche
d | |
| on before sending to the client during the connection handshake. | | on before sending to the client during the connection handshake. | |
| */ | | */ | |
| #define CLIENT_BASIC_FLAGS (((CLIENT_ALL_FLAGS & ~CLIENT_SSL) \ | | #define CLIENT_BASIC_FLAGS (((CLIENT_ALL_FLAGS & ~CLIENT_SSL) \ | |
| & ~CLIENT_COMPRESS) \ | | & ~CLIENT_COMPRESS) \ | |
| & ~CLIENT_SSL_VERIFY_SERVER_
CERT) | | & ~CLIENT_SSL_VERIFY_SERVER_
CERT) | |
| | | | |
| | | | |
| skipping to change at line 249 | | skipping to change at line 268 | |
| */ | | */ | |
| #define SERVER_STATUS_METADATA_CHANGED 1024 | | #define SERVER_STATUS_METADATA_CHANGED 1024 | |
| #define SERVER_QUERY_WAS_SLOW 2048 | | #define SERVER_QUERY_WAS_SLOW 2048 | |
| | | | |
| /** | | /** | |
| To mark ResultSet containing output parameter values. | | To mark ResultSet containing output parameter values. | |
| */ | | */ | |
| #define SERVER_PS_OUT_PARAMS 4096 | | #define SERVER_PS_OUT_PARAMS 4096 | |
| | | | |
| /** | | /** | |
|
| | | Set at the same time as SERVER_STATUS_IN_TRANS if the started | |
| | | multi-statement transaction is a read-only transaction. Cleared | |
| | | when the transaction commits or aborts. Since this flag is sent | |
| | | to clients in OK and EOF packets, the flag indicates the | |
| | | transaction status at the end of command execution. | |
| | | */ | |
| | | #define SERVER_STATUS_IN_TRANS_READONLY 8192 | |
| | | | |
| | | /** | |
| Server status flags that must be cleared when starting | | Server status flags that must be cleared when starting | |
| execution of a new SQL statement. | | execution of a new SQL statement. | |
| Flags from this set are only added to the | | Flags from this set are only added to the | |
| current server status by the execution engine, but | | current server status by the execution engine, but | |
| never removed -- the execution engine expects them | | never removed -- the execution engine expects them | |
| to disappear automagically by the next command. | | to disappear automagically by the next command. | |
| */ | | */ | |
| #define SERVER_STATUS_CLEAR_SET (SERVER_QUERY_NO_GOOD_INDEX_USED| \ | | #define SERVER_STATUS_CLEAR_SET (SERVER_QUERY_NO_GOOD_INDEX_USED| \ | |
| SERVER_QUERY_NO_INDEX_USED|\ | | SERVER_QUERY_NO_INDEX_USED|\ | |
| SERVER_MORE_RESULTS_EXISTS|\ | | SERVER_MORE_RESULTS_EXISTS|\ | |
| | | | |
| skipping to change at line 301 | | skipping to change at line 329 | |
| and do not want to confuse the client with OK at the wrong time | | and do not want to confuse the client with OK at the wrong time | |
| */ | | */ | |
| unsigned long remain_in_buf,length, buf_length, where_b; | | unsigned long remain_in_buf,length, buf_length, where_b; | |
| unsigned long max_packet,max_packet_size; | | unsigned long max_packet,max_packet_size; | |
| unsigned int pkt_nr,compress_pkt_nr; | | unsigned int pkt_nr,compress_pkt_nr; | |
| unsigned int write_timeout, read_timeout, retry_count; | | unsigned int write_timeout, read_timeout, retry_count; | |
| int fcntl; | | int fcntl; | |
| unsigned int *return_status; | | unsigned int *return_status; | |
| unsigned char reading_or_writing; | | unsigned char reading_or_writing; | |
| char save_char; | | char save_char; | |
|
| my_bool unused1; /* Please remove with the next incompatible ABI change.
*/ | | my_bool unused1; /* Please remove with the next incompatible ABI change *
/ | |
| my_bool unused2; /* Please remove with the next incompatible ABI change *
/ | | my_bool unused2; /* Please remove with the next incompatible ABI change *
/ | |
| my_bool compress; | | my_bool compress; | |
| my_bool unused3; /* Please remove with the next incompatible ABI change.
*/ | | my_bool unused3; /* Please remove with the next incompatible ABI change.
*/ | |
| /* | | /* | |
| Pointer to query object in query cache, do not equal NULL (0) for | | Pointer to query object in query cache, do not equal NULL (0) for | |
| queries in cache that have not stored its results yet | | queries in cache that have not stored its results yet | |
| */ | | */ | |
| #endif | | #endif | |
| /* | | /* | |
| Unused, please remove with the next incompatible ABI change. | | Unused, please remove with the next incompatible ABI change. | |
| */ | | */ | |
| unsigned char *unused; | | unsigned char *unused; | |
| unsigned int last_errno; | | unsigned int last_errno; | |
| unsigned char error; | | unsigned char error; | |
| my_bool unused4; /* Please remove with the next incompatible ABI change.
*/ | | my_bool unused4; /* Please remove with the next incompatible ABI change.
*/ | |
| my_bool unused5; /* Please remove with the next incompatible ABI change.
*/ | | my_bool unused5; /* Please remove with the next incompatible ABI change.
*/ | |
| /** Client library error message buffer. Actually belongs to struct MYSQL
. */ | | /** Client library error message buffer. Actually belongs to struct MYSQL
. */ | |
| char last_error[MYSQL_ERRMSG_SIZE]; | | char last_error[MYSQL_ERRMSG_SIZE]; | |
| /** Client library sqlstate buffer. Set along with the error message. */ | | /** Client library sqlstate buffer. Set along with the error message. */ | |
| char sqlstate[SQLSTATE_LENGTH+1]; | | char sqlstate[SQLSTATE_LENGTH+1]; | |
|
| void *extension; | | /** | |
| #if defined(MYSQL_SERVER) && !defined(EMBEDDED_LIBRARY) | | Extension pointer, for the caller private use. | |
| /* | | Any program linking with the networking library can use this pointer, | |
| Controls whether a big packet should be skipped. | | which is handy when private connection specific data needs to be | |
| | | maintained. | |
| Initially set to FALSE by default. Unauthenticated sessions must have | | The mysqld server process uses this pointer internally, | |
| this set to FALSE so that the server can't be tricked to read packets | | to maintain the server internal instrumentation for the connection. | |
| indefinitely. | | | |
| */ | | */ | |
|
| my_bool skip_big_packet; | | void *extension; | |
| #endif | | | |
| } NET; | | } NET; | |
| | | | |
| #define packet_error (~(unsigned long) 0) | | #define packet_error (~(unsigned long) 0) | |
| | | | |
| enum enum_field_types { MYSQL_TYPE_DECIMAL, MYSQL_TYPE_TINY, | | enum enum_field_types { MYSQL_TYPE_DECIMAL, MYSQL_TYPE_TINY, | |
| MYSQL_TYPE_SHORT, MYSQL_TYPE_LONG, | | MYSQL_TYPE_SHORT, MYSQL_TYPE_LONG, | |
| MYSQL_TYPE_FLOAT, MYSQL_TYPE_DOUBLE, | | MYSQL_TYPE_FLOAT, MYSQL_TYPE_DOUBLE, | |
| MYSQL_TYPE_NULL, MYSQL_TYPE_TIMESTAMP, | | MYSQL_TYPE_NULL, MYSQL_TYPE_TIMESTAMP, | |
| MYSQL_TYPE_LONGLONG,MYSQL_TYPE_INT24, | | MYSQL_TYPE_LONGLONG,MYSQL_TYPE_INT24, | |
| MYSQL_TYPE_DATE, MYSQL_TYPE_TIME, | | MYSQL_TYPE_DATE, MYSQL_TYPE_TIME, | |
| MYSQL_TYPE_DATETIME, MYSQL_TYPE_YEAR, | | MYSQL_TYPE_DATETIME, MYSQL_TYPE_YEAR, | |
| MYSQL_TYPE_NEWDATE, MYSQL_TYPE_VARCHAR, | | MYSQL_TYPE_NEWDATE, MYSQL_TYPE_VARCHAR, | |
| MYSQL_TYPE_BIT, | | MYSQL_TYPE_BIT, | |
|
| | | MYSQL_TYPE_TIMESTAMP2, | |
| | | MYSQL_TYPE_DATETIME2, | |
| | | MYSQL_TYPE_TIME2, | |
| MYSQL_TYPE_NEWDECIMAL=246, | | MYSQL_TYPE_NEWDECIMAL=246, | |
| MYSQL_TYPE_ENUM=247, | | MYSQL_TYPE_ENUM=247, | |
| MYSQL_TYPE_SET=248, | | MYSQL_TYPE_SET=248, | |
| MYSQL_TYPE_TINY_BLOB=249, | | MYSQL_TYPE_TINY_BLOB=249, | |
| MYSQL_TYPE_MEDIUM_BLOB=250, | | MYSQL_TYPE_MEDIUM_BLOB=250, | |
| MYSQL_TYPE_LONG_BLOB=251, | | MYSQL_TYPE_LONG_BLOB=251, | |
| MYSQL_TYPE_BLOB=252, | | MYSQL_TYPE_BLOB=252, | |
| MYSQL_TYPE_VAR_STRING=253, | | MYSQL_TYPE_VAR_STRING=253, | |
| MYSQL_TYPE_STRING=254, | | MYSQL_TYPE_STRING=254, | |
| MYSQL_TYPE_GEOMETRY=255 | | MYSQL_TYPE_GEOMETRY=255 | |
| | | | |
| skipping to change at line 444 | | skipping to change at line 473 | |
| MYSQL_OPTION_MULTI_STATEMENTS_OFF | | MYSQL_OPTION_MULTI_STATEMENTS_OFF | |
| }; | | }; | |
| | | | |
| #define net_new_transaction(net) ((net)->pkt_nr=0) | | #define net_new_transaction(net) ((net)->pkt_nr=0) | |
| | | | |
| #ifdef __cplusplus | | #ifdef __cplusplus | |
| extern "C" { | | extern "C" { | |
| #endif | | #endif | |
| | | | |
| my_bool my_net_init(NET *net, Vio* vio); | | my_bool my_net_init(NET *net, Vio* vio); | |
|
| void my_net_local_init(NET *net); | | void my_net_local_init(NET *net); | |
| void net_end(NET *net); | | void net_end(NET *net); | |
| void net_clear(NET *net, my_bool clear_buffer); | | void net_clear(NET *net, my_bool check_buffer); | |
| my_bool net_realloc(NET *net, size_t length); | | my_bool net_realloc(NET *net, size_t length); | |
| my_bool net_flush(NET *net); | | my_bool net_flush(NET *net); | |
| my_bool my_net_write(NET *net,const unsigned char *packet, size_t le
n); | | my_bool my_net_write(NET *net,const unsigned char *packet, size_t le
n); | |
| my_bool net_write_command(NET *net,unsigned char command, | | my_bool net_write_command(NET *net,unsigned char command, | |
| const unsigned char *header, size_t head_len, | | const unsigned char *header, size_t head_len, | |
| const unsigned char *packet, size_t len); | | const unsigned char *packet, size_t len); | |
|
| int net_real_write(NET *net,const unsigned char *packet, size_t len); | | my_bool net_write_packet(NET *net, const unsigned char *packet, size_t leng
th); | |
| unsigned long my_net_read(NET *net); | | unsigned long my_net_read(NET *net); | |
| | | | |
|
| #ifdef _global_h | | #ifdef MY_GLOBAL_INCLUDED | |
| void my_net_set_write_timeout(NET *net, uint timeout); | | void my_net_set_write_timeout(NET *net, uint timeout); | |
| void my_net_set_read_timeout(NET *net, uint timeout); | | void my_net_set_read_timeout(NET *net, uint timeout); | |
| #endif | | #endif | |
| | | | |
|
| struct sockaddr; | | | |
| int my_connect(my_socket s, const struct sockaddr *name, unsigned int namel | | | |
| en, | | | |
| unsigned int timeout); | | | |
| | | | |
| struct rand_struct { | | struct rand_struct { | |
| unsigned long seed1,seed2,max_value; | | unsigned long seed1,seed2,max_value; | |
| double max_value_dbl; | | double max_value_dbl; | |
| }; | | }; | |
| | | | |
| #ifdef __cplusplus | | #ifdef __cplusplus | |
| } | | } | |
| #endif | | #endif | |
| | | | |
| /* The following is for user defined functions */ | | /* The following is for user defined functions */ | |
| | | | |
| skipping to change at line 553 | | skipping to change at line 578 | |
| /* end of password.c */ | | /* end of password.c */ | |
| | | | |
| char *get_tty_password(const char *opt_message); | | char *get_tty_password(const char *opt_message); | |
| const char *mysql_errno_to_sqlstate(unsigned int mysql_errno); | | const char *mysql_errno_to_sqlstate(unsigned int mysql_errno); | |
| | | | |
| /* Some other useful functions */ | | /* Some other useful functions */ | |
| | | | |
| my_bool my_thread_init(void); | | my_bool my_thread_init(void); | |
| void my_thread_end(void); | | void my_thread_end(void); | |
| | | | |
|
| #ifdef _global_h | | #ifdef MY_GLOBAL_INCLUDED | |
| ulong STDCALL net_field_length(uchar **packet); | | ulong STDCALL net_field_length(uchar **packet); | |
| my_ulonglong net_field_length_ll(uchar **packet); | | my_ulonglong net_field_length_ll(uchar **packet); | |
| uchar *net_store_length(uchar *pkg, ulonglong length); | | uchar *net_store_length(uchar *pkg, ulonglong length); | |
| #endif | | #endif | |
| | | | |
| #ifdef __cplusplus | | #ifdef __cplusplus | |
| } | | } | |
| #endif | | #endif | |
| | | | |
| #define NULL_LENGTH ((unsigned long) ~0) /* For net_store_length */ | | #define NULL_LENGTH ((unsigned long) ~0) /* For net_store_length */ | |
| | | | |
End of changes. 18 change blocks. |
| 51 lines changed or deleted | | 78 lines changed or added | |
|
| mysql_file.h | | mysql_file.h | |
|
| /* Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reser
ved. | | /* Copyright (c) 2008, 2011, Oracle and/or its affiliates. All rights reser
ved. | |
| | | | |
| This program is free software; you can redistribute it and/or modify | | This program is free software; you can redistribute it and/or modify | |
| it under the terms of the GNU General Public License as published by | | it under the terms of the GNU General Public License as published by | |
| the Free Software Foundation; version 2 of the License. | | the Free Software Foundation; version 2 of the License. | |
| | | | |
| This program is distributed in the hope that it will be useful, | | This program is distributed in the hope that it will be useful, | |
| but WITHOUT ANY WARRANTY; without even the implied warranty of | | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
| GNU General Public License for more details. | | GNU General Public License for more details. | |
| | | | |
| | | | |
| skipping to change at line 53 | | skipping to change at line 53 | |
| | | | |
| #include "mysql/psi/psi.h" | | #include "mysql/psi/psi.h" | |
| | | | |
| /** | | /** | |
| @defgroup File_instrumentation File Instrumentation | | @defgroup File_instrumentation File Instrumentation | |
| @ingroup Instrumentation_interface | | @ingroup Instrumentation_interface | |
| @{ | | @{ | |
| */ | | */ | |
| | | | |
| /** | | /** | |
|
| | | @def mysql_file_register(P1, P2, P3) | |
| | | File registration. | |
| | | */ | |
| | | #define mysql_file_register(P1, P2, P3) \ | |
| | | inline_mysql_file_register(P1, P2, P3) | |
| | | | |
| | | /** | |
| @def mysql_file_fgets(P1, P2, F) | | @def mysql_file_fgets(P1, P2, F) | |
| Instrumented fgets. | | Instrumented fgets. | |
| @c mysql_file_fgets is a replacement for @c fgets. | | @c mysql_file_fgets is a replacement for @c fgets. | |
| */ | | */ | |
|
| #ifdef HAVE_PSI_INTERFACE | | #ifdef HAVE_PSI_FILE_INTERFACE | |
| #define mysql_file_fgets(P1, P2, F) \ | | #define mysql_file_fgets(P1, P2, F) \ | |
| inline_mysql_file_fgets(__FILE__, __LINE__, P1, P2, F) | | inline_mysql_file_fgets(__FILE__, __LINE__, P1, P2, F) | |
| #else | | #else | |
| #define mysql_file_fgets(P1, P2, F) \ | | #define mysql_file_fgets(P1, P2, F) \ | |
| inline_mysql_file_fgets(P1, P2, F) | | inline_mysql_file_fgets(P1, P2, F) | |
| #endif | | #endif | |
| | | | |
| /** | | /** | |
| @def mysql_file_fgetc(F) | | @def mysql_file_fgetc(F) | |
| Instrumented fgetc. | | Instrumented fgetc. | |
| @c mysql_file_fgetc is a replacement for @c fgetc. | | @c mysql_file_fgetc is a replacement for @c fgetc. | |
| */ | | */ | |
|
| #ifdef HAVE_PSI_INTERFACE | | #ifdef HAVE_PSI_FILE_INTERFACE | |
| #define mysql_file_fgetc(F) inline_mysql_file_fgetc(__FILE__, __LINE__, F
) | | #define mysql_file_fgetc(F) inline_mysql_file_fgetc(__FILE__, __LINE__, F
) | |
| #else | | #else | |
| #define mysql_file_fgetc(F) inline_mysql_file_fgetc(F) | | #define mysql_file_fgetc(F) inline_mysql_file_fgetc(F) | |
| #endif | | #endif | |
| | | | |
| /** | | /** | |
| @def mysql_file_fputs(P1, F) | | @def mysql_file_fputs(P1, F) | |
| Instrumented fputs. | | Instrumented fputs. | |
| @c mysql_file_fputs is a replacement for @c fputs. | | @c mysql_file_fputs is a replacement for @c fputs. | |
| */ | | */ | |
|
| #ifdef HAVE_PSI_INTERFACE | | #ifdef HAVE_PSI_FILE_INTERFACE | |
| #define mysql_file_fputs(P1, F) \ | | #define mysql_file_fputs(P1, F) \ | |
| inline_mysql_file_fputs(__FILE__, __LINE__, P1, F) | | inline_mysql_file_fputs(__FILE__, __LINE__, P1, F) | |
| #else | | #else | |
| #define mysql_file_fputs(P1, F)\ | | #define mysql_file_fputs(P1, F)\ | |
| inline_mysql_file_fputs(P1, F) | | inline_mysql_file_fputs(P1, F) | |
| #endif | | #endif | |
| | | | |
| /** | | /** | |
| @def mysql_file_fputc(P1, F) | | @def mysql_file_fputc(P1, F) | |
| Instrumented fputc. | | Instrumented fputc. | |
| @c mysql_file_fputc is a replacement for @c fputc. | | @c mysql_file_fputc is a replacement for @c fputc. | |
| */ | | */ | |
|
| #ifdef HAVE_PSI_INTERFACE | | #ifdef HAVE_PSI_FILE_INTERFACE | |
| #define mysql_file_fputc(P1, F) \ | | #define mysql_file_fputc(P1, F) \ | |
| inline_mysql_file_fputc(__FILE__, __LINE__, P1, F) | | inline_mysql_file_fputc(__FILE__, __LINE__, P1, F) | |
| #else | | #else | |
| #define mysql_file_fputc(P1, F) \ | | #define mysql_file_fputc(P1, F) \ | |
| inline_mysql_file_fputc(P1, F) | | inline_mysql_file_fputc(P1, F) | |
| #endif | | #endif | |
| | | | |
| /** | | /** | |
| @def mysql_file_fprintf | | @def mysql_file_fprintf | |
| Instrumented fprintf. | | Instrumented fprintf. | |
| @c mysql_file_fprintf is a replacement for @c fprintf. | | @c mysql_file_fprintf is a replacement for @c fprintf. | |
| */ | | */ | |
| #define mysql_file_fprintf inline_mysql_file_fprintf | | #define mysql_file_fprintf inline_mysql_file_fprintf | |
| | | | |
| /** | | /** | |
| @def mysql_file_vfprintf(F, P1, P2) | | @def mysql_file_vfprintf(F, P1, P2) | |
| Instrumented vfprintf. | | Instrumented vfprintf. | |
| @c mysql_file_vfprintf is a replacement for @c vfprintf. | | @c mysql_file_vfprintf is a replacement for @c vfprintf. | |
| */ | | */ | |
|
| #ifdef HAVE_PSI_INTERFACE | | #ifdef HAVE_PSI_FILE_INTERFACE | |
| #define mysql_file_vfprintf(F, P1, P2) \ | | #define mysql_file_vfprintf(F, P1, P2) \ | |
| inline_mysql_file_vfprintf(__FILE__, __LINE__, F, P1, P2) | | inline_mysql_file_vfprintf(__FILE__, __LINE__, F, P1, P2) | |
| #else | | #else | |
| #define mysql_file_vfprintf(F, P1, P2) \ | | #define mysql_file_vfprintf(F, P1, P2) \ | |
| inline_mysql_file_vfprintf(F, P1, P2) | | inline_mysql_file_vfprintf(F, P1, P2) | |
| #endif | | #endif | |
| | | | |
| /** | | /** | |
| @def mysql_file_fflush(F, P1, P2) | | @def mysql_file_fflush(F, P1, P2) | |
| Instrumented fflush. | | Instrumented fflush. | |
| @c mysql_file_fflush is a replacement for @c fflush. | | @c mysql_file_fflush is a replacement for @c fflush. | |
| */ | | */ | |
|
| #ifdef HAVE_PSI_INTERFACE | | #ifdef HAVE_PSI_FILE_INTERFACE | |
| #define mysql_file_fflush(F) \ | | #define mysql_file_fflush(F) \ | |
| inline_mysql_file_fflush(__FILE__, __LINE__, F) | | inline_mysql_file_fflush(__FILE__, __LINE__, F) | |
| #else | | #else | |
| #define mysql_file_fflush(F) \ | | #define mysql_file_fflush(F) \ | |
| inline_mysql_file_fflush(F) | | inline_mysql_file_fflush(F) | |
| #endif | | #endif | |
| | | | |
| /** | | /** | |
| @def mysql_file_feof(F) | | @def mysql_file_feof(F) | |
| Instrumented feof. | | Instrumented feof. | |
| @c mysql_file_feof is a replacement for @c feof. | | @c mysql_file_feof is a replacement for @c feof. | |
| */ | | */ | |
| #define mysql_file_feof(F) inline_mysql_file_feof(F) | | #define mysql_file_feof(F) inline_mysql_file_feof(F) | |
| | | | |
| /** | | /** | |
| @def mysql_file_fstat(FN, S, FL) | | @def mysql_file_fstat(FN, S, FL) | |
| Instrumented fstat. | | Instrumented fstat. | |
| @c mysql_file_fstat is a replacement for @c my_fstat. | | @c mysql_file_fstat is a replacement for @c my_fstat. | |
| */ | | */ | |
|
| #ifdef HAVE_PSI_INTERFACE | | #ifdef HAVE_PSI_FILE_INTERFACE | |
| #define mysql_file_fstat(FN, S, FL) \ | | #define mysql_file_fstat(FN, S, FL) \ | |
| inline_mysql_file_fstat(__FILE__, __LINE__, FN, S, FL) | | inline_mysql_file_fstat(__FILE__, __LINE__, FN, S, FL) | |
| #else | | #else | |
| #define mysql_file_fstat(FN, S, FL) \ | | #define mysql_file_fstat(FN, S, FL) \ | |
| inline_mysql_file_fstat(FN, S, FL) | | inline_mysql_file_fstat(FN, S, FL) | |
| #endif | | #endif | |
| | | | |
| /** | | /** | |
| @def mysql_file_stat(K, FN, S, FL) | | @def mysql_file_stat(K, FN, S, FL) | |
| Instrumented stat. | | Instrumented stat. | |
| @c mysql_file_stat is a replacement for @c my_stat. | | @c mysql_file_stat is a replacement for @c my_stat. | |
| */ | | */ | |
|
| #ifdef HAVE_PSI_INTERFACE | | #ifdef HAVE_PSI_FILE_INTERFACE | |
| #define mysql_file_stat(K, FN, S, FL) \ | | #define mysql_file_stat(K, FN, S, FL) \ | |
| inline_mysql_file_stat(K, __FILE__, __LINE__, FN, S, FL) | | inline_mysql_file_stat(K, __FILE__, __LINE__, FN, S, FL) | |
| #else | | #else | |
| #define mysql_file_stat(K, FN, S, FL) \ | | #define mysql_file_stat(K, FN, S, FL) \ | |
| inline_mysql_file_stat(FN, S, FL) | | inline_mysql_file_stat(FN, S, FL) | |
| #endif | | #endif | |
| | | | |
| /** | | /** | |
| @def mysql_file_chsize(F, P1, P2, P3) | | @def mysql_file_chsize(F, P1, P2, P3) | |
| Instrumented chsize. | | Instrumented chsize. | |
| @c mysql_file_chsize is a replacement for @c my_chsize. | | @c mysql_file_chsize is a replacement for @c my_chsize. | |
| */ | | */ | |
|
| #ifdef HAVE_PSI_INTERFACE | | #ifdef HAVE_PSI_FILE_INTERFACE | |
| #define mysql_file_chsize(F, P1, P2, P3) \ | | #define mysql_file_chsize(F, P1, P2, P3) \ | |
| inline_mysql_file_chsize(__FILE__, __LINE__, F, P1, P2, P3) | | inline_mysql_file_chsize(__FILE__, __LINE__, F, P1, P2, P3) | |
| #else | | #else | |
| #define mysql_file_chsize(F, P1, P2, P3) \ | | #define mysql_file_chsize(F, P1, P2, P3) \ | |
| inline_mysql_file_chsize(F, P1, P2, P3) | | inline_mysql_file_chsize(F, P1, P2, P3) | |
| #endif | | #endif | |
| | | | |
| /** | | /** | |
| @def mysql_file_fopen(K, N, F1, F2) | | @def mysql_file_fopen(K, N, F1, F2) | |
| Instrumented fopen. | | Instrumented fopen. | |
| @c mysql_file_fopen is a replacement for @c my_fopen. | | @c mysql_file_fopen is a replacement for @c my_fopen. | |
| */ | | */ | |
|
| #ifdef HAVE_PSI_INTERFACE | | #ifdef HAVE_PSI_FILE_INTERFACE | |
| #define mysql_file_fopen(K, N, F1, F2) \ | | #define mysql_file_fopen(K, N, F1, F2) \ | |
| inline_mysql_file_fopen(K, __FILE__, __LINE__, N, F1, F2) | | inline_mysql_file_fopen(K, __FILE__, __LINE__, N, F1, F2) | |
| #else | | #else | |
| #define mysql_file_fopen(K, N, F1, F2) \ | | #define mysql_file_fopen(K, N, F1, F2) \ | |
| inline_mysql_file_fopen(N, F1, F2) | | inline_mysql_file_fopen(N, F1, F2) | |
| #endif | | #endif | |
| | | | |
| /** | | /** | |
| @def mysql_file_fclose(FD, FL) | | @def mysql_file_fclose(FD, FL) | |
| Instrumented fclose. | | Instrumented fclose. | |
| @c mysql_file_fclose is a replacement for @c my_fclose. | | @c mysql_file_fclose is a replacement for @c my_fclose. | |
| Without the instrumentation, this call will have the same behavior as the | | Without the instrumentation, this call will have the same behavior as the | |
| undocumented and possibly platform specific my_fclose(NULL, ...) behavior
. | | undocumented and possibly platform specific my_fclose(NULL, ...) behavior
. | |
| With the instrumentation, mysql_fclose(NULL, ...) will safely return 0, | | With the instrumentation, mysql_fclose(NULL, ...) will safely return 0, | |
| which is an extension compared to my_fclose and is therefore compliant. | | which is an extension compared to my_fclose and is therefore compliant. | |
| mysql_fclose is on purpose *not* implementing | | mysql_fclose is on purpose *not* implementing | |
| @code DBUG_ASSERT(file != NULL) @endcode, | | @code DBUG_ASSERT(file != NULL) @endcode, | |
| since doing so could introduce regressions. | | since doing so could introduce regressions. | |
| */ | | */ | |
|
| #ifdef HAVE_PSI_INTERFACE | | #ifdef HAVE_PSI_FILE_INTERFACE | |
| #define mysql_file_fclose(FD, FL) \ | | #define mysql_file_fclose(FD, FL) \ | |
| inline_mysql_file_fclose(__FILE__, __LINE__, FD, FL) | | inline_mysql_file_fclose(__FILE__, __LINE__, FD, FL) | |
| #else | | #else | |
| #define mysql_file_fclose(FD, FL) \ | | #define mysql_file_fclose(FD, FL) \ | |
| inline_mysql_file_fclose(FD, FL) | | inline_mysql_file_fclose(FD, FL) | |
| #endif | | #endif | |
| | | | |
| /** | | /** | |
| @def mysql_file_fread(FD, P1, P2, P3) | | @def mysql_file_fread(FD, P1, P2, P3) | |
| Instrumented fread. | | Instrumented fread. | |
| @c mysql_file_fread is a replacement for @c my_fread. | | @c mysql_file_fread is a replacement for @c my_fread. | |
| */ | | */ | |
|
| #ifdef HAVE_PSI_INTERFACE | | #ifdef HAVE_PSI_FILE_INTERFACE | |
| #define mysql_file_fread(FD, P1, P2, P3) \ | | #define mysql_file_fread(FD, P1, P2, P3) \ | |
| inline_mysql_file_fread(__FILE__, __LINE__, FD, P1, P2, P3) | | inline_mysql_file_fread(__FILE__, __LINE__, FD, P1, P2, P3) | |
| #else | | #else | |
| #define mysql_file_fread(FD, P1, P2, P3) \ | | #define mysql_file_fread(FD, P1, P2, P3) \ | |
| inline_mysql_file_fread(FD, P1, P2, P3) | | inline_mysql_file_fread(FD, P1, P2, P3) | |
| #endif | | #endif | |
| | | | |
| /** | | /** | |
| @def mysql_file_fwrite(FD, P1, P2, P3) | | @def mysql_file_fwrite(FD, P1, P2, P3) | |
| Instrumented fwrite. | | Instrumented fwrite. | |
| @c mysql_file_fwrite is a replacement for @c my_fwrite. | | @c mysql_file_fwrite is a replacement for @c my_fwrite. | |
| */ | | */ | |
|
| #ifdef HAVE_PSI_INTERFACE | | #ifdef HAVE_PSI_FILE_INTERFACE | |
| #define mysql_file_fwrite(FD, P1, P2, P3) \ | | #define mysql_file_fwrite(FD, P1, P2, P3) \ | |
| inline_mysql_file_fwrite(__FILE__, __LINE__, FD, P1, P2, P3) | | inline_mysql_file_fwrite(__FILE__, __LINE__, FD, P1, P2, P3) | |
| #else | | #else | |
| #define mysql_file_fwrite(FD, P1, P2, P3) \ | | #define mysql_file_fwrite(FD, P1, P2, P3) \ | |
| inline_mysql_file_fwrite(FD, P1, P2, P3) | | inline_mysql_file_fwrite(FD, P1, P2, P3) | |
| #endif | | #endif | |
| | | | |
| /** | | /** | |
| @def mysql_file_fseek(FD, P, W, F) | | @def mysql_file_fseek(FD, P, W, F) | |
| Instrumented fseek. | | Instrumented fseek. | |
| @c mysql_file_fseek is a replacement for @c my_fseek. | | @c mysql_file_fseek is a replacement for @c my_fseek. | |
| */ | | */ | |
|
| #ifdef HAVE_PSI_INTERFACE | | #ifdef HAVE_PSI_FILE_INTERFACE | |
| #define mysql_file_fseek(FD, P, W, F) \ | | #define mysql_file_fseek(FD, P, W, F) \ | |
| inline_mysql_file_fseek(__FILE__, __LINE__, FD, P, W, F) | | inline_mysql_file_fseek(__FILE__, __LINE__, FD, P, W, F) | |
| #else | | #else | |
| #define mysql_file_fseek(FD, P, W, F) \ | | #define mysql_file_fseek(FD, P, W, F) \ | |
| inline_mysql_file_fseek(FD, P, W, F) | | inline_mysql_file_fseek(FD, P, W, F) | |
| #endif | | #endif | |
| | | | |
| /** | | /** | |
| @def mysql_file_ftell(FD, F) | | @def mysql_file_ftell(FD, F) | |
| Instrumented ftell. | | Instrumented ftell. | |
| @c mysql_file_ftell is a replacement for @c my_ftell. | | @c mysql_file_ftell is a replacement for @c my_ftell. | |
| */ | | */ | |
|
| #ifdef HAVE_PSI_INTERFACE | | #ifdef HAVE_PSI_FILE_INTERFACE | |
| #define mysql_file_ftell(FD, F) \ | | #define mysql_file_ftell(FD, F) \ | |
| inline_mysql_file_ftell(__FILE__, __LINE__, FD, F) | | inline_mysql_file_ftell(__FILE__, __LINE__, FD, F) | |
| #else | | #else | |
| #define mysql_file_ftell(FD, F) \ | | #define mysql_file_ftell(FD, F) \ | |
| inline_mysql_file_ftell(FD, F) | | inline_mysql_file_ftell(FD, F) | |
| #endif | | #endif | |
| | | | |
| /** | | /** | |
| @def mysql_file_create(K, N, F1, F2, F3) | | @def mysql_file_create(K, N, F1, F2, F3) | |
| Instrumented create. | | Instrumented create. | |
| @c mysql_file_create is a replacement for @c my_create. | | @c mysql_file_create is a replacement for @c my_create. | |
| */ | | */ | |
|
| #ifdef HAVE_PSI_INTERFACE | | #ifdef HAVE_PSI_FILE_INTERFACE | |
| #define mysql_file_create(K, N, F1, F2, F3) \ | | #define mysql_file_create(K, N, F1, F2, F3) \ | |
| inline_mysql_file_create(K, __FILE__, __LINE__, N, F1, F2, F3) | | inline_mysql_file_create(K, __FILE__, __LINE__, N, F1, F2, F3) | |
| #else | | #else | |
| #define mysql_file_create(K, N, F1, F2, F3) \ | | #define mysql_file_create(K, N, F1, F2, F3) \ | |
| inline_mysql_file_create(N, F1, F2, F3) | | inline_mysql_file_create(N, F1, F2, F3) | |
| #endif | | #endif | |
| | | | |
| /** | | /** | |
| @def mysql_file_create_temp(K, T, D, P, M, F) | | @def mysql_file_create_temp(K, T, D, P, M, F) | |
| Instrumented create_temp_file. | | Instrumented create_temp_file. | |
| @c mysql_file_create_temp is a replacement for @c create_temp_file. | | @c mysql_file_create_temp is a replacement for @c create_temp_file. | |
| */ | | */ | |
|
| #ifdef HAVE_PSI_INTERFACE | | #ifdef HAVE_PSI_FILE_INTERFACE | |
| #define mysql_file_create_temp(K, T, D, P, M, F) \ | | #define mysql_file_create_temp(K, T, D, P, M, F) \ | |
| inline_mysql_file_create_temp(K, T, D, P, M, F) | | inline_mysql_file_create_temp(K, T, D, P, M, F) | |
| #else | | #else | |
| #define mysql_file_create_temp(K, T, D, P, M, F) \ | | #define mysql_file_create_temp(K, T, D, P, M, F) \ | |
| inline_mysql_file_create_temp(T, D, P, M, F) | | inline_mysql_file_create_temp(T, D, P, M, F) | |
| #endif | | #endif | |
| | | | |
| /** | | /** | |
| @def mysql_file_open(K, N, F1, F2) | | @def mysql_file_open(K, N, F1, F2) | |
| Instrumented open. | | Instrumented open. | |
| @c mysql_file_open is a replacement for @c my_open. | | @c mysql_file_open is a replacement for @c my_open. | |
| */ | | */ | |
|
| #ifdef HAVE_PSI_INTERFACE | | #ifdef HAVE_PSI_FILE_INTERFACE | |
| #define mysql_file_open(K, N, F1, F2) \ | | #define mysql_file_open(K, N, F1, F2) \ | |
| inline_mysql_file_open(K, __FILE__, __LINE__, N, F1, F2) | | inline_mysql_file_open(K, __FILE__, __LINE__, N, F1, F2) | |
| #else | | #else | |
| #define mysql_file_open(K, N, F1, F2) \ | | #define mysql_file_open(K, N, F1, F2) \ | |
| inline_mysql_file_open(N, F1, F2) | | inline_mysql_file_open(N, F1, F2) | |
| #endif | | #endif | |
| | | | |
| /** | | /** | |
| @def mysql_file_close(FD, F) | | @def mysql_file_close(FD, F) | |
| Instrumented close. | | Instrumented close. | |
| @c mysql_file_close is a replacement for @c my_close. | | @c mysql_file_close is a replacement for @c my_close. | |
| */ | | */ | |
|
| #ifdef HAVE_PSI_INTERFACE | | #ifdef HAVE_PSI_FILE_INTERFACE | |
| #define mysql_file_close(FD, F) \ | | #define mysql_file_close(FD, F) \ | |
| inline_mysql_file_close(__FILE__, __LINE__, FD, F) | | inline_mysql_file_close(__FILE__, __LINE__, FD, F) | |
| #else | | #else | |
| #define mysql_file_close(FD, F) \ | | #define mysql_file_close(FD, F) \ | |
| inline_mysql_file_close(FD, F) | | inline_mysql_file_close(FD, F) | |
| #endif | | #endif | |
| | | | |
| /** | | /** | |
| @def mysql_file_read(FD, B, S, F) | | @def mysql_file_read(FD, B, S, F) | |
| Instrumented read. | | Instrumented read. | |
| @c mysql_read is a replacement for @c my_read. | | @c mysql_read is a replacement for @c my_read. | |
| */ | | */ | |
|
| #ifdef HAVE_PSI_INTERFACE | | #ifdef HAVE_PSI_FILE_INTERFACE | |
| #define mysql_file_read(FD, B, S, F) \ | | #define mysql_file_read(FD, B, S, F) \ | |
| inline_mysql_file_read(__FILE__, __LINE__, FD, B, S, F) | | inline_mysql_file_read(__FILE__, __LINE__, FD, B, S, F) | |
| #else | | #else | |
| #define mysql_file_read(FD, B, S, F) \ | | #define mysql_file_read(FD, B, S, F) \ | |
| inline_mysql_file_read(FD, B, S, F) | | inline_mysql_file_read(FD, B, S, F) | |
| #endif | | #endif | |
| | | | |
| /** | | /** | |
| @def mysql_file_write(FD, B, S, F) | | @def mysql_file_write(FD, B, S, F) | |
| Instrumented write. | | Instrumented write. | |
| @c mysql_file_write is a replacement for @c my_write. | | @c mysql_file_write is a replacement for @c my_write. | |
| */ | | */ | |
|
| #ifdef HAVE_PSI_INTERFACE | | #ifdef HAVE_PSI_FILE_INTERFACE | |
| #define mysql_file_write(FD, B, S, F) \ | | #define mysql_file_write(FD, B, S, F) \ | |
| inline_mysql_file_write(__FILE__, __LINE__, FD, B, S, F) | | inline_mysql_file_write(__FILE__, __LINE__, FD, B, S, F) | |
| #else | | #else | |
| #define mysql_file_write(FD, B, S, F) \ | | #define mysql_file_write(FD, B, S, F) \ | |
| inline_mysql_file_write(FD, B, S, F) | | inline_mysql_file_write(FD, B, S, F) | |
| #endif | | #endif | |
| | | | |
| /** | | /** | |
| @def mysql_file_pread(FD, B, S, O, F) | | @def mysql_file_pread(FD, B, S, O, F) | |
| Instrumented pread. | | Instrumented pread. | |
| @c mysql_pread is a replacement for @c my_pread. | | @c mysql_pread is a replacement for @c my_pread. | |
| */ | | */ | |
|
| #ifdef HAVE_PSI_INTERFACE | | #ifdef HAVE_PSI_FILE_INTERFACE | |
| #define mysql_file_pread(FD, B, S, O, F) \ | | #define mysql_file_pread(FD, B, S, O, F) \ | |
| inline_mysql_file_pread(__FILE__, __LINE__, FD, B, S, O, F) | | inline_mysql_file_pread(__FILE__, __LINE__, FD, B, S, O, F) | |
| #else | | #else | |
| #define mysql_file_pread(FD, B, S, O, F) \ | | #define mysql_file_pread(FD, B, S, O, F) \ | |
| inline_mysql_file_pread(FD, B, S, O, F) | | inline_mysql_file_pread(FD, B, S, O, F) | |
| #endif | | #endif | |
| | | | |
| /** | | /** | |
| @def mysql_file_pwrite(FD, B, S, O, F) | | @def mysql_file_pwrite(FD, B, S, O, F) | |
| Instrumented pwrite. | | Instrumented pwrite. | |
| @c mysql_file_pwrite is a replacement for @c my_pwrite. | | @c mysql_file_pwrite is a replacement for @c my_pwrite. | |
| */ | | */ | |
|
| #ifdef HAVE_PSI_INTERFACE | | #ifdef HAVE_PSI_FILE_INTERFACE | |
| #define mysql_file_pwrite(FD, B, S, O, F) \ | | #define mysql_file_pwrite(FD, B, S, O, F) \ | |
| inline_mysql_file_pwrite(__FILE__, __LINE__, FD, B, S, O, F) | | inline_mysql_file_pwrite(__FILE__, __LINE__, FD, B, S, O, F) | |
| #else | | #else | |
| #define mysql_file_pwrite(FD, B, S, O, F) \ | | #define mysql_file_pwrite(FD, B, S, O, F) \ | |
| inline_mysql_file_pwrite(FD, B, S, O, F) | | inline_mysql_file_pwrite(FD, B, S, O, F) | |
| #endif | | #endif | |
| | | | |
| /** | | /** | |
| @def mysql_file_seek(FD, P, W, F) | | @def mysql_file_seek(FD, P, W, F) | |
| Instrumented seek. | | Instrumented seek. | |
| @c mysql_file_seek is a replacement for @c my_seek. | | @c mysql_file_seek is a replacement for @c my_seek. | |
| */ | | */ | |
|
| #ifdef HAVE_PSI_INTERFACE | | #ifdef HAVE_PSI_FILE_INTERFACE | |
| #define mysql_file_seek(FD, P, W, F) \ | | #define mysql_file_seek(FD, P, W, F) \ | |
| inline_mysql_file_seek(__FILE__, __LINE__, FD, P, W, F) | | inline_mysql_file_seek(__FILE__, __LINE__, FD, P, W, F) | |
| #else | | #else | |
| #define mysql_file_seek(FD, P, W, F) \ | | #define mysql_file_seek(FD, P, W, F) \ | |
| inline_mysql_file_seek(FD, P, W, F) | | inline_mysql_file_seek(FD, P, W, F) | |
| #endif | | #endif | |
| | | | |
| /** | | /** | |
| @def mysql_file_tell(FD, F) | | @def mysql_file_tell(FD, F) | |
| Instrumented tell. | | Instrumented tell. | |
| @c mysql_file_tell is a replacement for @c my_tell. | | @c mysql_file_tell is a replacement for @c my_tell. | |
| */ | | */ | |
|
| #ifdef HAVE_PSI_INTERFACE | | #ifdef HAVE_PSI_FILE_INTERFACE | |
| #define mysql_file_tell(FD, F) \ | | #define mysql_file_tell(FD, F) \ | |
| inline_mysql_file_tell(__FILE__, __LINE__, FD, F) | | inline_mysql_file_tell(__FILE__, __LINE__, FD, F) | |
| #else | | #else | |
| #define mysql_file_tell(FD, F) \ | | #define mysql_file_tell(FD, F) \ | |
| inline_mysql_file_tell(FD, F) | | inline_mysql_file_tell(FD, F) | |
| #endif | | #endif | |
| | | | |
| /** | | /** | |
| @def mysql_file_delete(K, P1, P2) | | @def mysql_file_delete(K, P1, P2) | |
| Instrumented delete. | | Instrumented delete. | |
| @c mysql_file_delete is a replacement for @c my_delete. | | @c mysql_file_delete is a replacement for @c my_delete. | |
| */ | | */ | |
|
| #ifdef HAVE_PSI_INTERFACE | | #ifdef HAVE_PSI_FILE_INTERFACE | |
| #define mysql_file_delete(K, P1, P2) \ | | #define mysql_file_delete(K, P1, P2) \ | |
| inline_mysql_file_delete(K, __FILE__, __LINE__, P1, P2) | | inline_mysql_file_delete(K, __FILE__, __LINE__, P1, P2) | |
| #else | | #else | |
| #define mysql_file_delete(K, P1, P2) \ | | #define mysql_file_delete(K, P1, P2) \ | |
| inline_mysql_file_delete(P1, P2) | | inline_mysql_file_delete(P1, P2) | |
| #endif | | #endif | |
| | | | |
| /** | | /** | |
| @def mysql_file_rename(K, P1, P2, P3) | | @def mysql_file_rename(K, P1, P2, P3) | |
| Instrumented rename. | | Instrumented rename. | |
| @c mysql_file_rename is a replacement for @c my_rename. | | @c mysql_file_rename is a replacement for @c my_rename. | |
| */ | | */ | |
|
| #ifdef HAVE_PSI_INTERFACE | | #ifdef HAVE_PSI_FILE_INTERFACE | |
| #define mysql_file_rename(K, P1, P2, P3) \ | | #define mysql_file_rename(K, P1, P2, P3) \ | |
| inline_mysql_file_rename(K, __FILE__, __LINE__, P1, P2, P3) | | inline_mysql_file_rename(K, __FILE__, __LINE__, P1, P2, P3) | |
| #else | | #else | |
| #define mysql_file_rename(K, P1, P2, P3) \ | | #define mysql_file_rename(K, P1, P2, P3) \ | |
| inline_mysql_file_rename(P1, P2, P3) | | inline_mysql_file_rename(P1, P2, P3) | |
| #endif | | #endif | |
| | | | |
| /** | | /** | |
| @def mysql_file_create_with_symlink(K, P1, P2, P3, P4, P5) | | @def mysql_file_create_with_symlink(K, P1, P2, P3, P4, P5) | |
| Instrumented create with symbolic link. | | Instrumented create with symbolic link. | |
| @c mysql_file_create_with_symlink is a replacement | | @c mysql_file_create_with_symlink is a replacement | |
| for @c my_create_with_symlink. | | for @c my_create_with_symlink. | |
| */ | | */ | |
|
| #ifdef HAVE_PSI_INTERFACE | | #ifdef HAVE_PSI_FILE_INTERFACE | |
| #define mysql_file_create_with_symlink(K, P1, P2, P3, P4, P5) \ | | #define mysql_file_create_with_symlink(K, P1, P2, P3, P4, P5) \ | |
| inline_mysql_file_create_with_symlink(K, __FILE__, __LINE__, \ | | inline_mysql_file_create_with_symlink(K, __FILE__, __LINE__, \ | |
| P1, P2, P3, P4, P5) | | P1, P2, P3, P4, P5) | |
| #else | | #else | |
| #define mysql_file_create_with_symlink(K, P1, P2, P3, P4, P5) \ | | #define mysql_file_create_with_symlink(K, P1, P2, P3, P4, P5) \ | |
| inline_mysql_file_create_with_symlink(P1, P2, P3, P4, P5) | | inline_mysql_file_create_with_symlink(P1, P2, P3, P4, P5) | |
| #endif | | #endif | |
| | | | |
| /** | | /** | |
| @def mysql_file_delete_with_symlink(K, P1, P2) | | @def mysql_file_delete_with_symlink(K, P1, P2) | |
| Instrumented delete with symbolic link. | | Instrumented delete with symbolic link. | |
| @c mysql_file_delete_with_symlink is a replacement | | @c mysql_file_delete_with_symlink is a replacement | |
| for @c my_delete_with_symlink. | | for @c my_delete_with_symlink. | |
| */ | | */ | |
|
| #ifdef HAVE_PSI_INTERFACE | | #ifdef HAVE_PSI_FILE_INTERFACE | |
| #define mysql_file_delete_with_symlink(K, P1, P2) \ | | #define mysql_file_delete_with_symlink(K, P1, P2) \ | |
| inline_mysql_file_delete_with_symlink(K, __FILE__, __LINE__, P1, P2) | | inline_mysql_file_delete_with_symlink(K, __FILE__, __LINE__, P1, P2) | |
| #else | | #else | |
| #define mysql_file_delete_with_symlink(K, P1, P2) \ | | #define mysql_file_delete_with_symlink(K, P1, P2) \ | |
| inline_mysql_file_delete_with_symlink(P1, P2) | | inline_mysql_file_delete_with_symlink(P1, P2) | |
| #endif | | #endif | |
| | | | |
| /** | | /** | |
| @def mysql_file_rename_with_symlink(K, P1, P2, P3) | | @def mysql_file_rename_with_symlink(K, P1, P2, P3) | |
| Instrumented rename with symbolic link. | | Instrumented rename with symbolic link. | |
| @c mysql_file_rename_with_symlink is a replacement | | @c mysql_file_rename_with_symlink is a replacement | |
| for @c my_rename_with_symlink. | | for @c my_rename_with_symlink. | |
| */ | | */ | |
|
| #ifdef HAVE_PSI_INTERFACE | | #ifdef HAVE_PSI_FILE_INTERFACE | |
| #define mysql_file_rename_with_symlink(K, P1, P2, P3) \ | | #define mysql_file_rename_with_symlink(K, P1, P2, P3) \ | |
| inline_mysql_file_rename_with_symlink(K, __FILE__, __LINE__, P1, P2, P3) | | inline_mysql_file_rename_with_symlink(K, __FILE__, __LINE__, P1, P2, P3) | |
| #else | | #else | |
| #define mysql_file_rename_with_symlink(K, P1, P2, P3) \ | | #define mysql_file_rename_with_symlink(K, P1, P2, P3) \ | |
| inline_mysql_file_rename_with_symlink(P1, P2, P3) | | inline_mysql_file_rename_with_symlink(P1, P2, P3) | |
| #endif | | #endif | |
| | | | |
| /** | | /** | |
| @def mysql_file_sync(P1, P2) | | @def mysql_file_sync(P1, P2) | |
| Instrumented file sync. | | Instrumented file sync. | |
| @c mysql_file_sync is a replacement for @c my_sync. | | @c mysql_file_sync is a replacement for @c my_sync. | |
| */ | | */ | |
|
| #ifdef HAVE_PSI_INTERFACE | | #ifdef HAVE_PSI_FILE_INTERFACE | |
| #define mysql_file_sync(P1, P2) \ | | #define mysql_file_sync(P1, P2) \ | |
| inline_mysql_file_sync(__FILE__, __LINE__, P1, P2) | | inline_mysql_file_sync(__FILE__, __LINE__, P1, P2) | |
| #else | | #else | |
| #define mysql_file_sync(P1, P2) \ | | #define mysql_file_sync(P1, P2) \ | |
| inline_mysql_file_sync(P1, P2) | | inline_mysql_file_sync(P1, P2) | |
| #endif | | #endif | |
| | | | |
| /** | | /** | |
| An instrumented FILE structure. | | An instrumented FILE structure. | |
| @sa MYSQL_FILE | | @sa MYSQL_FILE | |
| | | | |
| skipping to change at line 501 | | skipping to change at line 508 | |
| struct PSI_file *m_psi; | | struct PSI_file *m_psi; | |
| }; | | }; | |
| | | | |
| /** | | /** | |
| Type of an instrumented file. | | Type of an instrumented file. | |
| @c MYSQL_FILE is a drop-in replacement for @c FILE. | | @c MYSQL_FILE is a drop-in replacement for @c FILE. | |
| @sa mysql_file_open | | @sa mysql_file_open | |
| */ | | */ | |
| typedef struct st_mysql_file MYSQL_FILE; | | typedef struct st_mysql_file MYSQL_FILE; | |
| | | | |
|
| | | static inline void inline_mysql_file_register( | |
| | | #ifdef HAVE_PSI_FILE_INTERFACE | |
| | | const char *category, | |
| | | PSI_file_info *info, | |
| | | int count | |
| | | #else | |
| | | const char *category __attribute__ ((unused)), | |
| | | void *info __attribute__ ((unused)), | |
| | | int count __attribute__ ((unused)) | |
| | | #endif | |
| | | ) | |
| | | { | |
| | | #ifdef HAVE_PSI_FILE_INTERFACE | |
| | | PSI_FILE_CALL(register_file)(category, info, count); | |
| | | #endif | |
| | | } | |
| | | | |
| static inline char * | | static inline char * | |
| inline_mysql_file_fgets( | | inline_mysql_file_fgets( | |
|
| #ifdef HAVE_PSI_INTERFACE | | #ifdef HAVE_PSI_FILE_INTERFACE | |
| const char *src_file, uint src_line, | | const char *src_file, uint src_line, | |
| #endif | | #endif | |
| char *str, int size, MYSQL_FILE *file) | | char *str, int size, MYSQL_FILE *file) | |
| { | | { | |
| char *result; | | char *result; | |
|
| #ifdef HAVE_PSI_INTERFACE | | #ifdef HAVE_PSI_FILE_INTERFACE | |
| struct PSI_file_locker *locker= NULL; | | struct PSI_file_locker *locker; | |
| PSI_file_locker_state state; | | PSI_file_locker_state state; | |
|
| if (likely(PSI_server && file->m_psi)) | | locker= PSI_FILE_CALL(get_thread_file_stream_locker) | |
| | | (&state, file->m_psi, PSI_FILE_READ); | |
| | | if (likely(locker != NULL)) | |
| { | | { | |
|
| locker= PSI_server->get_thread_file_stream_locker(&state, file->m_psi, | | PSI_FILE_CALL(start_file_wait)(locker, (size_t) size, src_file, src_lin | |
| PSI_FILE_READ); | | e); | |
| if (likely(locker != NULL)) | | result= fgets(str, size, file->m_file); | |
| PSI_server->start_file_wait(locker, (size_t) size, src_file, src_line | | PSI_FILE_CALL(end_file_wait)(locker, result ? strlen(result) : 0); | |
| ); | | return result; | |
| } | | } | |
| #endif | | #endif | |
|
| | | | |
| result= fgets(str, size, file->m_file); | | result= fgets(str, size, file->m_file); | |
|
| #ifdef HAVE_PSI_INTERFACE | | | |
| if (likely(locker != NULL)) | | | |
| PSI_server->end_file_wait(locker, result ? strlen(result) : 0); | | | |
| #endif | | | |
| return result; | | return result; | |
| } | | } | |
| | | | |
| static inline int | | static inline int | |
| inline_mysql_file_fgetc( | | inline_mysql_file_fgetc( | |
|
| #ifdef HAVE_PSI_INTERFACE | | #ifdef HAVE_PSI_FILE_INTERFACE | |
| const char *src_file, uint src_line, | | const char *src_file, uint src_line, | |
| #endif | | #endif | |
| MYSQL_FILE *file) | | MYSQL_FILE *file) | |
| { | | { | |
| int result; | | int result; | |
|
| #ifdef HAVE_PSI_INTERFACE | | #ifdef HAVE_PSI_FILE_INTERFACE | |
| struct PSI_file_locker *locker= NULL; | | struct PSI_file_locker *locker; | |
| PSI_file_locker_state state; | | PSI_file_locker_state state; | |
|
| if (likely(PSI_server && file->m_psi)) | | locker= PSI_FILE_CALL(get_thread_file_stream_locker) | |
| | | (&state, file->m_psi, PSI_FILE_READ); | |
| | | if (likely(locker != NULL)) | |
| { | | { | |
|
| locker= PSI_server->get_thread_file_stream_locker(&state, file->m_psi, | | PSI_FILE_CALL(start_file_wait)(locker, (size_t) 1, src_file, src_line); | |
| PSI_FILE_READ); | | result= fgetc(file->m_file); | |
| if (likely(locker != NULL)) | | PSI_FILE_CALL(end_file_wait)(locker, (size_t) 1); | |
| PSI_server->start_file_wait(locker, (size_t) 1, src_file, src_line); | | return result; | |
| } | | } | |
| #endif | | #endif | |
|
| | | | |
| result= fgetc(file->m_file); | | result= fgetc(file->m_file); | |
|
| #ifdef HAVE_PSI_INTERFACE | | | |
| if (likely(locker != NULL)) | | | |
| PSI_server->end_file_wait(locker, (size_t) 1); | | | |
| #endif | | | |
| return result; | | return result; | |
| } | | } | |
| | | | |
| static inline int | | static inline int | |
| inline_mysql_file_fputs( | | inline_mysql_file_fputs( | |
|
| #ifdef HAVE_PSI_INTERFACE | | #ifdef HAVE_PSI_FILE_INTERFACE | |
| const char *src_file, uint src_line, | | const char *src_file, uint src_line, | |
| #endif | | #endif | |
| const char *str, MYSQL_FILE *file) | | const char *str, MYSQL_FILE *file) | |
| { | | { | |
| int result; | | int result; | |
|
| #ifdef HAVE_PSI_INTERFACE | | #ifdef HAVE_PSI_FILE_INTERFACE | |
| struct PSI_file_locker *locker= NULL; | | struct PSI_file_locker *locker; | |
| PSI_file_locker_state state; | | PSI_file_locker_state state; | |
|
| size_t bytes= 0; | | size_t bytes; | |
| if (likely(PSI_server && file->m_psi)) | | locker= PSI_FILE_CALL(get_thread_file_stream_locker) | |
| | | (&state, file->m_psi, PSI_FILE_WRITE); | |
| | | if (likely(locker != NULL)) | |
| { | | { | |
|
| locker= PSI_server->get_thread_file_stream_locker(&state, file->m_psi, | | bytes= str ? strlen(str) : 0; | |
| PSI_FILE_WRITE); | | PSI_FILE_CALL(start_file_wait)(locker, bytes, src_file, src_line); | |
| if (likely(locker != NULL)) | | result= fputs(str, file->m_file); | |
| { | | PSI_FILE_CALL(end_file_wait)(locker, bytes); | |
| bytes= str ? strlen(str) : 0; | | return result; | |
| PSI_server->start_file_wait(locker, bytes, src_file, src_line); | | | |
| } | | | |
| } | | } | |
| #endif | | #endif | |
|
| | | | |
| result= fputs(str, file->m_file); | | result= fputs(str, file->m_file); | |
|
| #ifdef HAVE_PSI_INTERFACE | | | |
| if (likely(locker != NULL)) | | | |
| PSI_server->end_file_wait(locker, bytes); | | | |
| #endif | | | |
| return result; | | return result; | |
| } | | } | |
| | | | |
| static inline int | | static inline int | |
| inline_mysql_file_fputc( | | inline_mysql_file_fputc( | |
|
| #ifdef HAVE_PSI_INTERFACE | | #ifdef HAVE_PSI_FILE_INTERFACE | |
| const char *src_file, uint src_line, | | const char *src_file, uint src_line, | |
| #endif | | #endif | |
| char c, MYSQL_FILE *file) | | char c, MYSQL_FILE *file) | |
| { | | { | |
| int result; | | int result; | |
|
| #ifdef HAVE_PSI_INTERFACE | | #ifdef HAVE_PSI_FILE_INTERFACE | |
| struct PSI_file_locker *locker= NULL; | | struct PSI_file_locker *locker; | |
| PSI_file_locker_state state; | | PSI_file_locker_state state; | |
|
| if (likely(PSI_server && file->m_psi)) | | locker= PSI_FILE_CALL(get_thread_file_stream_locker) | |
| | | (&state, file->m_psi, PSI_FILE_WRITE); | |
| | | if (likely(locker != NULL)) | |
| { | | { | |
|
| locker= PSI_server->get_thread_file_stream_locker(&state, file->m_psi, | | PSI_FILE_CALL(start_file_wait)(locker, (size_t) 1, src_file, src_line); | |
| PSI_FILE_WRITE); | | result= fputc(c, file->m_file); | |
| if (likely(locker != NULL)) | | PSI_FILE_CALL(end_file_wait)(locker, (size_t) 1); | |
| PSI_server->start_file_wait(locker, (size_t) 1, src_file, src_line); | | return result; | |
| } | | } | |
| #endif | | #endif | |
|
| | | | |
| result= fputc(c, file->m_file); | | result= fputc(c, file->m_file); | |
|
| #ifdef HAVE_PSI_INTERFACE | | | |
| if (likely(locker != NULL)) | | | |
| PSI_server->end_file_wait(locker, (size_t) 1); | | | |
| #endif | | | |
| return result; | | return result; | |
| } | | } | |
| | | | |
| static inline int | | static inline int | |
| inline_mysql_file_fprintf(MYSQL_FILE *file, const char *format, ...) | | inline_mysql_file_fprintf(MYSQL_FILE *file, const char *format, ...) | |
| { | | { | |
| /* | | /* | |
| TODO: figure out how to pass src_file and src_line from the caller. | | TODO: figure out how to pass src_file and src_line from the caller. | |
| */ | | */ | |
| int result; | | int result; | |
| va_list args; | | va_list args; | |
|
| #ifdef HAVE_PSI_INTERFACE | | #ifdef HAVE_PSI_FILE_INTERFACE | |
| struct PSI_file_locker *locker= NULL; | | struct PSI_file_locker *locker; | |
| PSI_file_locker_state state; | | PSI_file_locker_state state; | |
|
| if (likely(PSI_server && file->m_psi)) | | locker= PSI_FILE_CALL(get_thread_file_stream_locker) | |
| | | (&state, file->m_psi, PSI_FILE_WRITE); | |
| | | if (likely(locker != NULL)) | |
| { | | { | |
|
| locker= PSI_server->get_thread_file_stream_locker(&state, file->m_psi, | | PSI_FILE_CALL(start_file_wait)(locker, (size_t) 0, __FILE__, __LINE__); | |
| PSI_FILE_WRITE); | | va_start(args, format); | |
| if (likely(locker != NULL)) | | result= vfprintf(file->m_file, format, args); | |
| PSI_server->start_file_wait(locker, (size_t) 0, __FILE__, __LINE__); | | va_end(args); | |
| | | PSI_FILE_CALL(end_file_wait)(locker, (size_t) result); | |
| | | return result; | |
| } | | } | |
| #endif | | #endif | |
|
| | | | |
| va_start(args, format); | | va_start(args, format); | |
| result= vfprintf(file->m_file, format, args); | | result= vfprintf(file->m_file, format, args); | |
| va_end(args); | | va_end(args); | |
|
| #ifdef HAVE_PSI_INTERFACE | | | |
| if (likely(locker != NULL)) | | | |
| PSI_server->end_file_wait(locker, (size_t) result); | | | |
| #endif | | | |
| return result; | | return result; | |
| } | | } | |
| | | | |
| static inline int | | static inline int | |
| inline_mysql_file_vfprintf( | | inline_mysql_file_vfprintf( | |
|
| #ifdef HAVE_PSI_INTERFACE | | #ifdef HAVE_PSI_FILE_INTERFACE | |
| const char *src_file, uint src_line, | | const char *src_file, uint src_line, | |
| #endif | | #endif | |
| MYSQL_FILE *file, const char *format, va_list args) | | MYSQL_FILE *file, const char *format, va_list args) | |
| { | | { | |
| int result; | | int result; | |
|
| #ifdef HAVE_PSI_INTERFACE | | #ifdef HAVE_PSI_FILE_INTERFACE | |
| struct PSI_file_locker *locker= NULL; | | struct PSI_file_locker *locker; | |
| PSI_file_locker_state state; | | PSI_file_locker_state state; | |
|
| if (likely(PSI_server && file->m_psi)) | | locker= PSI_FILE_CALL(get_thread_file_stream_locker) | |
| | | (&state, file->m_psi, PSI_FILE_WRITE); | |
| | | if (likely(locker != NULL)) | |
| { | | { | |
|
| locker= PSI_server->get_thread_file_stream_locker(&state, file->m_psi, | | PSI_FILE_CALL(start_file_wait)(locker, (size_t) 0, src_file, src_line); | |
| PSI_FILE_WRITE); | | result= vfprintf(file->m_file, format, args); | |
| if (likely(locker != NULL)) | | PSI_FILE_CALL(end_file_wait)(locker, (size_t) result); | |
| PSI_server->start_file_wait(locker, (size_t) 0, src_file, src_line); | | return result; | |
| } | | } | |
| #endif | | #endif | |
|
| | | | |
| result= vfprintf(file->m_file, format, args); | | result= vfprintf(file->m_file, format, args); | |
|
| #ifdef HAVE_PSI_INTERFACE | | | |
| if (likely(locker != NULL)) | | | |
| PSI_server->end_file_wait(locker, (size_t) result); | | | |
| #endif | | | |
| return result; | | return result; | |
| } | | } | |
| | | | |
| static inline int | | static inline int | |
| inline_mysql_file_fflush( | | inline_mysql_file_fflush( | |
|
| #ifdef HAVE_PSI_INTERFACE | | #ifdef HAVE_PSI_FILE_INTERFACE | |
| const char *src_file, uint src_line, | | const char *src_file, uint src_line, | |
| #endif | | #endif | |
| MYSQL_FILE *file) | | MYSQL_FILE *file) | |
| { | | { | |
| int result; | | int result; | |
|
| #ifdef HAVE_PSI_INTERFACE | | #ifdef HAVE_PSI_FILE_INTERFACE | |
| struct PSI_file_locker *locker= NULL; | | struct PSI_file_locker *locker; | |
| PSI_file_locker_state state; | | PSI_file_locker_state state; | |
|
| if (likely(PSI_server && file->m_psi)) | | locker= PSI_FILE_CALL(get_thread_file_stream_locker) | |
| | | (&state, file->m_psi, PSI_FILE_FLUSH); | |
| | | if (likely(locker != NULL)) | |
| { | | { | |
|
| locker= PSI_server->get_thread_file_stream_locker(&state, file->m_psi, | | PSI_FILE_CALL(start_file_wait)(locker, (size_t) 0, src_file, src_line); | |
| PSI_FILE_FLUSH); | | result= fflush(file->m_file); | |
| if (likely(locker != NULL)) | | PSI_FILE_CALL(end_file_wait)(locker, (size_t) 0); | |
| PSI_server->start_file_wait(locker, (size_t) 0, src_file, src_line); | | return result; | |
| } | | } | |
| #endif | | #endif | |
|
| | | | |
| result= fflush(file->m_file); | | result= fflush(file->m_file); | |
|
| #ifdef HAVE_PSI_INTERFACE | | | |
| if (likely(locker != NULL)) | | | |
| PSI_server->end_file_wait(locker, (size_t) 0); | | | |
| #endif | | | |
| return result; | | return result; | |
| } | | } | |
| | | | |
| static inline int inline_mysql_file_feof(MYSQL_FILE *file) | | static inline int inline_mysql_file_feof(MYSQL_FILE *file) | |
| { | | { | |
| /* Not instrumented, there is no wait involved */ | | /* Not instrumented, there is no wait involved */ | |
| return feof(file->m_file); | | return feof(file->m_file); | |
| } | | } | |
| | | | |
| static inline int | | static inline int | |
| inline_mysql_file_fstat( | | inline_mysql_file_fstat( | |
|
| #ifdef HAVE_PSI_INTERFACE | | #ifdef HAVE_PSI_FILE_INTERFACE | |
| const char *src_file, uint src_line, | | const char *src_file, uint src_line, | |
| #endif | | #endif | |
| int filenr, MY_STAT *stat_area, myf flags) | | int filenr, MY_STAT *stat_area, myf flags) | |
| { | | { | |
| int result; | | int result; | |
|
| #ifdef HAVE_PSI_INTERFACE | | #ifdef HAVE_PSI_FILE_INTERFACE | |
| struct PSI_file_locker *locker= NULL; | | struct PSI_file_locker *locker; | |
| PSI_file_locker_state state; | | PSI_file_locker_state state; | |
|
| if (likely(PSI_server != NULL)) | | locker= PSI_FILE_CALL(get_thread_file_descriptor_locker) | |
| | | (&state, filenr, PSI_FILE_FSTAT); | |
| | | if (likely(locker != NULL)) | |
| { | | { | |
|
| locker= PSI_server->get_thread_file_descriptor_locker(&state, filenr, | | PSI_FILE_CALL(start_file_wait)(locker, (size_t) 0, src_file, src_line); | |
| PSI_FILE_FSTAT); | | result= my_fstat(filenr, stat_area, flags); | |
| if (likely(locker != NULL)) | | PSI_FILE_CALL(end_file_wait)(locker, (size_t) 0); | |
| PSI_server->start_file_wait(locker, (size_t) 0, src_file, src_line); | | return result; | |
| } | | } | |
| #endif | | #endif | |
|
| | | | |
| result= my_fstat(filenr, stat_area, flags); | | result= my_fstat(filenr, stat_area, flags); | |
|
| #ifdef HAVE_PSI_INTERFACE | | | |
| if (likely(locker != NULL)) | | | |
| PSI_server->end_file_wait(locker, (size_t) 0); | | | |
| #endif | | | |
| return result; | | return result; | |
| } | | } | |
| | | | |
| static inline MY_STAT * | | static inline MY_STAT * | |
| inline_mysql_file_stat( | | inline_mysql_file_stat( | |
|
| #ifdef HAVE_PSI_INTERFACE | | #ifdef HAVE_PSI_FILE_INTERFACE | |
| PSI_file_key key, const char *src_file, uint src_line, | | PSI_file_key key, const char *src_file, uint src_line, | |
| #endif | | #endif | |
| const char *path, MY_STAT *stat_area, myf flags) | | const char *path, MY_STAT *stat_area, myf flags) | |
| { | | { | |
| MY_STAT *result; | | MY_STAT *result; | |
|
| #ifdef HAVE_PSI_INTERFACE | | #ifdef HAVE_PSI_FILE_INTERFACE | |
| struct PSI_file_locker *locker= NULL; | | struct PSI_file_locker *locker; | |
| PSI_file_locker_state state; | | PSI_file_locker_state state; | |
|
| if (likely(PSI_server != NULL)) | | locker= PSI_FILE_CALL(get_thread_file_name_locker) | |
| | | (&state, key, PSI_FILE_STAT, path, &locker); | |
| | | if (likely(locker != NULL)) | |
| { | | { | |
|
| locker= PSI_server->get_thread_file_name_locker(&state, | | PSI_FILE_CALL(start_file_open_wait)(locker, src_file, src_line); | |
| key, PSI_FILE_STAT, | | result= my_stat(path, stat_area, flags); | |
| path, &locker); | | PSI_FILE_CALL(end_file_open_wait)(locker, result); | |
| if (likely(locker != NULL)) | | return result; | |
| PSI_server->start_file_open_wait(locker, src_file, src_line); | | | |
| } | | } | |
| #endif | | #endif | |
|
| | | | |
| result= my_stat(path, stat_area, flags); | | result= my_stat(path, stat_area, flags); | |
|
| #ifdef HAVE_PSI_INTERFACE | | | |
| if (likely(locker != NULL)) | | | |
| PSI_server->end_file_wait(locker, (size_t) 0); | | | |
| #endif | | | |
| return result; | | return result; | |
| } | | } | |
| | | | |
| static inline int | | static inline int | |
| inline_mysql_file_chsize( | | inline_mysql_file_chsize( | |
|
| #ifdef HAVE_PSI_INTERFACE | | #ifdef HAVE_PSI_FILE_INTERFACE | |
| const char *src_file, uint src_line, | | const char *src_file, uint src_line, | |
| #endif | | #endif | |
| File file, my_off_t newlength, int filler, myf flags) | | File file, my_off_t newlength, int filler, myf flags) | |
| { | | { | |
| int result; | | int result; | |
|
| #ifdef HAVE_PSI_INTERFACE | | #ifdef HAVE_PSI_FILE_INTERFACE | |
| struct PSI_file_locker *locker= NULL; | | struct PSI_file_locker *locker; | |
| PSI_file_locker_state state; | | PSI_file_locker_state state; | |
|
| if (likely(PSI_server != NULL)) | | locker= PSI_FILE_CALL(get_thread_file_descriptor_locker) | |
| | | (&state, file, PSI_FILE_CHSIZE); | |
| | | if (likely(locker != NULL)) | |
| { | | { | |
|
| locker= PSI_server->get_thread_file_descriptor_locker(&state, file, | | PSI_FILE_CALL(start_file_wait)(locker, (size_t) newlength, src_file, | |
| PSI_FILE_CHSIZE); | | src_line); | |
| if (likely(locker != NULL)) | | result= my_chsize(file, newlength, filler, flags); | |
| PSI_server->start_file_wait(locker, (size_t) newlength, src_file, | | PSI_FILE_CALL(end_file_wait)(locker, (size_t) newlength); | |
| src_line); | | return result; | |
| } | | } | |
| #endif | | #endif | |
|
| | | | |
| result= my_chsize(file, newlength, filler, flags); | | result= my_chsize(file, newlength, filler, flags); | |
|
| #ifdef HAVE_PSI_INTERFACE | | | |
| if (likely(locker != NULL)) | | | |
| PSI_server->end_file_wait(locker, (size_t) newlength); | | | |
| #endif | | | |
| return result; | | return result; | |
| } | | } | |
| | | | |
| static inline MYSQL_FILE* | | static inline MYSQL_FILE* | |
| inline_mysql_file_fopen( | | inline_mysql_file_fopen( | |
|
| #ifdef HAVE_PSI_INTERFACE | | #ifdef HAVE_PSI_FILE_INTERFACE | |
| PSI_file_key key, const char *src_file, uint src_line, | | PSI_file_key key, const char *src_file, uint src_line, | |
| #endif | | #endif | |
| const char *filename, int flags, myf myFlags) | | const char *filename, int flags, myf myFlags) | |
| { | | { | |
| MYSQL_FILE *that; | | MYSQL_FILE *that; | |
| that= (MYSQL_FILE*) my_malloc(sizeof(MYSQL_FILE), MYF(MY_WME)); | | that= (MYSQL_FILE*) my_malloc(sizeof(MYSQL_FILE), MYF(MY_WME)); | |
| if (likely(that != NULL)) | | if (likely(that != NULL)) | |
| { | | { | |
|
| that->m_psi= NULL; | | #ifdef HAVE_PSI_FILE_INTERFACE | |
| | | struct PSI_file_locker *locker; | |
| | | PSI_file_locker_state state; | |
| | | locker= PSI_FILE_CALL(get_thread_file_name_locker) | |
| | | (&state, key, PSI_FILE_STREAM_OPEN, filename, that); | |
| | | if (likely(locker != NULL)) | |
| { | | { | |
|
| #ifdef HAVE_PSI_INTERFACE | | PSI_FILE_CALL(start_file_open_wait) | |
| struct PSI_file_locker *locker= NULL; | | (locker, src_file, src_line); | |
| PSI_file_locker_state state; | | | |
| if (likely(PSI_server != NULL)) | | | |
| { | | | |
| locker= PSI_server->get_thread_file_name_locker | | | |
| (&state, key, PSI_FILE_STREAM_OPEN, filename, that); | | | |
| if (likely(locker != NULL)) | | | |
| that->m_psi= PSI_server->start_file_open_wait(locker, src_file, | | | |
| src_line); | | | |
| } | | | |
| #endif | | | |
| that->m_file= my_fopen(filename, flags, myFlags); | | that->m_file= my_fopen(filename, flags, myFlags); | |
|
| #ifdef HAVE_PSI_INTERFACE | | that->m_psi= PSI_FILE_CALL(end_file_open_wait)(locker, that->m_file); | |
| if (likely(locker != NULL)) | | | |
| PSI_server->end_file_open_wait(locker); | | | |
| #endif | | | |
| if (unlikely(that->m_file == NULL)) | | if (unlikely(that->m_file == NULL)) | |
| { | | { | |
| my_free(that); | | my_free(that); | |
| return NULL; | | return NULL; | |
| } | | } | |
|
| | | return that; | |
| | | } | |
| | | #endif | |
| | | | |
| | | that->m_psi= NULL; | |
| | | that->m_file= my_fopen(filename, flags, myFlags); | |
| | | if (unlikely(that->m_file == NULL)) | |
| | | { | |
| | | my_free(that); | |
| | | return NULL; | |
| } | | } | |
| } | | } | |
| return that; | | return that; | |
| } | | } | |
| | | | |
| static inline int | | static inline int | |
| inline_mysql_file_fclose( | | inline_mysql_file_fclose( | |
|
| #ifdef HAVE_PSI_INTERFACE | | #ifdef HAVE_PSI_FILE_INTERFACE | |
| const char *src_file, uint src_line, | | const char *src_file, uint src_line, | |
| #endif | | #endif | |
| MYSQL_FILE *file, myf flags) | | MYSQL_FILE *file, myf flags) | |
| { | | { | |
| int result= 0; | | int result= 0; | |
| if (likely(file != NULL)) | | if (likely(file != NULL)) | |
| { | | { | |
|
| #ifdef HAVE_PSI_INTERFACE | | #ifdef HAVE_PSI_FILE_INTERFACE | |
| struct PSI_file_locker *locker= NULL; | | struct PSI_file_locker *locker; | |
| PSI_file_locker_state state; | | PSI_file_locker_state state; | |
|
| DBUG_ASSERT(file != NULL); | | locker= PSI_FILE_CALL(get_thread_file_stream_locker) | |
| if (likely(PSI_server && file->m_psi)) | | (&state, file->m_psi, PSI_FILE_STREAM_CLOSE); | |
| | | if (likely(locker != NULL)) | |
| { | | { | |
|
| locker= PSI_server->get_thread_file_stream_locker(&state, file->m_psi | | PSI_FILE_CALL(start_file_close_wait)(locker, src_file, src_line); | |
| , | | result= my_fclose(file->m_file, flags); | |
| PSI_FILE_STREAM_CLO | | PSI_FILE_CALL(end_file_close_wait)(locker, result); | |
| SE); | | my_free(file); | |
| if (likely(locker != NULL)) | | return result; | |
| PSI_server->start_file_wait(locker, (size_t) 0, src_file, src_line) | | | |
| ; | | | |
| } | | } | |
| #endif | | #endif | |
|
| | | | |
| result= my_fclose(file->m_file, flags); | | result= my_fclose(file->m_file, flags); | |
|
| #ifdef HAVE_PSI_INTERFACE | | | |
| if (likely(locker != NULL)) | | | |
| PSI_server->end_file_wait(locker, (size_t) 0); | | | |
| #endif | | | |
| my_free(file); | | my_free(file); | |
| } | | } | |
| return result; | | return result; | |
| } | | } | |
| | | | |
| static inline size_t | | static inline size_t | |
| inline_mysql_file_fread( | | inline_mysql_file_fread( | |
|
| #ifdef HAVE_PSI_INTERFACE | | #ifdef HAVE_PSI_FILE_INTERFACE | |
| const char *src_file, uint src_line, | | const char *src_file, uint src_line, | |
| #endif | | #endif | |
| MYSQL_FILE *file, uchar *buffer, size_t count, myf flags) | | MYSQL_FILE *file, uchar *buffer, size_t count, myf flags) | |
| { | | { | |
|
| size_t result= 0; | | size_t result; | |
| #ifdef HAVE_PSI_INTERFACE | | #ifdef HAVE_PSI_FILE_INTERFACE | |
| struct PSI_file_locker *locker= NULL; | | struct PSI_file_locker *locker; | |
| PSI_file_locker_state state; | | PSI_file_locker_state state; | |
|
| if (likely(PSI_server && file->m_psi)) | | size_t bytes_read; | |
| { | | locker= PSI_FILE_CALL(get_thread_file_stream_locker) | |
| locker= PSI_server->get_thread_file_stream_locker(&state, file->m_psi, | | (&state, file->m_psi, PSI_FILE_READ); | |
| PSI_FILE_READ); | | | |
| if (likely(locker != NULL)) | | | |
| PSI_server->start_file_wait(locker, count, src_file, src_line); | | | |
| } | | | |
| #endif | | | |
| result= my_fread(file->m_file, buffer, count, flags); | | | |
| #ifdef HAVE_PSI_INTERFACE | | | |
| if (likely(locker != NULL)) | | if (likely(locker != NULL)) | |
| { | | { | |
|
| size_t bytes_read; | | PSI_FILE_CALL(start_file_wait)(locker, count, src_file, src_line); | |
| | | result= my_fread(file->m_file, buffer, count, flags); | |
| if (flags & (MY_NABP | MY_FNABP)) | | if (flags & (MY_NABP | MY_FNABP)) | |
| bytes_read= (result == 0) ? count : 0; | | bytes_read= (result == 0) ? count : 0; | |
| else | | else | |
| bytes_read= (result != MY_FILE_ERROR) ? result : 0; | | bytes_read= (result != MY_FILE_ERROR) ? result : 0; | |
|
| PSI_server->end_file_wait(locker, bytes_read); | | PSI_FILE_CALL(end_file_wait)(locker, bytes_read); | |
| | | return result; | |
| } | | } | |
| #endif | | #endif | |
|
| | | | |
| | | result= my_fread(file->m_file, buffer, count, flags); | |
| return result; | | return result; | |
| } | | } | |
| | | | |
| static inline size_t | | static inline size_t | |
| inline_mysql_file_fwrite( | | inline_mysql_file_fwrite( | |
|
| #ifdef HAVE_PSI_INTERFACE | | #ifdef HAVE_PSI_FILE_INTERFACE | |
| const char *src_file, uint src_line, | | const char *src_file, uint src_line, | |
| #endif | | #endif | |
| MYSQL_FILE *file, const uchar *buffer, size_t count, myf flags) | | MYSQL_FILE *file, const uchar *buffer, size_t count, myf flags) | |
| { | | { | |
|
| size_t result= 0; | | size_t result; | |
| #ifdef HAVE_PSI_INTERFACE | | #ifdef HAVE_PSI_FILE_INTERFACE | |
| struct PSI_file_locker *locker= NULL; | | struct PSI_file_locker *locker; | |
| PSI_file_locker_state state; | | PSI_file_locker_state state; | |
|
| if (likely(PSI_server && file->m_psi)) | | size_t bytes_written; | |
| { | | locker= PSI_FILE_CALL(get_thread_file_stream_locker) | |
| locker= PSI_server->get_thread_file_stream_locker(&state, file->m_psi, | | (&state, file->m_psi, PSI_FILE_WRITE); | |
| PSI_FILE_WRITE); | | | |
| if (likely(locker != NULL)) | | | |
| PSI_server->start_file_wait(locker, count, src_file, src_line); | | | |
| } | | | |
| #endif | | | |
| result= my_fwrite(file->m_file, buffer, count, flags); | | | |
| #ifdef HAVE_PSI_INTERFACE | | | |
| if (likely(locker != NULL)) | | if (likely(locker != NULL)) | |
| { | | { | |
|
| size_t bytes_written; | | PSI_FILE_CALL(start_file_wait)(locker, count, src_file, src_line); | |
| | | result= my_fwrite(file->m_file, buffer, count, flags); | |
| if (flags & (MY_NABP | MY_FNABP)) | | if (flags & (MY_NABP | MY_FNABP)) | |
| bytes_written= (result == 0) ? count : 0; | | bytes_written= (result == 0) ? count : 0; | |
| else | | else | |
| bytes_written= (result != MY_FILE_ERROR) ? result : 0; | | bytes_written= (result != MY_FILE_ERROR) ? result : 0; | |
|
| PSI_server->end_file_wait(locker, bytes_written); | | PSI_FILE_CALL(end_file_wait)(locker, bytes_written); | |
| | | return result; | |
| } | | } | |
| #endif | | #endif | |
|
| | | | |
| | | result= my_fwrite(file->m_file, buffer, count, flags); | |
| return result; | | return result; | |
| } | | } | |
| | | | |
| static inline my_off_t | | static inline my_off_t | |
| inline_mysql_file_fseek( | | inline_mysql_file_fseek( | |
|
| #ifdef HAVE_PSI_INTERFACE | | #ifdef HAVE_PSI_FILE_INTERFACE | |
| const char *src_file, uint src_line, | | const char *src_file, uint src_line, | |
| #endif | | #endif | |
| MYSQL_FILE *file, my_off_t pos, int whence, myf flags) | | MYSQL_FILE *file, my_off_t pos, int whence, myf flags) | |
| { | | { | |
| my_off_t result; | | my_off_t result; | |
|
| #ifdef HAVE_PSI_INTERFACE | | #ifdef HAVE_PSI_FILE_INTERFACE | |
| struct PSI_file_locker *locker= NULL; | | struct PSI_file_locker *locker; | |
| PSI_file_locker_state state; | | PSI_file_locker_state state; | |
|
| if (likely(PSI_server && file->m_psi)) | | locker= PSI_FILE_CALL(get_thread_file_stream_locker) | |
| | | (&state, file->m_psi, PSI_FILE_SEEK); | |
| | | if (likely(locker != NULL)) | |
| { | | { | |
|
| locker= PSI_server->get_thread_file_stream_locker(&state, file->m_psi, | | PSI_FILE_CALL(start_file_wait)(locker, (size_t) 0, src_file, src_line); | |
| PSI_FILE_SEEK); | | result= my_fseek(file->m_file, pos, whence, flags); | |
| if (likely(locker != NULL)) | | PSI_FILE_CALL(end_file_wait)(locker, (size_t) 0); | |
| PSI_server->start_file_wait(locker, (size_t) 0, src_file, src_line); | | return result; | |
| } | | } | |
| #endif | | #endif | |
|
| | | | |
| result= my_fseek(file->m_file, pos, whence, flags); | | result= my_fseek(file->m_file, pos, whence, flags); | |
|
| #ifdef HAVE_PSI_INTERFACE | | | |
| if (likely(locker != NULL)) | | | |
| PSI_server->end_file_wait(locker, (size_t) 0); | | | |
| #endif | | | |
| return result; | | return result; | |
| } | | } | |
| | | | |
| static inline my_off_t | | static inline my_off_t | |
| inline_mysql_file_ftell( | | inline_mysql_file_ftell( | |
|
| #ifdef HAVE_PSI_INTERFACE | | #ifdef HAVE_PSI_FILE_INTERFACE | |
| const char *src_file, uint src_line, | | const char *src_file, uint src_line, | |
| #endif | | #endif | |
| MYSQL_FILE *file, myf flags) | | MYSQL_FILE *file, myf flags) | |
| { | | { | |
| my_off_t result; | | my_off_t result; | |
|
| #ifdef HAVE_PSI_INTERFACE | | #ifdef HAVE_PSI_FILE_INTERFACE | |
| struct PSI_file_locker *locker= NULL; | | struct PSI_file_locker *locker; | |
| PSI_file_locker_state state; | | PSI_file_locker_state state; | |
|
| if (likely(PSI_server && file->m_psi)) | | locker= PSI_FILE_CALL(get_thread_file_stream_locker) | |
| | | (&state, file->m_psi, PSI_FILE_TELL); | |
| | | if (likely(locker != NULL)) | |
| { | | { | |
|
| locker= PSI_server->get_thread_file_stream_locker(&state, file->m_psi, | | PSI_FILE_CALL(start_file_wait)(locker, (size_t) 0, src_file, src_line); | |
| PSI_FILE_TELL); | | result= my_ftell(file->m_file, flags); | |
| if (likely(locker != NULL)) | | PSI_FILE_CALL(end_file_wait)(locker, (size_t) 0); | |
| PSI_server->start_file_wait(locker, (size_t) 0, src_file, src_line); | | return result; | |
| } | | } | |
| #endif | | #endif | |
|
| | | | |
| result= my_ftell(file->m_file, flags); | | result= my_ftell(file->m_file, flags); | |
|
| #ifdef HAVE_PSI_INTERFACE | | | |
| if (likely(locker != NULL)) | | | |
| PSI_server->end_file_wait(locker, (size_t) 0); | | | |
| #endif | | | |
| return result; | | return result; | |
| } | | } | |
| | | | |
| static inline File | | static inline File | |
| inline_mysql_file_create( | | inline_mysql_file_create( | |
|
| #ifdef HAVE_PSI_INTERFACE | | #ifdef HAVE_PSI_FILE_INTERFACE | |
| PSI_file_key key, const char *src_file, uint src_line, | | PSI_file_key key, const char *src_file, uint src_line, | |
| #endif | | #endif | |
| const char *filename, int create_flags, int access_flags, myf myFlags) | | const char *filename, int create_flags, int access_flags, myf myFlags) | |
| { | | { | |
| File file; | | File file; | |
|
| #ifdef HAVE_PSI_INTERFACE | | #ifdef HAVE_PSI_FILE_INTERFACE | |
| struct PSI_file_locker *locker= NULL; | | struct PSI_file_locker *locker; | |
| PSI_file_locker_state state; | | PSI_file_locker_state state; | |
|
| if (likely(PSI_server != NULL)) | | locker= PSI_FILE_CALL(get_thread_file_name_locker) | |
| | | (&state, key, PSI_FILE_CREATE, filename, &locker); | |
| | | if (likely(locker != NULL)) | |
| { | | { | |
|
| locker= PSI_server->get_thread_file_name_locker(&state, key, PSI_FILE_C | | PSI_FILE_CALL(start_file_open_wait)(locker, src_file, src_line); | |
| REATE, | | file= my_create(filename, create_flags, access_flags, myFlags); | |
| filename, &locker); | | PSI_FILE_CALL(end_file_open_wait_and_bind_to_descriptor)(locker, file); | |
| if (likely(locker != NULL)) | | return file; | |
| PSI_server->start_file_open_wait(locker, src_file, src_line); | | | |
| } | | } | |
| #endif | | #endif | |
|
| | | | |
| file= my_create(filename, create_flags, access_flags, myFlags); | | file= my_create(filename, create_flags, access_flags, myFlags); | |
|
| #ifdef HAVE_PSI_INTERFACE | | | |
| if (likely(locker != NULL)) | | | |
| PSI_server->end_file_open_wait_and_bind_to_descriptor(locker, file); | | | |
| #endif | | | |
| return file; | | return file; | |
| } | | } | |
| | | | |
| static inline File | | static inline File | |
| inline_mysql_file_create_temp( | | inline_mysql_file_create_temp( | |
|
| #ifdef HAVE_PSI_INTERFACE | | #ifdef HAVE_PSI_FILE_INTERFACE | |
| PSI_file_key key, | | PSI_file_key key, | |
| #endif | | #endif | |
| char *to, const char *dir, const char *pfx, int mode, myf myFlags) | | char *to, const char *dir, const char *pfx, int mode, myf myFlags) | |
| { | | { | |
| File file; | | File file; | |
| /* | | /* | |
| TODO: This event is instrumented, but not timed. | | TODO: This event is instrumented, but not timed. | |
| The problem is that the file name is now known | | The problem is that the file name is now known | |
| before the create_temp_file call. | | before the create_temp_file call. | |
| */ | | */ | |
| file= create_temp_file(to, dir, pfx, mode, myFlags); | | file= create_temp_file(to, dir, pfx, mode, myFlags); | |
|
| #ifdef HAVE_PSI_INTERFACE | | #ifdef HAVE_PSI_FILE_INTERFACE | |
| if (likely(PSI_server != NULL)) | | PSI_FILE_CALL(create_file)(key, to, file); | |
| PSI_server->create_file(key, to, file); | | | |
| #endif | | #endif | |
| return file; | | return file; | |
| } | | } | |
| | | | |
| static inline File | | static inline File | |
| inline_mysql_file_open( | | inline_mysql_file_open( | |
|
| #ifdef HAVE_PSI_INTERFACE | | #ifdef HAVE_PSI_FILE_INTERFACE | |
| PSI_file_key key, const char *src_file, uint src_line, | | PSI_file_key key, const char *src_file, uint src_line, | |
| #endif | | #endif | |
| const char *filename, int flags, myf myFlags) | | const char *filename, int flags, myf myFlags) | |
| { | | { | |
| File file; | | File file; | |
|
| #ifdef HAVE_PSI_INTERFACE | | #ifdef HAVE_PSI_FILE_INTERFACE | |
| struct PSI_file_locker *locker= NULL; | | struct PSI_file_locker *locker; | |
| PSI_file_locker_state state; | | PSI_file_locker_state state; | |
|
| if (likely(PSI_server != NULL)) | | locker= PSI_FILE_CALL(get_thread_file_name_locker) | |
| | | (&state, key, PSI_FILE_OPEN, filename, &locker); | |
| | | if (likely(locker != NULL)) | |
| { | | { | |
|
| locker= PSI_server->get_thread_file_name_locker(&state, key, PSI_FILE_O | | PSI_FILE_CALL(start_file_open_wait)(locker, src_file, src_line); | |
| PEN, | | file= my_open(filename, flags, myFlags); | |
| filename, &locker); | | PSI_FILE_CALL(end_file_open_wait_and_bind_to_descriptor)(locker, file); | |
| if (likely(locker != NULL)) | | return file; | |
| PSI_server->start_file_open_wait(locker, src_file, src_line); | | | |
| } | | } | |
| #endif | | #endif | |
|
| | | | |
| file= my_open(filename, flags, myFlags); | | file= my_open(filename, flags, myFlags); | |
|
| #ifdef HAVE_PSI_INTERFACE | | | |
| if (likely(locker != NULL)) | | | |
| PSI_server->end_file_open_wait_and_bind_to_descriptor(locker, file); | | | |
| #endif | | | |
| return file; | | return file; | |
| } | | } | |
| | | | |
| static inline int | | static inline int | |
| inline_mysql_file_close( | | inline_mysql_file_close( | |
|
| #ifdef HAVE_PSI_INTERFACE | | #ifdef HAVE_PSI_FILE_INTERFACE | |
| const char *src_file, uint src_line, | | const char *src_file, uint src_line, | |
| #endif | | #endif | |
| File file, myf flags) | | File file, myf flags) | |
| { | | { | |
| int result; | | int result; | |
|
| #ifdef HAVE_PSI_INTERFACE | | #ifdef HAVE_PSI_FILE_INTERFACE | |
| struct PSI_file_locker *locker= NULL; | | struct PSI_file_locker *locker; | |
| PSI_file_locker_state state; | | PSI_file_locker_state state; | |
|
| if (likely(PSI_server != NULL)) | | locker= PSI_FILE_CALL(get_thread_file_descriptor_locker) | |
| | | (&state, file, PSI_FILE_CLOSE); | |
| | | if (likely(locker != NULL)) | |
| { | | { | |
|
| locker= PSI_server->get_thread_file_descriptor_locker(&state, file, | | PSI_FILE_CALL(start_file_close_wait)(locker, src_file, src_line); | |
| PSI_FILE_CLOSE); | | result= my_close(file, flags); | |
| if (likely(locker != NULL)) | | PSI_FILE_CALL(end_file_close_wait)(locker, result); | |
| PSI_server->start_file_wait(locker, (size_t) 0, src_file, src_line); | | return result; | |
| } | | } | |
| #endif | | #endif | |
|
| | | | |
| result= my_close(file, flags); | | result= my_close(file, flags); | |
|
| #ifdef HAVE_PSI_INTERFACE | | | |
| if (likely(locker != NULL)) | | | |
| PSI_server->end_file_wait(locker, (size_t) 0); | | | |
| #endif | | | |
| return result; | | return result; | |
| } | | } | |
| | | | |
| static inline size_t | | static inline size_t | |
| inline_mysql_file_read( | | inline_mysql_file_read( | |
|
| #ifdef HAVE_PSI_INTERFACE | | #ifdef HAVE_PSI_FILE_INTERFACE | |
| const char *src_file, uint src_line, | | const char *src_file, uint src_line, | |
| #endif | | #endif | |
| File file, uchar *buffer, size_t count, myf flags) | | File file, uchar *buffer, size_t count, myf flags) | |
| { | | { | |
|
| size_t result= 0; | | size_t result; | |
| #ifdef HAVE_PSI_INTERFACE | | #ifdef HAVE_PSI_FILE_INTERFACE | |
| struct PSI_file_locker *locker= NULL; | | struct PSI_file_locker *locker; | |
| PSI_file_locker_state state; | | PSI_file_locker_state state; | |
|
| if (likely(PSI_server != NULL)) | | size_t bytes_read; | |
| { | | locker= PSI_FILE_CALL(get_thread_file_descriptor_locker) | |
| locker= PSI_server->get_thread_file_descriptor_locker(&state, file, | | (&state, file, PSI_FILE_READ); | |
| PSI_FILE_READ); | | | |
| if (likely(locker != NULL)) | | | |
| PSI_server->start_file_wait(locker, count, src_file, src_line); | | | |
| } | | | |
| #endif | | | |
| result= my_read(file, buffer, count, flags); | | | |
| #ifdef HAVE_PSI_INTERFACE | | | |
| if (likely(locker != NULL)) | | if (likely(locker != NULL)) | |
| { | | { | |
|
| size_t bytes_read; | | PSI_FILE_CALL(start_file_wait)(locker, count, src_file, src_line); | |
| | | result= my_read(file, buffer, count, flags); | |
| if (flags & (MY_NABP | MY_FNABP)) | | if (flags & (MY_NABP | MY_FNABP)) | |
| bytes_read= (result == 0) ? count : 0; | | bytes_read= (result == 0) ? count : 0; | |
| else | | else | |
| bytes_read= (result != MY_FILE_ERROR) ? result : 0; | | bytes_read= (result != MY_FILE_ERROR) ? result : 0; | |
|
| PSI_server->end_file_wait(locker, bytes_read); | | PSI_FILE_CALL(end_file_wait)(locker, bytes_read); | |
| | | return result; | |
| } | | } | |
| #endif | | #endif | |
|
| | | | |
| | | result= my_read(file, buffer, count, flags); | |
| return result; | | return result; | |
| } | | } | |
| | | | |
| static inline size_t | | static inline size_t | |
| inline_mysql_file_write( | | inline_mysql_file_write( | |
|
| #ifdef HAVE_PSI_INTERFACE | | #ifdef HAVE_PSI_FILE_INTERFACE | |
| const char *src_file, uint src_line, | | const char *src_file, uint src_line, | |
| #endif | | #endif | |
| File file, const uchar *buffer, size_t count, myf flags) | | File file, const uchar *buffer, size_t count, myf flags) | |
| { | | { | |
| size_t result; | | size_t result; | |
|
| #ifdef HAVE_PSI_INTERFACE | | #ifdef HAVE_PSI_FILE_INTERFACE | |
| struct PSI_file_locker *locker= NULL; | | struct PSI_file_locker *locker; | |
| PSI_file_locker_state state; | | PSI_file_locker_state state; | |
|
| if (likely(PSI_server != NULL)) | | size_t bytes_written; | |
| { | | locker= PSI_FILE_CALL(get_thread_file_descriptor_locker) | |
| locker= PSI_server->get_thread_file_descriptor_locker(&state, file, | | (&state, file, PSI_FILE_WRITE); | |
| PSI_FILE_WRITE); | | | |
| if (likely(locker != NULL)) | | | |
| PSI_server->start_file_wait(locker, count, src_file, src_line); | | | |
| } | | | |
| #endif | | | |
| result= my_write(file, buffer, count, flags); | | | |
| #ifdef HAVE_PSI_INTERFACE | | | |
| if (likely(locker != NULL)) | | if (likely(locker != NULL)) | |
| { | | { | |
|
| size_t bytes_written; | | PSI_FILE_CALL(start_file_wait)(locker, count, src_file, src_line); | |
| | | result= my_write(file, buffer, count, flags); | |
| if (flags & (MY_NABP | MY_FNABP)) | | if (flags & (MY_NABP | MY_FNABP)) | |
| bytes_written= (result == 0) ? count : 0; | | bytes_written= (result == 0) ? count : 0; | |
| else | | else | |
| bytes_written= (result != MY_FILE_ERROR) ? result : 0; | | bytes_written= (result != MY_FILE_ERROR) ? result : 0; | |
|
| PSI_server->end_file_wait(locker, bytes_written); | | PSI_FILE_CALL(end_file_wait)(locker, bytes_written); | |
| | | return result; | |
| } | | } | |
| #endif | | #endif | |
|
| | | | |
| | | result= my_write(file, buffer, count, flags); | |
| return result; | | return result; | |
| } | | } | |
| | | | |
| static inline size_t | | static inline size_t | |
| inline_mysql_file_pread( | | inline_mysql_file_pread( | |
|
| #ifdef HAVE_PSI_INTERFACE | | #ifdef HAVE_PSI_FILE_INTERFACE | |
| const char *src_file, uint src_line, | | const char *src_file, uint src_line, | |
| #endif | | #endif | |
| File file, uchar *buffer, size_t count, my_off_t offset, myf flags) | | File file, uchar *buffer, size_t count, my_off_t offset, myf flags) | |
| { | | { | |
| size_t result; | | size_t result; | |
|
| #ifdef HAVE_PSI_INTERFACE | | #ifdef HAVE_PSI_FILE_INTERFACE | |
| struct PSI_file_locker *locker= NULL; | | struct PSI_file_locker *locker; | |
| PSI_file_locker_state state; | | PSI_file_locker_state state; | |
|
| if (likely(PSI_server != NULL)) | | size_t bytes_read; | |
| { | | locker= PSI_FILE_CALL(get_thread_file_descriptor_locker) | |
| locker= PSI_server->get_thread_file_descriptor_locker(&state, file, PSI | | (&state, file, PSI_FILE_READ); | |
| _FILE_READ); | | | |
| if (likely(locker != NULL)) | | | |
| PSI_server->start_file_wait(locker, count, src_file, src_line); | | | |
| } | | | |
| #endif | | | |
| result= my_pread(file, buffer, count, offset, flags); | | | |
| #ifdef HAVE_PSI_INTERFACE | | | |
| if (likely(locker != NULL)) | | if (likely(locker != NULL)) | |
| { | | { | |
|
| size_t bytes_read; | | PSI_FILE_CALL(start_file_wait)(locker, count, src_file, src_line); | |
| | | result= my_pread(file, buffer, count, offset, flags); | |
| if (flags & (MY_NABP | MY_FNABP)) | | if (flags & (MY_NABP | MY_FNABP)) | |
| bytes_read= (result == 0) ? count : 0; | | bytes_read= (result == 0) ? count : 0; | |
| else | | else | |
| bytes_read= (result != MY_FILE_ERROR) ? result : 0; | | bytes_read= (result != MY_FILE_ERROR) ? result : 0; | |
|
| PSI_server->end_file_wait(locker, bytes_read); | | PSI_FILE_CALL(end_file_wait)(locker, bytes_read); | |
| | | return result; | |
| } | | } | |
| #endif | | #endif | |
|
| | | | |
| | | result= my_pread(file, buffer, count, offset, flags); | |
| return result; | | return result; | |
| } | | } | |
| | | | |
| static inline size_t | | static inline size_t | |
| inline_mysql_file_pwrite( | | inline_mysql_file_pwrite( | |
|
| #ifdef HAVE_PSI_INTERFACE | | #ifdef HAVE_PSI_FILE_INTERFACE | |
| const char *src_file, uint src_line, | | const char *src_file, uint src_line, | |
| #endif | | #endif | |
| File file, const uchar *buffer, size_t count, my_off_t offset, myf flags) | | File file, const uchar *buffer, size_t count, my_off_t offset, myf flags) | |
| { | | { | |
| size_t result; | | size_t result; | |
|
| #ifdef HAVE_PSI_INTERFACE | | #ifdef HAVE_PSI_FILE_INTERFACE | |
| struct PSI_file_locker *locker= NULL; | | struct PSI_file_locker *locker; | |
| PSI_file_locker_state state; | | PSI_file_locker_state state; | |
|
| if (likely(PSI_server != NULL)) | | size_t bytes_written; | |
| { | | locker= PSI_FILE_CALL(get_thread_file_descriptor_locker) | |
| locker= PSI_server->get_thread_file_descriptor_locker(&state, file, | | (&state, file, PSI_FILE_WRITE); | |
| PSI_FILE_WRITE); | | | |
| if (likely(locker != NULL)) | | | |
| PSI_server->start_file_wait(locker, count, src_file, src_line); | | | |
| } | | | |
| #endif | | | |
| result= my_pwrite(file, buffer, count, offset, flags); | | | |
| #ifdef HAVE_PSI_INTERFACE | | | |
| if (likely(locker != NULL)) | | if (likely(locker != NULL)) | |
| { | | { | |
|
| size_t bytes_written; | | PSI_FILE_CALL(start_file_wait)(locker, count, src_file, src_line); | |
| | | result= my_pwrite(file, buffer, count, offset, flags); | |
| if (flags & (MY_NABP | MY_FNABP)) | | if (flags & (MY_NABP | MY_FNABP)) | |
| bytes_written= (result == 0) ? count : 0; | | bytes_written= (result == 0) ? count : 0; | |
| else | | else | |
| bytes_written= (result != MY_FILE_ERROR) ? result : 0; | | bytes_written= (result != MY_FILE_ERROR) ? result : 0; | |
|
| PSI_server->end_file_wait(locker, bytes_written); | | PSI_FILE_CALL(end_file_wait)(locker, bytes_written); | |
| | | return result; | |
| } | | } | |
| #endif | | #endif | |
|
| | | | |
| | | result= my_pwrite(file, buffer, count, offset, flags); | |
| return result; | | return result; | |
| } | | } | |
| | | | |
| static inline my_off_t | | static inline my_off_t | |
| inline_mysql_file_seek( | | inline_mysql_file_seek( | |
|
| #ifdef HAVE_PSI_INTERFACE | | #ifdef HAVE_PSI_FILE_INTERFACE | |
| const char *src_file, uint src_line, | | const char *src_file, uint src_line, | |
| #endif | | #endif | |
| File file, my_off_t pos, int whence, myf flags) | | File file, my_off_t pos, int whence, myf flags) | |
| { | | { | |
| my_off_t result; | | my_off_t result; | |
|
| #ifdef HAVE_PSI_INTERFACE | | #ifdef HAVE_PSI_FILE_INTERFACE | |
| struct PSI_file_locker *locker= NULL; | | struct PSI_file_locker *locker; | |
| PSI_file_locker_state state; | | PSI_file_locker_state state; | |
|
| if (likely(PSI_server != NULL)) | | locker= PSI_FILE_CALL(get_thread_file_descriptor_locker) | |
| | | (&state, file, PSI_FILE_SEEK); | |
| | | if (likely(locker != NULL)) | |
| { | | { | |
|
| locker= PSI_server->get_thread_file_descriptor_locker(&state, file, PSI | | PSI_FILE_CALL(start_file_wait)(locker, (size_t) 0, src_file, src_line); | |
| _FILE_SEEK); | | result= my_seek(file, pos, whence, flags); | |
| if (likely(locker != NULL)) | | PSI_FILE_CALL(end_file_wait)(locker, (size_t) 0); | |
| PSI_server->start_file_wait(locker, (size_t) 0, src_file, src_line); | | return result; | |
| } | | } | |
| #endif | | #endif | |
|
| | | | |
| result= my_seek(file, pos, whence, flags); | | result= my_seek(file, pos, whence, flags); | |
|
| #ifdef HAVE_PSI_INTERFACE | | | |
| if (likely(locker != NULL)) | | | |
| PSI_server->end_file_wait(locker, (size_t) 0); | | | |
| #endif | | | |
| return result; | | return result; | |
| } | | } | |
| | | | |
| static inline my_off_t | | static inline my_off_t | |
| inline_mysql_file_tell( | | inline_mysql_file_tell( | |
|
| #ifdef HAVE_PSI_INTERFACE | | #ifdef HAVE_PSI_FILE_INTERFACE | |
| const char *src_file, uint src_line, | | const char *src_file, uint src_line, | |
| #endif | | #endif | |
| File file, myf flags) | | File file, myf flags) | |
| { | | { | |
| my_off_t result; | | my_off_t result; | |
|
| #ifdef HAVE_PSI_INTERFACE | | #ifdef HAVE_PSI_FILE_INTERFACE | |
| struct PSI_file_locker *locker= NULL; | | struct PSI_file_locker *locker; | |
| PSI_file_locker_state state; | | PSI_file_locker_state state; | |
|
| if (likely(PSI_server != NULL)) | | locker= PSI_FILE_CALL(get_thread_file_descriptor_locker) | |
| | | (&state, file, PSI_FILE_TELL); | |
| | | if (likely(locker != NULL)) | |
| { | | { | |
|
| locker= PSI_server->get_thread_file_descriptor_locker(&state, file, PSI | | PSI_FILE_CALL(start_file_wait)(locker, (size_t) 0, src_file, src_line); | |
| _FILE_TELL); | | result= my_tell(file, flags); | |
| if (likely(locker != NULL)) | | PSI_FILE_CALL(end_file_wait)(locker, (size_t) 0); | |
| PSI_server->start_file_wait(locker, (size_t) 0, src_file, src_line); | | return result; | |
| } | | } | |
| #endif | | #endif | |
|
| | | | |
| result= my_tell(file, flags); | | result= my_tell(file, flags); | |
|
| #ifdef HAVE_PSI_INTERFACE | | | |
| if (likely(locker != NULL)) | | | |
| PSI_server->end_file_wait(locker, (size_t) 0); | | | |
| #endif | | | |
| return result; | | return result; | |
| } | | } | |
| | | | |
| static inline int | | static inline int | |
| inline_mysql_file_delete( | | inline_mysql_file_delete( | |
|
| #ifdef HAVE_PSI_INTERFACE | | #ifdef HAVE_PSI_FILE_INTERFACE | |
| PSI_file_key key, const char *src_file, uint src_line, | | PSI_file_key key, const char *src_file, uint src_line, | |
| #endif | | #endif | |
| const char *name, myf flags) | | const char *name, myf flags) | |
| { | | { | |
| int result; | | int result; | |
|
| #ifdef HAVE_PSI_INTERFACE | | #ifdef HAVE_PSI_FILE_INTERFACE | |
| struct PSI_file_locker *locker= NULL; | | struct PSI_file_locker *locker; | |
| PSI_file_locker_state state; | | PSI_file_locker_state state; | |
|
| if (likely(PSI_server != NULL)) | | locker= PSI_FILE_CALL(get_thread_file_name_locker) | |
| | | (&state, key, PSI_FILE_DELETE, name, &locker); | |
| | | if (likely(locker != NULL)) | |
| { | | { | |
|
| locker= PSI_server->get_thread_file_name_locker(&state, key, PSI_FILE_D | | PSI_FILE_CALL(start_file_close_wait)(locker, src_file, src_line); | |
| ELETE, | | result= my_delete(name, flags); | |
| name, &locker); | | PSI_FILE_CALL(end_file_close_wait)(locker, result); | |
| if (likely(locker != NULL)) | | return result; | |
| PSI_server->start_file_wait(locker, (size_t) 0, src_file, src_line); | | | |
| } | | } | |
| #endif | | #endif | |
|
| | | | |
| result= my_delete(name, flags); | | result= my_delete(name, flags); | |
|
| #ifdef HAVE_PSI_INTERFACE | | | |
| if (likely(locker != NULL)) | | | |
| PSI_server->end_file_wait(locker, (size_t) 0); | | | |
| #endif | | | |
| return result; | | return result; | |
| } | | } | |
| | | | |
| static inline int | | static inline int | |
| inline_mysql_file_rename( | | inline_mysql_file_rename( | |
|
| #ifdef HAVE_PSI_INTERFACE | | #ifdef HAVE_PSI_FILE_INTERFACE | |
| PSI_file_key key, const char *src_file, uint src_line, | | PSI_file_key key, const char *src_file, uint src_line, | |
| #endif | | #endif | |
| const char *from, const char *to, myf flags) | | const char *from, const char *to, myf flags) | |
| { | | { | |
| int result; | | int result; | |
|
| #ifdef HAVE_PSI_INTERFACE | | #ifdef HAVE_PSI_FILE_INTERFACE | |
| struct PSI_file_locker *locker= NULL; | | struct PSI_file_locker *locker; | |
| PSI_file_locker_state state; | | PSI_file_locker_state state; | |
|
| if (likely(PSI_server != NULL)) | | locker= PSI_FILE_CALL(get_thread_file_name_locker) | |
| | | (&state, key, PSI_FILE_RENAME, to, &locker); | |
| | | if (likely(locker != NULL)) | |
| { | | { | |
|
| locker= PSI_server->get_thread_file_name_locker(&state, key, PSI_FILE_R | | PSI_FILE_CALL(start_file_wait)(locker, (size_t) 0, src_file, src_line); | |
| ENAME, | | result= my_rename(from, to, flags); | |
| to, &locker); | | PSI_FILE_CALL(end_file_wait)(locker, (size_t) 0); | |
| if (likely(locker != NULL)) | | return result; | |
| PSI_server->start_file_wait(locker, (size_t) 0, src_file, src_line); | | | |
| } | | } | |
| #endif | | #endif | |
|
| | | | |
| result= my_rename(from, to, flags); | | result= my_rename(from, to, flags); | |
|
| #ifdef HAVE_PSI_INTERFACE | | | |
| if (likely(locker != NULL)) | | | |
| PSI_server->end_file_wait(locker, (size_t) 0); | | | |
| #endif | | | |
| return result; | | return result; | |
| } | | } | |
| | | | |
| static inline File | | static inline File | |
| inline_mysql_file_create_with_symlink( | | inline_mysql_file_create_with_symlink( | |
|
| #ifdef HAVE_PSI_INTERFACE | | #ifdef HAVE_PSI_FILE_INTERFACE | |
| PSI_file_key key, const char *src_file, uint src_line, | | PSI_file_key key, const char *src_file, uint src_line, | |
| #endif | | #endif | |
| const char *linkname, const char *filename, int create_flags, | | const char *linkname, const char *filename, int create_flags, | |
| int access_flags, myf flags) | | int access_flags, myf flags) | |
| { | | { | |
| File file; | | File file; | |
|
| #ifdef HAVE_PSI_INTERFACE | | #ifdef HAVE_PSI_FILE_INTERFACE | |
| struct PSI_file_locker *locker= NULL; | | struct PSI_file_locker *locker; | |
| PSI_file_locker_state state; | | PSI_file_locker_state state; | |
|
| if (likely(PSI_server != NULL)) | | locker= PSI_FILE_CALL(get_thread_file_name_locker) | |
| | | (&state, key, PSI_FILE_CREATE, filename, &locker); | |
| | | if (likely(locker != NULL)) | |
| { | | { | |
|
| locker= PSI_server->get_thread_file_name_locker(&state, key, PSI_FILE_C | | PSI_FILE_CALL(start_file_open_wait)(locker, src_file, src_line); | |
| REATE, | | file= my_create_with_symlink(linkname, filename, create_flags, access_f | |
| filename, &locker); | | lags, | |
| if (likely(locker != NULL)) | | flags); | |
| PSI_server->start_file_open_wait(locker, src_file, src_line); | | PSI_FILE_CALL(end_file_open_wait_and_bind_to_descriptor)(locker, file); | |
| | | return file; | |
| } | | } | |
| #endif | | #endif | |
|
| | | | |
| file= my_create_with_symlink(linkname, filename, create_flags, access_fla
gs, | | file= my_create_with_symlink(linkname, filename, create_flags, access_fla
gs, | |
| flags); | | flags); | |
|
| #ifdef HAVE_PSI_INTERFACE | | | |
| if (likely(locker != NULL)) | | | |
| PSI_server->end_file_open_wait_and_bind_to_descriptor(locker, file); | | | |
| #endif | | | |
| return file; | | return file; | |
| } | | } | |
| | | | |
| static inline int | | static inline int | |
| inline_mysql_file_delete_with_symlink( | | inline_mysql_file_delete_with_symlink( | |
|
| #ifdef HAVE_PSI_INTERFACE | | #ifdef HAVE_PSI_FILE_INTERFACE | |
| PSI_file_key key, const char *src_file, uint src_line, | | PSI_file_key key, const char *src_file, uint src_line, | |
| #endif | | #endif | |
| const char *name, myf flags) | | const char *name, myf flags) | |
| { | | { | |
| int result; | | int result; | |
|
| #ifdef HAVE_PSI_INTERFACE | | #ifdef HAVE_PSI_FILE_INTERFACE | |
| struct PSI_file_locker *locker= NULL; | | struct PSI_file_locker *locker; | |
| PSI_file_locker_state state; | | PSI_file_locker_state state; | |
|
| if (likely(PSI_server != NULL)) | | locker= PSI_FILE_CALL(get_thread_file_name_locker) | |
| | | (&state, key, PSI_FILE_DELETE, name, &locker); | |
| | | if (likely(locker != NULL)) | |
| { | | { | |
|
| locker= PSI_server->get_thread_file_name_locker(&state, key, PSI_FILE_D | | PSI_FILE_CALL(start_file_close_wait)(locker, src_file, src_line); | |
| ELETE, | | result= my_delete_with_symlink(name, flags); | |
| name, &locker); | | PSI_FILE_CALL(end_file_close_wait)(locker, result); | |
| if (likely(locker != NULL)) | | return result; | |
| PSI_server->start_file_wait(locker, (size_t) 0, src_file, src_line); | | | |
| } | | } | |
| #endif | | #endif | |
|
| | | | |
| result= my_delete_with_symlink(name, flags); | | result= my_delete_with_symlink(name, flags); | |
|
| #ifdef HAVE_PSI_INTERFACE | | | |
| if (likely(locker != NULL)) | | | |
| PSI_server->end_file_wait(locker, (size_t) 0); | | | |
| #endif | | | |
| return result; | | return result; | |
| } | | } | |
| | | | |
| static inline int | | static inline int | |
| inline_mysql_file_rename_with_symlink( | | inline_mysql_file_rename_with_symlink( | |
|
| #ifdef HAVE_PSI_INTERFACE | | #ifdef HAVE_PSI_FILE_INTERFACE | |
| PSI_file_key key, const char *src_file, uint src_line, | | PSI_file_key key, const char *src_file, uint src_line, | |
| #endif | | #endif | |
| const char *from, const char *to, myf flags) | | const char *from, const char *to, myf flags) | |
| { | | { | |
| int result; | | int result; | |
|
| #ifdef HAVE_PSI_INTERFACE | | #ifdef HAVE_PSI_FILE_INTERFACE | |
| struct PSI_file_locker *locker= NULL; | | struct PSI_file_locker *locker; | |
| PSI_file_locker_state state; | | PSI_file_locker_state state; | |
|
| if (likely(PSI_server != NULL)) | | locker= PSI_FILE_CALL(get_thread_file_name_locker) | |
| | | (&state, key, PSI_FILE_RENAME, to, &locker); | |
| | | if (likely(locker != NULL)) | |
| { | | { | |
|
| locker= PSI_server->get_thread_file_name_locker(&state, key, PSI_FILE_R | | PSI_FILE_CALL(start_file_wait)(locker, (size_t) 0, src_file, src_line); | |
| ENAME, | | result= my_rename_with_symlink(from, to, flags); | |
| to, &locker); | | PSI_FILE_CALL(end_file_wait)(locker, (size_t) 0); | |
| if (likely(locker != NULL)) | | return result; | |
| PSI_server->start_file_wait(locker, (size_t) 0, src_file, src_line); | | | |
| } | | } | |
| #endif | | #endif | |
|
| | | | |
| result= my_rename_with_symlink(from, to, flags); | | result= my_rename_with_symlink(from, to, flags); | |
|
| #ifdef HAVE_PSI_INTERFACE | | | |
| if (likely(locker != NULL)) | | | |
| PSI_server->end_file_wait(locker, (size_t) 0); | | | |
| #endif | | | |
| return result; | | return result; | |
| } | | } | |
| | | | |
| static inline int | | static inline int | |
| inline_mysql_file_sync( | | inline_mysql_file_sync( | |
|
| #ifdef HAVE_PSI_INTERFACE | | #ifdef HAVE_PSI_FILE_INTERFACE | |
| const char *src_file, uint src_line, | | const char *src_file, uint src_line, | |
| #endif | | #endif | |
| File fd, myf flags) | | File fd, myf flags) | |
| { | | { | |
| int result= 0; | | int result= 0; | |
|
| #ifdef HAVE_PSI_INTERFACE | | #ifdef HAVE_PSI_FILE_INTERFACE | |
| struct PSI_file_locker *locker= NULL; | | struct PSI_file_locker *locker; | |
| PSI_file_locker_state state; | | PSI_file_locker_state state; | |
|
| if (likely(PSI_server != NULL)) | | locker= PSI_FILE_CALL(get_thread_file_descriptor_locker) | |
| | | (&state, fd, PSI_FILE_SYNC); | |
| | | if (likely(locker != NULL)) | |
| { | | { | |
|
| locker= PSI_server->get_thread_file_descriptor_locker(&state, fd, PSI_F | | PSI_FILE_CALL(start_file_wait)(locker, (size_t) 0, src_file, src_line); | |
| ILE_SYNC); | | result= my_sync(fd, flags); | |
| if (likely(locker != NULL)) | | PSI_FILE_CALL(end_file_wait)(locker, (size_t) 0); | |
| PSI_server->start_file_wait(locker, (size_t) 0, src_file, src_line); | | return result; | |
| } | | } | |
| #endif | | #endif | |
|
| | | | |
| result= my_sync(fd, flags); | | result= my_sync(fd, flags); | |
|
| #ifdef HAVE_PSI_INTERFACE | | | |
| if (likely(locker != NULL)) | | | |
| PSI_server->end_file_wait(locker, (size_t) 0); | | | |
| #endif | | | |
| return result; | | return result; | |
| } | | } | |
| | | | |
| /** @} (end of group File_instrumentation) */ | | /** @} (end of group File_instrumentation) */ | |
| | | | |
| #endif | | #endif | |
| | | | |
End of changes. 220 change blocks. |
| 452 lines changed or deleted | | 426 lines changed or added | |
|
| mysql_thread.h | | mysql_thread.h | |
|
| /* Copyright (c) 2008, 2013, Oracle and/or its affiliates. All rights reser
ved. | | /* Copyright (c) 2008, 2012, Oracle and/or its affiliates. All rights reser
ved. | |
| | | | |
| This program is free software; you can redistribute it and/or modify | | This program is free software; you can redistribute it and/or modify | |
| it under the terms of the GNU General Public License as published by | | it under the terms of the GNU General Public License as published by | |
| the Free Software Foundation; version 2 of the License. | | the Free Software Foundation; version 2 of the License. | |
| | | | |
| This program is distributed in the hope that it will be useful, | | This program is distributed in the hope that it will be useful, | |
| but WITHOUT ANY WARRANTY; without even the implied warranty of | | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
| GNU General Public License for more details. | | GNU General Public License for more details. | |
| | | | |
| | | | |
| skipping to change at line 72 | | skipping to change at line 72 | |
| @{ | | @{ | |
| */ | | */ | |
| | | | |
| /** | | /** | |
| An instrumented mutex structure. | | An instrumented mutex structure. | |
| @sa mysql_mutex_t | | @sa mysql_mutex_t | |
| */ | | */ | |
| struct st_mysql_mutex | | struct st_mysql_mutex | |
| { | | { | |
| /** The real mutex. */ | | /** The real mutex. */ | |
|
| | | #ifdef SAFE_MUTEX | |
| | | safe_mutex_t m_mutex; | |
| | | #elif defined(MY_PTHREAD_FASTMUTEX) | |
| | | my_pthread_fastmutex_t m_mutex; | |
| | | #else | |
| pthread_mutex_t m_mutex; | | pthread_mutex_t m_mutex; | |
|
| | | #endif | |
| /** | | /** | |
| The instrumentation hook. | | The instrumentation hook. | |
| Note that this hook is not conditionally defined, | | Note that this hook is not conditionally defined, | |
| for binary compatibility of the @c mysql_mutex_t interface. | | for binary compatibility of the @c mysql_mutex_t interface. | |
| */ | | */ | |
| struct PSI_mutex *m_psi; | | struct PSI_mutex *m_psi; | |
| }; | | }; | |
| | | | |
| /** | | /** | |
| Type of an instrumented mutex. | | Type of an instrumented mutex. | |
| | | | |
| skipping to change at line 225 | | skipping to change at line 231 | |
| | | | |
| /** Wrappers for instrumented prlock objects. */ | | /** Wrappers for instrumented prlock objects. */ | |
| | | | |
| #define mysql_prlock_assert_write_owner(M) \ | | #define mysql_prlock_assert_write_owner(M) \ | |
| rw_pr_lock_assert_write_owner(&(M)->m_prlock) | | rw_pr_lock_assert_write_owner(&(M)->m_prlock) | |
| | | | |
| #define mysql_prlock_assert_not_write_owner(M) \ | | #define mysql_prlock_assert_not_write_owner(M) \ | |
| rw_pr_lock_assert_not_write_owner(&(M)->m_prlock) | | rw_pr_lock_assert_not_write_owner(&(M)->m_prlock) | |
| | | | |
| /** | | /** | |
|
| | | @def mysql_mutex_register(P1, P2, P3) | |
| | | Mutex registration. | |
| | | */ | |
| | | #define mysql_mutex_register(P1, P2, P3) \ | |
| | | inline_mysql_mutex_register(P1, P2, P3) | |
| | | | |
| | | /** | |
| @def mysql_mutex_init(K, M, A) | | @def mysql_mutex_init(K, M, A) | |
| Instrumented mutex_init. | | Instrumented mutex_init. | |
| @c mysql_mutex_init is a replacement for @c pthread_mutex_init. | | @c mysql_mutex_init is a replacement for @c pthread_mutex_init. | |
| @param K The PSI_mutex_key for this instrumented mutex | | @param K The PSI_mutex_key for this instrumented mutex | |
| @param M The mutex to initialize | | @param M The mutex to initialize | |
| @param A Mutex attributes | | @param A Mutex attributes | |
| */ | | */ | |
| | | | |
|
| #ifdef HAVE_PSI_INTERFACE | | #ifdef HAVE_PSI_MUTEX_INTERFACE | |
| #ifdef SAFE_MUTEX | | #ifdef SAFE_MUTEX | |
| #define mysql_mutex_init(K, M, A) \ | | #define mysql_mutex_init(K, M, A) \ | |
| inline_mysql_mutex_init(K, M, A, __FILE__, __LINE__) | | inline_mysql_mutex_init(K, M, A, __FILE__, __LINE__) | |
| #else | | #else | |
| #define mysql_mutex_init(K, M, A) \ | | #define mysql_mutex_init(K, M, A) \ | |
| inline_mysql_mutex_init(K, M, A) | | inline_mysql_mutex_init(K, M, A) | |
| #endif | | #endif | |
| #else | | #else | |
| #ifdef SAFE_MUTEX | | #ifdef SAFE_MUTEX | |
| #define mysql_mutex_init(K, M, A) \ | | #define mysql_mutex_init(K, M, A) \ | |
| | | | |
| skipping to change at line 272 | | skipping to change at line 285 | |
| inline_mysql_mutex_destroy(M) | | inline_mysql_mutex_destroy(M) | |
| #endif | | #endif | |
| | | | |
| /** | | /** | |
| @def mysql_mutex_lock(M) | | @def mysql_mutex_lock(M) | |
| Instrumented mutex_lock. | | Instrumented mutex_lock. | |
| @c mysql_mutex_lock is a drop-in replacement for @c pthread_mutex_lock. | | @c mysql_mutex_lock is a drop-in replacement for @c pthread_mutex_lock. | |
| @param M The mutex to lock | | @param M The mutex to lock | |
| */ | | */ | |
| | | | |
|
| #if defined(SAFE_MUTEX) || defined (HAVE_PSI_INTERFACE) | | #if defined(SAFE_MUTEX) || defined (HAVE_PSI_MUTEX_INTERFACE) | |
| #define mysql_mutex_lock(M) \ | | #define mysql_mutex_lock(M) \ | |
| inline_mysql_mutex_lock(M, __FILE__, __LINE__) | | inline_mysql_mutex_lock(M, __FILE__, __LINE__) | |
| #else | | #else | |
| #define mysql_mutex_lock(M) \ | | #define mysql_mutex_lock(M) \ | |
| inline_mysql_mutex_lock(M) | | inline_mysql_mutex_lock(M) | |
| #endif | | #endif | |
| | | | |
| /** | | /** | |
| @def mysql_mutex_trylock(M) | | @def mysql_mutex_trylock(M) | |
| Instrumented mutex_lock. | | Instrumented mutex_lock. | |
| @c mysql_mutex_trylock is a drop-in replacement | | @c mysql_mutex_trylock is a drop-in replacement | |
| for @c pthread_mutex_trylock. | | for @c pthread_mutex_trylock. | |
| */ | | */ | |
| | | | |
|
| #if defined(SAFE_MUTEX) || defined (HAVE_PSI_INTERFACE) | | #if defined(SAFE_MUTEX) || defined (HAVE_PSI_MUTEX_INTERFACE) | |
| #define mysql_mutex_trylock(M) \ | | #define mysql_mutex_trylock(M) \ | |
| inline_mysql_mutex_trylock(M, __FILE__, __LINE__) | | inline_mysql_mutex_trylock(M, __FILE__, __LINE__) | |
| #else | | #else | |
| #define mysql_mutex_trylock(M) \ | | #define mysql_mutex_trylock(M) \ | |
| inline_mysql_mutex_trylock(M) | | inline_mysql_mutex_trylock(M) | |
| #endif | | #endif | |
| | | | |
| /** | | /** | |
| @def mysql_mutex_unlock(M) | | @def mysql_mutex_unlock(M) | |
| Instrumented mutex_unlock. | | Instrumented mutex_unlock. | |
| | | | |
| skipping to change at line 309 | | skipping to change at line 322 | |
| */ | | */ | |
| #ifdef SAFE_MUTEX | | #ifdef SAFE_MUTEX | |
| #define mysql_mutex_unlock(M) \ | | #define mysql_mutex_unlock(M) \ | |
| inline_mysql_mutex_unlock(M, __FILE__, __LINE__) | | inline_mysql_mutex_unlock(M, __FILE__, __LINE__) | |
| #else | | #else | |
| #define mysql_mutex_unlock(M) \ | | #define mysql_mutex_unlock(M) \ | |
| inline_mysql_mutex_unlock(M) | | inline_mysql_mutex_unlock(M) | |
| #endif | | #endif | |
| | | | |
| /** | | /** | |
|
| | | @def mysql_rwlock_register(P1, P2, P3) | |
| | | Rwlock registration. | |
| | | */ | |
| | | #define mysql_rwlock_register(P1, P2, P3) \ | |
| | | inline_mysql_rwlock_register(P1, P2, P3) | |
| | | | |
| | | /** | |
| @def mysql_rwlock_init(K, RW) | | @def mysql_rwlock_init(K, RW) | |
| Instrumented rwlock_init. | | Instrumented rwlock_init. | |
| @c mysql_rwlock_init is a replacement for @c pthread_rwlock_init. | | @c mysql_rwlock_init is a replacement for @c pthread_rwlock_init. | |
| Note that pthread_rwlockattr_t is not supported in MySQL. | | Note that pthread_rwlockattr_t is not supported in MySQL. | |
| @param K The PSI_rwlock_key for this instrumented rwlock | | @param K The PSI_rwlock_key for this instrumented rwlock | |
| @param RW The rwlock to initialize | | @param RW The rwlock to initialize | |
| */ | | */ | |
|
| #ifdef HAVE_PSI_INTERFACE | | #ifdef HAVE_PSI_RWLOCK_INTERFACE | |
| #define mysql_rwlock_init(K, RW) inline_mysql_rwlock_init(K, RW) | | #define mysql_rwlock_init(K, RW) inline_mysql_rwlock_init(K, RW) | |
| #else | | #else | |
| #define mysql_rwlock_init(K, RW) inline_mysql_rwlock_init(RW) | | #define mysql_rwlock_init(K, RW) inline_mysql_rwlock_init(RW) | |
| #endif | | #endif | |
| | | | |
| /** | | /** | |
| @def mysql_prlock_init(K, RW) | | @def mysql_prlock_init(K, RW) | |
| Instrumented rw_pr_init. | | Instrumented rw_pr_init. | |
| @c mysql_prlock_init is a replacement for @c rw_pr_init. | | @c mysql_prlock_init is a replacement for @c rw_pr_init. | |
| @param K The PSI_rwlock_key for this instrumented prlock | | @param K The PSI_rwlock_key for this instrumented prlock | |
| @param RW The prlock to initialize | | @param RW The prlock to initialize | |
| */ | | */ | |
|
| #ifdef HAVE_PSI_INTERFACE | | #ifdef HAVE_PSI_RWLOCK_INTERFACE | |
| #define mysql_prlock_init(K, RW) inline_mysql_prlock_init(K, RW) | | #define mysql_prlock_init(K, RW) inline_mysql_prlock_init(K, RW) | |
| #else | | #else | |
| #define mysql_prlock_init(K, RW) inline_mysql_prlock_init(RW) | | #define mysql_prlock_init(K, RW) inline_mysql_prlock_init(RW) | |
| #endif | | #endif | |
| | | | |
| /** | | /** | |
| @def mysql_rwlock_destroy(RW) | | @def mysql_rwlock_destroy(RW) | |
| Instrumented rwlock_destroy. | | Instrumented rwlock_destroy. | |
| @c mysql_rwlock_destroy is a drop-in replacement | | @c mysql_rwlock_destroy is a drop-in replacement | |
| for @c pthread_rwlock_destroy. | | for @c pthread_rwlock_destroy. | |
| | | | |
| skipping to change at line 357 | | skipping to change at line 377 | |
| for @c rw_pr_destroy. | | for @c rw_pr_destroy. | |
| */ | | */ | |
| #define mysql_prlock_destroy(RW) inline_mysql_prlock_destroy(RW) | | #define mysql_prlock_destroy(RW) inline_mysql_prlock_destroy(RW) | |
| | | | |
| /** | | /** | |
| @def mysql_rwlock_rdlock(RW) | | @def mysql_rwlock_rdlock(RW) | |
| Instrumented rwlock_rdlock. | | Instrumented rwlock_rdlock. | |
| @c mysql_rwlock_rdlock is a drop-in replacement | | @c mysql_rwlock_rdlock is a drop-in replacement | |
| for @c pthread_rwlock_rdlock. | | for @c pthread_rwlock_rdlock. | |
| */ | | */ | |
|
| #ifdef HAVE_PSI_INTERFACE | | #ifdef HAVE_PSI_RWLOCK_INTERFACE | |
| #define mysql_rwlock_rdlock(RW) \ | | #define mysql_rwlock_rdlock(RW) \ | |
| inline_mysql_rwlock_rdlock(RW, __FILE__, __LINE__) | | inline_mysql_rwlock_rdlock(RW, __FILE__, __LINE__) | |
| #else | | #else | |
| #define mysql_rwlock_rdlock(RW) \ | | #define mysql_rwlock_rdlock(RW) \ | |
| inline_mysql_rwlock_rdlock(RW) | | inline_mysql_rwlock_rdlock(RW) | |
| #endif | | #endif | |
| | | | |
| /** | | /** | |
| @def mysql_prlock_rdlock(RW) | | @def mysql_prlock_rdlock(RW) | |
| Instrumented rw_pr_rdlock. | | Instrumented rw_pr_rdlock. | |
| @c mysql_prlock_rdlock is a drop-in replacement | | @c mysql_prlock_rdlock is a drop-in replacement | |
| for @c rw_pr_rdlock. | | for @c rw_pr_rdlock. | |
| */ | | */ | |
|
| #ifdef HAVE_PSI_INTERFACE | | #ifdef HAVE_PSI_RWLOCK_INTERFACE | |
| #define mysql_prlock_rdlock(RW) \ | | #define mysql_prlock_rdlock(RW) \ | |
| inline_mysql_prlock_rdlock(RW, __FILE__, __LINE__) | | inline_mysql_prlock_rdlock(RW, __FILE__, __LINE__) | |
| #else | | #else | |
| #define mysql_prlock_rdlock(RW) \ | | #define mysql_prlock_rdlock(RW) \ | |
| inline_mysql_prlock_rdlock(RW) | | inline_mysql_prlock_rdlock(RW) | |
| #endif | | #endif | |
| | | | |
| /** | | /** | |
| @def mysql_rwlock_wrlock(RW) | | @def mysql_rwlock_wrlock(RW) | |
| Instrumented rwlock_wrlock. | | Instrumented rwlock_wrlock. | |
| @c mysql_rwlock_wrlock is a drop-in replacement | | @c mysql_rwlock_wrlock is a drop-in replacement | |
| for @c pthread_rwlock_wrlock. | | for @c pthread_rwlock_wrlock. | |
| */ | | */ | |
|
| #ifdef HAVE_PSI_INTERFACE | | #ifdef HAVE_PSI_RWLOCK_INTERFACE | |
| #define mysql_rwlock_wrlock(RW) \ | | #define mysql_rwlock_wrlock(RW) \ | |
| inline_mysql_rwlock_wrlock(RW, __FILE__, __LINE__) | | inline_mysql_rwlock_wrlock(RW, __FILE__, __LINE__) | |
| #else | | #else | |
| #define mysql_rwlock_wrlock(RW) \ | | #define mysql_rwlock_wrlock(RW) \ | |
| inline_mysql_rwlock_wrlock(RW) | | inline_mysql_rwlock_wrlock(RW) | |
| #endif | | #endif | |
| | | | |
| /** | | /** | |
| @def mysql_prlock_wrlock(RW) | | @def mysql_prlock_wrlock(RW) | |
| Instrumented rw_pr_wrlock. | | Instrumented rw_pr_wrlock. | |
| @c mysql_prlock_wrlock is a drop-in replacement | | @c mysql_prlock_wrlock is a drop-in replacement | |
| for @c rw_pr_wrlock. | | for @c rw_pr_wrlock. | |
| */ | | */ | |
|
| #ifdef HAVE_PSI_INTERFACE | | #ifdef HAVE_PSI_RWLOCK_INTERFACE | |
| #define mysql_prlock_wrlock(RW) \ | | #define mysql_prlock_wrlock(RW) \ | |
| inline_mysql_prlock_wrlock(RW, __FILE__, __LINE__) | | inline_mysql_prlock_wrlock(RW, __FILE__, __LINE__) | |
| #else | | #else | |
| #define mysql_prlock_wrlock(RW) \ | | #define mysql_prlock_wrlock(RW) \ | |
| inline_mysql_prlock_wrlock(RW) | | inline_mysql_prlock_wrlock(RW) | |
| #endif | | #endif | |
| | | | |
| /** | | /** | |
| @def mysql_rwlock_tryrdlock(RW) | | @def mysql_rwlock_tryrdlock(RW) | |
| Instrumented rwlock_tryrdlock. | | Instrumented rwlock_tryrdlock. | |
| @c mysql_rwlock_tryrdlock is a drop-in replacement | | @c mysql_rwlock_tryrdlock is a drop-in replacement | |
| for @c pthread_rwlock_tryrdlock. | | for @c pthread_rwlock_tryrdlock. | |
| */ | | */ | |
|
| #ifdef HAVE_PSI_INTERFACE | | #ifdef HAVE_PSI_RWLOCK_INTERFACE | |
| #define mysql_rwlock_tryrdlock(RW) \ | | #define mysql_rwlock_tryrdlock(RW) \ | |
| inline_mysql_rwlock_tryrdlock(RW, __FILE__, __LINE__) | | inline_mysql_rwlock_tryrdlock(RW, __FILE__, __LINE__) | |
| #else | | #else | |
| #define mysql_rwlock_tryrdlock(RW) \ | | #define mysql_rwlock_tryrdlock(RW) \ | |
| inline_mysql_rwlock_tryrdlock(RW) | | inline_mysql_rwlock_tryrdlock(RW) | |
| #endif | | #endif | |
| | | | |
| /** | | /** | |
| @def mysql_rwlock_trywrlock(RW) | | @def mysql_rwlock_trywrlock(RW) | |
| Instrumented rwlock_trywrlock. | | Instrumented rwlock_trywrlock. | |
| @c mysql_rwlock_trywrlock is a drop-in replacement | | @c mysql_rwlock_trywrlock is a drop-in replacement | |
| for @c pthread_rwlock_trywrlock. | | for @c pthread_rwlock_trywrlock. | |
| */ | | */ | |
|
| #ifdef HAVE_PSI_INTERFACE | | #ifdef HAVE_PSI_RWLOCK_INTERFACE | |
| #define mysql_rwlock_trywrlock(RW) \ | | #define mysql_rwlock_trywrlock(RW) \ | |
| inline_mysql_rwlock_trywrlock(RW, __FILE__, __LINE__) | | inline_mysql_rwlock_trywrlock(RW, __FILE__, __LINE__) | |
| #else | | #else | |
| #define mysql_rwlock_trywrlock(RW) \ | | #define mysql_rwlock_trywrlock(RW) \ | |
| inline_mysql_rwlock_trywrlock(RW) | | inline_mysql_rwlock_trywrlock(RW) | |
| #endif | | #endif | |
| | | | |
| /** | | /** | |
| @def mysql_rwlock_unlock(RW) | | @def mysql_rwlock_unlock(RW) | |
| Instrumented rwlock_unlock. | | Instrumented rwlock_unlock. | |
| | | | |
| skipping to change at line 452 | | skipping to change at line 472 | |
| | | | |
| /** | | /** | |
| @def mysql_prlock_unlock(RW) | | @def mysql_prlock_unlock(RW) | |
| Instrumented rw_pr_unlock. | | Instrumented rw_pr_unlock. | |
| @c mysql_prlock_unlock is a drop-in replacement | | @c mysql_prlock_unlock is a drop-in replacement | |
| for @c rw_pr_unlock. | | for @c rw_pr_unlock. | |
| */ | | */ | |
| #define mysql_prlock_unlock(RW) inline_mysql_prlock_unlock(RW) | | #define mysql_prlock_unlock(RW) inline_mysql_prlock_unlock(RW) | |
| | | | |
| /** | | /** | |
|
| | | @def mysql_cond_register(P1, P2, P3) | |
| | | Cond registration. | |
| | | */ | |
| | | #define mysql_cond_register(P1, P2, P3) \ | |
| | | inline_mysql_cond_register(P1, P2, P3) | |
| | | | |
| | | /** | |
| @def mysql_cond_init(K, C, A) | | @def mysql_cond_init(K, C, A) | |
| Instrumented cond_init. | | Instrumented cond_init. | |
| @c mysql_cond_init is a replacement for @c pthread_cond_init. | | @c mysql_cond_init is a replacement for @c pthread_cond_init. | |
| @param C The cond to initialize | | @param C The cond to initialize | |
| @param K The PSI_cond_key for this instrumented cond | | @param K The PSI_cond_key for this instrumented cond | |
| @param A Condition attributes | | @param A Condition attributes | |
| */ | | */ | |
|
| #ifdef HAVE_PSI_INTERFACE | | #ifdef HAVE_PSI_COND_INTERFACE | |
| #define mysql_cond_init(K, C, A) inline_mysql_cond_init(K, C, A) | | #define mysql_cond_init(K, C, A) inline_mysql_cond_init(K, C, A) | |
| #else | | #else | |
| #define mysql_cond_init(K, C, A) inline_mysql_cond_init(C, A) | | #define mysql_cond_init(K, C, A) inline_mysql_cond_init(C, A) | |
| #endif | | #endif | |
| | | | |
| /** | | /** | |
| @def mysql_cond_destroy(C) | | @def mysql_cond_destroy(C) | |
| Instrumented cond_destroy. | | Instrumented cond_destroy. | |
| @c mysql_cond_destroy is a drop-in replacement for @c pthread_cond_destro
y. | | @c mysql_cond_destroy is a drop-in replacement for @c pthread_cond_destro
y. | |
| */ | | */ | |
| #define mysql_cond_destroy(C) inline_mysql_cond_destroy(C) | | #define mysql_cond_destroy(C) inline_mysql_cond_destroy(C) | |
| | | | |
| /** | | /** | |
| @def mysql_cond_wait(C) | | @def mysql_cond_wait(C) | |
| Instrumented cond_wait. | | Instrumented cond_wait. | |
| @c mysql_cond_wait is a drop-in replacement for @c pthread_cond_wait. | | @c mysql_cond_wait is a drop-in replacement for @c pthread_cond_wait. | |
| */ | | */ | |
|
| #ifdef HAVE_PSI_INTERFACE | | #ifdef HAVE_PSI_COND_INTERFACE | |
| #define mysql_cond_wait(C, M) \ | | #define mysql_cond_wait(C, M) \ | |
| inline_mysql_cond_wait(C, M, __FILE__, __LINE__) | | inline_mysql_cond_wait(C, M, __FILE__, __LINE__) | |
| #else | | #else | |
| #define mysql_cond_wait(C, M) \ | | #define mysql_cond_wait(C, M) \ | |
| inline_mysql_cond_wait(C, M) | | inline_mysql_cond_wait(C, M) | |
| #endif | | #endif | |
| | | | |
| /** | | /** | |
| @def mysql_cond_timedwait(C, M, W) | | @def mysql_cond_timedwait(C, M, W) | |
| Instrumented cond_timedwait. | | Instrumented cond_timedwait. | |
| @c mysql_cond_timedwait is a drop-in replacement | | @c mysql_cond_timedwait is a drop-in replacement | |
| for @c pthread_cond_timedwait. | | for @c pthread_cond_timedwait. | |
| */ | | */ | |
|
| #ifdef HAVE_PSI_INTERFACE | | #ifdef HAVE_PSI_COND_INTERFACE | |
| #define mysql_cond_timedwait(C, M, W) \ | | #define mysql_cond_timedwait(C, M, W) \ | |
| inline_mysql_cond_timedwait(C, M, W, __FILE__, __LINE__) | | inline_mysql_cond_timedwait(C, M, W, __FILE__, __LINE__) | |
| #else | | #else | |
| #define mysql_cond_timedwait(C, M, W) \ | | #define mysql_cond_timedwait(C, M, W) \ | |
| inline_mysql_cond_timedwait(C, M, W) | | inline_mysql_cond_timedwait(C, M, W) | |
| #endif | | #endif | |
| | | | |
| /** | | /** | |
| @def mysql_cond_signal(C) | | @def mysql_cond_signal(C) | |
| Instrumented cond_signal. | | Instrumented cond_signal. | |
| | | | |
| skipping to change at line 515 | | skipping to change at line 542 | |
| | | | |
| /** | | /** | |
| @def mysql_cond_broadcast(C) | | @def mysql_cond_broadcast(C) | |
| Instrumented cond_broadcast. | | Instrumented cond_broadcast. | |
| @c mysql_cond_broadcast is a drop-in replacement | | @c mysql_cond_broadcast is a drop-in replacement | |
| for @c pthread_cond_broadcast. | | for @c pthread_cond_broadcast. | |
| */ | | */ | |
| #define mysql_cond_broadcast(C) inline_mysql_cond_broadcast(C) | | #define mysql_cond_broadcast(C) inline_mysql_cond_broadcast(C) | |
| | | | |
| /** | | /** | |
|
| | | @def mysql_thread_register(P1, P2, P3) | |
| | | Thread registration. | |
| | | */ | |
| | | #define mysql_thread_register(P1, P2, P3) \ | |
| | | inline_mysql_thread_register(P1, P2, P3) | |
| | | | |
| | | /** | |
| @def mysql_thread_create(K, P1, P2, P3, P4) | | @def mysql_thread_create(K, P1, P2, P3, P4) | |
| Instrumented pthread_create. | | Instrumented pthread_create. | |
| This function creates both the thread instrumentation and a thread. | | This function creates both the thread instrumentation and a thread. | |
| @c mysql_thread_create is a replacement for @c pthread_create. | | @c mysql_thread_create is a replacement for @c pthread_create. | |
| The parameter P4 (or, if it is NULL, P1) will be used as the | | The parameter P4 (or, if it is NULL, P1) will be used as the | |
| instrumented thread "indentity". | | instrumented thread "indentity". | |
| Providing a P1 / P4 parameter with a different value for each call | | Providing a P1 / P4 parameter with a different value for each call | |
| will on average improve performances, since this thread identity value | | will on average improve performances, since this thread identity value | |
| is used internally to randomize access to data and prevent contention. | | is used internally to randomize access to data and prevent contention. | |
| This is optional, and the improvement is not guaranteed, only statistical
. | | This is optional, and the improvement is not guaranteed, only statistical
. | |
| @param K The PSI_thread_key for this instrumented thread | | @param K The PSI_thread_key for this instrumented thread | |
| @param P1 pthread_create parameter 1 | | @param P1 pthread_create parameter 1 | |
| @param P2 pthread_create parameter 2 | | @param P2 pthread_create parameter 2 | |
| @param P3 pthread_create parameter 3 | | @param P3 pthread_create parameter 3 | |
| @param P4 pthread_create parameter 4 | | @param P4 pthread_create parameter 4 | |
| */ | | */ | |
|
| #ifdef HAVE_PSI_INTERFACE | | #ifdef HAVE_PSI_THREAD_INTERFACE | |
| #define mysql_thread_create(K, P1, P2, P3, P4) \ | | #define mysql_thread_create(K, P1, P2, P3, P4) \ | |
| inline_mysql_thread_create(K, P1, P2, P3, P4) | | inline_mysql_thread_create(K, P1, P2, P3, P4) | |
| #else | | #else | |
| #define mysql_thread_create(K, P1, P2, P3, P4) \ | | #define mysql_thread_create(K, P1, P2, P3, P4) \ | |
| pthread_create(P1, P2, P3, P4) | | pthread_create(P1, P2, P3, P4) | |
| #endif | | #endif | |
| | | | |
| /** | | /** | |
| @def mysql_thread_set_psi_id(I) | | @def mysql_thread_set_psi_id(I) | |
| Set the thread indentifier for the instrumentation. | | Set the thread indentifier for the instrumentation. | |
| @param I The thread identifier | | @param I The thread identifier | |
| */ | | */ | |
|
| #ifdef HAVE_PSI_INTERFACE | | #ifdef HAVE_PSI_THREAD_INTERFACE | |
| #define mysql_thread_set_psi_id(I) inline_mysql_thread_set_psi_id(I) | | #define mysql_thread_set_psi_id(I) inline_mysql_thread_set_psi_id(I) | |
| #else | | #else | |
| #define mysql_thread_set_psi_id(I) do {} while (0) | | #define mysql_thread_set_psi_id(I) do {} while (0) | |
| #endif | | #endif | |
| | | | |
|
| | | static inline void inline_mysql_mutex_register( | |
| | | #ifdef HAVE_PSI_MUTEX_INTERFACE | |
| | | const char *category, | |
| | | PSI_mutex_info *info, | |
| | | int count | |
| | | #else | |
| | | const char *category __attribute__ ((unused)), | |
| | | void *info __attribute__ ((unused)), | |
| | | int count __attribute__ ((unused)) | |
| | | #endif | |
| | | ) | |
| | | { | |
| | | #ifdef HAVE_PSI_MUTEX_INTERFACE | |
| | | PSI_MUTEX_CALL(register_mutex)(category, info, count); | |
| | | #endif | |
| | | } | |
| | | | |
| static inline int inline_mysql_mutex_init( | | static inline int inline_mysql_mutex_init( | |
|
| #ifdef HAVE_PSI_INTERFACE | | #ifdef HAVE_PSI_MUTEX_INTERFACE | |
| PSI_mutex_key key, | | PSI_mutex_key key, | |
| #endif | | #endif | |
| mysql_mutex_t *that, | | mysql_mutex_t *that, | |
| const pthread_mutexattr_t *attr | | const pthread_mutexattr_t *attr | |
| #ifdef SAFE_MUTEX | | #ifdef SAFE_MUTEX | |
| , const char *src_file, uint src_line | | , const char *src_file, uint src_line | |
| #endif | | #endif | |
| ) | | ) | |
| { | | { | |
|
| #ifdef HAVE_PSI_INTERFACE | | #ifdef HAVE_PSI_MUTEX_INTERFACE | |
| that->m_psi= PSI_server ? PSI_server->init_mutex(key, &that->m_mutex) | | that->m_psi= PSI_MUTEX_CALL(init_mutex)(key, &that->m_mutex); | |
| : NULL; | | | |
| #else | | #else | |
| that->m_psi= NULL; | | that->m_psi= NULL; | |
| #endif | | #endif | |
| #ifdef SAFE_MUTEX | | #ifdef SAFE_MUTEX | |
| return safe_mutex_init(&that->m_mutex, attr, src_file, src_line); | | return safe_mutex_init(&that->m_mutex, attr, src_file, src_line); | |
|
| | | #elif defined(MY_PTHREAD_FASTMUTEX) | |
| | | return my_pthread_fastmutex_init(&that->m_mutex, attr); | |
| #else | | #else | |
| return pthread_mutex_init(&that->m_mutex, attr); | | return pthread_mutex_init(&that->m_mutex, attr); | |
| #endif | | #endif | |
| } | | } | |
| | | | |
| static inline int inline_mysql_mutex_destroy( | | static inline int inline_mysql_mutex_destroy( | |
| mysql_mutex_t *that | | mysql_mutex_t *that | |
| #ifdef SAFE_MUTEX | | #ifdef SAFE_MUTEX | |
| , const char *src_file, uint src_line | | , const char *src_file, uint src_line | |
| #endif | | #endif | |
| ) | | ) | |
| { | | { | |
|
| #ifdef HAVE_PSI_INTERFACE | | #ifdef HAVE_PSI_MUTEX_INTERFACE | |
| if (likely(PSI_server && that->m_psi)) | | if (that->m_psi != NULL) | |
| { | | { | |
|
| PSI_server->destroy_mutex(that->m_psi); | | PSI_MUTEX_CALL(destroy_mutex)(that->m_psi); | |
| that->m_psi= NULL; | | that->m_psi= NULL; | |
| } | | } | |
| #endif | | #endif | |
| #ifdef SAFE_MUTEX | | #ifdef SAFE_MUTEX | |
| return safe_mutex_destroy(&that->m_mutex, src_file, src_line); | | return safe_mutex_destroy(&that->m_mutex, src_file, src_line); | |
|
| | | #elif defined(MY_PTHREAD_FASTMUTEX) | |
| | | return pthread_mutex_destroy(&that->m_mutex.mutex); | |
| #else | | #else | |
| return pthread_mutex_destroy(&that->m_mutex); | | return pthread_mutex_destroy(&that->m_mutex); | |
| #endif | | #endif | |
| } | | } | |
| | | | |
| static inline int inline_mysql_mutex_lock( | | static inline int inline_mysql_mutex_lock( | |
| mysql_mutex_t *that | | mysql_mutex_t *that | |
|
| #if defined(SAFE_MUTEX) || defined (HAVE_PSI_INTERFACE) | | #if defined(SAFE_MUTEX) || defined (HAVE_PSI_MUTEX_INTERFACE) | |
| , const char *src_file, uint src_line | | , const char *src_file, uint src_line | |
| #endif | | #endif | |
| ) | | ) | |
| { | | { | |
| int result; | | int result; | |
|
| #ifdef HAVE_PSI_INTERFACE | | | |
| struct PSI_mutex_locker *locker= NULL; | | #ifdef HAVE_PSI_MUTEX_INTERFACE | |
| PSI_mutex_locker_state state; | | if (that->m_psi != NULL) | |
| if (likely(PSI_server && that->m_psi)) | | | |
| { | | { | |
|
| locker= PSI_server->get_thread_mutex_locker(&state, that->m_psi, PSI_MU | | /* Instrumentation start */ | |
| TEX_LOCK); | | PSI_mutex_locker *locker; | |
| if (likely(locker != NULL)) | | PSI_mutex_locker_state state; | |
| PSI_server->start_mutex_wait(locker, src_file, src_line); | | locker= PSI_MUTEX_CALL(start_mutex_wait)(&state, that->m_psi, | |
| | | PSI_MUTEX_LOCK, src_file, src_line); | |
| | | | |
| | | /* Instrumented code */ | |
| | | #ifdef SAFE_MUTEX | |
| | | result= safe_mutex_lock(&that->m_mutex, FALSE, src_file, src_line); | |
| | | #elif defined(MY_PTHREAD_FASTMUTEX) | |
| | | result= my_pthread_fastmutex_lock(&that->m_mutex); | |
| | | #else | |
| | | result= pthread_mutex_lock(&that->m_mutex); | |
| | | #endif | |
| | | | |
| | | /* Instrumentation end */ | |
| | | if (locker != NULL) | |
| | | PSI_MUTEX_CALL(end_mutex_wait)(locker, result); | |
| | | | |
| | | return result; | |
| } | | } | |
| #endif | | #endif | |
|
| | | | |
| | | /* Non instrumented code */ | |
| #ifdef SAFE_MUTEX | | #ifdef SAFE_MUTEX | |
| result= safe_mutex_lock(&that->m_mutex, FALSE, src_file, src_line); | | result= safe_mutex_lock(&that->m_mutex, FALSE, src_file, src_line); | |
|
| | | #elif defined(MY_PTHREAD_FASTMUTEX) | |
| | | result= my_pthread_fastmutex_lock(&that->m_mutex); | |
| #else | | #else | |
| result= pthread_mutex_lock(&that->m_mutex); | | result= pthread_mutex_lock(&that->m_mutex); | |
| #endif | | #endif | |
|
| #ifdef HAVE_PSI_INTERFACE | | | |
| if (likely(locker != NULL)) | | | |
| PSI_server->end_mutex_wait(locker, result); | | | |
| #endif | | | |
| return result; | | return result; | |
| } | | } | |
| | | | |
| static inline int inline_mysql_mutex_trylock( | | static inline int inline_mysql_mutex_trylock( | |
| mysql_mutex_t *that | | mysql_mutex_t *that | |
|
| #if defined(SAFE_MUTEX) || defined (HAVE_PSI_INTERFACE) | | #if defined(SAFE_MUTEX) || defined (HAVE_PSI_MUTEX_INTERFACE) | |
| , const char *src_file, uint src_line | | , const char *src_file, uint src_line | |
| #endif | | #endif | |
| ) | | ) | |
| { | | { | |
| int result; | | int result; | |
|
| #ifdef HAVE_PSI_INTERFACE | | | |
| struct PSI_mutex_locker *locker= NULL; | | #ifdef HAVE_PSI_MUTEX_INTERFACE | |
| PSI_mutex_locker_state state; | | if (that->m_psi != NULL) | |
| if (likely(PSI_server && that->m_psi)) | | | |
| { | | { | |
|
| locker= PSI_server->get_thread_mutex_locker(&state, that->m_psi, PSI_MU | | /* Instrumentation start */ | |
| TEX_TRYLOCK); | | PSI_mutex_locker *locker; | |
| if (likely(locker != NULL)) | | PSI_mutex_locker_state state; | |
| PSI_server->start_mutex_wait(locker, src_file, src_line); | | locker= PSI_MUTEX_CALL(start_mutex_wait)(&state, that->m_psi, | |
| | | PSI_MUTEX_TRYLOCK, src_file, src_lin | |
| | | e); | |
| | | | |
| | | /* Instrumented code */ | |
| | | #ifdef SAFE_MUTEX | |
| | | result= safe_mutex_lock(&that->m_mutex, TRUE, src_file, src_line); | |
| | | #elif defined(MY_PTHREAD_FASTMUTEX) | |
| | | result= pthread_mutex_trylock(&that->m_mutex.mutex); | |
| | | #else | |
| | | result= pthread_mutex_trylock(&that->m_mutex); | |
| | | #endif | |
| | | | |
| | | /* Instrumentation end */ | |
| | | if (locker != NULL) | |
| | | PSI_MUTEX_CALL(end_mutex_wait)(locker, result); | |
| | | | |
| | | return result; | |
| } | | } | |
| #endif | | #endif | |
|
| | | | |
| | | /* Non instrumented code */ | |
| #ifdef SAFE_MUTEX | | #ifdef SAFE_MUTEX | |
| result= safe_mutex_lock(&that->m_mutex, TRUE, src_file, src_line); | | result= safe_mutex_lock(&that->m_mutex, TRUE, src_file, src_line); | |
|
| | | #elif defined(MY_PTHREAD_FASTMUTEX) | |
| | | result= pthread_mutex_trylock(&that->m_mutex.mutex); | |
| #else | | #else | |
| result= pthread_mutex_trylock(&that->m_mutex); | | result= pthread_mutex_trylock(&that->m_mutex); | |
| #endif | | #endif | |
|
| #ifdef HAVE_PSI_INTERFACE | | | |
| if (likely(locker != NULL)) | | | |
| PSI_server->end_mutex_wait(locker, result); | | | |
| #endif | | | |
| return result; | | return result; | |
| } | | } | |
| | | | |
| static inline int inline_mysql_mutex_unlock( | | static inline int inline_mysql_mutex_unlock( | |
| mysql_mutex_t *that | | mysql_mutex_t *that | |
| #ifdef SAFE_MUTEX | | #ifdef SAFE_MUTEX | |
| , const char *src_file, uint src_line | | , const char *src_file, uint src_line | |
| #endif | | #endif | |
| ) | | ) | |
| { | | { | |
| int result; | | int result; | |
|
| #ifdef HAVE_PSI_INTERFACE | | | |
| if (likely(PSI_server && that->m_psi)) | | #ifdef HAVE_PSI_MUTEX_INTERFACE | |
| PSI_server->unlock_mutex(that->m_psi); | | if (that->m_psi != NULL) | |
| | | PSI_MUTEX_CALL(unlock_mutex)(that->m_psi); | |
| #endif | | #endif | |
|
| | | | |
| #ifdef SAFE_MUTEX | | #ifdef SAFE_MUTEX | |
| result= safe_mutex_unlock(&that->m_mutex, src_file, src_line); | | result= safe_mutex_unlock(&that->m_mutex, src_file, src_line); | |
|
| | | #elif defined(MY_PTHREAD_FASTMUTEX) | |
| | | result= pthread_mutex_unlock(&that->m_mutex.mutex); | |
| #else | | #else | |
| result= pthread_mutex_unlock(&that->m_mutex); | | result= pthread_mutex_unlock(&that->m_mutex); | |
| #endif | | #endif | |
|
| | | | |
| return result; | | return result; | |
| } | | } | |
| | | | |
|
| | | static inline void inline_mysql_rwlock_register( | |
| | | #ifdef HAVE_PSI_RWLOCK_INTERFACE | |
| | | const char *category, | |
| | | PSI_rwlock_info *info, | |
| | | int count | |
| | | #else | |
| | | const char *category __attribute__ ((unused)), | |
| | | void *info __attribute__ ((unused)), | |
| | | int count __attribute__ ((unused)) | |
| | | #endif | |
| | | ) | |
| | | { | |
| | | #ifdef HAVE_PSI_RWLOCK_INTERFACE | |
| | | PSI_RWLOCK_CALL(register_rwlock)(category, info, count); | |
| | | #endif | |
| | | } | |
| | | | |
| static inline int inline_mysql_rwlock_init( | | static inline int inline_mysql_rwlock_init( | |
|
| #ifdef HAVE_PSI_INTERFACE | | #ifdef HAVE_PSI_RWLOCK_INTERFACE | |
| PSI_rwlock_key key, | | PSI_rwlock_key key, | |
| #endif | | #endif | |
| mysql_rwlock_t *that) | | mysql_rwlock_t *that) | |
| { | | { | |
|
| #ifdef HAVE_PSI_INTERFACE | | #ifdef HAVE_PSI_RWLOCK_INTERFACE | |
| that->m_psi= (PSI_server ? PSI_server->init_rwlock(key, &that->m_rwlock) | | that->m_psi= PSI_RWLOCK_CALL(init_rwlock)(key, &that->m_rwlock); | |
| : NULL); | | | |
| #else | | #else | |
| that->m_psi= NULL; | | that->m_psi= NULL; | |
| #endif | | #endif | |
| /* | | /* | |
| pthread_rwlockattr_t is not used in MySQL. | | pthread_rwlockattr_t is not used in MySQL. | |
| */ | | */ | |
| return my_rwlock_init(&that->m_rwlock, NULL); | | return my_rwlock_init(&that->m_rwlock, NULL); | |
| } | | } | |
| | | | |
| #ifndef DISABLE_MYSQL_PRLOCK_H | | #ifndef DISABLE_MYSQL_PRLOCK_H | |
| static inline int inline_mysql_prlock_init( | | static inline int inline_mysql_prlock_init( | |
|
| #ifdef HAVE_PSI_INTERFACE | | #ifdef HAVE_PSI_RWLOCK_INTERFACE | |
| PSI_rwlock_key key, | | PSI_rwlock_key key, | |
| #endif | | #endif | |
| mysql_prlock_t *that) | | mysql_prlock_t *that) | |
| { | | { | |
|
| #ifdef HAVE_PSI_INTERFACE | | #ifdef HAVE_PSI_RWLOCK_INTERFACE | |
| that->m_psi= (PSI_server ? PSI_server->init_rwlock(key, &that->m_prlock) | | that->m_psi= PSI_RWLOCK_CALL(init_rwlock)(key, &that->m_prlock); | |
| : NULL); | | | |
| #else | | #else | |
| that->m_psi= NULL; | | that->m_psi= NULL; | |
| #endif | | #endif | |
| return rw_pr_init(&that->m_prlock); | | return rw_pr_init(&that->m_prlock); | |
| } | | } | |
| #endif | | #endif | |
| | | | |
| static inline int inline_mysql_rwlock_destroy( | | static inline int inline_mysql_rwlock_destroy( | |
| mysql_rwlock_t *that) | | mysql_rwlock_t *that) | |
| { | | { | |
|
| #ifdef HAVE_PSI_INTERFACE | | #ifdef HAVE_PSI_RWLOCK_INTERFACE | |
| if (likely(PSI_server && that->m_psi)) | | if (that->m_psi != NULL) | |
| { | | { | |
|
| PSI_server->destroy_rwlock(that->m_psi); | | PSI_RWLOCK_CALL(destroy_rwlock)(that->m_psi); | |
| that->m_psi= NULL; | | that->m_psi= NULL; | |
| } | | } | |
| #endif | | #endif | |
| return rwlock_destroy(&that->m_rwlock); | | return rwlock_destroy(&that->m_rwlock); | |
| } | | } | |
| | | | |
| #ifndef DISABLE_MYSQL_PRLOCK_H | | #ifndef DISABLE_MYSQL_PRLOCK_H | |
| static inline int inline_mysql_prlock_destroy( | | static inline int inline_mysql_prlock_destroy( | |
| mysql_prlock_t *that) | | mysql_prlock_t *that) | |
| { | | { | |
|
| #ifdef HAVE_PSI_INTERFACE | | #ifdef HAVE_PSI_RWLOCK_INTERFACE | |
| if (likely(PSI_server && that->m_psi)) | | if (that->m_psi != NULL) | |
| { | | { | |
|
| PSI_server->destroy_rwlock(that->m_psi); | | PSI_RWLOCK_CALL(destroy_rwlock)(that->m_psi); | |
| that->m_psi= NULL; | | that->m_psi= NULL; | |
| } | | } | |
| #endif | | #endif | |
| return rw_pr_destroy(&that->m_prlock); | | return rw_pr_destroy(&that->m_prlock); | |
| } | | } | |
| #endif | | #endif | |
| | | | |
| static inline int inline_mysql_rwlock_rdlock( | | static inline int inline_mysql_rwlock_rdlock( | |
| mysql_rwlock_t *that | | mysql_rwlock_t *that | |
|
| #ifdef HAVE_PSI_INTERFACE | | #ifdef HAVE_PSI_RWLOCK_INTERFACE | |
| , const char *src_file, uint src_line | | , const char *src_file, uint src_line | |
| #endif | | #endif | |
| ) | | ) | |
| { | | { | |
| int result; | | int result; | |
|
| #ifdef HAVE_PSI_INTERFACE | | | |
| struct PSI_rwlock_locker *locker= NULL; | | #ifdef HAVE_PSI_RWLOCK_INTERFACE | |
| PSI_rwlock_locker_state state; | | if (that->m_psi != NULL) | |
| if (likely(PSI_server && that->m_psi)) | | | |
| { | | { | |
|
| locker= PSI_server->get_thread_rwlock_locker(&state, that->m_psi, | | /* Instrumentation start */ | |
| PSI_RWLOCK_READLOCK); | | PSI_rwlock_locker *locker; | |
| if (likely(locker != NULL)) | | PSI_rwlock_locker_state state; | |
| PSI_server->start_rwlock_rdwait(locker, src_file, src_line); | | locker= PSI_RWLOCK_CALL(start_rwlock_rdwait)(&state, that->m_psi, | |
| | | PSI_RWLOCK_READLOCK, src_file, sr | |
| | | c_line); | |
| | | | |
| | | /* Instrumented code */ | |
| | | result= rw_rdlock(&that->m_rwlock); | |
| | | | |
| | | /* Instrumentation end */ | |
| | | if (locker != NULL) | |
| | | PSI_RWLOCK_CALL(end_rwlock_rdwait)(locker, result); | |
| | | | |
| | | return result; | |
| } | | } | |
| #endif | | #endif | |
|
| | | | |
| | | /* Non instrumented code */ | |
| result= rw_rdlock(&that->m_rwlock); | | result= rw_rdlock(&that->m_rwlock); | |
|
| #ifdef HAVE_PSI_INTERFACE | | | |
| if (likely(locker != NULL)) | | | |
| PSI_server->end_rwlock_rdwait(locker, result); | | | |
| #endif | | | |
| return result; | | return result; | |
| } | | } | |
| | | | |
| #ifndef DISABLE_MYSQL_PRLOCK_H | | #ifndef DISABLE_MYSQL_PRLOCK_H | |
| static inline int inline_mysql_prlock_rdlock( | | static inline int inline_mysql_prlock_rdlock( | |
| mysql_prlock_t *that | | mysql_prlock_t *that | |
|
| #ifdef HAVE_PSI_INTERFACE | | #ifdef HAVE_PSI_RWLOCK_INTERFACE | |
| , const char *src_file, uint src_line | | , const char *src_file, uint src_line | |
| #endif | | #endif | |
| ) | | ) | |
| { | | { | |
| int result; | | int result; | |
|
| #ifdef HAVE_PSI_INTERFACE | | | |
| struct PSI_rwlock_locker *locker= NULL; | | #ifdef HAVE_PSI_RWLOCK_INTERFACE | |
| PSI_rwlock_locker_state state; | | if (that->m_psi != NULL) | |
| if (likely(PSI_server && that->m_psi)) | | | |
| { | | { | |
|
| locker= PSI_server->get_thread_rwlock_locker(&state, that->m_psi, | | /* Instrumentation start */ | |
| PSI_RWLOCK_READLOCK); | | PSI_rwlock_locker *locker; | |
| if (likely(locker != NULL)) | | PSI_rwlock_locker_state state; | |
| PSI_server->start_rwlock_rdwait(locker, src_file, src_line); | | locker= PSI_RWLOCK_CALL(start_rwlock_rdwait)(&state, that->m_psi, | |
| | | PSI_RWLOCK_READLOCK, src_file, sr | |
| | | c_line); | |
| | | | |
| | | /* Instrumented code */ | |
| | | result= rw_pr_rdlock(&that->m_prlock); | |
| | | | |
| | | /* Instrumentation end */ | |
| | | if (locker != NULL) | |
| | | PSI_RWLOCK_CALL(end_rwlock_rdwait)(locker, result); | |
| | | | |
| | | return result; | |
| } | | } | |
| #endif | | #endif | |
|
| | | | |
| | | /* Non instrumented code */ | |
| result= rw_pr_rdlock(&that->m_prlock); | | result= rw_pr_rdlock(&that->m_prlock); | |
|
| #ifdef HAVE_PSI_INTERFACE | | | |
| if (likely(locker != NULL)) | | | |
| PSI_server->end_rwlock_rdwait(locker, result); | | | |
| #endif | | | |
| return result; | | return result; | |
| } | | } | |
| #endif | | #endif | |
| | | | |
| static inline int inline_mysql_rwlock_wrlock( | | static inline int inline_mysql_rwlock_wrlock( | |
| mysql_rwlock_t *that | | mysql_rwlock_t *that | |
|
| #ifdef HAVE_PSI_INTERFACE | | #ifdef HAVE_PSI_RWLOCK_INTERFACE | |
| , const char *src_file, uint src_line | | , const char *src_file, uint src_line | |
| #endif | | #endif | |
| ) | | ) | |
| { | | { | |
| int result; | | int result; | |
|
| #ifdef HAVE_PSI_INTERFACE | | | |
| struct PSI_rwlock_locker *locker= NULL; | | #ifdef HAVE_PSI_RWLOCK_INTERFACE | |
| PSI_rwlock_locker_state state; | | if (that->m_psi != NULL) | |
| if (likely(PSI_server && that->m_psi)) | | | |
| { | | { | |
|
| locker= PSI_server->get_thread_rwlock_locker(&state, that->m_psi, | | /* Instrumentation start */ | |
| PSI_RWLOCK_WRITELOCK); | | PSI_rwlock_locker *locker; | |
| if (likely(locker != NULL)) | | PSI_rwlock_locker_state state; | |
| PSI_server->start_rwlock_wrwait(locker, src_file, src_line); | | locker= PSI_RWLOCK_CALL(start_rwlock_wrwait)(&state, that->m_psi, | |
| | | PSI_RWLOCK_WRITELOCK, src_file, s | |
| | | rc_line); | |
| | | | |
| | | /* Instrumented code */ | |
| | | result= rw_wrlock(&that->m_rwlock); | |
| | | | |
| | | /* Instrumentation end */ | |
| | | if (locker != NULL) | |
| | | PSI_RWLOCK_CALL(end_rwlock_wrwait)(locker, result); | |
| | | | |
| | | return result; | |
| } | | } | |
| #endif | | #endif | |
|
| | | | |
| | | /* Non instrumented code */ | |
| result= rw_wrlock(&that->m_rwlock); | | result= rw_wrlock(&that->m_rwlock); | |
|
| #ifdef HAVE_PSI_INTERFACE | | | |
| if (likely(locker != NULL)) | | | |
| PSI_server->end_rwlock_wrwait(locker, result); | | | |
| #endif | | | |
| return result; | | return result; | |
| } | | } | |
| | | | |
| #ifndef DISABLE_MYSQL_PRLOCK_H | | #ifndef DISABLE_MYSQL_PRLOCK_H | |
| static inline int inline_mysql_prlock_wrlock( | | static inline int inline_mysql_prlock_wrlock( | |
| mysql_prlock_t *that | | mysql_prlock_t *that | |
|
| #ifdef HAVE_PSI_INTERFACE | | #ifdef HAVE_PSI_RWLOCK_INTERFACE | |
| , const char *src_file, uint src_line | | , const char *src_file, uint src_line | |
| #endif | | #endif | |
| ) | | ) | |
| { | | { | |
| int result; | | int result; | |
|
| #ifdef HAVE_PSI_INTERFACE | | | |
| struct PSI_rwlock_locker *locker= NULL; | | #ifdef HAVE_PSI_RWLOCK_INTERFACE | |
| PSI_rwlock_locker_state state; | | if (that->m_psi != NULL) | |
| if (likely(PSI_server && that->m_psi)) | | | |
| { | | { | |
|
| locker= PSI_server->get_thread_rwlock_locker(&state, that->m_psi, | | /* Instrumentation start */ | |
| PSI_RWLOCK_WRITELOCK); | | PSI_rwlock_locker *locker; | |
| if (likely(locker != NULL)) | | PSI_rwlock_locker_state state; | |
| PSI_server->start_rwlock_wrwait(locker, src_file, src_line); | | locker= PSI_RWLOCK_CALL(start_rwlock_wrwait)(&state, that->m_psi, | |
| | | PSI_RWLOCK_WRITELOCK, src_file, s | |
| | | rc_line); | |
| | | | |
| | | /* Instrumented code */ | |
| | | result= rw_pr_wrlock(&that->m_prlock); | |
| | | | |
| | | /* Instrumentation end */ | |
| | | if (locker != NULL) | |
| | | PSI_RWLOCK_CALL(end_rwlock_wrwait)(locker, result); | |
| | | | |
| | | return result; | |
| } | | } | |
| #endif | | #endif | |
|
| | | | |
| | | /* Non instrumented code */ | |
| result= rw_pr_wrlock(&that->m_prlock); | | result= rw_pr_wrlock(&that->m_prlock); | |
|
| #ifdef HAVE_PSI_INTERFACE | | | |
| if (likely(locker != NULL)) | | | |
| PSI_server->end_rwlock_wrwait(locker, result); | | | |
| #endif | | | |
| return result; | | return result; | |
| } | | } | |
| #endif | | #endif | |
| | | | |
| static inline int inline_mysql_rwlock_tryrdlock( | | static inline int inline_mysql_rwlock_tryrdlock( | |
| mysql_rwlock_t *that | | mysql_rwlock_t *that | |
|
| #ifdef HAVE_PSI_INTERFACE | | #ifdef HAVE_PSI_RWLOCK_INTERFACE | |
| , const char *src_file, uint src_line | | , const char *src_file, uint src_line | |
| #endif | | #endif | |
| ) | | ) | |
| { | | { | |
| int result; | | int result; | |
|
| #ifdef HAVE_PSI_INTERFACE | | | |
| struct PSI_rwlock_locker *locker= NULL; | | #ifdef HAVE_PSI_RWLOCK_INTERFACE | |
| PSI_rwlock_locker_state state; | | if (that->m_psi != NULL) | |
| if (likely(PSI_server && that->m_psi)) | | | |
| { | | { | |
|
| locker= PSI_server->get_thread_rwlock_locker(&state, that->m_psi, | | /* Instrumentation start */ | |
| PSI_RWLOCK_TRYREADLOCK); | | PSI_rwlock_locker *locker; | |
| if (likely(locker != NULL)) | | PSI_rwlock_locker_state state; | |
| PSI_server->start_rwlock_rdwait(locker, src_file, src_line); | | locker= PSI_RWLOCK_CALL(start_rwlock_rdwait)(&state, that->m_psi, | |
| | | PSI_RWLOCK_TRYREADLOCK, src_file, | |
| | | src_line); | |
| | | | |
| | | /* Instrumented code */ | |
| | | result= rw_tryrdlock(&that->m_rwlock); | |
| | | | |
| | | /* Instrumentation end */ | |
| | | if (locker != NULL) | |
| | | PSI_RWLOCK_CALL(end_rwlock_rdwait)(locker, result); | |
| | | | |
| | | return result; | |
| } | | } | |
| #endif | | #endif | |
|
| | | | |
| | | /* Non instrumented code */ | |
| result= rw_tryrdlock(&that->m_rwlock); | | result= rw_tryrdlock(&that->m_rwlock); | |
|
| #ifdef HAVE_PSI_INTERFACE | | | |
| if (likely(locker != NULL)) | | | |
| PSI_server->end_rwlock_rdwait(locker, result); | | | |
| #endif | | | |
| return result; | | return result; | |
| } | | } | |
| | | | |
| static inline int inline_mysql_rwlock_trywrlock( | | static inline int inline_mysql_rwlock_trywrlock( | |
| mysql_rwlock_t *that | | mysql_rwlock_t *that | |
|
| #ifdef HAVE_PSI_INTERFACE | | #ifdef HAVE_PSI_RWLOCK_INTERFACE | |
| , const char *src_file, uint src_line | | , const char *src_file, uint src_line | |
| #endif | | #endif | |
| ) | | ) | |
| { | | { | |
| int result; | | int result; | |
|
| #ifdef HAVE_PSI_INTERFACE | | | |
| struct PSI_rwlock_locker *locker= NULL; | | #ifdef HAVE_PSI_RWLOCK_INTERFACE | |
| PSI_rwlock_locker_state state; | | if (that->m_psi != NULL) | |
| if (likely(PSI_server && that->m_psi)) | | | |
| { | | { | |
|
| locker= PSI_server->get_thread_rwlock_locker(&state, that->m_psi, | | /* Instrumentation start */ | |
| PSI_RWLOCK_TRYWRITELOCK); | | PSI_rwlock_locker *locker; | |
| if (likely(locker != NULL)) | | PSI_rwlock_locker_state state; | |
| PSI_server->start_rwlock_wrwait(locker, src_file, src_line); | | locker= PSI_RWLOCK_CALL(start_rwlock_wrwait)(&state, that->m_psi, | |
| | | PSI_RWLOCK_TRYWRITELOCK, src_file | |
| | | , src_line); | |
| | | | |
| | | /* Instrumented code */ | |
| | | result= rw_trywrlock(&that->m_rwlock); | |
| | | | |
| | | /* Instrumentation end */ | |
| | | if (locker != NULL) | |
| | | PSI_RWLOCK_CALL(end_rwlock_wrwait)(locker, result); | |
| | | | |
| | | return result; | |
| } | | } | |
| #endif | | #endif | |
|
| | | | |
| | | /* Non instrumented code */ | |
| result= rw_trywrlock(&that->m_rwlock); | | result= rw_trywrlock(&that->m_rwlock); | |
|
| #ifdef HAVE_PSI_INTERFACE | | | |
| if (likely(locker != NULL)) | | | |
| PSI_server->end_rwlock_wrwait(locker, result); | | | |
| #endif | | | |
| return result; | | return result; | |
| } | | } | |
| | | | |
| static inline int inline_mysql_rwlock_unlock( | | static inline int inline_mysql_rwlock_unlock( | |
| mysql_rwlock_t *that) | | mysql_rwlock_t *that) | |
| { | | { | |
| int result; | | int result; | |
|
| #ifdef HAVE_PSI_INTERFACE | | #ifdef HAVE_PSI_RWLOCK_INTERFACE | |
| if (likely(PSI_server && that->m_psi)) | | if (that->m_psi != NULL) | |
| PSI_server->unlock_rwlock(that->m_psi); | | PSI_RWLOCK_CALL(unlock_rwlock)(that->m_psi); | |
| #endif | | #endif | |
| result= rw_unlock(&that->m_rwlock); | | result= rw_unlock(&that->m_rwlock); | |
| return result; | | return result; | |
| } | | } | |
| | | | |
| #ifndef DISABLE_MYSQL_PRLOCK_H | | #ifndef DISABLE_MYSQL_PRLOCK_H | |
| static inline int inline_mysql_prlock_unlock( | | static inline int inline_mysql_prlock_unlock( | |
| mysql_prlock_t *that) | | mysql_prlock_t *that) | |
| { | | { | |
| int result; | | int result; | |
|
| #ifdef HAVE_PSI_INTERFACE | | #ifdef HAVE_PSI_RWLOCK_INTERFACE | |
| if (likely(PSI_server && that->m_psi)) | | if (that->m_psi != NULL) | |
| PSI_server->unlock_rwlock(that->m_psi); | | PSI_RWLOCK_CALL(unlock_rwlock)(that->m_psi); | |
| #endif | | #endif | |
| result= rw_pr_unlock(&that->m_prlock); | | result= rw_pr_unlock(&that->m_prlock); | |
| return result; | | return result; | |
| } | | } | |
| #endif | | #endif | |
| | | | |
|
| | | static inline void inline_mysql_cond_register( | |
| | | #ifdef HAVE_PSI_COND_INTERFACE | |
| | | const char *category, | |
| | | PSI_cond_info *info, | |
| | | int count | |
| | | #else | |
| | | const char *category __attribute__ ((unused)), | |
| | | void *info __attribute__ ((unused)), | |
| | | int count __attribute__ ((unused)) | |
| | | #endif | |
| | | ) | |
| | | { | |
| | | #ifdef HAVE_PSI_COND_INTERFACE | |
| | | PSI_COND_CALL(register_cond)(category, info, count); | |
| | | #endif | |
| | | } | |
| | | | |
| static inline int inline_mysql_cond_init( | | static inline int inline_mysql_cond_init( | |
|
| #ifdef HAVE_PSI_INTERFACE | | #ifdef HAVE_PSI_COND_INTERFACE | |
| PSI_cond_key key, | | PSI_cond_key key, | |
| #endif | | #endif | |
| mysql_cond_t *that, | | mysql_cond_t *that, | |
| const pthread_condattr_t *attr) | | const pthread_condattr_t *attr) | |
| { | | { | |
|
| #ifdef HAVE_PSI_INTERFACE | | #ifdef HAVE_PSI_COND_INTERFACE | |
| that->m_psi= (PSI_server ? PSI_server->init_cond(key, &that->m_cond) | | that->m_psi= PSI_COND_CALL(init_cond)(key, &that->m_cond); | |
| : NULL); | | | |
| #else | | #else | |
| that->m_psi= NULL; | | that->m_psi= NULL; | |
| #endif | | #endif | |
| return pthread_cond_init(&that->m_cond, attr); | | return pthread_cond_init(&that->m_cond, attr); | |
| } | | } | |
| | | | |
| static inline int inline_mysql_cond_destroy( | | static inline int inline_mysql_cond_destroy( | |
| mysql_cond_t *that) | | mysql_cond_t *that) | |
| { | | { | |
|
| #ifdef HAVE_PSI_INTERFACE | | #ifdef HAVE_PSI_COND_INTERFACE | |
| if (likely(PSI_server && that->m_psi)) | | if (that->m_psi != NULL) | |
| { | | { | |
|
| PSI_server->destroy_cond(that->m_psi); | | PSI_COND_CALL(destroy_cond)(that->m_psi); | |
| that->m_psi= NULL; | | that->m_psi= NULL; | |
| } | | } | |
| #endif | | #endif | |
| return pthread_cond_destroy(&that->m_cond); | | return pthread_cond_destroy(&that->m_cond); | |
| } | | } | |
| | | | |
| static inline int inline_mysql_cond_wait( | | static inline int inline_mysql_cond_wait( | |
| mysql_cond_t *that, | | mysql_cond_t *that, | |
| mysql_mutex_t *mutex | | mysql_mutex_t *mutex | |
|
| #ifdef HAVE_PSI_INTERFACE | | #ifdef HAVE_PSI_COND_INTERFACE | |
| , const char *src_file, uint src_line | | , const char *src_file, uint src_line | |
| #endif | | #endif | |
| ) | | ) | |
| { | | { | |
| int result; | | int result; | |
|
| #ifdef HAVE_PSI_INTERFACE | | | |
| struct PSI_cond_locker *locker= NULL; | | #ifdef HAVE_PSI_COND_INTERFACE | |
| PSI_cond_locker_state state; | | if (that->m_psi != NULL) | |
| if (likely(PSI_server && that->m_psi)) | | | |
| { | | { | |
|
| locker= PSI_server->get_thread_cond_locker(&state, that->m_psi, mutex-> | | /* Instrumentation start */ | |
| m_psi, | | PSI_cond_locker *locker; | |
| PSI_COND_WAIT); | | PSI_cond_locker_state state; | |
| if (likely(locker != NULL)) | | locker= PSI_COND_CALL(start_cond_wait)(&state, that->m_psi, mutex->m_ps | |
| PSI_server->start_cond_wait(locker, src_file, src_line); | | i, | |
| | | PSI_COND_WAIT, src_file, src_line); | |
| | | | |
| | | /* Instrumented code */ | |
| | | result= my_cond_wait(&that->m_cond, &mutex->m_mutex); | |
| | | | |
| | | /* Instrumentation end */ | |
| | | if (locker != NULL) | |
| | | PSI_COND_CALL(end_cond_wait)(locker, result); | |
| | | | |
| | | return result; | |
| } | | } | |
| #endif | | #endif | |
|
| result= pthread_cond_wait(&that->m_cond, &mutex->m_mutex); | | | |
| #ifdef HAVE_PSI_INTERFACE | | /* Non instrumented code */ | |
| if (likely(locker != NULL)) | | result= my_cond_wait(&that->m_cond, &mutex->m_mutex); | |
| PSI_server->end_cond_wait(locker, result); | | | |
| #endif | | | |
| return result; | | return result; | |
| } | | } | |
| | | | |
| static inline int inline_mysql_cond_timedwait( | | static inline int inline_mysql_cond_timedwait( | |
| mysql_cond_t *that, | | mysql_cond_t *that, | |
| mysql_mutex_t *mutex, | | mysql_mutex_t *mutex, | |
|
| const struct timespec *abstime | | struct timespec *abstime | |
| #ifdef HAVE_PSI_INTERFACE | | #ifdef HAVE_PSI_COND_INTERFACE | |
| , const char *src_file, uint src_line | | , const char *src_file, uint src_line | |
| #endif | | #endif | |
| ) | | ) | |
| { | | { | |
| int result; | | int result; | |
|
| #ifdef HAVE_PSI_INTERFACE | | | |
| struct PSI_cond_locker *locker= NULL; | | #ifdef HAVE_PSI_COND_INTERFACE | |
| PSI_cond_locker_state state; | | if (that->m_psi != NULL) | |
| if (likely(PSI_server && that->m_psi)) | | | |
| { | | { | |
|
| locker= PSI_server->get_thread_cond_locker(&state, that->m_psi, mutex-> | | /* Instrumentation start */ | |
| m_psi, | | PSI_cond_locker *locker; | |
| PSI_COND_TIMEDWAIT); | | PSI_cond_locker_state state; | |
| if (likely(locker != NULL)) | | locker= PSI_COND_CALL(start_cond_wait)(&state, that->m_psi, mutex->m_ps | |
| PSI_server->start_cond_wait(locker, src_file, src_line); | | i, | |
| | | PSI_COND_TIMEDWAIT, src_file, src_lin | |
| | | e); | |
| | | | |
| | | /* Instrumented code */ | |
| | | result= my_cond_timedwait(&that->m_cond, &mutex->m_mutex, abstime); | |
| | | | |
| | | /* Instrumentation end */ | |
| | | if (locker != NULL) | |
| | | PSI_COND_CALL(end_cond_wait)(locker, result); | |
| | | | |
| | | return result; | |
| } | | } | |
| #endif | | #endif | |
|
| result= pthread_cond_timedwait(&that->m_cond, &mutex->m_mutex, abstime); | | | |
| #ifdef HAVE_PSI_INTERFACE | | /* Non instrumented code */ | |
| if (likely(locker != NULL)) | | result= my_cond_timedwait(&that->m_cond, &mutex->m_mutex, abstime); | |
| PSI_server->end_cond_wait(locker, result); | | | |
| #endif | | | |
| return result; | | return result; | |
| } | | } | |
| | | | |
| static inline int inline_mysql_cond_signal( | | static inline int inline_mysql_cond_signal( | |
| mysql_cond_t *that) | | mysql_cond_t *that) | |
| { | | { | |
| int result; | | int result; | |
|
| #ifdef HAVE_PSI_INTERFACE | | #ifdef HAVE_PSI_COND_INTERFACE | |
| if (likely(PSI_server && that->m_psi)) | | if (that->m_psi != NULL) | |
| PSI_server->signal_cond(that->m_psi); | | PSI_COND_CALL(signal_cond)(that->m_psi); | |
| #endif | | #endif | |
| result= pthread_cond_signal(&that->m_cond); | | result= pthread_cond_signal(&that->m_cond); | |
| return result; | | return result; | |
| } | | } | |
| | | | |
| static inline int inline_mysql_cond_broadcast( | | static inline int inline_mysql_cond_broadcast( | |
| mysql_cond_t *that) | | mysql_cond_t *that) | |
| { | | { | |
| int result; | | int result; | |
|
| #ifdef HAVE_PSI_INTERFACE | | #ifdef HAVE_PSI_COND_INTERFACE | |
| if (likely(PSI_server && that->m_psi)) | | if (that->m_psi != NULL) | |
| PSI_server->broadcast_cond(that->m_psi); | | PSI_COND_CALL(broadcast_cond)(that->m_psi); | |
| #endif | | #endif | |
| result= pthread_cond_broadcast(&that->m_cond); | | result= pthread_cond_broadcast(&that->m_cond); | |
| return result; | | return result; | |
| } | | } | |
| | | | |
|
| #ifdef HAVE_PSI_INTERFACE | | static inline void inline_mysql_thread_register( | |
| | | #ifdef HAVE_PSI_THREAD_INTERFACE | |
| | | const char *category, | |
| | | PSI_thread_info *info, | |
| | | int count | |
| | | #else | |
| | | const char *category __attribute__ ((unused)), | |
| | | void *info __attribute__ ((unused)), | |
| | | int count __attribute__ ((unused)) | |
| | | #endif | |
| | | ) | |
| | | { | |
| | | #ifdef HAVE_PSI_THREAD_INTERFACE | |
| | | PSI_THREAD_CALL(register_thread)(category, info, count); | |
| | | #endif | |
| | | } | |
| | | | |
| | | #ifdef HAVE_PSI_THREAD_INTERFACE | |
| static inline int inline_mysql_thread_create( | | static inline int inline_mysql_thread_create( | |
| PSI_thread_key key, | | PSI_thread_key key, | |
| pthread_t *thread, const pthread_attr_t *attr, | | pthread_t *thread, const pthread_attr_t *attr, | |
| void *(*start_routine)(void*), void *arg) | | void *(*start_routine)(void*), void *arg) | |
| { | | { | |
| int result; | | int result; | |
|
| if (likely(PSI_server != NULL)) | | result= PSI_THREAD_CALL(spawn_thread)(key, thread, attr, start_routine, a | |
| result= PSI_server->spawn_thread(key, thread, attr, start_routine, arg) | | rg); | |
| ; | | | |
| else | | | |
| result= pthread_create(thread, attr, start_routine, arg); | | | |
| return result; | | return result; | |
| } | | } | |
| | | | |
| static inline void inline_mysql_thread_set_psi_id(ulong id) | | static inline void inline_mysql_thread_set_psi_id(ulong id) | |
| { | | { | |
|
| if (likely(PSI_server != NULL)) | | struct PSI_thread *psi= PSI_THREAD_CALL(get_thread)(); | |
| { | | PSI_THREAD_CALL(set_thread_id)(psi, id); | |
| struct PSI_thread *psi= PSI_server->get_thread(); | | | |
| if (likely(psi != NULL)) | | | |
| PSI_server->set_thread_id(psi, id); | | | |
| } | | | |
| } | | } | |
| #endif | | #endif | |
| | | | |
| #endif /* DISABLE_MYSQL_THREAD_H */ | | #endif /* DISABLE_MYSQL_THREAD_H */ | |
| | | | |
| /** @} (end of group Thread_instrumentation) */ | | /** @} (end of group Thread_instrumentation) */ | |
| | | | |
| #endif | | #endif | |
| | | | |
End of changes. 105 change blocks. |
| 207 lines changed or deleted | | 411 lines changed or added | |
|
| mysqld_ername.h | | mysqld_ername.h | |
| /* Autogenerated file, please don't edit */ | | /* Autogenerated file, please don't edit */ | |
| | | | |
| { "ER_HASHCHK", 1000, "hashchk" }, | | { "ER_HASHCHK", 1000, "hashchk" }, | |
| { "ER_NISAMCHK", 1001, "isamchk" }, | | { "ER_NISAMCHK", 1001, "isamchk" }, | |
| { "ER_NO", 1002, "NO" }, | | { "ER_NO", 1002, "NO" }, | |
| { "ER_YES", 1003, "YES" }, | | { "ER_YES", 1003, "YES" }, | |
|
| { "ER_CANT_CREATE_FILE", 1004, "Can\'t create file \'%-.200s\' (errno: %d)"
}, | | { "ER_CANT_CREATE_FILE", 1004, "Can\'t create file \'%-.200s\' (errno: %d -
%s)" }, | |
| { "ER_CANT_CREATE_TABLE", 1005, "Can\'t create table \'%-.200s\' (errno: %d
)" }, | | { "ER_CANT_CREATE_TABLE", 1005, "Can\'t create table \'%-.200s\' (errno: %d
)" }, | |
| { "ER_CANT_CREATE_DB", 1006, "Can\'t create database \'%-.192s\' (errno: %d
)" }, | | { "ER_CANT_CREATE_DB", 1006, "Can\'t create database \'%-.192s\' (errno: %d
)" }, | |
| { "ER_DB_CREATE_EXISTS", 1007, "Can\'t create database \'%-.192s\'; databas
e exists" }, | | { "ER_DB_CREATE_EXISTS", 1007, "Can\'t create database \'%-.192s\'; databas
e exists" }, | |
| { "ER_DB_DROP_EXISTS", 1008, "Can\'t drop database \'%-.192s\'; database do
esn\'t exist" }, | | { "ER_DB_DROP_EXISTS", 1008, "Can\'t drop database \'%-.192s\'; database do
esn\'t exist" }, | |
| { "ER_DB_DROP_DELETE", 1009, "Error dropping database (can\'t delete \'%-.1
92s\', errno: %d)" }, | | { "ER_DB_DROP_DELETE", 1009, "Error dropping database (can\'t delete \'%-.1
92s\', errno: %d)" }, | |
| { "ER_DB_DROP_RMDIR", 1010, "Error dropping database (can\'t rmdir \'%-.192
s\', errno: %d)" }, | | { "ER_DB_DROP_RMDIR", 1010, "Error dropping database (can\'t rmdir \'%-.192
s\', errno: %d)" }, | |
|
| { "ER_CANT_DELETE_FILE", 1011, "Error on delete of \'%-.192s\' (errno: %d)"
}, | | { "ER_CANT_DELETE_FILE", 1011, "Error on delete of \'%-.192s\' (errno: %d -
%s)" }, | |
| { "ER_CANT_FIND_SYSTEM_REC", 1012, "Can\'t read record in system table" }, | | { "ER_CANT_FIND_SYSTEM_REC", 1012, "Can\'t read record in system table" }, | |
|
| { "ER_CANT_GET_STAT", 1013, "Can\'t get status of \'%-.200s\' (errno: %d)" | | { "ER_CANT_GET_STAT", 1013, "Can\'t get status of \'%-.200s\' (errno: %d - | |
| }, | | %s)" }, | |
| { "ER_CANT_GET_WD", 1014, "Can\'t get working directory (errno: %d)" }, | | { "ER_CANT_GET_WD", 1014, "Can\'t get working directory (errno: %d - %s)" } | |
| { "ER_CANT_LOCK", 1015, "Can\'t lock file (errno: %d)" }, | | , | |
| { "ER_CANT_OPEN_FILE", 1016, "Can\'t open file: \'%-.200s\' (errno: %d)" }, | | { "ER_CANT_LOCK", 1015, "Can\'t lock file (errno: %d - %s)" }, | |
| { "ER_FILE_NOT_FOUND", 1017, "Can\'t find file: \'%-.200s\' (errno: %d)" }, | | { "ER_CANT_OPEN_FILE", 1016, "Can\'t open file: \'%-.200s\' (errno: %d - %s | |
| { "ER_CANT_READ_DIR", 1018, "Can\'t read dir of \'%-.192s\' (errno: %d)" }, | | )" }, | |
| { "ER_CANT_SET_WD", 1019, "Can\'t change dir to \'%-.192s\' (errno: %d)" }, | | { "ER_FILE_NOT_FOUND", 1017, "Can\'t find file: \'%-.200s\' (errno: %d - %s | |
| | | )" }, | |
| | | { "ER_CANT_READ_DIR", 1018, "Can\'t read dir of \'%-.192s\' (errno: %d - %s | |
| | | )" }, | |
| | | { "ER_CANT_SET_WD", 1019, "Can\'t change dir to \'%-.192s\' (errno: %d - %s | |
| | | )" }, | |
| { "ER_CHECKREAD", 1020, "Record has changed since last read in table \'%-.1
92s\'" }, | | { "ER_CHECKREAD", 1020, "Record has changed since last read in table \'%-.1
92s\'" }, | |
|
| { "ER_DISK_FULL", 1021, "Disk full (%s); waiting for someone to free some s
pace..." }, | | { "ER_DISK_FULL", 1021, "Disk full (%s); waiting for someone to free some s
pace... (errno: %d - %s)" }, | |
| { "ER_DUP_KEY", 1022, "Can\'t write; duplicate key in table \'%-.192s\'" }, | | { "ER_DUP_KEY", 1022, "Can\'t write; duplicate key in table \'%-.192s\'" }, | |
|
| { "ER_ERROR_ON_CLOSE", 1023, "Error on close of \'%-.192s\' (errno: %d)" }, | | { "ER_ERROR_ON_CLOSE", 1023, "Error on close of \'%-.192s\' (errno: %d - %s | |
| { "ER_ERROR_ON_READ", 1024, "Error reading file \'%-.200s\' (errno: %d)" }, | | )" }, | |
| { "ER_ERROR_ON_RENAME", 1025, "Error on rename of \'%-.210s\' to \'%-.210s\ | | { "ER_ERROR_ON_READ", 1024, "Error reading file \'%-.200s\' (errno: %d - %s | |
| ' (errno: %d)" }, | | )" }, | |
| { "ER_ERROR_ON_WRITE", 1026, "Error writing file \'%-.200s\' (errno: %d)" } | | { "ER_ERROR_ON_RENAME", 1025, "Error on rename of \'%-.210s\' to \'%-.210s\ | |
| , | | ' (errno: %d - %s)" }, | |
| | | { "ER_ERROR_ON_WRITE", 1026, "Error writing file \'%-.200s\' (errno: %d - % | |
| | | s)" }, | |
| { "ER_FILE_USED", 1027, "\'%-.192s\' is locked against change" }, | | { "ER_FILE_USED", 1027, "\'%-.192s\' is locked against change" }, | |
| { "ER_FILSORT_ABORT", 1028, "Sort aborted" }, | | { "ER_FILSORT_ABORT", 1028, "Sort aborted" }, | |
| { "ER_FORM_NOT_FOUND", 1029, "View \'%-.192s\' doesn\'t exist for \'%-.192s
\'" }, | | { "ER_FORM_NOT_FOUND", 1029, "View \'%-.192s\' doesn\'t exist for \'%-.192s
\'" }, | |
| { "ER_GET_ERRNO", 1030, "Got error %d from storage engine" }, | | { "ER_GET_ERRNO", 1030, "Got error %d from storage engine" }, | |
| { "ER_ILLEGAL_HA", 1031, "Table storage engine for \'%-.192s\' doesn\'t hav
e this option" }, | | { "ER_ILLEGAL_HA", 1031, "Table storage engine for \'%-.192s\' doesn\'t hav
e this option" }, | |
| { "ER_KEY_NOT_FOUND", 1032, "Can\'t find record in \'%-.192s\'" }, | | { "ER_KEY_NOT_FOUND", 1032, "Can\'t find record in \'%-.192s\'" }, | |
| { "ER_NOT_FORM_FILE", 1033, "Incorrect information in file: \'%-.200s\'" }, | | { "ER_NOT_FORM_FILE", 1033, "Incorrect information in file: \'%-.200s\'" }, | |
| { "ER_NOT_KEYFILE", 1034, "Incorrect key file for table \'%-.200s\'; try to
repair it" }, | | { "ER_NOT_KEYFILE", 1034, "Incorrect key file for table \'%-.200s\'; try to
repair it" }, | |
| { "ER_OLD_KEYFILE", 1035, "Old key file for table \'%-.192s\'; repair it!"
}, | | { "ER_OLD_KEYFILE", 1035, "Old key file for table \'%-.192s\'; repair it!"
}, | |
| { "ER_OPEN_AS_READONLY", 1036, "Table \'%-.192s\' is read only" }, | | { "ER_OPEN_AS_READONLY", 1036, "Table \'%-.192s\' is read only" }, | |
| { "ER_OUTOFMEMORY", 1037, "Out of memory; restart server and try again (nee
ded %d bytes)" }, | | { "ER_OUTOFMEMORY", 1037, "Out of memory; restart server and try again (nee
ded %d bytes)" }, | |
| { "ER_OUT_OF_SORTMEMORY", 1038, "Out of sort memory, consider increasing se
rver sort buffer size" }, | | { "ER_OUT_OF_SORTMEMORY", 1038, "Out of sort memory, consider increasing se
rver sort buffer size" }, | |
|
| { "ER_UNEXPECTED_EOF", 1039, "Unexpected EOF found when reading file \'%-.1
92s\' (errno: %d)" }, | | { "ER_UNEXPECTED_EOF", 1039, "Unexpected EOF found when reading file \'%-.1
92s\' (errno: %d - %s)" }, | |
| { "ER_CON_COUNT_ERROR", 1040, "Too many connections" }, | | { "ER_CON_COUNT_ERROR", 1040, "Too many connections" }, | |
| { "ER_OUT_OF_RESOURCES", 1041, "Out of memory; check if mysqld or some othe
r process uses all available memory; if not, you may have to use \'ulimit\'
to allow mysqld to use more memory or you can add more swap space" }, | | { "ER_OUT_OF_RESOURCES", 1041, "Out of memory; check if mysqld or some othe
r process uses all available memory; if not, you may have to use \'ulimit\'
to allow mysqld to use more memory or you can add more swap space" }, | |
| { "ER_BAD_HOST_ERROR", 1042, "Can\'t get hostname for your address" }, | | { "ER_BAD_HOST_ERROR", 1042, "Can\'t get hostname for your address" }, | |
| { "ER_HANDSHAKE_ERROR", 1043, "Bad handshake" }, | | { "ER_HANDSHAKE_ERROR", 1043, "Bad handshake" }, | |
| { "ER_DBACCESS_DENIED_ERROR", 1044, "Access denied for user \'%-.48s\'@\'%-
.64s\' to database \'%-.192s\'" }, | | { "ER_DBACCESS_DENIED_ERROR", 1044, "Access denied for user \'%-.48s\'@\'%-
.64s\' to database \'%-.192s\'" }, | |
| { "ER_ACCESS_DENIED_ERROR", 1045, "Access denied for user \'%-.48s\'@\'%-.6
4s\' (using password: %s)" }, | | { "ER_ACCESS_DENIED_ERROR", 1045, "Access denied for user \'%-.48s\'@\'%-.6
4s\' (using password: %s)" }, | |
| { "ER_NO_DB_ERROR", 1046, "No database selected" }, | | { "ER_NO_DB_ERROR", 1046, "No database selected" }, | |
| { "ER_UNKNOWN_COM_ERROR", 1047, "Unknown command" }, | | { "ER_UNKNOWN_COM_ERROR", 1047, "Unknown command" }, | |
| { "ER_BAD_NULL_ERROR", 1048, "Column \'%-.192s\' cannot be null" }, | | { "ER_BAD_NULL_ERROR", 1048, "Column \'%-.192s\' cannot be null" }, | |
| { "ER_BAD_DB_ERROR", 1049, "Unknown database \'%-.192s\'" }, | | { "ER_BAD_DB_ERROR", 1049, "Unknown database \'%-.192s\'" }, | |
| | | | |
| skipping to change at line 121 | | skipping to change at line 121 | |
| { "ER_WRONG_PARAMETERS_TO_PROCEDURE", 1108, "Incorrect parameters to proced
ure \'%-.192s\'" }, | | { "ER_WRONG_PARAMETERS_TO_PROCEDURE", 1108, "Incorrect parameters to proced
ure \'%-.192s\'" }, | |
| { "ER_UNKNOWN_TABLE", 1109, "Unknown table \'%-.192s\' in %-.32s" }, | | { "ER_UNKNOWN_TABLE", 1109, "Unknown table \'%-.192s\' in %-.32s" }, | |
| { "ER_FIELD_SPECIFIED_TWICE", 1110, "Column \'%-.192s\' specified twice" }, | | { "ER_FIELD_SPECIFIED_TWICE", 1110, "Column \'%-.192s\' specified twice" }, | |
| { "ER_INVALID_GROUP_FUNC_USE", 1111, "Invalid use of group function" }, | | { "ER_INVALID_GROUP_FUNC_USE", 1111, "Invalid use of group function" }, | |
| { "ER_UNSUPPORTED_EXTENSION", 1112, "Table \'%-.192s\' uses an extension th
at doesn\'t exist in this MySQL version" }, | | { "ER_UNSUPPORTED_EXTENSION", 1112, "Table \'%-.192s\' uses an extension th
at doesn\'t exist in this MySQL version" }, | |
| { "ER_TABLE_MUST_HAVE_COLUMNS", 1113, "A table must have at least 1 column"
}, | | { "ER_TABLE_MUST_HAVE_COLUMNS", 1113, "A table must have at least 1 column"
}, | |
| { "ER_RECORD_FILE_FULL", 1114, "The table \'%-.192s\' is full" }, | | { "ER_RECORD_FILE_FULL", 1114, "The table \'%-.192s\' is full" }, | |
| { "ER_UNKNOWN_CHARACTER_SET", 1115, "Unknown character set: \'%-.64s\'" }, | | { "ER_UNKNOWN_CHARACTER_SET", 1115, "Unknown character set: \'%-.64s\'" }, | |
| { "ER_TOO_MANY_TABLES", 1116, "Too many tables; MySQL can only use %d table
s in a join" }, | | { "ER_TOO_MANY_TABLES", 1116, "Too many tables; MySQL can only use %d table
s in a join" }, | |
| { "ER_TOO_MANY_FIELDS", 1117, "Too many columns" }, | | { "ER_TOO_MANY_FIELDS", 1117, "Too many columns" }, | |
|
| { "ER_TOO_BIG_ROWSIZE", 1118, "Row size too large. The maximum row size for
the used table type, not counting BLOBs, is %ld. You have to change some c
olumns to TEXT or BLOBs" }, | | { "ER_TOO_BIG_ROWSIZE", 1118, "Row size too large. The maximum row size for
the used table type, not counting BLOBs, is %ld. This includes storage ove
rhead, check the manual. You have to change some columns to TEXT or BLOBs"
}, | |
| { "ER_STACK_OVERRUN", 1119, "Thread stack overrun: Used: %ld of a %ld stac
k. Use \'mysqld --thread_stack=#\' to specify a bigger stack if needed" }, | | { "ER_STACK_OVERRUN", 1119, "Thread stack overrun: Used: %ld of a %ld stac
k. Use \'mysqld --thread_stack=#\' to specify a bigger stack if needed" }, | |
| { "ER_WRONG_OUTER_JOIN", 1120, "Cross dependency found in OUTER JOIN; exami
ne your ON conditions" }, | | { "ER_WRONG_OUTER_JOIN", 1120, "Cross dependency found in OUTER JOIN; exami
ne your ON conditions" }, | |
| { "ER_NULL_COLUMN_IN_INDEX", 1121, "Table handler doesn\'t support NULL in
given index. Please change column \'%-.192s\' to be NOT NULL or use another
handler" }, | | { "ER_NULL_COLUMN_IN_INDEX", 1121, "Table handler doesn\'t support NULL in
given index. Please change column \'%-.192s\' to be NOT NULL or use another
handler" }, | |
| { "ER_CANT_FIND_UDF", 1122, "Can\'t load function \'%-.192s\'" }, | | { "ER_CANT_FIND_UDF", 1122, "Can\'t load function \'%-.192s\'" }, | |
| { "ER_CANT_INITIALIZE_UDF", 1123, "Can\'t initialize function \'%-.192s\';
%-.80s" }, | | { "ER_CANT_INITIALIZE_UDF", 1123, "Can\'t initialize function \'%-.192s\';
%-.80s" }, | |
| { "ER_UDF_NO_PATHS", 1124, "No paths allowed for shared library" }, | | { "ER_UDF_NO_PATHS", 1124, "No paths allowed for shared library" }, | |
| { "ER_UDF_EXISTS", 1125, "Function \'%-.192s\' already exists" }, | | { "ER_UDF_EXISTS", 1125, "Function \'%-.192s\' already exists" }, | |
| { "ER_CANT_OPEN_LIBRARY", 1126, "Can\'t open shared library \'%-.192s\' (er
rno: %d %-.128s)" }, | | { "ER_CANT_OPEN_LIBRARY", 1126, "Can\'t open shared library \'%-.192s\' (er
rno: %d %-.128s)" }, | |
| { "ER_CANT_FIND_DL_ENTRY", 1127, "Can\'t find symbol \'%-.128s\' in library
" }, | | { "ER_CANT_FIND_DL_ENTRY", 1127, "Can\'t find symbol \'%-.128s\' in library
" }, | |
| { "ER_FUNCTION_NOT_DEFINED", 1128, "Function \'%-.192s\' is not defined" }, | | { "ER_FUNCTION_NOT_DEFINED", 1128, "Function \'%-.192s\' is not defined" }, | |
| | | | |
| skipping to change at line 145 | | skipping to change at line 145 | |
| { "ER_PASSWORD_NOT_ALLOWED", 1132, "You must have privileges to update tabl
es in the mysql database to be able to change passwords for others" }, | | { "ER_PASSWORD_NOT_ALLOWED", 1132, "You must have privileges to update tabl
es in the mysql database to be able to change passwords for others" }, | |
| { "ER_PASSWORD_NO_MATCH", 1133, "Can\'t find any matching row in the user t
able" }, | | { "ER_PASSWORD_NO_MATCH", 1133, "Can\'t find any matching row in the user t
able" }, | |
| { "ER_UPDATE_INFO", 1134, "Rows matched: %ld Changed: %ld Warnings: %ld"
}, | | { "ER_UPDATE_INFO", 1134, "Rows matched: %ld Changed: %ld Warnings: %ld"
}, | |
| { "ER_CANT_CREATE_THREAD", 1135, "Can\'t create a new thread (errno %d); if
you are not out of available memory, you can consult the manual for a poss
ible OS-dependent bug" }, | | { "ER_CANT_CREATE_THREAD", 1135, "Can\'t create a new thread (errno %d); if
you are not out of available memory, you can consult the manual for a poss
ible OS-dependent bug" }, | |
| { "ER_WRONG_VALUE_COUNT_ON_ROW", 1136, "Column count doesn\'t match value c
ount at row %ld" }, | | { "ER_WRONG_VALUE_COUNT_ON_ROW", 1136, "Column count doesn\'t match value c
ount at row %ld" }, | |
| { "ER_CANT_REOPEN_TABLE", 1137, "Can\'t reopen table: \'%-.192s\'" }, | | { "ER_CANT_REOPEN_TABLE", 1137, "Can\'t reopen table: \'%-.192s\'" }, | |
| { "ER_INVALID_USE_OF_NULL", 1138, "Invalid use of NULL value" }, | | { "ER_INVALID_USE_OF_NULL", 1138, "Invalid use of NULL value" }, | |
| { "ER_REGEXP_ERROR", 1139, "Got error \'%-.64s\' from regexp" }, | | { "ER_REGEXP_ERROR", 1139, "Got error \'%-.64s\' from regexp" }, | |
| { "ER_MIX_OF_GROUP_FUNC_AND_FIELDS", 1140, "Mixing of GROUP columns (MIN(),
MAX(),COUNT(),...) with no GROUP columns is illegal if there is no GROUP BY
clause" }, | | { "ER_MIX_OF_GROUP_FUNC_AND_FIELDS", 1140, "Mixing of GROUP columns (MIN(),
MAX(),COUNT(),...) with no GROUP columns is illegal if there is no GROUP BY
clause" }, | |
| { "ER_NONEXISTING_GRANT", 1141, "There is no such grant defined for user \'
%-.48s\' on host \'%-.64s\'" }, | | { "ER_NONEXISTING_GRANT", 1141, "There is no such grant defined for user \'
%-.48s\' on host \'%-.64s\'" }, | |
|
| { "ER_TABLEACCESS_DENIED_ERROR", 1142, "%-.16s command denied to user \'%-.
48s\'@\'%-.64s\' for table \'%-.192s\'" }, | | { "ER_TABLEACCESS_DENIED_ERROR", 1142, "%-.128s command denied to user \'%-
.48s\'@\'%-.64s\' for table \'%-.64s\'" }, | |
| { "ER_COLUMNACCESS_DENIED_ERROR", 1143, "%-.16s command denied to user \'%-
.48s\'@\'%-.64s\' for column \'%-.192s\' in table \'%-.192s\'" }, | | { "ER_COLUMNACCESS_DENIED_ERROR", 1143, "%-.16s command denied to user \'%-
.48s\'@\'%-.64s\' for column \'%-.192s\' in table \'%-.192s\'" }, | |
| { "ER_ILLEGAL_GRANT_FOR_TABLE", 1144, "Illegal GRANT/REVOKE command; please
consult the manual to see which privileges can be used" }, | | { "ER_ILLEGAL_GRANT_FOR_TABLE", 1144, "Illegal GRANT/REVOKE command; please
consult the manual to see which privileges can be used" }, | |
| { "ER_GRANT_WRONG_HOST_OR_USER", 1145, "The host or user argument to GRANT
is too long" }, | | { "ER_GRANT_WRONG_HOST_OR_USER", 1145, "The host or user argument to GRANT
is too long" }, | |
| { "ER_NO_SUCH_TABLE", 1146, "Table \'%-.192s.%-.192s\' doesn\'t exist" }, | | { "ER_NO_SUCH_TABLE", 1146, "Table \'%-.192s.%-.192s\' doesn\'t exist" }, | |
| { "ER_NONEXISTING_TABLE_GRANT", 1147, "There is no such grant defined for u
ser \'%-.48s\' on host \'%-.64s\' on table \'%-.192s\'" }, | | { "ER_NONEXISTING_TABLE_GRANT", 1147, "There is no such grant defined for u
ser \'%-.48s\' on host \'%-.64s\' on table \'%-.192s\'" }, | |
| { "ER_NOT_ALLOWED_COMMAND", 1148, "The used command is not allowed with thi
s MySQL version" }, | | { "ER_NOT_ALLOWED_COMMAND", 1148, "The used command is not allowed with thi
s MySQL version" }, | |
| { "ER_SYNTAX_ERROR", 1149, "You have an error in your SQL syntax; check the
manual that corresponds to your MySQL server version for the right syntax
to use" }, | | { "ER_SYNTAX_ERROR", 1149, "You have an error in your SQL syntax; check the
manual that corresponds to your MySQL server version for the right syntax
to use" }, | |
| { "ER_DELAYED_CANT_CHANGE_LOCK", 1150, "Delayed insert thread couldn\'t get
requested lock for table %-.192s" }, | | { "ER_DELAYED_CANT_CHANGE_LOCK", 1150, "Delayed insert thread couldn\'t get
requested lock for table %-.192s" }, | |
| { "ER_TOO_MANY_DELAYED_THREADS", 1151, "Too many delayed threads in use" }, | | { "ER_TOO_MANY_DELAYED_THREADS", 1151, "Too many delayed threads in use" }, | |
| { "ER_ABORTING_CONNECTION", 1152, "Aborted connection %ld to db: \'%-.192s\
' user: \'%-.48s\' (%-.64s)" }, | | { "ER_ABORTING_CONNECTION", 1152, "Aborted connection %ld to db: \'%-.192s\
' user: \'%-.48s\' (%-.64s)" }, | |
| | | | |
| skipping to change at line 318 | | skipping to change at line 318 | |
| { "ER_SP_DOES_NOT_EXIST", 1305, "%s %s does not exist" }, | | { "ER_SP_DOES_NOT_EXIST", 1305, "%s %s does not exist" }, | |
| { "ER_SP_DROP_FAILED", 1306, "Failed to DROP %s %s" }, | | { "ER_SP_DROP_FAILED", 1306, "Failed to DROP %s %s" }, | |
| { "ER_SP_STORE_FAILED", 1307, "Failed to CREATE %s %s" }, | | { "ER_SP_STORE_FAILED", 1307, "Failed to CREATE %s %s" }, | |
| { "ER_SP_LILABEL_MISMATCH", 1308, "%s with no matching label: %s" }, | | { "ER_SP_LILABEL_MISMATCH", 1308, "%s with no matching label: %s" }, | |
| { "ER_SP_LABEL_REDEFINE", 1309, "Redefining label %s" }, | | { "ER_SP_LABEL_REDEFINE", 1309, "Redefining label %s" }, | |
| { "ER_SP_LABEL_MISMATCH", 1310, "End-label %s without match" }, | | { "ER_SP_LABEL_MISMATCH", 1310, "End-label %s without match" }, | |
| { "ER_SP_UNINIT_VAR", 1311, "Referring to uninitialized variable %s" }, | | { "ER_SP_UNINIT_VAR", 1311, "Referring to uninitialized variable %s" }, | |
| { "ER_SP_BADSELECT", 1312, "PROCEDURE %s can\'t return a result set in the
given context" }, | | { "ER_SP_BADSELECT", 1312, "PROCEDURE %s can\'t return a result set in the
given context" }, | |
| { "ER_SP_BADRETURN", 1313, "RETURN is only allowed in a FUNCTION" }, | | { "ER_SP_BADRETURN", 1313, "RETURN is only allowed in a FUNCTION" }, | |
| { "ER_SP_BADSTATEMENT", 1314, "%s is not allowed in stored procedures" }, | | { "ER_SP_BADSTATEMENT", 1314, "%s is not allowed in stored procedures" }, | |
|
| { "ER_UPDATE_LOG_DEPRECATED_IGNORED", 1315, "The update log is deprecated a | | { "ER_UPDATE_LOG_DEPRECATED_IGNORED", 1315, "The update log is deprecated a | |
| nd replaced by the binary log; SET SQL_LOG_UPDATE has been ignored. This op | | nd replaced by the binary log; SET SQL_LOG_UPDATE has been ignored." }, | |
| tion will be removed in MySQL 5.6." }, | | { "ER_UPDATE_LOG_DEPRECATED_TRANSLATED", 1316, "The update log is deprecate | |
| { "ER_UPDATE_LOG_DEPRECATED_TRANSLATED", 1316, "The update log is deprecate | | d and replaced by the binary log; SET SQL_LOG_UPDATE has been translated to | |
| d and replaced by the binary log; SET SQL_LOG_UPDATE has been translated to | | SET SQL_LOG_BIN." }, | |
| SET SQL_LOG_BIN. This option will be removed in MySQL 5.6." }, | | | |
| { "ER_QUERY_INTERRUPTED", 1317, "Query execution was interrupted" }, | | { "ER_QUERY_INTERRUPTED", 1317, "Query execution was interrupted" }, | |
| { "ER_SP_WRONG_NO_OF_ARGS", 1318, "Incorrect number of arguments for %s %s;
expected %u, got %u" }, | | { "ER_SP_WRONG_NO_OF_ARGS", 1318, "Incorrect number of arguments for %s %s;
expected %u, got %u" }, | |
| { "ER_SP_COND_MISMATCH", 1319, "Undefined CONDITION: %s" }, | | { "ER_SP_COND_MISMATCH", 1319, "Undefined CONDITION: %s" }, | |
| { "ER_SP_NORETURN", 1320, "No RETURN found in FUNCTION %s" }, | | { "ER_SP_NORETURN", 1320, "No RETURN found in FUNCTION %s" }, | |
| { "ER_SP_NORETURNEND", 1321, "FUNCTION %s ended without RETURN" }, | | { "ER_SP_NORETURNEND", 1321, "FUNCTION %s ended without RETURN" }, | |
| { "ER_SP_BAD_CURSOR_QUERY", 1322, "Cursor statement must be a SELECT" }, | | { "ER_SP_BAD_CURSOR_QUERY", 1322, "Cursor statement must be a SELECT" }, | |
| { "ER_SP_BAD_CURSOR_SELECT", 1323, "Cursor SELECT must not have INTO" }, | | { "ER_SP_BAD_CURSOR_SELECT", 1323, "Cursor SELECT must not have INTO" }, | |
| { "ER_SP_CURSOR_MISMATCH", 1324, "Undefined CURSOR: %s" }, | | { "ER_SP_CURSOR_MISMATCH", 1324, "Undefined CURSOR: %s" }, | |
| { "ER_SP_CURSOR_ALREADY_OPEN", 1325, "Cursor is already open" }, | | { "ER_SP_CURSOR_ALREADY_OPEN", 1325, "Cursor is already open" }, | |
| { "ER_SP_CURSOR_NOT_OPEN", 1326, "Cursor is not open" }, | | { "ER_SP_CURSOR_NOT_OPEN", 1326, "Cursor is not open" }, | |
| | | | |
| skipping to change at line 550 | | skipping to change at line 550 | |
| { "ER_EVENT_ALREADY_EXISTS", 1537, "Event \'%-.192s\' already exists" }, | | { "ER_EVENT_ALREADY_EXISTS", 1537, "Event \'%-.192s\' already exists" }, | |
| { "ER_EVENT_STORE_FAILED", 1538, "Failed to store event %s. Error code %d f
rom storage engine." }, | | { "ER_EVENT_STORE_FAILED", 1538, "Failed to store event %s. Error code %d f
rom storage engine." }, | |
| { "ER_EVENT_DOES_NOT_EXIST", 1539, "Unknown event \'%-.192s\'" }, | | { "ER_EVENT_DOES_NOT_EXIST", 1539, "Unknown event \'%-.192s\'" }, | |
| { "ER_EVENT_CANT_ALTER", 1540, "Failed to alter event \'%-.192s\'" }, | | { "ER_EVENT_CANT_ALTER", 1540, "Failed to alter event \'%-.192s\'" }, | |
| { "ER_EVENT_DROP_FAILED", 1541, "Failed to drop %s" }, | | { "ER_EVENT_DROP_FAILED", 1541, "Failed to drop %s" }, | |
| { "ER_EVENT_INTERVAL_NOT_POSITIVE_OR_TOO_BIG", 1542, "INTERVAL is either no
t positive or too big" }, | | { "ER_EVENT_INTERVAL_NOT_POSITIVE_OR_TOO_BIG", 1542, "INTERVAL is either no
t positive or too big" }, | |
| { "ER_EVENT_ENDS_BEFORE_STARTS", 1543, "ENDS is either invalid or before ST
ARTS" }, | | { "ER_EVENT_ENDS_BEFORE_STARTS", 1543, "ENDS is either invalid or before ST
ARTS" }, | |
| { "ER_EVENT_EXEC_TIME_IN_THE_PAST", 1544, "Event execution time is in the p
ast. Event has been disabled" }, | | { "ER_EVENT_EXEC_TIME_IN_THE_PAST", 1544, "Event execution time is in the p
ast. Event has been disabled" }, | |
| { "ER_EVENT_OPEN_TABLE_FAILED", 1545, "Failed to open mysql.event" }, | | { "ER_EVENT_OPEN_TABLE_FAILED", 1545, "Failed to open mysql.event" }, | |
| { "ER_EVENT_NEITHER_M_EXPR_NOR_M_AT", 1546, "No datetime expression provide
d" }, | | { "ER_EVENT_NEITHER_M_EXPR_NOR_M_AT", 1546, "No datetime expression provide
d" }, | |
|
| { "ER_COL_COUNT_DOESNT_MATCH_CORRUPTED", 1547, "Column count of mysql.%s is | | { "ER_OBSOLETE_COL_COUNT_DOESNT_MATCH_CORRUPTED", 1547, "Column count of my | |
| wrong. Expected %d, found %d. The table is probably corrupted" }, | | sql.%s is wrong. Expected %d, found %d. The table is probably corrupted" }, | |
| { "ER_CANNOT_LOAD_FROM_TABLE", 1548, "Cannot load from mysql.%s. The table | | { "ER_OBSOLETE_CANNOT_LOAD_FROM_TABLE", 1548, "Cannot load from mysql.%s. T | |
| is probably corrupted" }, | | he table is probably corrupted" }, | |
| { "ER_EVENT_CANNOT_DELETE", 1549, "Failed to delete the event from mysql.ev
ent" }, | | { "ER_EVENT_CANNOT_DELETE", 1549, "Failed to delete the event from mysql.ev
ent" }, | |
| { "ER_EVENT_COMPILE_ERROR", 1550, "Error during compilation of event\'s bod
y" }, | | { "ER_EVENT_COMPILE_ERROR", 1550, "Error during compilation of event\'s bod
y" }, | |
| { "ER_EVENT_SAME_NAME", 1551, "Same old and new event name" }, | | { "ER_EVENT_SAME_NAME", 1551, "Same old and new event name" }, | |
| { "ER_EVENT_DATA_TOO_LONG", 1552, "Data for column \'%s\' too long" }, | | { "ER_EVENT_DATA_TOO_LONG", 1552, "Data for column \'%s\' too long" }, | |
| { "ER_DROP_INDEX_FK", 1553, "Cannot drop index \'%-.192s\': needed in a for
eign key constraint" }, | | { "ER_DROP_INDEX_FK", 1553, "Cannot drop index \'%-.192s\': needed in a for
eign key constraint" }, | |
| { "ER_WARN_DEPRECATED_SYNTAX_WITH_VER", 1554, "The syntax \'%s\' is depreca
ted and will be removed in MySQL %s. Please use %s instead" }, | | { "ER_WARN_DEPRECATED_SYNTAX_WITH_VER", 1554, "The syntax \'%s\' is depreca
ted and will be removed in MySQL %s. Please use %s instead" }, | |
| { "ER_CANT_WRITE_LOCK_LOG_TABLE", 1555, "You can\'t write-lock a log table.
Only read access is possible" }, | | { "ER_CANT_WRITE_LOCK_LOG_TABLE", 1555, "You can\'t write-lock a log table.
Only read access is possible" }, | |
| { "ER_CANT_LOCK_LOG_TABLE", 1556, "You can\'t use locks with log tables." }
, | | { "ER_CANT_LOCK_LOG_TABLE", 1556, "You can\'t use locks with log tables." }
, | |
|
| { "ER_FOREIGN_DUPLICATE_KEY", 1557, "Upholding foreign key constraints for
table \'%.192s\', entry \'%-.192s\', key %d would lead to a duplicate entry
" }, | | { "ER_FOREIGN_DUPLICATE_KEY_OLD_UNUSED", 1557, "Upholding foreign key const
raints for table \'%.192s\', entry \'%-.192s\', key %d would lead to a dupl
icate entry" }, | |
| { "ER_COL_COUNT_DOESNT_MATCH_PLEASE_UPDATE", 1558, "Column count of mysql.%
s is wrong. Expected %d, found %d. Created with MySQL %d, now running %d. P
lease use mysql_upgrade to fix this error." }, | | { "ER_COL_COUNT_DOESNT_MATCH_PLEASE_UPDATE", 1558, "Column count of mysql.%
s is wrong. Expected %d, found %d. Created with MySQL %d, now running %d. P
lease use mysql_upgrade to fix this error." }, | |
| { "ER_TEMP_TABLE_PREVENTS_SWITCH_OUT_OF_RBR", 1559, "Cannot switch out of t
he row-based binary log format when the session has open temporary tables"
}, | | { "ER_TEMP_TABLE_PREVENTS_SWITCH_OUT_OF_RBR", 1559, "Cannot switch out of t
he row-based binary log format when the session has open temporary tables"
}, | |
| { "ER_STORED_FUNCTION_PREVENTS_SWITCH_BINLOG_FORMAT", 1560, "Cannot change
the binary logging format inside a stored function or trigger" }, | | { "ER_STORED_FUNCTION_PREVENTS_SWITCH_BINLOG_FORMAT", 1560, "Cannot change
the binary logging format inside a stored function or trigger" }, | |
| { "ER_NDB_CANT_SWITCH_BINLOG_FORMAT", 1561, "The NDB cluster engine does no
t support changing the binlog format on the fly yet" }, | | { "ER_NDB_CANT_SWITCH_BINLOG_FORMAT", 1561, "The NDB cluster engine does no
t support changing the binlog format on the fly yet" }, | |
| { "ER_PARTITION_NO_TEMPORARY", 1562, "Cannot create temporary table with pa
rtitions" }, | | { "ER_PARTITION_NO_TEMPORARY", 1562, "Cannot create temporary table with pa
rtitions" }, | |
| { "ER_PARTITION_CONST_DOMAIN_ERROR", 1563, "Partition constant is out of pa
rtition function domain" }, | | { "ER_PARTITION_CONST_DOMAIN_ERROR", 1563, "Partition constant is out of pa
rtition function domain" }, | |
| { "ER_PARTITION_FUNCTION_IS_NOT_ALLOWED", 1564, "This partition function is
not allowed" }, | | { "ER_PARTITION_FUNCTION_IS_NOT_ALLOWED", 1564, "This partition function is
not allowed" }, | |
| { "ER_DDL_LOG_ERROR", 1565, "Error in DDL log" }, | | { "ER_DDL_LOG_ERROR", 1565, "Error in DDL log" }, | |
| { "ER_NULL_IN_VALUES_LESS_THAN", 1566, "Not allowed to use NULL value in VA
LUES LESS THAN" }, | | { "ER_NULL_IN_VALUES_LESS_THAN", 1566, "Not allowed to use NULL value in VA
LUES LESS THAN" }, | |
| { "ER_WRONG_PARTITION_NAME", 1567, "Incorrect partition name" }, | | { "ER_WRONG_PARTITION_NAME", 1567, "Incorrect partition name" }, | |
|
| { "ER_CANT_CHANGE_TX_ISOLATION", 1568, "Transaction isolation level can\'t
be changed while a transaction is in progress" }, | | { "ER_CANT_CHANGE_TX_CHARACTERISTICS", 1568, "Transaction characteristics c
an\'t be changed while a transaction is in progress" }, | |
| { "ER_DUP_ENTRY_AUTOINCREMENT_CASE", 1569, "ALTER TABLE causes auto_increme
nt resequencing, resulting in duplicate entry \'%-.192s\' for key \'%-.192s
\'" }, | | { "ER_DUP_ENTRY_AUTOINCREMENT_CASE", 1569, "ALTER TABLE causes auto_increme
nt resequencing, resulting in duplicate entry \'%-.192s\' for key \'%-.192s
\'" }, | |
| { "ER_EVENT_MODIFY_QUEUE_ERROR", 1570, "Internal scheduler error %d" }, | | { "ER_EVENT_MODIFY_QUEUE_ERROR", 1570, "Internal scheduler error %d" }, | |
| { "ER_EVENT_SET_VAR_ERROR", 1571, "Error during starting/stopping of the sc
heduler. Error code %u" }, | | { "ER_EVENT_SET_VAR_ERROR", 1571, "Error during starting/stopping of the sc
heduler. Error code %u" }, | |
| { "ER_PARTITION_MERGE_ERROR", 1572, "Engine cannot be used in partitioned t
ables" }, | | { "ER_PARTITION_MERGE_ERROR", 1572, "Engine cannot be used in partitioned t
ables" }, | |
| { "ER_CANT_ACTIVATE_LOG", 1573, "Cannot activate \'%-.64s\' log" }, | | { "ER_CANT_ACTIVATE_LOG", 1573, "Cannot activate \'%-.64s\' log" }, | |
| { "ER_RBR_NOT_AVAILABLE", 1574, "The server was not built with row-based re
plication" }, | | { "ER_RBR_NOT_AVAILABLE", 1574, "The server was not built with row-based re
plication" }, | |
| { "ER_BASE64_DECODE_ERROR", 1575, "Decoding of base64 string failed" }, | | { "ER_BASE64_DECODE_ERROR", 1575, "Decoding of base64 string failed" }, | |
| { "ER_EVENT_RECURSION_FORBIDDEN", 1576, "Recursion of EVENT DDL statements
is forbidden when body is present" }, | | { "ER_EVENT_RECURSION_FORBIDDEN", 1576, "Recursion of EVENT DDL statements
is forbidden when body is present" }, | |
| { "ER_EVENTS_DB_ERROR", 1577, "Cannot proceed because system tables used by
Event Scheduler were found damaged at server start" }, | | { "ER_EVENTS_DB_ERROR", 1577, "Cannot proceed because system tables used by
Event Scheduler were found damaged at server start" }, | |
| { "ER_ONLY_INTEGERS_ALLOWED", 1578, "Only integers allowed as number here"
}, | | { "ER_ONLY_INTEGERS_ALLOWED", 1578, "Only integers allowed as number here"
}, | |
| { "ER_UNSUPORTED_LOG_ENGINE", 1579, "This storage engine cannot be used for
log tables\"" }, | | { "ER_UNSUPORTED_LOG_ENGINE", 1579, "This storage engine cannot be used for
log tables\"" }, | |
| { "ER_BAD_LOG_STATEMENT", 1580, "You cannot \'%s\' a log table if logging i
s enabled" }, | | { "ER_BAD_LOG_STATEMENT", 1580, "You cannot \'%s\' a log table if logging i
s enabled" }, | |
| { "ER_CANT_RENAME_LOG_TABLE", 1581, "Cannot rename \'%s\'. When logging ena
bled, rename to/from log table must rename two tables: the log table to an
archive table and another table back to \'%s\'" }, | | { "ER_CANT_RENAME_LOG_TABLE", 1581, "Cannot rename \'%s\'. When logging ena
bled, rename to/from log table must rename two tables: the log table to an
archive table and another table back to \'%s\'" }, | |
| { "ER_WRONG_PARAMCOUNT_TO_NATIVE_FCT", 1582, "Incorrect parameter count in
the call to native function \'%-.192s\'" }, | | { "ER_WRONG_PARAMCOUNT_TO_NATIVE_FCT", 1582, "Incorrect parameter count in
the call to native function \'%-.192s\'" }, | |
| { "ER_WRONG_PARAMETERS_TO_NATIVE_FCT", 1583, "Incorrect parameters in the c
all to native function \'%-.192s\'" }, | | { "ER_WRONG_PARAMETERS_TO_NATIVE_FCT", 1583, "Incorrect parameters in the c
all to native function \'%-.192s\'" }, | |
| { "ER_WRONG_PARAMETERS_TO_STORED_FCT", 1584, "Incorrect parameters in the c
all to stored function \'%-.192s\'" }, | | { "ER_WRONG_PARAMETERS_TO_STORED_FCT", 1584, "Incorrect parameters in the c
all to stored function \'%-.192s\'" }, | |
| { "ER_NATIVE_FCT_NAME_COLLISION", 1585, "This function \'%-.192s\' has the
same name as a native function" }, | | { "ER_NATIVE_FCT_NAME_COLLISION", 1585, "This function \'%-.192s\' has the
same name as a native function" }, | |
| { "ER_DUP_ENTRY_WITH_KEY_NAME", 1586, "Duplicate entry \'%-.64s\' for key \
'%-.192s\'" }, | | { "ER_DUP_ENTRY_WITH_KEY_NAME", 1586, "Duplicate entry \'%-.64s\' for key \
'%-.192s\'" }, | |
| { "ER_BINLOG_PURGE_EMFILE", 1587, "Too many files opened, please execute th
e command again" }, | | { "ER_BINLOG_PURGE_EMFILE", 1587, "Too many files opened, please execute th
e command again" }, | |
| { "ER_EVENT_CANNOT_CREATE_IN_THE_PAST", 1588, "Event execution time is in t
he past and ON COMPLETION NOT PRESERVE is set. The event was dropped immedi
ately after creation." }, | | { "ER_EVENT_CANNOT_CREATE_IN_THE_PAST", 1588, "Event execution time is in t
he past and ON COMPLETION NOT PRESERVE is set. The event was dropped immedi
ately after creation." }, | |
|
| { "ER_EVENT_CANNOT_ALTER_IN_THE_PAST", 1589, "Event execution time is in th
e past and ON COMPLETION NOT PRESERVE is set. The event was dropped immedia
tely after creation." }, | | { "ER_EVENT_CANNOT_ALTER_IN_THE_PAST", 1589, "Event execution time is in th
e past and ON COMPLETION NOT PRESERVE is set. The event was not changed. Sp
ecify a time in the future." }, | |
| { "ER_SLAVE_INCIDENT", 1590, "The incident %s occured on the master. Messag
e: %-.64s" }, | | { "ER_SLAVE_INCIDENT", 1590, "The incident %s occured on the master. Messag
e: %-.64s" }, | |
| { "ER_NO_PARTITION_FOR_GIVEN_VALUE_SILENT", 1591, "Table has no partition f
or some existing values" }, | | { "ER_NO_PARTITION_FOR_GIVEN_VALUE_SILENT", 1591, "Table has no partition f
or some existing values" }, | |
| { "ER_BINLOG_UNSAFE_STATEMENT", 1592, "Unsafe statement written to the bina
ry log using statement format since BINLOG_FORMAT = STATEMENT. %s" }, | | { "ER_BINLOG_UNSAFE_STATEMENT", 1592, "Unsafe statement written to the bina
ry log using statement format since BINLOG_FORMAT = STATEMENT. %s" }, | |
| { "ER_SLAVE_FATAL_ERROR", 1593, "Fatal error: %s" }, | | { "ER_SLAVE_FATAL_ERROR", 1593, "Fatal error: %s" }, | |
| { "ER_SLAVE_RELAY_LOG_READ_FAILURE", 1594, "Relay log read failure: %s" }, | | { "ER_SLAVE_RELAY_LOG_READ_FAILURE", 1594, "Relay log read failure: %s" }, | |
| { "ER_SLAVE_RELAY_LOG_WRITE_FAILURE", 1595, "Relay log write failure: %s" }
, | | { "ER_SLAVE_RELAY_LOG_WRITE_FAILURE", 1595, "Relay log write failure: %s" }
, | |
| { "ER_SLAVE_CREATE_EVENT_FAILURE", 1596, "Failed to create %s" }, | | { "ER_SLAVE_CREATE_EVENT_FAILURE", 1596, "Failed to create %s" }, | |
| { "ER_SLAVE_MASTER_COM_FAILURE", 1597, "Master command %s failed: %s" }, | | { "ER_SLAVE_MASTER_COM_FAILURE", 1597, "Master command %s failed: %s" }, | |
| { "ER_BINLOG_LOGGING_IMPOSSIBLE", 1598, "Binary logging not possible. Messa
ge: %s" }, | | { "ER_BINLOG_LOGGING_IMPOSSIBLE", 1598, "Binary logging not possible. Messa
ge: %s" }, | |
| { "ER_VIEW_NO_CREATION_CTX", 1599, "View `%-.64s`.`%-.64s` has no creation
context" }, | | { "ER_VIEW_NO_CREATION_CTX", 1599, "View `%-.64s`.`%-.64s` has no creation
context" }, | |
| | | | |
| skipping to change at line 731 | | skipping to change at line 731 | |
| { "ER_BINLOG_UNSAFE_CREATE_REPLACE_SELECT", 1718, "CREATE... REPLACE SELECT
is unsafe because the order in which rows are retrieved by the SELECT dete
rmines which (if any) rows are replaced. This order cannot be predicted and
may differ on master and the slave." }, | | { "ER_BINLOG_UNSAFE_CREATE_REPLACE_SELECT", 1718, "CREATE... REPLACE SELECT
is unsafe because the order in which rows are retrieved by the SELECT dete
rmines which (if any) rows are replaced. This order cannot be predicted and
may differ on master and the slave." }, | |
| { "ER_BINLOG_UNSAFE_UPDATE_IGNORE", 1719, "UPDATE IGNORE is unsafe because
the order in which rows are updated determines which (if any) rows are igno
red. This order cannot be predicted and may differ on master and the slave.
" }, | | { "ER_BINLOG_UNSAFE_UPDATE_IGNORE", 1719, "UPDATE IGNORE is unsafe because
the order in which rows are updated determines which (if any) rows are igno
red. This order cannot be predicted and may differ on master and the slave.
" }, | |
| { "ER_PLUGIN_NO_UNINSTALL", 1720, "Plugin \'%s\' is marked as not dynamical
ly uninstallable. You have to stop the server to uninstall it." }, | | { "ER_PLUGIN_NO_UNINSTALL", 1720, "Plugin \'%s\' is marked as not dynamical
ly uninstallable. You have to stop the server to uninstall it." }, | |
| { "ER_PLUGIN_NO_INSTALL", 1721, "Plugin \'%s\' is marked as not dynamically
installable. You have to stop the server to install it." }, | | { "ER_PLUGIN_NO_INSTALL", 1721, "Plugin \'%s\' is marked as not dynamically
installable. You have to stop the server to install it." }, | |
| { "ER_BINLOG_UNSAFE_WRITE_AUTOINC_SELECT", 1722, "Statements writing to a t
able with an auto-increment column after selecting from another table are u
nsafe because the order in which rows are retrieved determines what (if any
) rows will be written. This order cannot be predicted and may differ on ma
ster and the slave." }, | | { "ER_BINLOG_UNSAFE_WRITE_AUTOINC_SELECT", 1722, "Statements writing to a t
able with an auto-increment column after selecting from another table are u
nsafe because the order in which rows are retrieved determines what (if any
) rows will be written. This order cannot be predicted and may differ on ma
ster and the slave." }, | |
| { "ER_BINLOG_UNSAFE_CREATE_SELECT_AUTOINC", 1723, "CREATE TABLE... SELECT..
. on a table with an auto-increment column is unsafe because the order in
which rows are retrieved by the SELECT determines which (if any) rows are i
nserted. This order cannot be predicted and may differ on master and the sl
ave." }, | | { "ER_BINLOG_UNSAFE_CREATE_SELECT_AUTOINC", 1723, "CREATE TABLE... SELECT..
. on a table with an auto-increment column is unsafe because the order in
which rows are retrieved by the SELECT determines which (if any) rows are i
nserted. This order cannot be predicted and may differ on master and the sl
ave." }, | |
| { "ER_BINLOG_UNSAFE_INSERT_TWO_KEYS", 1724, "INSERT... ON DUPLICATE KEY UPD
ATE on a table with more than one UNIQUE KEY is unsafe" }, | | { "ER_BINLOG_UNSAFE_INSERT_TWO_KEYS", 1724, "INSERT... ON DUPLICATE KEY UPD
ATE on a table with more than one UNIQUE KEY is unsafe" }, | |
| { "ER_TABLE_IN_FK_CHECK", 1725, "Table is being used in foreign key check."
}, | | { "ER_TABLE_IN_FK_CHECK", 1725, "Table is being used in foreign key check."
}, | |
| { "ER_UNSUPPORTED_ENGINE", 1726, "Storage engine \'%s\' does not support sy
stem tables. [%s.%s]" }, | | { "ER_UNSUPPORTED_ENGINE", 1726, "Storage engine \'%s\' does not support sy
stem tables. [%s.%s]" }, | |
| { "ER_BINLOG_UNSAFE_AUTOINC_NOT_FIRST", 1727, "INSERT into autoincrement fi
eld which is not the first part in the composed primary key is unsafe." }, | | { "ER_BINLOG_UNSAFE_AUTOINC_NOT_FIRST", 1727, "INSERT into autoincrement fi
eld which is not the first part in the composed primary key is unsafe." }, | |
|
| | | { "ER_CANNOT_LOAD_FROM_TABLE_V2", 1728, "Cannot load from %s.%s. The table | |
| | | is probably corrupted" }, | |
| | | { "ER_MASTER_DELAY_VALUE_OUT_OF_RANGE", 1729, "The requested value %u for t | |
| | | he master delay exceeds the maximum %u" }, | |
| | | { "ER_ONLY_FD_AND_RBR_EVENTS_ALLOWED_IN_BINLOG_STATEMENT", 1730, "Only Form | |
| | | at_description_log_event and row events are allowed in BINLOG statements (b | |
| | | ut %s was provided)" }, | |
| | | { "ER_PARTITION_EXCHANGE_DIFFERENT_OPTION", 1731, "Non matching attribute \ | |
| | | '%-.64s\' between partition and table" }, | |
| | | { "ER_PARTITION_EXCHANGE_PART_TABLE", 1732, "Table to exchange with partiti | |
| | | on is partitioned: \'%-.64s\'" }, | |
| | | { "ER_PARTITION_EXCHANGE_TEMP_TABLE", 1733, "Table to exchange with partiti | |
| | | on is temporary: \'%-.64s\'" }, | |
| | | { "ER_PARTITION_INSTEAD_OF_SUBPARTITION", 1734, "Subpartitioned table, use | |
| | | subpartition instead of partition" }, | |
| | | { "ER_UNKNOWN_PARTITION", 1735, "Unknown partition \'%-.64s\' in table \'%- | |
| | | .64s\'" }, | |
| | | { "ER_TABLES_DIFFERENT_METADATA", 1736, "Tables have different definitions" | |
| | | }, | |
| | | { "ER_ROW_DOES_NOT_MATCH_PARTITION", 1737, "Found a row that does not match | |
| | | the partition" }, | |
| | | { "ER_BINLOG_CACHE_SIZE_GREATER_THAN_MAX", 1738, "Option binlog_cache_size | |
| | | (%lu) is greater than max_binlog_cache_size (%lu); setting binlog_cache_siz | |
| | | e equal to max_binlog_cache_size." }, | |
| | | { "ER_WARN_INDEX_NOT_APPLICABLE", 1739, "Cannot use %-.64s access on index | |
| | | \'%-.64s\' due to type or collation conversion on field \'%-.64s\'" }, | |
| | | { "ER_PARTITION_EXCHANGE_FOREIGN_KEY", 1740, "Table to exchange with partit | |
| | | ion has foreign key references: \'%-.64s\'" }, | |
| | | { "ER_NO_SUCH_KEY_VALUE", 1741, "Key value \'%-.192s\' was not found in tab | |
| | | le \'%-.192s.%-.192s\'" }, | |
| | | { "ER_RPL_INFO_DATA_TOO_LONG", 1742, "Data for column \'%s\' too long" }, | |
| | | { "ER_NETWORK_READ_EVENT_CHECKSUM_FAILURE", 1743, "Replication event checks | |
| | | um verification failed while reading from network." }, | |
| | | { "ER_BINLOG_READ_EVENT_CHECKSUM_FAILURE", 1744, "Replication event checksu | |
| | | m verification failed while reading from a log file." }, | |
| | | { "ER_BINLOG_STMT_CACHE_SIZE_GREATER_THAN_MAX", 1745, "Option binlog_stmt_c | |
| | | ache_size (%lu) is greater than max_binlog_stmt_cache_size (%lu); setting b | |
| | | inlog_stmt_cache_size equal to max_binlog_stmt_cache_size." }, | |
| | | { "ER_CANT_UPDATE_TABLE_IN_CREATE_TABLE_SELECT", 1746, "Can\'t update table | |
| | | \'%-.192s\' while \'%-.192s\' is being created." }, | |
| | | { "ER_PARTITION_CLAUSE_ON_NONPARTITIONED", 1747, "PARTITION () clause on no | |
| | | n partitioned table" }, | |
| | | { "ER_ROW_DOES_NOT_MATCH_GIVEN_PARTITION_SET", 1748, "Found a row not match | |
| | | ing the given partition set" }, | |
| | | { "ER_NO_SUCH_PARTITION__UNUSED", 1749, "partition \'%-.64s\' doesn\'t exis | |
| | | t" }, | |
| | | { "ER_CHANGE_RPL_INFO_REPOSITORY_FAILURE", 1750, "Failure while changing th | |
| | | e type of replication repository: %s." }, | |
| | | { "ER_WARNING_NOT_COMPLETE_ROLLBACK_WITH_CREATED_TEMP_TABLE", 1751, "The cr | |
| | | eation of some temporary tables could not be rolled back." }, | |
| | | { "ER_WARNING_NOT_COMPLETE_ROLLBACK_WITH_DROPPED_TEMP_TABLE", 1752, "Some t | |
| | | emporary tables were dropped, but these operations could not be rolled back | |
| | | ." }, | |
| | | { "ER_MTS_FEATURE_IS_NOT_SUPPORTED", 1753, "%s is not supported in multi-th | |
| | | readed slave mode. %s" }, | |
| | | { "ER_MTS_UPDATED_DBS_GREATER_MAX", 1754, "The number of modified databases | |
| | | exceeds the maximum %d; the database names will not be included in the rep | |
| | | lication event metadata." }, | |
| | | { "ER_MTS_CANT_PARALLEL", 1755, "Cannot execute the current event group in | |
| | | the parallel mode. Encountered event %s, relay-log name %s, position %s whi | |
| | | ch prevents execution of this event group in parallel mode. Reason: %s." }, | |
| | | { "ER_MTS_INCONSISTENT_DATA", 1756, "%s" }, | |
| | | { "ER_FULLTEXT_NOT_SUPPORTED_WITH_PARTITIONING", 1757, "FULLTEXT index is n | |
| | | ot supported for partitioned tables." }, | |
| | | { "ER_DA_INVALID_CONDITION_NUMBER", 1758, "Invalid condition number" }, | |
| | | { "ER_INSECURE_PLAIN_TEXT", 1759, "Sending passwords in plain text without | |
| | | SSL/TLS is extremely insecure." }, | |
| | | { "ER_INSECURE_CHANGE_MASTER", 1760, "Storing MySQL user name or password i | |
| | | nformation in the master.info repository is not secure and is therefore not | |
| | | recommended. Please see the MySQL Manual for more about this issue and pos | |
| | | sible alternatives." }, | |
| | | { "ER_FOREIGN_DUPLICATE_KEY_WITH_CHILD_INFO", 1761, "Foreign key constraint | |
| | | for table \'%.192s\', record \'%-.192s\' would lead to a duplicate entry i | |
| | | n table \'%.192s\', key \'%.192s\'" }, | |
| | | { "ER_FOREIGN_DUPLICATE_KEY_WITHOUT_CHILD_INFO", 1762, "Foreign key constra | |
| | | int for table \'%.192s\', record \'%-.192s\' would lead to a duplicate entr | |
| | | y in a child table" }, | |
| | | { "ER_SQLTHREAD_WITH_SECURE_SLAVE", 1763, "Setting authentication options i | |
| | | s not possible when only the Slave SQL Thread is being started." }, | |
| | | { "ER_TABLE_HAS_NO_FT", 1764, "The table does not have FULLTEXT index to su | |
| | | pport this query" }, | |
| | | { "ER_VARIABLE_NOT_SETTABLE_IN_SF_OR_TRIGGER", 1765, "The system variable % | |
| | | .200s cannot be set in stored functions or triggers." }, | |
| | | { "ER_VARIABLE_NOT_SETTABLE_IN_TRANSACTION", 1766, "The system variable %.2 | |
| | | 00s cannot be set when there is an ongoing transaction." }, | |
| | | { "ER_GTID_NEXT_IS_NOT_IN_GTID_NEXT_LIST", 1767, "The system variable @@SES | |
| | | SION.GTID_NEXT has the value %.200s, which is not listed in @@SESSION.GTID_ | |
| | | NEXT_LIST." }, | |
| | | { "ER_CANT_CHANGE_GTID_NEXT_IN_TRANSACTION_WHEN_GTID_NEXT_LIST_IS_NULL", 17 | |
| | | 68, "When @@SESSION.GTID_NEXT_LIST == NULL, the system variable @@SESSION.G | |
| | | TID_NEXT cannot change inside a transaction." }, | |
| | | { "ER_SET_STATEMENT_CANNOT_INVOKE_FUNCTION", 1769, "The statement \'SET %.2 | |
| | | 00s\' cannot invoke a stored function." }, | |
| | | { "ER_GTID_NEXT_CANT_BE_AUTOMATIC_IF_GTID_NEXT_LIST_IS_NON_NULL", 1770, "Th | |
| | | e system variable @@SESSION.GTID_NEXT cannot be \'AUTOMATIC\' when @@SESSIO | |
| | | N.GTID_NEXT_LIST is non-NULL." }, | |
| | | { "ER_SKIPPING_LOGGED_TRANSACTION", 1771, "Skipping transaction %.200s beca | |
| | | use it has already been executed and logged." }, | |
| | | { "ER_MALFORMED_GTID_SET_SPECIFICATION", 1772, "Malformed GTID set specific | |
| | | ation \'%.200s\'." }, | |
| | | { "ER_MALFORMED_GTID_SET_ENCODING", 1773, "Malformed GTID set encoding." }, | |
| | | { "ER_MALFORMED_GTID_SPECIFICATION", 1774, "Malformed GTID specification \' | |
| | | %.200s\'." }, | |
| | | { "ER_GNO_EXHAUSTED", 1775, "Impossible to generate Global Transaction Iden | |
| | | tifier: the integer component reached the maximal value. Restart the server | |
| | | with a new server_uuid." }, | |
| | | { "ER_BAD_SLAVE_AUTO_POSITION", 1776, "Parameters MASTER_LOG_FILE, MASTER_L | |
| | | OG_POS, RELAY_LOG_FILE and RELAY_LOG_POS cannot be set when MASTER_AUTO_POS | |
| | | ITION is active." }, | |
| | | { "ER_AUTO_POSITION_REQUIRES_GTID_MODE_ON", 1777, "CHANGE MASTER TO MASTER_ | |
| | | AUTO_POSITION = 1 can only be executed when GTID_MODE = ON." }, | |
| | | { "ER_CANT_DO_IMPLICIT_COMMIT_IN_TRX_WHEN_GTID_NEXT_IS_SET", 1778, "Cannot | |
| | | execute statements with implicit commit inside a transaction when GTID_NEXT | |
| | | != AUTOMATIC or GTID_NEXT_LIST != NULL." }, | |
| | | { "ER_GTID_MODE_2_OR_3_REQUIRES_ENFORCE_GTID_CONSISTENCY_ON", 1779, "GTID_M | |
| | | ODE = ON or GTID_MODE = UPGRADE_STEP_2 requires ENFORCE_GTID_CONSISTENCY = | |
| | | 1." }, | |
| | | { "ER_GTID_MODE_REQUIRES_BINLOG", 1780, "GTID_MODE = ON or UPGRADE_STEP_1 o | |
| | | r UPGRADE_STEP_2 requires --log-bin and --log-slave-updates." }, | |
| | | { "ER_CANT_SET_GTID_NEXT_TO_GTID_WHEN_GTID_MODE_IS_OFF", 1781, "GTID_NEXT c | |
| | | annot be set to UUID:NUMBER when GTID_MODE = OFF." }, | |
| | | { "ER_CANT_SET_GTID_NEXT_TO_ANONYMOUS_WHEN_GTID_MODE_IS_ON", 1782, "GTID_NE | |
| | | XT cannot be set to ANONYMOUS when GTID_MODE = ON." }, | |
| | | { "ER_CANT_SET_GTID_NEXT_LIST_TO_NON_NULL_WHEN_GTID_MODE_IS_OFF", 1783, "GT | |
| | | ID_NEXT_LIST cannot be set to a non-NULL value when GTID_MODE = OFF." }, | |
| | | { "ER_FOUND_GTID_EVENT_WHEN_GTID_MODE_IS_OFF", 1784, "Found a Gtid_log_even | |
| | | t or Previous_gtids_log_event when GTID_MODE = OFF." }, | |
| | | { "ER_GTID_UNSAFE_NON_TRANSACTIONAL_TABLE", 1785, "When ENFORCE_GTID_CONSIS | |
| | | TENCY = 1, updates to non-transactional tables can only be done in either a | |
| | | utocommitted statements or single-statement transactions, and never in the | |
| | | same statement as updates to transactional tables." }, | |
| | | { "ER_GTID_UNSAFE_CREATE_SELECT", 1786, "CREATE TABLE ... SELECT is forbidd | |
| | | en when ENFORCE_GTID_CONSISTENCY = 1." }, | |
| | | { "ER_GTID_UNSAFE_CREATE_DROP_TEMPORARY_TABLE_IN_TRANSACTION", 1787, "When | |
| | | ENFORCE_GTID_CONSISTENCY = 1, the statements CREATE TEMPORARY TABLE and DRO | |
| | | P TEMPORARY TABLE can be executed in a non-transactional context only, and | |
| | | require that AUTOCOMMIT = 1." }, | |
| | | { "ER_GTID_MODE_CAN_ONLY_CHANGE_ONE_STEP_AT_A_TIME", 1788, "The value of GT | |
| | | ID_MODE can only change one step at a time: OFF <-> UPGRADE_STEP_1 <-> UPGR | |
| | | ADE_STEP_2 <-> ON. Also note that this value must be stepped up or down sim | |
| | | ultaneously on all servers; see the Manual for instructions." }, | |
| | | { "ER_MASTER_HAS_PURGED_REQUIRED_GTIDS", 1789, "The slave is connecting usi | |
| | | ng CHANGE MASTER TO MASTER_AUTO_POSITION = 1, but the master has purged bin | |
| | | ary logs containing GTIDs that the slave requires." }, | |
| | | { "ER_CANT_SET_GTID_NEXT_WHEN_OWNING_GTID", 1790, "GTID_NEXT cannot be chan | |
| | | ged by a client that owns a GTID. The client owns %s. Ownership is released | |
| | | on COMMIT or ROLLBACK." }, | |
| | | { "ER_UNKNOWN_EXPLAIN_FORMAT", 1791, "Unknown EXPLAIN format name: \'%s\'" | |
| | | }, | |
| | | { "ER_CANT_EXECUTE_IN_READ_ONLY_TRANSACTION", 1792, "Cannot execute stateme | |
| | | nt in a READ ONLY transaction." }, | |
| | | { "ER_TOO_LONG_TABLE_PARTITION_COMMENT", 1793, "Comment for table partition | |
| | | \'%-.64s\' is too long (max = %lu)" }, | |
| | | { "ER_SLAVE_CONFIGURATION", 1794, "Slave is not configured or failed to ini | |
| | | tialize properly. You must at least set --server-id to enable either a mast | |
| | | er or a slave. Additional error messages can be found in the MySQL error lo | |
| | | g." }, | |
| | | { "ER_INNODB_FT_LIMIT", 1795, "InnoDB presently supports one FULLTEXT index | |
| | | creation at a time" }, | |
| | | { "ER_INNODB_NO_FT_TEMP_TABLE", 1796, "Cannot create FULLTEXT index on temp | |
| | | orary InnoDB table" }, | |
| | | { "ER_INNODB_FT_WRONG_DOCID_COLUMN", 1797, "Column \'%-.192s\' is of wrong | |
| | | type for an InnoDB FULLTEXT index" }, | |
| | | { "ER_INNODB_FT_WRONG_DOCID_INDEX", 1798, "Index \'%-.192s\' is of wrong ty | |
| | | pe for an InnoDB FULLTEXT index" }, | |
| | | { "ER_INNODB_ONLINE_LOG_TOO_BIG", 1799, "Creating index \'%-.192s\' require | |
| | | d more than \'innodb_online_alter_log_max_size\' bytes of modification log. | |
| | | Please try again." }, | |
| | | { "ER_UNKNOWN_ALTER_ALGORITHM", 1800, "Unknown ALGORITHM \'%s\'" }, | |
| | | { "ER_UNKNOWN_ALTER_LOCK", 1801, "Unknown LOCK type \'%s\'" }, | |
| | | { "ER_MTS_CHANGE_MASTER_CANT_RUN_WITH_GAPS", 1802, "CHANGE MASTER cannot be | |
| | | executed when the slave was stopped with an error or killed in MTS mode. C | |
| | | onsider using RESET SLAVE or START SLAVE UNTIL." }, | |
| | | { "ER_MTS_RECOVERY_FAILURE", 1803, "Cannot recover after SLAVE errored out | |
| | | in parallel execution mode. Additional error messages can be found in the M | |
| | | ySQL error log." }, | |
| | | { "ER_MTS_RESET_WORKERS", 1804, "Cannot clean up worker info tables. Additi | |
| | | onal error messages can be found in the MySQL error log." }, | |
| | | { "ER_COL_COUNT_DOESNT_MATCH_CORRUPTED_V2", 1805, "Column count of %s.%s is | |
| | | wrong. Expected %d, found %d. The table is probably corrupted" }, | |
| | | { "ER_SLAVE_SILENT_RETRY_TRANSACTION", 1806, "Slave must silently retry cur | |
| | | rent transaction" }, | |
| | | { "ER_DISCARD_FK_CHECKS_RUNNING", 1807, "There is a foreign key check runni | |
| | | ng on table \'%-.192s\'. Cannot discard the table." }, | |
| | | { "ER_TABLE_SCHEMA_MISMATCH", 1808, "Schema mismatch (%s)" }, | |
| | | { "ER_TABLE_IN_SYSTEM_TABLESPACE", 1809, "Table \'%-.192s\' in system table | |
| | | space" }, | |
| | | { "ER_IO_READ_ERROR", 1810, "IO Read error: (%lu, %s) %s" }, | |
| | | { "ER_IO_WRITE_ERROR", 1811, "IO Write error: (%lu, %s) %s" }, | |
| | | { "ER_TABLESPACE_MISSING", 1812, "Tablespace is missing for table \'%-.192s | |
| | | \'" }, | |
| | | { "ER_TABLESPACE_EXISTS", 1813, "Tablespace for table \'%-.192s\' exists. P | |
| | | lease DISCARD the tablespace before IMPORT." }, | |
| | | { "ER_TABLESPACE_DISCARDED", 1814, "Tablespace has been discarded for table | |
| | | \'%-.192s\'" }, | |
| | | { "ER_INTERNAL_ERROR", 1815, "Internal error: %s" }, | |
| | | { "ER_INNODB_IMPORT_ERROR", 1816, "ALTER TABLE \'%-.192s\' IMPORT TABLESPAC | |
| | | E failed with error %lu : \'%s\'" }, | |
| | | { "ER_INNODB_INDEX_CORRUPT", 1817, "Index corrupt: %s" }, | |
| | | { "ER_INVALID_YEAR_COLUMN_LENGTH", 1818, "YEAR(%lu) column type is deprecat | |
| | | ed. Creating YEAR(4) column instead." }, | |
| | | { "ER_NOT_VALID_PASSWORD", 1819, "Your password does not satisfy the curren | |
| | | t policy requirements" }, | |
| | | { "ER_MUST_CHANGE_PASSWORD", 1820, "You must SET PASSWORD before executing | |
| | | this statement" }, | |
| | | { "ER_FK_NO_INDEX_CHILD", 1821, "Failed to add the foreign key constaint. M | |
| | | issing index for constraint \'%s\' in the foreign table \'%s\'" }, | |
| | | { "ER_FK_NO_INDEX_PARENT", 1822, "Failed to add the foreign key constaint. | |
| | | Missing index for constraint \'%s\' in the referenced table \'%s\'" }, | |
| | | { "ER_FK_FAIL_ADD_SYSTEM", 1823, "Failed to add the foreign key constraint | |
| | | \'%s\' to system tables" }, | |
| | | { "ER_FK_CANNOT_OPEN_PARENT", 1824, "Failed to open the referenced table \' | |
| | | %s\'" }, | |
| | | { "ER_FK_INCORRECT_OPTION", 1825, "Failed to add the foreign key constraint | |
| | | on table \'%s\'. Incorrect options in FOREIGN KEY constraint \'%s\'" }, | |
| | | { "ER_FK_DUP_NAME", 1826, "Duplicate foreign key constraint name \'%s\'" }, | |
| | | { "ER_PASSWORD_FORMAT", 1827, "The password hash doesn\'t have the expected | |
| | | format. Check if the correct password algorithm is being used with the PAS | |
| | | SWORD() function." }, | |
| | | { "ER_FK_COLUMN_CANNOT_DROP", 1828, "Cannot drop column \'%-.192s\': needed | |
| | | in a foreign key constraint \'%-.192s\'" }, | |
| | | { "ER_FK_COLUMN_CANNOT_DROP_CHILD", 1829, "Cannot drop column \'%-.192s\': | |
| | | needed in a foreign key constraint \'%-.192s\' of table \'%-.192s\'" }, | |
| | | { "ER_FK_COLUMN_NOT_NULL", 1830, "Column \'%-.192s\' cannot be NOT NULL: ne | |
| | | eded in a foreign key constraint \'%-.192s\' SET NULL" }, | |
| | | { "ER_DUP_INDEX", 1831, "Duplicate index \'%-.64s\' defined on the table \' | |
| | | %-.64s.%-.64s\'. This is deprecated and will be disallowed in a future rele | |
| | | ase." }, | |
| | | { "ER_FK_COLUMN_CANNOT_CHANGE", 1832, "Cannot change column \'%-.192s\': us | |
| | | ed in a foreign key constraint \'%-.192s\'" }, | |
| | | { "ER_FK_COLUMN_CANNOT_CHANGE_CHILD", 1833, "Cannot change column \'%-.192s | |
| | | \': used in a foreign key constraint \'%-.192s\' of table \'%-.192s\'" }, | |
| | | { "ER_FK_CANNOT_DELETE_PARENT", 1834, "Cannot delete rows from table which | |
| | | is parent in a foreign key constraint \'%-.192s\' of table \'%-.192s\'" }, | |
| | | { "ER_MALFORMED_PACKET", 1835, "Malformed communication packet." }, | |
| | | { "ER_READ_ONLY_MODE", 1836, "Running in read-only mode" }, | |
| | | { "ER_GTID_NEXT_TYPE_UNDEFINED_GROUP", 1837, "When GTID_NEXT is set to a GT | |
| | | ID, you must explicitly set it again after a COMMIT or ROLLBACK. If you see | |
| | | this error message in the slave SQL thread, it means that a table in the c | |
| | | urrent transaction is transactional on the master and non-transactional on | |
| | | the slave. In a client connection, it means that you executed SET GTID_NEXT | |
| | | before a transaction and forgot to set GTID_NEXT to a different identifier | |
| | | or to \'AUTOMATIC\' after COMMIT or ROLLBACK. Current GTID_NEXT is \'%s\'. | |
| | | " }, | |
| | | { "ER_VARIABLE_NOT_SETTABLE_IN_SP", 1838, "The system variable %.200s canno | |
| | | t be set in stored procedures." }, | |
| | | { "ER_CANT_SET_GTID_PURGED_WHEN_GTID_MODE_IS_OFF", 1839, "GTID_PURGED can o | |
| | | nly be set when GTID_MODE = ON." }, | |
| | | { "ER_CANT_SET_GTID_PURGED_WHEN_GTID_EXECUTED_IS_NOT_EMPTY", 1840, "GTID_PU | |
| | | RGED can only be set when GTID_EXECUTED is empty." }, | |
| | | { "ER_CANT_SET_GTID_PURGED_WHEN_OWNED_GTIDS_IS_NOT_EMPTY", 1841, "GTID_PURG | |
| | | ED can only be set when there are no ongoing transactions (not even in othe | |
| | | r clients)." }, | |
| | | { "ER_GTID_PURGED_WAS_CHANGED", 1842, "GTID_PURGED was changed from \'%s\' | |
| | | to \'%s\'." }, | |
| | | { "ER_GTID_EXECUTED_WAS_CHANGED", 1843, "GTID_EXECUTED was changed from \'% | |
| | | s\' to \'%s\'." }, | |
| | | { "ER_BINLOG_STMT_MODE_AND_NO_REPL_TABLES", 1844, "Cannot execute statement | |
| | | : impossible to write to binary log since BINLOG_FORMAT = STATEMENT, and bo | |
| | | th replicated and non replicated tables are written to." }, | |
| | | { "ER_ALTER_OPERATION_NOT_SUPPORTED", 1845, "%s is not supported for this o | |
| | | peration. Try %s." }, | |
| | | { "ER_ALTER_OPERATION_NOT_SUPPORTED_REASON", 1846, "%s is not supported. Re | |
| | | ason: %s. Try %s." }, | |
| | | { "ER_ALTER_OPERATION_NOT_SUPPORTED_REASON_COPY", 1847, "COPY algorithm req | |
| | | uires a lock" }, | |
| | | { "ER_ALTER_OPERATION_NOT_SUPPORTED_REASON_PARTITION", 1848, "Partition spe | |
| | | cific operations do not yet support LOCK/ALGORITHM" }, | |
| | | { "ER_ALTER_OPERATION_NOT_SUPPORTED_REASON_FK_RENAME", 1849, "Columns parti | |
| | | cipating in a foreign key are renamed" }, | |
| | | { "ER_ALTER_OPERATION_NOT_SUPPORTED_REASON_COLUMN_TYPE", 1850, "Cannot chan | |
| | | ge column type INPLACE" }, | |
| | | { "ER_ALTER_OPERATION_NOT_SUPPORTED_REASON_FK_CHECK", 1851, "Adding foreign | |
| | | keys needs foreign_key_checks=OFF" }, | |
| | | { "ER_ALTER_OPERATION_NOT_SUPPORTED_REASON_IGNORE", 1852, "Creating unique | |
| | | indexes with IGNORE requires COPY algorithm to remove duplicate rows" }, | |
| | | { "ER_ALTER_OPERATION_NOT_SUPPORTED_REASON_NOPK", 1853, "Dropping a primary | |
| | | key is not allowed without also adding a new primary key" }, | |
| | | { "ER_ALTER_OPERATION_NOT_SUPPORTED_REASON_AUTOINC", 1854, "Adding an auto- | |
| | | increment column requires a lock" }, | |
| | | { "ER_ALTER_OPERATION_NOT_SUPPORTED_REASON_HIDDEN_FTS", 1855, "Cannot repla | |
| | | ce hidden FTS_DOC_ID with a user-visible one" }, | |
| | | { "ER_ALTER_OPERATION_NOT_SUPPORTED_REASON_CHANGE_FTS", 1856, "Cannot drop | |
| | | or rename FTS_DOC_ID" }, | |
| | | { "ER_ALTER_OPERATION_NOT_SUPPORTED_REASON_FTS", 1857, "Fulltext index crea | |
| | | tion requires a lock" }, | |
| | | { "ER_SQL_SLAVE_SKIP_COUNTER_NOT_SETTABLE_IN_GTID_MODE", 1858, "sql_slave_s | |
| | | kip_counter can not be set when the server is running with GTID_MODE = ON. | |
| | | Instead, for each transaction that you want to skip, generate an empty tran | |
| | | saction with the same GTID as the transaction" }, | |
| | | { "ER_DUP_UNKNOWN_IN_INDEX", 1859, "Duplicate entry for key \'%-.192s\'" }, | |
| | | { "ER_IDENT_CAUSES_TOO_LONG_PATH", 1860, "Long database name and identifier | |
| | | for object resulted in path length exceeding %d characters. Path: \'%s\'." | |
| | | }, | |
| | | { "ER_ALTER_OPERATION_NOT_SUPPORTED_REASON_NOT_NULL", 1861, "cannot silentl | |
| | | y convert NULL values, as required in this SQL_MODE" }, | |
| | | | |
End of changes. 14 change blocks. |
| 33 lines changed or deleted | | 39 lines changed or added | |
|
| plugin.h | | plugin.h | |
|
| /* Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reser
ved. | | /* Copyright (c) 2005, 2011, 2012 Oracle and/or its affiliates. All rights
reserved. | |
| | | | |
| This program is free software; you can redistribute it and/or modify | | This program is free software; you can redistribute it and/or modify | |
| it under the terms of the GNU General Public License as published by | | it under the terms of the GNU General Public License as published by | |
| the Free Software Foundation; version 2 of the License. | | the Free Software Foundation; version 2 of the License. | |
| | | | |
| This program is distributed in the hope that it will be useful, | | This program is distributed in the hope that it will be useful, | |
| but WITHOUT ANY WARRANTY; without even the implied warranty of | | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
| GNU General Public License for more details. | | GNU General Public License for more details. | |
| | | | |
| | | | |
| skipping to change at line 51 | | skipping to change at line 51 | |
| #endif | | #endif | |
| | | | |
| #ifdef __cplusplus | | #ifdef __cplusplus | |
| class THD; | | class THD; | |
| class Item; | | class Item; | |
| #define MYSQL_THD THD* | | #define MYSQL_THD THD* | |
| #else | | #else | |
| #define MYSQL_THD void* | | #define MYSQL_THD void* | |
| #endif | | #endif | |
| | | | |
|
| | | typedef void * MYSQL_PLUGIN; | |
| | | | |
| #include <mysql/services.h> | | #include <mysql/services.h> | |
| | | | |
| #define MYSQL_XIDDATASIZE 128 | | #define MYSQL_XIDDATASIZE 128 | |
| /** | | /** | |
| struct st_mysql_xid is binary compatible with the XID structure as | | struct st_mysql_xid is binary compatible with the XID structure as | |
| in the X/Open CAE Specification, Distributed Transaction Processing: | | in the X/Open CAE Specification, Distributed Transaction Processing: | |
| The XA Specification, X/Open Company Ltd., 1991. | | The XA Specification, X/Open Company Ltd., 1991. | |
| http://www.opengroup.org/bookstore/catalog/c193.htm | | http://www.opengroup.org/bookstore/catalog/c193.htm | |
| | | | |
| @see XID in sql/handler.h | | @see XID in sql/handler.h | |
| | | | |
| skipping to change at line 74 | | skipping to change at line 76 | |
| long gtrid_length; | | long gtrid_length; | |
| long bqual_length; | | long bqual_length; | |
| char data[MYSQL_XIDDATASIZE]; /* Not \0-terminated */ | | char data[MYSQL_XIDDATASIZE]; /* Not \0-terminated */ | |
| }; | | }; | |
| typedef struct st_mysql_xid MYSQL_XID; | | typedef struct st_mysql_xid MYSQL_XID; | |
| | | | |
| /************************************************************************* | | /************************************************************************* | |
| Plugin API. Common for all plugin types. | | Plugin API. Common for all plugin types. | |
| */ | | */ | |
| | | | |
|
| #define MYSQL_PLUGIN_INTERFACE_VERSION 0x0103 | | #define MYSQL_PLUGIN_INTERFACE_VERSION 0x0104 | |
| | | | |
| /* | | /* | |
| The allowable types of plugins | | The allowable types of plugins | |
| */ | | */ | |
| #define MYSQL_UDF_PLUGIN 0 /* User-defined function */ | | #define MYSQL_UDF_PLUGIN 0 /* User-defined function */ | |
| #define MYSQL_STORAGE_ENGINE_PLUGIN 1 /* Storage Engine */ | | #define MYSQL_STORAGE_ENGINE_PLUGIN 1 /* Storage Engine */ | |
| #define MYSQL_FTPARSER_PLUGIN 2 /* Full-text parser plugin */ | | #define MYSQL_FTPARSER_PLUGIN 2 /* Full-text parser plugin */ | |
| #define MYSQL_DAEMON_PLUGIN 3 /* The daemon/raw plugin type */ | | #define MYSQL_DAEMON_PLUGIN 3 /* The daemon/raw plugin type */ | |
| #define MYSQL_INFORMATION_SCHEMA_PLUGIN 4 /* The I_S plugin type */ | | #define MYSQL_INFORMATION_SCHEMA_PLUGIN 4 /* The I_S plugin type */ | |
| #define MYSQL_AUDIT_PLUGIN 5 /* The Audit plugin type */ | | #define MYSQL_AUDIT_PLUGIN 5 /* The Audit plugin type */ | |
| #define MYSQL_REPLICATION_PLUGIN 6 /* The replication plugin type */ | | #define MYSQL_REPLICATION_PLUGIN 6 /* The replication plugin type */ | |
| #define MYSQL_AUTHENTICATION_PLUGIN 7 /* The authentication plugin type *
/ | | #define MYSQL_AUTHENTICATION_PLUGIN 7 /* The authentication plugin type *
/ | |
|
| #define MYSQL_MAX_PLUGIN_TYPE_NUM 8 /* The number of plugin types */ | | #define MYSQL_VALIDATE_PASSWORD_PLUGIN 8 /* validate password plugin typ | |
| | | e */ | |
| | | #define MYSQL_MAX_PLUGIN_TYPE_NUM 9 /* The number of plugin types */ | |
| | | | |
| /* We use the following strings to define licenses for plugins */ | | /* We use the following strings to define licenses for plugins */ | |
| #define PLUGIN_LICENSE_PROPRIETARY 0 | | #define PLUGIN_LICENSE_PROPRIETARY 0 | |
| #define PLUGIN_LICENSE_GPL 1 | | #define PLUGIN_LICENSE_GPL 1 | |
| #define PLUGIN_LICENSE_BSD 2 | | #define PLUGIN_LICENSE_BSD 2 | |
| | | | |
| #define PLUGIN_LICENSE_PROPRIETARY_STRING "PROPRIETARY" | | #define PLUGIN_LICENSE_PROPRIETARY_STRING "PROPRIETARY" | |
| #define PLUGIN_LICENSE_GPL_STRING "GPL" | | #define PLUGIN_LICENSE_GPL_STRING "GPL" | |
| #define PLUGIN_LICENSE_BSD_STRING "BSD" | | #define PLUGIN_LICENSE_BSD_STRING "BSD" | |
| | | | |
| | | | |
| skipping to change at line 124 | | skipping to change at line 127 | |
| #endif | | #endif | |
| | | | |
| #define mysql_declare_plugin(NAME) \ | | #define mysql_declare_plugin(NAME) \ | |
| __MYSQL_DECLARE_PLUGIN(NAME, \ | | __MYSQL_DECLARE_PLUGIN(NAME, \ | |
| builtin_ ## NAME ## _plugin_interface_version, \ | | builtin_ ## NAME ## _plugin_interface_version, \ | |
| builtin_ ## NAME ## _sizeof_struct_st_plugin, \ | | builtin_ ## NAME ## _sizeof_struct_st_plugin, \ | |
| builtin_ ## NAME ## _plugin) | | builtin_ ## NAME ## _plugin) | |
| | | | |
| #define mysql_declare_plugin_end ,{0,0,0,0,0,0,0,0,0,0,0,0,0}} | | #define mysql_declare_plugin_end ,{0,0,0,0,0,0,0,0,0,0,0,0,0}} | |
| | | | |
|
| /* | | /** | |
| declarations for SHOW STATUS support in plugins | | declarations for SHOW STATUS support in plugins | |
| */ | | */ | |
| enum enum_mysql_show_type | | enum enum_mysql_show_type | |
| { | | { | |
|
| SHOW_UNDEF, SHOW_BOOL, SHOW_INT, SHOW_LONG, | | SHOW_UNDEF, SHOW_BOOL, | |
| SHOW_LONGLONG, SHOW_CHAR, SHOW_CHAR_PTR, | | SHOW_INT, ///< shown as _unsigned_ int | |
| | | SHOW_LONG, ///< shown as _unsigned_ long | |
| | | SHOW_LONGLONG, ///< shown as _unsigned_ longlong | |
| | | SHOW_CHAR, SHOW_CHAR_PTR, | |
| SHOW_ARRAY, SHOW_FUNC, SHOW_DOUBLE, | | SHOW_ARRAY, SHOW_FUNC, SHOW_DOUBLE, | |
| SHOW_always_last | | SHOW_always_last | |
| }; | | }; | |
| | | | |
| struct st_mysql_show_var { | | struct st_mysql_show_var { | |
| const char *name; | | const char *name; | |
| char *value; | | char *value; | |
| enum enum_mysql_show_type type; | | enum enum_mysql_show_type type; | |
| }; | | }; | |
| | | | |
| | | | |
| skipping to change at line 162 | | skipping to change at line 168 | |
| declarations for server variables and command line options | | declarations for server variables and command line options | |
| */ | | */ | |
| | | | |
| #define PLUGIN_VAR_BOOL 0x0001 | | #define PLUGIN_VAR_BOOL 0x0001 | |
| #define PLUGIN_VAR_INT 0x0002 | | #define PLUGIN_VAR_INT 0x0002 | |
| #define PLUGIN_VAR_LONG 0x0003 | | #define PLUGIN_VAR_LONG 0x0003 | |
| #define PLUGIN_VAR_LONGLONG 0x0004 | | #define PLUGIN_VAR_LONGLONG 0x0004 | |
| #define PLUGIN_VAR_STR 0x0005 | | #define PLUGIN_VAR_STR 0x0005 | |
| #define PLUGIN_VAR_ENUM 0x0006 | | #define PLUGIN_VAR_ENUM 0x0006 | |
| #define PLUGIN_VAR_SET 0x0007 | | #define PLUGIN_VAR_SET 0x0007 | |
|
| #define PLUGIN_VAR_DOUBLE 0x0008 | | | |
| #define PLUGIN_VAR_UNSIGNED 0x0080 | | #define PLUGIN_VAR_UNSIGNED 0x0080 | |
| #define PLUGIN_VAR_THDLOCAL 0x0100 /* Variable is per-connection */ | | #define PLUGIN_VAR_THDLOCAL 0x0100 /* Variable is per-connection */ | |
| #define PLUGIN_VAR_READONLY 0x0200 /* Server variable is read only */ | | #define PLUGIN_VAR_READONLY 0x0200 /* Server variable is read only */ | |
| #define PLUGIN_VAR_NOSYSVAR 0x0400 /* Not a server variable */ | | #define PLUGIN_VAR_NOSYSVAR 0x0400 /* Not a server variable */ | |
| #define PLUGIN_VAR_NOCMDOPT 0x0800 /* Not a command line option */ | | #define PLUGIN_VAR_NOCMDOPT 0x0800 /* Not a command line option */ | |
| #define PLUGIN_VAR_NOCMDARG 0x1000 /* No argument for cmd line */ | | #define PLUGIN_VAR_NOCMDARG 0x1000 /* No argument for cmd line */ | |
| #define PLUGIN_VAR_RQCMDARG 0x0000 /* Argument required for cmd line */ | | #define PLUGIN_VAR_RQCMDARG 0x0000 /* Argument required for cmd line */ | |
| #define PLUGIN_VAR_OPCMDARG 0x2000 /* Argument optional for cmd line */ | | #define PLUGIN_VAR_OPCMDARG 0x2000 /* Argument optional for cmd line */ | |
| #define PLUGIN_VAR_MEMALLOC 0x8000 /* String needs memory allocated */ | | #define PLUGIN_VAR_MEMALLOC 0x8000 /* String needs memory allocated */ | |
| | | | |
| | | | |
| skipping to change at line 341 | | skipping to change at line 346 | |
| #define MYSQL_SYSVAR_ENUM(name, varname, opt, comment, check, update, def,
typelib) \ | | #define MYSQL_SYSVAR_ENUM(name, varname, opt, comment, check, update, def,
typelib) \ | |
| DECLARE_MYSQL_SYSVAR_TYPELIB(name, unsigned long) = { \ | | DECLARE_MYSQL_SYSVAR_TYPELIB(name, unsigned long) = { \ | |
| PLUGIN_VAR_ENUM | ((opt) & PLUGIN_VAR_MASK), \ | | PLUGIN_VAR_ENUM | ((opt) & PLUGIN_VAR_MASK), \ | |
| #name, comment, check, update, &varname, def, typelib } | | #name, comment, check, update, &varname, def, typelib } | |
| | | | |
| #define MYSQL_SYSVAR_SET(name, varname, opt, comment, check, update, def, t
ypelib) \ | | #define MYSQL_SYSVAR_SET(name, varname, opt, comment, check, update, def, t
ypelib) \ | |
| DECLARE_MYSQL_SYSVAR_TYPELIB(name, unsigned long long) = { \ | | DECLARE_MYSQL_SYSVAR_TYPELIB(name, unsigned long long) = { \ | |
| PLUGIN_VAR_SET | ((opt) & PLUGIN_VAR_MASK), \ | | PLUGIN_VAR_SET | ((opt) & PLUGIN_VAR_MASK), \ | |
| #name, comment, check, update, &varname, def, typelib } | | #name, comment, check, update, &varname, def, typelib } | |
| | | | |
|
| #define MYSQL_SYSVAR_DOUBLE(name, varname, opt, comment, check, update, def | | | |
| , min, max, blk) \ | | | |
| DECLARE_MYSQL_SYSVAR_SIMPLE(name, double) = { \ | | | |
| PLUGIN_VAR_DOUBLE | ((opt) & PLUGIN_VAR_MASK), \ | | | |
| #name, comment, check, update, &varname, def, min, max, blk } | | | |
| | | | |
| #define MYSQL_THDVAR_BOOL(name, opt, comment, check, update, def) \ | | #define MYSQL_THDVAR_BOOL(name, opt, comment, check, update, def) \ | |
| DECLARE_MYSQL_THDVAR_BASIC(name, char) = { \ | | DECLARE_MYSQL_THDVAR_BASIC(name, char) = { \ | |
| PLUGIN_VAR_BOOL | PLUGIN_VAR_THDLOCAL | ((opt) & PLUGIN_VAR_MASK), \ | | PLUGIN_VAR_BOOL | PLUGIN_VAR_THDLOCAL | ((opt) & PLUGIN_VAR_MASK), \ | |
| #name, comment, check, update, -1, def, NULL} | | #name, comment, check, update, -1, def, NULL} | |
| | | | |
| #define MYSQL_THDVAR_STR(name, opt, comment, check, update, def) \ | | #define MYSQL_THDVAR_STR(name, opt, comment, check, update, def) \ | |
| DECLARE_MYSQL_THDVAR_BASIC(name, char *) = { \ | | DECLARE_MYSQL_THDVAR_BASIC(name, char *) = { \ | |
| PLUGIN_VAR_STR | PLUGIN_VAR_THDLOCAL | ((opt) & PLUGIN_VAR_MASK), \ | | PLUGIN_VAR_STR | PLUGIN_VAR_THDLOCAL | ((opt) & PLUGIN_VAR_MASK), \ | |
| #name, comment, check, update, -1, def, NULL} | | #name, comment, check, update, -1, def, NULL} | |
| | | | |
| | | | |
| skipping to change at line 396 | | skipping to change at line 396 | |
| #define MYSQL_THDVAR_ENUM(name, opt, comment, check, update, def, typelib)
\ | | #define MYSQL_THDVAR_ENUM(name, opt, comment, check, update, def, typelib)
\ | |
| DECLARE_MYSQL_THDVAR_TYPELIB(name, unsigned long) = { \ | | DECLARE_MYSQL_THDVAR_TYPELIB(name, unsigned long) = { \ | |
| PLUGIN_VAR_ENUM | PLUGIN_VAR_THDLOCAL | ((opt) & PLUGIN_VAR_MASK), \ | | PLUGIN_VAR_ENUM | PLUGIN_VAR_THDLOCAL | ((opt) & PLUGIN_VAR_MASK), \ | |
| #name, comment, check, update, -1, def, NULL, typelib } | | #name, comment, check, update, -1, def, NULL, typelib } | |
| | | | |
| #define MYSQL_THDVAR_SET(name, opt, comment, check, update, def, typelib) \ | | #define MYSQL_THDVAR_SET(name, opt, comment, check, update, def, typelib) \ | |
| DECLARE_MYSQL_THDVAR_TYPELIB(name, unsigned long long) = { \ | | DECLARE_MYSQL_THDVAR_TYPELIB(name, unsigned long long) = { \ | |
| PLUGIN_VAR_SET | PLUGIN_VAR_THDLOCAL | ((opt) & PLUGIN_VAR_MASK), \ | | PLUGIN_VAR_SET | PLUGIN_VAR_THDLOCAL | ((opt) & PLUGIN_VAR_MASK), \ | |
| #name, comment, check, update, -1, def, NULL, typelib } | | #name, comment, check, update, -1, def, NULL, typelib } | |
| | | | |
|
| #define MYSQL_THDVAR_DOUBLE(name, opt, comment, check, update, def, min, ma | | | |
| x, blk) \ | | | |
| DECLARE_MYSQL_THDVAR_SIMPLE(name, double) = { \ | | | |
| PLUGIN_VAR_DOUBLE | PLUGIN_VAR_THDLOCAL | ((opt) & PLUGIN_VAR_MASK), \ | | | |
| #name, comment, check, update, -1, def, min, max, blk, NULL } | | | |
| | | | |
| /* accessor macros */ | | /* accessor macros */ | |
| | | | |
| #define SYSVAR(name) \ | | #define SYSVAR(name) \ | |
| (*(MYSQL_SYSVAR_NAME(name).value)) | | (*(MYSQL_SYSVAR_NAME(name).value)) | |
| | | | |
| /* when thd == null, result points to global value */ | | /* when thd == null, result points to global value */ | |
| #define THDVAR(thd, name) \ | | #define THDVAR(thd, name) \ | |
| (*(MYSQL_SYSVAR_NAME(name).resolve(thd, MYSQL_SYSVAR_NAME(name).offset))) | | (*(MYSQL_SYSVAR_NAME(name).resolve(thd, MYSQL_SYSVAR_NAME(name).offset))) | |
| | | | |
| /* | | /* | |
| | | | |
| skipping to change at line 422 | | skipping to change at line 417 | |
| */ | | */ | |
| | | | |
| struct st_mysql_plugin | | struct st_mysql_plugin | |
| { | | { | |
| int type; /* the plugin type (a MYSQL_XXX_PLUGIN value) */ | | int type; /* the plugin type (a MYSQL_XXX_PLUGIN value) */ | |
| void *info; /* pointer to type-specific plugin descriptor */ | | void *info; /* pointer to type-specific plugin descriptor */ | |
| const char *name; /* plugin name */ | | const char *name; /* plugin name */ | |
| const char *author; /* plugin author (for I_S.PLUGINS) */ | | const char *author; /* plugin author (for I_S.PLUGINS) */ | |
| const char *descr; /* general descriptive text (for I_S.PLUGINS) */ | | const char *descr; /* general descriptive text (for I_S.PLUGINS) */ | |
| int license; /* the plugin license (PLUGIN_LICENSE_XXX) */ | | int license; /* the plugin license (PLUGIN_LICENSE_XXX) */ | |
|
| int (*init)(void *); /* the function to invoke when plugin is loaded */ | | int (*init)(MYSQL_PLUGIN); /* the function to invoke when plugin is load | |
| int (*deinit)(void *);/* the function to invoke when plugin is unloaded * | | ed */ | |
| / | | int (*deinit)(MYSQL_PLUGIN);/* the function to invoke when plugin is unlo | |
| | | aded */ | |
| unsigned int version; /* plugin version (for I_S.PLUGINS) */ | | unsigned int version; /* plugin version (for I_S.PLUGINS) */ | |
| struct st_mysql_show_var *status_vars; | | struct st_mysql_show_var *status_vars; | |
| struct st_mysql_sys_var **system_vars; | | struct st_mysql_sys_var **system_vars; | |
| void * __reserved1; /* reserved for dependency checking */ | | void * __reserved1; /* reserved for dependency checking */ | |
| unsigned long flags; /* flags for plugin */ | | unsigned long flags; /* flags for plugin */ | |
| }; | | }; | |
| | | | |
| /************************************************************************* | | /************************************************************************* | |
| API for Full-text parser plugin. (MYSQL_FTPARSER_PLUGIN) | | API for Full-text parser plugin. (MYSQL_FTPARSER_PLUGIN) | |
| */ | | */ | |
| | | | |
| skipping to change at line 493 | | skipping to change at line 488 | |
| struct st_mysql_storage_engine | | struct st_mysql_storage_engine | |
| { | | { | |
| int interface_version; | | int interface_version; | |
| }; | | }; | |
| | | | |
| struct handlerton; | | struct handlerton; | |
| | | | |
| /* | | /* | |
| API for Replication plugin. (MYSQL_REPLICATION_PLUGIN) | | API for Replication plugin. (MYSQL_REPLICATION_PLUGIN) | |
| */ | | */ | |
|
| #define MYSQL_REPLICATION_INTERFACE_VERSION 0x0100 | | #define MYSQL_REPLICATION_INTERFACE_VERSION 0x0200 | |
| | | | |
| /** | | /** | |
| Replication plugin descriptor | | Replication plugin descriptor | |
| */ | | */ | |
| struct Mysql_replication { | | struct Mysql_replication { | |
| int interface_version; | | int interface_version; | |
| }; | | }; | |
| | | | |
| /************************************************************************* | | /************************************************************************* | |
| st_mysql_value struct for reading values from mysqld. | | st_mysql_value struct for reading values from mysqld. | |
| | | | |
| skipping to change at line 541 | | skipping to change at line 536 | |
| #endif | | #endif | |
| | | | |
| int thd_in_lock_tables(const MYSQL_THD thd); | | int thd_in_lock_tables(const MYSQL_THD thd); | |
| int thd_tablespace_op(const MYSQL_THD thd); | | int thd_tablespace_op(const MYSQL_THD thd); | |
| long long thd_test_options(const MYSQL_THD thd, long long test_options); | | long long thd_test_options(const MYSQL_THD thd, long long test_options); | |
| int thd_sql_command(const MYSQL_THD thd); | | int thd_sql_command(const MYSQL_THD thd); | |
| const char *thd_proc_info(MYSQL_THD thd, const char *info); | | const char *thd_proc_info(MYSQL_THD thd, const char *info); | |
| void **thd_ha_data(const MYSQL_THD thd, const struct handlerton *hton); | | void **thd_ha_data(const MYSQL_THD thd, const struct handlerton *hton); | |
| void thd_storage_lock_wait(MYSQL_THD thd, long long value); | | void thd_storage_lock_wait(MYSQL_THD thd, long long value); | |
| int thd_tx_isolation(const MYSQL_THD thd); | | int thd_tx_isolation(const MYSQL_THD thd); | |
|
| | | int thd_tx_is_read_only(const MYSQL_THD thd); | |
| char *thd_security_context(MYSQL_THD thd, char *buffer, unsigned int length
, | | char *thd_security_context(MYSQL_THD thd, char *buffer, unsigned int length
, | |
| unsigned int max_query_len); | | unsigned int max_query_len); | |
| /* Increments the row counter, see THD::row_count */ | | /* Increments the row counter, see THD::row_count */ | |
| void thd_inc_row_count(MYSQL_THD thd); | | void thd_inc_row_count(MYSQL_THD thd); | |
| | | | |
| /** | | /** | |
| Create a temporary file. | | Create a temporary file. | |
| | | | |
| @details | | @details | |
| The temporary file is created in a location specified by the mysql | | The temporary file is created in a location specified by the mysql | |
| | | | |
| skipping to change at line 577 | | skipping to change at line 573 | |
| time-consuming loops, and gracefully abort the operation if it is | | time-consuming loops, and gracefully abort the operation if it is | |
| non-zero. | | non-zero. | |
| | | | |
| @param thd user thread connection handle | | @param thd user thread connection handle | |
| @retval 0 the connection is active | | @retval 0 the connection is active | |
| @retval 1 the connection has been killed | | @retval 1 the connection has been killed | |
| */ | | */ | |
| int thd_killed(const MYSQL_THD thd); | | int thd_killed(const MYSQL_THD thd); | |
| | | | |
| /** | | /** | |
|
| | | Get binary log position for latest written entry. | |
| | | | |
| | | @note The file variable will be set to a buffer holding the name of | |
| | | the file name currently, but this can change if a rotation | |
| | | occur. Copy the string if you want to retain it. | |
| | | | |
| | | @param thd Use thread connection handle | |
| | | @param file_var Pointer to variable that will hold the file name. | |
| | | @param pos_var Pointer to variable that will hold the file position. | |
| | | */ | |
| | | void thd_binlog_pos(const MYSQL_THD thd, | |
| | | const char **file_var, | |
| | | unsigned long long *pos_var); | |
| | | | |
| | | /** | |
| Return the thread id of a user thread | | Return the thread id of a user thread | |
| | | | |
| @param thd user thread connection handle | | @param thd user thread connection handle | |
| @return thread id | | @return thread id | |
| */ | | */ | |
| unsigned long thd_get_thread_id(const MYSQL_THD thd); | | unsigned long thd_get_thread_id(const MYSQL_THD thd); | |
| | | | |
| /** | | /** | |
| Get the XID for this connection's transaction | | Get the XID for this connection's transaction | |
| | | | |
| | | | |
End of changes. 13 change blocks. |
| 23 lines changed or deleted | | 34 lines changed or added | |
|
| psi.h | | psi.h | |
|
| /* Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reser
ved. | | /* Copyright (c) 2008, 2012, Oracle and/or its affiliates. All rights reser
ved. | |
| | | | |
| This program is free software; you can redistribute it and/or modify | | This program is free software; you can redistribute it and/or modify | |
| it under the terms of the GNU General Public License as published by | | it under the terms of the GNU General Public License as published by | |
| the Free Software Foundation; version 2 of the License. | | the Free Software Foundation; version 2 of the License. | |
| | | | |
| This program is distributed in the hope that it will be useful, | | This program is distributed in the hope that it will be useful, | |
| but WITHOUT ANY WARRANTY; without even the implied warranty of | | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
| GNU General Public License for more details. | | GNU General Public License for more details. | |
| | | | |
| You should have received a copy of the GNU General Public License | | You should have received a copy of the GNU General Public License | |
| along with this program; if not, write to the Free Software Foundation, | | along with this program; if not, write to the Free Software Foundation, | |
| 51 Franklin Street, Suite 500, Boston, MA 02110-1335 USA */ | | 51 Franklin Street, Suite 500, Boston, MA 02110-1335 USA */ | |
| | | | |
| #ifndef MYSQL_PERFORMANCE_SCHEMA_INTERFACE_H | | #ifndef MYSQL_PERFORMANCE_SCHEMA_INTERFACE_H | |
| #define MYSQL_PERFORMANCE_SCHEMA_INTERFACE_H | | #define MYSQL_PERFORMANCE_SCHEMA_INTERFACE_H | |
| | | | |
|
| #ifndef _global_h | | #ifdef EMBEDDED_LIBRARY | |
| | | #define DISABLE_PSI_MUTEX | |
| | | #define DISABLE_PSI_RWLOCK | |
| | | #define DISABLE_PSI_COND | |
| | | #define DISABLE_PSI_FILE | |
| | | #define DISABLE_PSI_TABLE | |
| | | #define DISABLE_PSI_SOCKET | |
| | | #define DISABLE_PSI_STAGE | |
| | | #define DISABLE_PSI_STATEMENT | |
| | | #define DISABLE_PSI_IDLE | |
| | | #define DISABLE_PSI_STATEMENT_DIGEST | |
| | | #endif /* EMBEDDED_LIBRARY */ | |
| | | | |
| | | #ifndef MY_GLOBAL_INCLUDED | |
| /* | | /* | |
| Make sure a .c or .cc file contains an include to my_global.h first. | | Make sure a .c or .cc file contains an include to my_global.h first. | |
| When this include is missing, all the #ifdef HAVE_XXX have no effect, | | When this include is missing, all the #ifdef HAVE_XXX have no effect, | |
| and the resulting binary won't build, or won't link, | | and the resulting binary won't build, or won't link, | |
| or will crash at runtime | | or will crash at runtime | |
| since various structures will have different binary definitions. | | since various structures will have different binary definitions. | |
| */ | | */ | |
| #error "You must include my_global.h in the code for the build to be correc
t." | | #error "You must include my_global.h in the code for the build to be correc
t." | |
| #endif | | #endif | |
| | | | |
| C_MODE_START | | C_MODE_START | |
| | | | |
|
| | | struct TABLE_SHARE; | |
| | | /* | |
| | | There are 3 known bison parsers in the server: | |
| | | - (1) the SQL parser itself, sql/sql_yacc.yy | |
| | | - (2) storage/innobase/fts/fts0pars.y | |
| | | - (3) storage/innobase/pars/pars0grm.y | |
| | | What is instrumented here are the tokens from the SQL query text (1), | |
| | | to make digests. | |
| | | Now, to avoid name pollution and conflicts with different YYSTYPE definit | |
| | | ions, | |
| | | an opaque structure is used here. | |
| | | The real type to use when invoking the digest api is LEX_YYSTYPE. | |
| | | */ | |
| | | struct OPAQUE_LEX_YYSTYPE; | |
| | | | |
| /** | | /** | |
| @file mysql/psi/psi.h | | @file mysql/psi/psi.h | |
| Performance schema instrumentation interface. | | Performance schema instrumentation interface. | |
| | | | |
| @defgroup Instrumentation_interface Instrumentation Interface | | @defgroup Instrumentation_interface Instrumentation Interface | |
| @ingroup Performance_schema | | @ingroup Performance_schema | |
| @{ | | @{ | |
| */ | | */ | |
| | | | |
| /** | | /** | |
| Interface for an instrumented mutex. | | Interface for an instrumented mutex. | |
| This is an opaque structure. | | This is an opaque structure. | |
| */ | | */ | |
| struct PSI_mutex; | | struct PSI_mutex; | |
|
| | | typedef struct PSI_mutex PSI_mutex; | |
| | | | |
| /** | | /** | |
| Interface for an instrumented rwlock. | | Interface for an instrumented rwlock. | |
| This is an opaque structure. | | This is an opaque structure. | |
| */ | | */ | |
| struct PSI_rwlock; | | struct PSI_rwlock; | |
|
| | | typedef struct PSI_rwlock PSI_rwlock; | |
| | | | |
| /** | | /** | |
| Interface for an instrumented condition. | | Interface for an instrumented condition. | |
| This is an opaque structure. | | This is an opaque structure. | |
| */ | | */ | |
| struct PSI_cond; | | struct PSI_cond; | |
|
| | | typedef struct PSI_cond PSI_cond; | |
| | | | |
| /** | | /** | |
| Interface for an instrumented table share. | | Interface for an instrumented table share. | |
| This is an opaque structure. | | This is an opaque structure. | |
| */ | | */ | |
| struct PSI_table_share; | | struct PSI_table_share; | |
|
| | | typedef struct PSI_table_share PSI_table_share; | |
| | | | |
| /** | | /** | |
| Interface for an instrumented table handle. | | Interface for an instrumented table handle. | |
| This is an opaque structure. | | This is an opaque structure. | |
| */ | | */ | |
| struct PSI_table; | | struct PSI_table; | |
|
| | | typedef struct PSI_table PSI_table; | |
| | | | |
| /** | | /** | |
| Interface for an instrumented thread. | | Interface for an instrumented thread. | |
| This is an opaque structure. | | This is an opaque structure. | |
| */ | | */ | |
| struct PSI_thread; | | struct PSI_thread; | |
|
| | | typedef struct PSI_thread PSI_thread; | |
| | | | |
| /** | | /** | |
| Interface for an instrumented file handle. | | Interface for an instrumented file handle. | |
| This is an opaque structure. | | This is an opaque structure. | |
| */ | | */ | |
| struct PSI_file; | | struct PSI_file; | |
|
| | | typedef struct PSI_file PSI_file; | |
| | | | |
| | | /** | |
| | | Interface for an instrumented socket descriptor. | |
| | | This is an opaque structure. | |
| | | */ | |
| | | struct PSI_socket; | |
| | | typedef struct PSI_socket PSI_socket; | |
| | | | |
| | | /** | |
| | | Interface for an instrumented table operation. | |
| | | This is an opaque structure. | |
| | | */ | |
| | | struct PSI_table_locker; | |
| | | typedef struct PSI_table_locker PSI_table_locker; | |
| | | | |
| | | /** | |
| | | Interface for an instrumented statement. | |
| | | This is an opaque structure. | |
| | | */ | |
| | | struct PSI_statement_locker; | |
| | | typedef struct PSI_statement_locker PSI_statement_locker; | |
| | | | |
| | | /** | |
| | | Interface for an instrumented idle operation. | |
| | | This is an opaque structure. | |
| | | */ | |
| | | struct PSI_idle_locker; | |
| | | typedef struct PSI_idle_locker PSI_idle_locker; | |
| | | | |
| | | /** | |
| | | Interface for an instrumented statement digest operation. | |
| | | This is an opaque structure. | |
| | | */ | |
| | | struct PSI_digest_locker; | |
| | | typedef struct PSI_digest_locker PSI_digest_locker; | |
| | | | |
| /** Entry point for the performance schema interface. */ | | /** Entry point for the performance schema interface. */ | |
| struct PSI_bootstrap | | struct PSI_bootstrap | |
| { | | { | |
| /** | | /** | |
| ABI interface finder. | | ABI interface finder. | |
| Calling this method with an interface version number returns either | | Calling this method with an interface version number returns either | |
| an instance of the ABI for this version, or NULL. | | an instance of the ABI for this version, or NULL. | |
| @param version the interface version number to find | | @param version the interface version number to find | |
| @return a versioned interface (PSI_v1, PSI_v2 or PSI) | | @return a versioned interface (PSI_v1, PSI_v2 or PSI) | |
| @sa PSI_VERSION_1 | | @sa PSI_VERSION_1 | |
| @sa PSI_v1 | | @sa PSI_v1 | |
| @sa PSI_VERSION_2 | | @sa PSI_VERSION_2 | |
| @sa PSI_v2 | | @sa PSI_v2 | |
| @sa PSI_CURRENT_VERSION | | @sa PSI_CURRENT_VERSION | |
| @sa PSI | | @sa PSI | |
| */ | | */ | |
| void* (*get_interface)(int version); | | void* (*get_interface)(int version); | |
| }; | | }; | |
|
| | | typedef struct PSI_bootstrap PSI_bootstrap; | |
| | | | |
| #ifdef HAVE_PSI_INTERFACE | | #ifdef HAVE_PSI_INTERFACE | |
| | | | |
| /** | | /** | |
|
| | | @def DISABLE_PSI_MUTEX | |
| | | Compiling option to disable the mutex instrumentation. | |
| | | This option is mostly intended to be used during development, | |
| | | when doing special builds with only a subset of the performance schema in | |
| | | strumentation, | |
| | | for code analysis / profiling / performance tuning of a specific instrume | |
| | | ntation alone. | |
| | | For this reason, DISABLE_PSI_MUTEX is not advertised in the cmake general | |
| | | options. | |
| | | To disable mutexes, add -DDISABLE_PSI_MUTEX to CFLAGS. | |
| | | @sa DISABLE_PSI_RWLOCK | |
| | | @sa DISABLE_PSI_COND | |
| | | @sa DISABLE_PSI_FILE | |
| | | @sa DISABLE_PSI_THREAD | |
| | | @sa DISABLE_PSI_TABLE | |
| | | @sa DISABLE_PSI_STAGE | |
| | | @sa DISABLE_PSI_STATEMENT | |
| | | @sa DISABLE_PSI_SOCKET | |
| | | @sa DISABLE_PSI_IDLE | |
| | | */ | |
| | | | |
| | | #ifndef DISABLE_PSI_MUTEX | |
| | | #define HAVE_PSI_MUTEX_INTERFACE | |
| | | #endif | |
| | | | |
| | | /** | |
| | | @def DISABLE_PSI_RWLOCK | |
| | | Compiling option to disable the rwlock instrumentation. | |
| | | @sa DISABLE_PSI_MUTEX | |
| | | */ | |
| | | | |
| | | #ifndef DISABLE_PSI_RWLOCK | |
| | | #define HAVE_PSI_RWLOCK_INTERFACE | |
| | | #endif | |
| | | | |
| | | /** | |
| | | @def DISABLE_PSI_COND | |
| | | Compiling option to disable the cond instrumentation. | |
| | | @sa DISABLE_PSI_MUTEX | |
| | | */ | |
| | | | |
| | | #ifndef DISABLE_PSI_COND | |
| | | #define HAVE_PSI_COND_INTERFACE | |
| | | #endif | |
| | | | |
| | | /** | |
| | | @def DISABLE_PSI_FILE | |
| | | Compiling option to disable the file instrumentation. | |
| | | @sa DISABLE_PSI_MUTEX | |
| | | */ | |
| | | | |
| | | #ifndef DISABLE_PSI_FILE | |
| | | #define HAVE_PSI_FILE_INTERFACE | |
| | | #endif | |
| | | | |
| | | /** | |
| | | @def DISABLE_PSI_THREAD | |
| | | Compiling option to disable the thread instrumentation. | |
| | | @sa DISABLE_PSI_MUTEX | |
| | | */ | |
| | | #ifndef DISABLE_PSI_THREAD | |
| | | #define HAVE_PSI_THREAD_INTERFACE | |
| | | #endif | |
| | | | |
| | | /** | |
| | | @def DISABLE_PSI_TABLE | |
| | | Compiling option to disable the table instrumentation. | |
| | | @sa DISABLE_PSI_MUTEX | |
| | | */ | |
| | | | |
| | | #ifndef DISABLE_PSI_TABLE | |
| | | #define HAVE_PSI_TABLE_INTERFACE | |
| | | #endif | |
| | | | |
| | | /** | |
| | | @def DISABLE_PSI_STAGE | |
| | | Compiling option to disable the stage instrumentation. | |
| | | @sa DISABLE_PSI_MUTEX | |
| | | */ | |
| | | | |
| | | #ifndef DISABLE_PSI_STAGE | |
| | | #define HAVE_PSI_STAGE_INTERFACE | |
| | | #endif | |
| | | | |
| | | /** | |
| | | @def DISABLE_PSI_STATEMENT | |
| | | Compiling option to disable the statement instrumentation. | |
| | | @sa DISABLE_PSI_MUTEX | |
| | | */ | |
| | | | |
| | | #ifndef DISABLE_PSI_STATEMENT | |
| | | #define HAVE_PSI_STATEMENT_INTERFACE | |
| | | #endif | |
| | | | |
| | | /** | |
| | | @def DISABLE_PSI_STATEMENT_DIGEST | |
| | | Compiling option to disable the statement digest instrumentation. | |
| | | */ | |
| | | | |
| | | #ifndef DISABLE_PSI_STATEMENT | |
| | | #ifndef DISABLE_PSI_STATEMENT_DIGEST | |
| | | #define HAVE_PSI_STATEMENT_DIGEST_INTERFACE | |
| | | #endif | |
| | | #endif | |
| | | | |
| | | /** | |
| | | @def DISABLE_PSI_SOCKET | |
| | | Compiling option to disable the statement instrumentation. | |
| | | @sa DISABLE_PSI_MUTEX | |
| | | */ | |
| | | | |
| | | #ifndef DISABLE_PSI_SOCKET | |
| | | #define HAVE_PSI_SOCKET_INTERFACE | |
| | | #endif | |
| | | | |
| | | /** | |
| | | @def DISABLE_PSI_IDLE | |
| | | Compiling option to disable the idle instrumentation. | |
| | | @sa DISABLE_PSI_MUTEX | |
| | | */ | |
| | | | |
| | | #ifndef DISABLE_PSI_IDLE | |
| | | #define HAVE_PSI_IDLE_INTERFACE | |
| | | #endif | |
| | | | |
| | | /** | |
| @def PSI_VERSION_1 | | @def PSI_VERSION_1 | |
| Performance Schema Interface number for version 1. | | Performance Schema Interface number for version 1. | |
| This version is supported. | | This version is supported. | |
| */ | | */ | |
| #define PSI_VERSION_1 1 | | #define PSI_VERSION_1 1 | |
| | | | |
| /** | | /** | |
| @def PSI_VERSION_2 | | @def PSI_VERSION_2 | |
| Performance Schema Interface number for version 2. | | Performance Schema Interface number for version 2. | |
| This version is not implemented, it's a placeholder. | | This version is not implemented, it's a placeholder. | |
| | | | |
| skipping to change at line 136 | | skipping to change at line 329 | |
| #ifndef USE_PSI_1 | | #ifndef USE_PSI_1 | |
| #define USE_PSI_1 | | #define USE_PSI_1 | |
| #endif | | #endif | |
| #endif | | #endif | |
| | | | |
| /** | | /** | |
| Interface for an instrumented mutex operation. | | Interface for an instrumented mutex operation. | |
| This is an opaque structure. | | This is an opaque structure. | |
| */ | | */ | |
| struct PSI_mutex_locker; | | struct PSI_mutex_locker; | |
|
| | | typedef struct PSI_mutex_locker PSI_mutex_locker; | |
| | | | |
| /** | | /** | |
| Interface for an instrumented rwlock operation. | | Interface for an instrumented rwlock operation. | |
| This is an opaque structure. | | This is an opaque structure. | |
| */ | | */ | |
|
| | | | |
| struct PSI_rwlock_locker; | | struct PSI_rwlock_locker; | |
|
| | | typedef struct PSI_rwlock_locker PSI_rwlock_locker; | |
| | | | |
| /** | | /** | |
| Interface for an instrumented condition operation. | | Interface for an instrumented condition operation. | |
| This is an opaque structure. | | This is an opaque structure. | |
| */ | | */ | |
|
| | | | |
| struct PSI_cond_locker; | | struct PSI_cond_locker; | |
|
| | | typedef struct PSI_cond_locker PSI_cond_locker; | |
| | | | |
| /** | | /** | |
| Interface for an instrumented file operation. | | Interface for an instrumented file operation. | |
| This is an opaque structure. | | This is an opaque structure. | |
| */ | | */ | |
| struct PSI_file_locker; | | struct PSI_file_locker; | |
|
| | | typedef struct PSI_file_locker PSI_file_locker; | |
| | | | |
| | | /** | |
| | | Interface for an instrumented socket operation. | |
| | | This is an opaque structure. | |
| | | */ | |
| | | struct PSI_socket_locker; | |
| | | typedef struct PSI_socket_locker PSI_socket_locker; | |
| | | | |
| /** Operation performed on an instrumented mutex. */ | | /** Operation performed on an instrumented mutex. */ | |
| enum PSI_mutex_operation | | enum PSI_mutex_operation | |
| { | | { | |
| /** Lock. */ | | /** Lock. */ | |
| PSI_MUTEX_LOCK= 0, | | PSI_MUTEX_LOCK= 0, | |
| /** Lock attempt. */ | | /** Lock attempt. */ | |
| PSI_MUTEX_TRYLOCK= 1 | | PSI_MUTEX_TRYLOCK= 1 | |
| }; | | }; | |
|
| | | typedef enum PSI_mutex_operation PSI_mutex_operation; | |
| | | | |
| /** Operation performed on an instrumented rwlock. */ | | /** Operation performed on an instrumented rwlock. */ | |
| enum PSI_rwlock_operation | | enum PSI_rwlock_operation | |
| { | | { | |
| /** Read lock. */ | | /** Read lock. */ | |
| PSI_RWLOCK_READLOCK= 0, | | PSI_RWLOCK_READLOCK= 0, | |
| /** Write lock. */ | | /** Write lock. */ | |
| PSI_RWLOCK_WRITELOCK= 1, | | PSI_RWLOCK_WRITELOCK= 1, | |
| /** Read lock attempt. */ | | /** Read lock attempt. */ | |
| PSI_RWLOCK_TRYREADLOCK= 2, | | PSI_RWLOCK_TRYREADLOCK= 2, | |
| /** Write lock attempt. */ | | /** Write lock attempt. */ | |
| PSI_RWLOCK_TRYWRITELOCK= 3 | | PSI_RWLOCK_TRYWRITELOCK= 3 | |
| }; | | }; | |
|
| | | typedef enum PSI_rwlock_operation PSI_rwlock_operation; | |
| | | | |
| /** Operation performed on an instrumented condition. */ | | /** Operation performed on an instrumented condition. */ | |
| enum PSI_cond_operation | | enum PSI_cond_operation | |
| { | | { | |
| /** Wait. */ | | /** Wait. */ | |
| PSI_COND_WAIT= 0, | | PSI_COND_WAIT= 0, | |
| /** Wait, with timeout. */ | | /** Wait, with timeout. */ | |
| PSI_COND_TIMEDWAIT= 1 | | PSI_COND_TIMEDWAIT= 1 | |
| }; | | }; | |
|
| | | typedef enum PSI_cond_operation PSI_cond_operation; | |
| | | | |
| /** Operation performed on an instrumented file. */ | | /** Operation performed on an instrumented file. */ | |
| enum PSI_file_operation | | enum PSI_file_operation | |
| { | | { | |
| /** File creation, as in @c create(). */ | | /** File creation, as in @c create(). */ | |
| PSI_FILE_CREATE= 0, | | PSI_FILE_CREATE= 0, | |
| /** Temporary file creation, as in @c create_temp_file(). */ | | /** Temporary file creation, as in @c create_temp_file(). */ | |
| PSI_FILE_CREATE_TMP= 1, | | PSI_FILE_CREATE_TMP= 1, | |
| /** File open, as in @c open(). */ | | /** File open, as in @c open(). */ | |
| PSI_FILE_OPEN= 2, | | PSI_FILE_OPEN= 2, | |
| | | | |
| skipping to change at line 231 | | skipping to change at line 437 | |
| PSI_FILE_FSTAT= 12, | | PSI_FILE_FSTAT= 12, | |
| /** File chsize, as in @c my_chsize(). */ | | /** File chsize, as in @c my_chsize(). */ | |
| PSI_FILE_CHSIZE= 13, | | PSI_FILE_CHSIZE= 13, | |
| /** File delete, such as @c my_delete() or @c my_delete_with_symlink(). *
/ | | /** File delete, such as @c my_delete() or @c my_delete_with_symlink(). *
/ | |
| PSI_FILE_DELETE= 14, | | PSI_FILE_DELETE= 14, | |
| /** File rename, such as @c my_rename() or @c my_rename_with_symlink(). *
/ | | /** File rename, such as @c my_rename() or @c my_rename_with_symlink(). *
/ | |
| PSI_FILE_RENAME= 15, | | PSI_FILE_RENAME= 15, | |
| /** File sync, as in @c fsync() or @c my_sync(). */ | | /** File sync, as in @c fsync() or @c my_sync(). */ | |
| PSI_FILE_SYNC= 16 | | PSI_FILE_SYNC= 16 | |
| }; | | }; | |
|
| | | typedef enum PSI_file_operation PSI_file_operation; | |
| | | | |
|
| /** | | /** IO operation performed on an instrumented table. */ | |
| Interface for an instrumented table operation. | | enum PSI_table_io_operation | |
| This is an opaque structure. | | { | |
| */ | | /** Row fetch. */ | |
| struct PSI_table_locker; | | PSI_TABLE_FETCH_ROW= 0, | |
| | | /** Row write. */ | |
| | | PSI_TABLE_WRITE_ROW= 1, | |
| | | /** Row update. */ | |
| | | PSI_TABLE_UPDATE_ROW= 2, | |
| | | /** Row delete. */ | |
| | | PSI_TABLE_DELETE_ROW= 3 | |
| | | }; | |
| | | typedef enum PSI_table_io_operation PSI_table_io_operation; | |
| | | | |
| | | /** Lock operation performed on an instrumented table. */ | |
| | | enum PSI_table_lock_operation | |
| | | { | |
| | | /** Table lock, in the server layer. */ | |
| | | PSI_TABLE_LOCK= 0, | |
| | | /** Table lock, in the storage engine layer. */ | |
| | | PSI_TABLE_EXTERNAL_LOCK= 1 | |
| | | }; | |
| | | typedef enum PSI_table_lock_operation PSI_table_lock_operation; | |
| | | | |
| | | /** State of an instrumented socket. */ | |
| | | enum PSI_socket_state | |
| | | { | |
| | | /** Idle, waiting for the next command. */ | |
| | | PSI_SOCKET_STATE_IDLE= 1, | |
| | | /** Active, executing a command. */ | |
| | | PSI_SOCKET_STATE_ACTIVE= 2 | |
| | | }; | |
| | | typedef enum PSI_socket_state PSI_socket_state; | |
| | | | |
| | | /** Operation performed on an instrumented socket. */ | |
| | | enum PSI_socket_operation | |
| | | { | |
| | | /** Socket creation, as in @c socket() or @c socketpair(). */ | |
| | | PSI_SOCKET_CREATE= 0, | |
| | | /** Socket connection, as in @c connect(), @c listen() and @c accept(). * | |
| | | / | |
| | | PSI_SOCKET_CONNECT= 1, | |
| | | /** Socket bind, as in @c bind(), @c getsockname() and @c getpeername(). | |
| | | */ | |
| | | PSI_SOCKET_BIND= 2, | |
| | | /** Socket close, as in @c shutdown(). */ | |
| | | PSI_SOCKET_CLOSE= 3, | |
| | | /** Socket send, @c send(). */ | |
| | | PSI_SOCKET_SEND= 4, | |
| | | /** Socket receive, @c recv(). */ | |
| | | PSI_SOCKET_RECV= 5, | |
| | | /** Socket send, @c sendto(). */ | |
| | | PSI_SOCKET_SENDTO= 6, | |
| | | /** Socket receive, @c recvfrom). */ | |
| | | PSI_SOCKET_RECVFROM= 7, | |
| | | /** Socket send, @c sendmsg(). */ | |
| | | PSI_SOCKET_SENDMSG= 8, | |
| | | /** Socket receive, @c recvmsg(). */ | |
| | | PSI_SOCKET_RECVMSG= 9, | |
| | | /** Socket seek, such as @c fseek() or @c seek(). */ | |
| | | PSI_SOCKET_SEEK= 10, | |
| | | /** Socket options, as in @c getsockopt() and @c setsockopt(). */ | |
| | | PSI_SOCKET_OPT= 11, | |
| | | /** Socket status, as in @c sockatmark() and @c isfdtype(). */ | |
| | | PSI_SOCKET_STAT= 12, | |
| | | /** Socket shutdown, as in @c shutdown(). */ | |
| | | PSI_SOCKET_SHUTDOWN= 13, | |
| | | /** Socket select, as in @c select() and @c poll(). */ | |
| | | PSI_SOCKET_SELECT= 14 | |
| | | }; | |
| | | typedef enum PSI_socket_operation PSI_socket_operation; | |
| | | | |
| /** | | /** | |
| Instrumented mutex key. | | Instrumented mutex key. | |
| To instrument a mutex, a mutex key must be obtained using @c register_mut
ex. | | To instrument a mutex, a mutex key must be obtained using @c register_mut
ex. | |
| Using a zero key always disable the instrumentation. | | Using a zero key always disable the instrumentation. | |
| */ | | */ | |
| typedef unsigned int PSI_mutex_key; | | typedef unsigned int PSI_mutex_key; | |
| | | | |
| /** | | /** | |
| Instrumented rwlock key. | | Instrumented rwlock key. | |
| | | | |
| skipping to change at line 277 | | skipping to change at line 548 | |
| typedef unsigned int PSI_thread_key; | | typedef unsigned int PSI_thread_key; | |
| | | | |
| /** | | /** | |
| Instrumented file key. | | Instrumented file key. | |
| To instrument a file, a file key must be obtained using @c register_file. | | To instrument a file, a file key must be obtained using @c register_file. | |
| Using a zero key always disable the instrumentation. | | Using a zero key always disable the instrumentation. | |
| */ | | */ | |
| typedef unsigned int PSI_file_key; | | typedef unsigned int PSI_file_key; | |
| | | | |
| /** | | /** | |
|
| | | Instrumented stage key. | |
| | | To instrument a stage, a stage key must be obtained using @c register_sta | |
| | | ge. | |
| | | Using a zero key always disable the instrumentation. | |
| | | */ | |
| | | typedef unsigned int PSI_stage_key; | |
| | | | |
| | | /** | |
| | | Instrumented statement key. | |
| | | To instrument a statement, a statement key must be obtained using @c regi | |
| | | ster_statement. | |
| | | Using a zero key always disable the instrumentation. | |
| | | */ | |
| | | typedef unsigned int PSI_statement_key; | |
| | | | |
| | | /** | |
| | | Instrumented socket key. | |
| | | To instrument a socket, a socket key must be obtained using @c register_s | |
| | | ocket. | |
| | | Using a zero key always disable the instrumentation. | |
| | | */ | |
| | | typedef unsigned int PSI_socket_key; | |
| | | | |
| | | /** | |
| @def USE_PSI_1 | | @def USE_PSI_1 | |
| Define USE_PSI_1 to use the interface version 1. | | Define USE_PSI_1 to use the interface version 1. | |
| */ | | */ | |
| | | | |
| /** | | /** | |
| @def USE_PSI_2 | | @def USE_PSI_2 | |
| Define USE_PSI_2 to use the interface version 2. | | Define USE_PSI_2 to use the interface version 2. | |
| */ | | */ | |
| | | | |
| /** | | /** | |
| | | | |
| skipping to change at line 303 | | skipping to change at line 595 | |
| Define HAVE_PSI_2 if the interface version 2 needs to be compiled in. | | Define HAVE_PSI_2 if the interface version 2 needs to be compiled in. | |
| */ | | */ | |
| | | | |
| /** | | /** | |
| Global flag. | | Global flag. | |
| This flag indicate that an instrumentation point is a global variable, | | This flag indicate that an instrumentation point is a global variable, | |
| or a singleton. | | or a singleton. | |
| */ | | */ | |
| #define PSI_FLAG_GLOBAL (1 << 0) | | #define PSI_FLAG_GLOBAL (1 << 0) | |
| | | | |
|
| | | /** | |
| | | Global flag. | |
| | | This flag indicate that an instrumentation point is a general placeholder | |
| | | , | |
| | | that can mutate into a more specific instrumentation point. | |
| | | */ | |
| | | #define PSI_FLAG_MUTABLE (1 << 1) | |
| | | | |
| #ifdef USE_PSI_1 | | #ifdef USE_PSI_1 | |
| #define HAVE_PSI_1 | | #define HAVE_PSI_1 | |
| #endif | | #endif | |
| | | | |
| #ifdef HAVE_PSI_1 | | #ifdef HAVE_PSI_1 | |
| | | | |
| /** | | /** | |
| @defgroup Group_PSI_v1 Application Binary Interface, version 1 | | @defgroup Group_PSI_v1 Application Binary Interface, version 1 | |
| @ingroup Instrumentation_interface | | @ingroup Instrumentation_interface | |
| @{ | | @{ | |
| | | | |
| skipping to change at line 426 | | skipping to change at line 725 | |
| */ | | */ | |
| const char *m_name; | | const char *m_name; | |
| /** | | /** | |
| The flags of the file instrument to register. | | The flags of the file instrument to register. | |
| @sa PSI_FLAG_GLOBAL | | @sa PSI_FLAG_GLOBAL | |
| */ | | */ | |
| int m_flags; | | int m_flags; | |
| }; | | }; | |
| | | | |
| /** | | /** | |
|
| State data storage for @c get_thread_mutex_locker_v1_t. | | Stage instrument information. | |
| | | @since PSI_VERSION_1 | |
| | | This structure is used to register an instrumented stage. | |
| | | */ | |
| | | struct PSI_stage_info_v1 | |
| | | { | |
| | | /** The registered stage key. */ | |
| | | PSI_stage_key m_key; | |
| | | /** The name of the stage instrument to register. */ | |
| | | const char *m_name; | |
| | | /** The flags of the stage instrument to register. */ | |
| | | int m_flags; | |
| | | }; | |
| | | | |
| | | /** | |
| | | Statement instrument information. | |
| | | @since PSI_VERSION_1 | |
| | | This structure is used to register an instrumented statement. | |
| | | */ | |
| | | struct PSI_statement_info_v1 | |
| | | { | |
| | | /** The registered statement key. */ | |
| | | PSI_statement_key m_key; | |
| | | /** The name of the statement instrument to register. */ | |
| | | const char *m_name; | |
| | | /** The flags of the statement instrument to register. */ | |
| | | int m_flags; | |
| | | }; | |
| | | | |
| | | /** | |
| | | Socket instrument information. | |
| | | @since PSI_VERSION_1 | |
| | | This structure is used to register an instrumented socket. | |
| | | */ | |
| | | struct PSI_socket_info_v1 | |
| | | { | |
| | | /** | |
| | | Pointer to the key assigned to the registered socket. | |
| | | */ | |
| | | PSI_socket_key *m_key; | |
| | | /** | |
| | | The name of the socket instrument to register. | |
| | | */ | |
| | | const char *m_name; | |
| | | /** | |
| | | The flags of the socket instrument to register. | |
| | | @sa PSI_FLAG_GLOBAL | |
| | | */ | |
| | | int m_flags; | |
| | | }; | |
| | | | |
| | | /** | |
| | | State data storage for @c start_idle_wait_v1_t. | |
| | | This structure provide temporary storage to an idle locker. | |
| | | The content of this structure is considered opaque, | |
| | | the fields are only hints of what an implementation | |
| | | of the psi interface can use. | |
| | | This memory is provided by the instrumented code for performance reasons. | |
| | | @sa start_idle_wait_v1_t. | |
| | | */ | |
| | | struct PSI_idle_locker_state_v1 | |
| | | { | |
| | | /** Internal state. */ | |
| | | uint m_flags; | |
| | | /** Current thread. */ | |
| | | struct PSI_thread *m_thread; | |
| | | /** Timer start. */ | |
| | | ulonglong m_timer_start; | |
| | | /** Timer function. */ | |
| | | ulonglong (*m_timer)(void); | |
| | | /** Internal data. */ | |
| | | void *m_wait; | |
| | | }; | |
| | | | |
| | | /** | |
| | | State data storage for @c start_mutex_wait_v1_t. | |
| This structure provide temporary storage to a mutex locker. | | This structure provide temporary storage to a mutex locker. | |
| The content of this structure is considered opaque, | | The content of this structure is considered opaque, | |
| the fields are only hints of what an implementation | | the fields are only hints of what an implementation | |
| of the psi interface can use. | | of the psi interface can use. | |
| This memory is provided by the instrumented code for performance reasons. | | This memory is provided by the instrumented code for performance reasons. | |
|
| @sa get_thread_mutex_locker_v1_t | | @sa start_mutex_wait_v1_t | |
| */ | | */ | |
| struct PSI_mutex_locker_state_v1 | | struct PSI_mutex_locker_state_v1 | |
| { | | { | |
| /** Internal state. */ | | /** Internal state. */ | |
| uint m_flags; | | uint m_flags; | |
|
| | | /** Current operation. */ | |
| | | enum PSI_mutex_operation m_operation; | |
| /** Current mutex. */ | | /** Current mutex. */ | |
| struct PSI_mutex *m_mutex; | | struct PSI_mutex *m_mutex; | |
| /** Current thread. */ | | /** Current thread. */ | |
| struct PSI_thread *m_thread; | | struct PSI_thread *m_thread; | |
| /** Timer start. */ | | /** Timer start. */ | |
| ulonglong m_timer_start; | | ulonglong m_timer_start; | |
| /** Timer function. */ | | /** Timer function. */ | |
| ulonglong (*m_timer)(void); | | ulonglong (*m_timer)(void); | |
|
| /** Current operation. */ | | | |
| enum PSI_mutex_operation m_operation; | | | |
| /** Source file. */ | | | |
| const char* m_src_file; | | | |
| /** Source line number. */ | | | |
| int m_src_line; | | | |
| /** Internal data. */ | | /** Internal data. */ | |
| void *m_wait; | | void *m_wait; | |
| }; | | }; | |
| | | | |
| /** | | /** | |
|
| State data storage for @c get_thread_rwlock_locker_v1_t. | | State data storage for @c start_rwlock_rdwait_v1_t, @c start_rwlock_wrwai
t_v1_t. | |
| This structure provide temporary storage to a rwlock locker. | | This structure provide temporary storage to a rwlock locker. | |
| The content of this structure is considered opaque, | | The content of this structure is considered opaque, | |
| the fields are only hints of what an implementation | | the fields are only hints of what an implementation | |
| of the psi interface can use. | | of the psi interface can use. | |
| This memory is provided by the instrumented code for performance reasons. | | This memory is provided by the instrumented code for performance reasons. | |
|
| @sa get_thread_rwlock_locker_v1_t | | @sa start_rwlock_rdwait_v1_t | |
| | | @sa start_rwlock_wrwait_v1_t | |
| */ | | */ | |
| struct PSI_rwlock_locker_state_v1 | | struct PSI_rwlock_locker_state_v1 | |
| { | | { | |
| /** Internal state. */ | | /** Internal state. */ | |
| uint m_flags; | | uint m_flags; | |
|
| | | /** Current operation. */ | |
| | | enum PSI_rwlock_operation m_operation; | |
| /** Current rwlock. */ | | /** Current rwlock. */ | |
| struct PSI_rwlock *m_rwlock; | | struct PSI_rwlock *m_rwlock; | |
| /** Current thread. */ | | /** Current thread. */ | |
| struct PSI_thread *m_thread; | | struct PSI_thread *m_thread; | |
| /** Timer start. */ | | /** Timer start. */ | |
| ulonglong m_timer_start; | | ulonglong m_timer_start; | |
| /** Timer function. */ | | /** Timer function. */ | |
| ulonglong (*m_timer)(void); | | ulonglong (*m_timer)(void); | |
|
| /** Current operation. */ | | | |
| enum PSI_rwlock_operation m_operation; | | | |
| /** Source file. */ | | | |
| const char* m_src_file; | | | |
| /** Source line number. */ | | | |
| int m_src_line; | | | |
| /** Internal data. */ | | /** Internal data. */ | |
| void *m_wait; | | void *m_wait; | |
| }; | | }; | |
| | | | |
| /** | | /** | |
|
| State data storage for @c get_thread_cond_locker_v1_t. | | State data storage for @c start_cond_wait_v1_t. | |
| This structure provide temporary storage to a condition locker. | | This structure provide temporary storage to a condition locker. | |
| The content of this structure is considered opaque, | | The content of this structure is considered opaque, | |
| the fields are only hints of what an implementation | | the fields are only hints of what an implementation | |
| of the psi interface can use. | | of the psi interface can use. | |
| This memory is provided by the instrumented code for performance reasons. | | This memory is provided by the instrumented code for performance reasons. | |
|
| @sa get_thread_cond_locker_v1_t | | @sa start_cond_wait_v1_t | |
| */ | | */ | |
| struct PSI_cond_locker_state_v1 | | struct PSI_cond_locker_state_v1 | |
| { | | { | |
| /** Internal state. */ | | /** Internal state. */ | |
| uint m_flags; | | uint m_flags; | |
|
| | | /** Current operation. */ | |
| | | enum PSI_cond_operation m_operation; | |
| /** Current condition. */ | | /** Current condition. */ | |
| struct PSI_cond *m_cond; | | struct PSI_cond *m_cond; | |
| /** Current mutex. */ | | /** Current mutex. */ | |
| struct PSI_mutex *m_mutex; | | struct PSI_mutex *m_mutex; | |
| /** Current thread. */ | | /** Current thread. */ | |
| struct PSI_thread *m_thread; | | struct PSI_thread *m_thread; | |
| /** Timer start. */ | | /** Timer start. */ | |
| ulonglong m_timer_start; | | ulonglong m_timer_start; | |
| /** Timer function. */ | | /** Timer function. */ | |
| ulonglong (*m_timer)(void); | | ulonglong (*m_timer)(void); | |
|
| /** Current operation. */ | | | |
| enum PSI_cond_operation m_operation; | | | |
| /** Source file. */ | | | |
| const char* m_src_file; | | | |
| /** Source line number. */ | | | |
| int m_src_line; | | | |
| /** Internal data. */ | | /** Internal data. */ | |
| void *m_wait; | | void *m_wait; | |
| }; | | }; | |
| | | | |
| /** | | /** | |
| State data storage for @c get_thread_file_name_locker_v1_t. | | State data storage for @c get_thread_file_name_locker_v1_t. | |
| This structure provide temporary storage to a file locker. | | This structure provide temporary storage to a file locker. | |
| The content of this structure is considered opaque, | | The content of this structure is considered opaque, | |
| the fields are only hints of what an implementation | | the fields are only hints of what an implementation | |
| of the psi interface can use. | | of the psi interface can use. | |
| This memory is provided by the instrumented code for performance reasons. | | This memory is provided by the instrumented code for performance reasons. | |
| @sa get_thread_file_name_locker_v1_t | | @sa get_thread_file_name_locker_v1_t | |
| @sa get_thread_file_stream_locker_v1_t | | @sa get_thread_file_stream_locker_v1_t | |
| @sa get_thread_file_descriptor_locker_v1_t | | @sa get_thread_file_descriptor_locker_v1_t | |
| */ | | */ | |
| struct PSI_file_locker_state_v1 | | struct PSI_file_locker_state_v1 | |
| { | | { | |
| /** Internal state. */ | | /** Internal state. */ | |
| uint m_flags; | | uint m_flags; | |
|
| | | /** Current operation. */ | |
| | | enum PSI_file_operation m_operation; | |
| /** Current file. */ | | /** Current file. */ | |
| struct PSI_file *m_file; | | struct PSI_file *m_file; | |
|
| | | /** Current file name. */ | |
| | | const char *m_name; | |
| | | /** Current file class. */ | |
| | | void *m_class; | |
| /** Current thread. */ | | /** Current thread. */ | |
| struct PSI_thread *m_thread; | | struct PSI_thread *m_thread; | |
| /** Operation number of bytes. */ | | /** Operation number of bytes. */ | |
| size_t m_number_of_bytes; | | size_t m_number_of_bytes; | |
| /** Timer start. */ | | /** Timer start. */ | |
| ulonglong m_timer_start; | | ulonglong m_timer_start; | |
| /** Timer function. */ | | /** Timer function. */ | |
| ulonglong (*m_timer)(void); | | ulonglong (*m_timer)(void); | |
|
| /** Current operation. */ | | | |
| enum PSI_file_operation m_operation; | | | |
| /** Source file. */ | | | |
| const char* m_src_file; | | | |
| /** Source line number. */ | | | |
| int m_src_line; | | | |
| /** Internal data. */ | | /** Internal data. */ | |
| void *m_wait; | | void *m_wait; | |
| }; | | }; | |
| | | | |
| /** | | /** | |
|
| State data storage for @c get_thread_table_locker_v1_t. | | State data storage for @c start_table_io_wait_v1_t, | |
| | | @c start_table_lock_wait_v1_t. | |
| This structure provide temporary storage to a table locker. | | This structure provide temporary storage to a table locker. | |
| The content of this structure is considered opaque, | | The content of this structure is considered opaque, | |
| the fields are only hints of what an implementation | | the fields are only hints of what an implementation | |
| of the psi interface can use. | | of the psi interface can use. | |
| This memory is provided by the instrumented code for performance reasons. | | This memory is provided by the instrumented code for performance reasons. | |
|
| @sa get_thread_table_locker_v1_t | | @sa start_table_io_wait_v1_t | |
| | | @sa start_table_lock_wait_v1_t | |
| */ | | */ | |
| struct PSI_table_locker_state_v1 | | struct PSI_table_locker_state_v1 | |
| { | | { | |
| /** Internal state. */ | | /** Internal state. */ | |
| uint m_flags; | | uint m_flags; | |
|
| | | /** Current io operation. */ | |
| | | enum PSI_table_io_operation m_io_operation; | |
| /** Current table handle. */ | | /** Current table handle. */ | |
| struct PSI_table *m_table; | | struct PSI_table *m_table; | |
| /** Current table share. */ | | /** Current table share. */ | |
| struct PSI_table_share *m_table_share; | | struct PSI_table_share *m_table_share; | |
|
| | | /** Current thread. */ | |
| | | struct PSI_thread *m_thread; | |
| | | /** Timer start. */ | |
| | | ulonglong m_timer_start; | |
| | | /** Timer function. */ | |
| | | ulonglong (*m_timer)(void); | |
| | | /** Internal data. */ | |
| | | void *m_wait; | |
| | | /** | |
| | | Implementation specific. | |
| | | For table io, the table io index. | |
| | | For table lock, the lock type. | |
| | | */ | |
| | | uint m_index; | |
| | | }; | |
| | | | |
| | | #define PSI_MAX_DIGEST_STORAGE_SIZE 1024 | |
| | | | |
| | | /** | |
| | | Structure to store token count/array for a statement | |
| | | on which digest is to be calculated. | |
| | | */ | |
| | | struct PSI_digest_storage | |
| | | { | |
| | | my_bool m_full; | |
| | | int m_byte_count; | |
| | | /** Character set number. */ | |
| | | uint m_charset_number; | |
| | | unsigned char m_token_array[PSI_MAX_DIGEST_STORAGE_SIZE]; | |
| | | }; | |
| | | typedef struct PSI_digest_storage PSI_digest_storage; | |
| | | | |
| | | struct PSI_digest_locker_state | |
| | | { | |
| | | int m_last_id_index; | |
| | | PSI_digest_storage m_digest_storage; | |
| | | }; | |
| | | typedef struct PSI_digest_locker_state PSI_digest_locker_state; | |
| | | | |
| | | /* Duplicate of NAME_LEN, to avoid dependency on mysql_com.h */ | |
| | | #define PSI_SCHEMA_NAME_LEN (64 * 3) | |
| | | | |
| | | /** | |
| | | State data storage for @c get_thread_statement_locker_v1_t, | |
| | | @c get_thread_statement_locker_v1_t. | |
| | | This structure provide temporary storage to a statement locker. | |
| | | The content of this structure is considered opaque, | |
| | | the fields are only hints of what an implementation | |
| | | of the psi interface can use. | |
| | | This memory is provided by the instrumented code for performance reasons. | |
| | | @sa get_thread_statement_locker_v1_t | |
| | | */ | |
| | | struct PSI_statement_locker_state_v1 | |
| | | { | |
| | | /** Discarded flag. */ | |
| | | my_bool m_discarded; | |
| | | /** Metric, no index used flag. */ | |
| | | uchar m_no_index_used; | |
| | | /** Metric, no good index used flag. */ | |
| | | uchar m_no_good_index_used; | |
| | | /** Internal state. */ | |
| | | uint m_flags; | |
| /** Instrumentation class. */ | | /** Instrumentation class. */ | |
| void *m_class; | | void *m_class; | |
| /** Current thread. */ | | /** Current thread. */ | |
| struct PSI_thread *m_thread; | | struct PSI_thread *m_thread; | |
| /** Timer start. */ | | /** Timer start. */ | |
| ulonglong m_timer_start; | | ulonglong m_timer_start; | |
| /** Timer function. */ | | /** Timer function. */ | |
| ulonglong (*m_timer)(void); | | ulonglong (*m_timer)(void); | |
|
| /* Current operation (waiting for WL#4895). */ | | /** Internal data. */ | |
| /* enum PSI_table_operation m_operation; */ | | void *m_statement; | |
| /** Current table io index. */ | | /** Locked time. */ | |
| uint m_index; | | ulonglong m_lock_time; | |
| /** Current table lock index. */ | | /** Rows sent. */ | |
| uint m_lock_index; | | ulonglong m_rows_sent; | |
| | | /** Rows examined. */ | |
| | | ulonglong m_rows_examined; | |
| | | /** Metric, temporary tables created on disk. */ | |
| | | ulong m_created_tmp_disk_tables; | |
| | | /** Metric, temporary tables created. */ | |
| | | ulong m_created_tmp_tables; | |
| | | /** Metric, number of select full join. */ | |
| | | ulong m_select_full_join; | |
| | | /** Metric, number of select full range join. */ | |
| | | ulong m_select_full_range_join; | |
| | | /** Metric, number of select range. */ | |
| | | ulong m_select_range; | |
| | | /** Metric, number of select range check. */ | |
| | | ulong m_select_range_check; | |
| | | /** Metric, number of select scan. */ | |
| | | ulong m_select_scan; | |
| | | /** Metric, number of sort merge passes. */ | |
| | | ulong m_sort_merge_passes; | |
| | | /** Metric, number of sort merge. */ | |
| | | ulong m_sort_range; | |
| | | /** Metric, number of sort rows. */ | |
| | | ulong m_sort_rows; | |
| | | /** Metric, number of sort scans. */ | |
| | | ulong m_sort_scan; | |
| | | /** Statement digest. */ | |
| | | PSI_digest_locker_state m_digest_state; | |
| | | /** Current schema name. */ | |
| | | char m_schema_name[PSI_SCHEMA_NAME_LEN]; | |
| | | /** Length in bytes of @c m_schema_name. */ | |
| | | uint m_schema_name_length; | |
| | | }; | |
| | | | |
| | | /** | |
| | | State data storage for @c start_socket_wait_v1_t. | |
| | | This structure provide temporary storage to a socket locker. | |
| | | The content of this structure is considered opaque, | |
| | | the fields are only hints of what an implementation | |
| | | of the psi interface can use. | |
| | | This memory is provided by the instrumented code for performance reasons. | |
| | | @sa start_socket_wait_v1_t | |
| | | */ | |
| | | struct PSI_socket_locker_state_v1 | |
| | | { | |
| | | /** Internal state. */ | |
| | | uint m_flags; | |
| | | /** Current socket. */ | |
| | | struct PSI_socket *m_socket; | |
| | | /** Current thread. */ | |
| | | struct PSI_thread *m_thread; | |
| | | /** Operation number of bytes. */ | |
| | | size_t m_number_of_bytes; | |
| | | /** Timer start. */ | |
| | | ulonglong m_timer_start; | |
| | | /** Timer function. */ | |
| | | ulonglong (*m_timer)(void); | |
| | | /** Current operation. */ | |
| | | enum PSI_socket_operation m_operation; | |
| /** Source file. */ | | /** Source file. */ | |
| const char* m_src_file; | | const char* m_src_file; | |
| /** Source line number. */ | | /** Source line number. */ | |
| int m_src_line; | | int m_src_line; | |
| /** Internal data. */ | | /** Internal data. */ | |
| void *m_wait; | | void *m_wait; | |
| }; | | }; | |
| | | | |
| /* Using typedef to make reuse between PSI_v1 and PSI_v2 easier later. */ | | /* Using typedef to make reuse between PSI_v1 and PSI_v2 easier later. */ | |
| | | | |
| | | | |
| skipping to change at line 642 | | skipping to change at line 1128 | |
| /** | | /** | |
| File registration API. | | File registration API. | |
| @param category a category name (typically a plugin name) | | @param category a category name (typically a plugin name) | |
| @param info an array of file info to register | | @param info an array of file info to register | |
| @param count the size of the info array | | @param count the size of the info array | |
| */ | | */ | |
| typedef void (*register_file_v1_t) | | typedef void (*register_file_v1_t) | |
| (const char *category, struct PSI_file_info_v1 *info, int count); | | (const char *category, struct PSI_file_info_v1 *info, int count); | |
| | | | |
| /** | | /** | |
|
| Mutex instrumentation initialisation API. | | Stage registration API. | |
| @param key the registered mutex key | | @param category a category name | |
| @param identity the address of the mutex itself | | @param info an array of stage info to register | |
| @return an instrumented mutex | | @param count the size of the info array | |
| */ | | */ | |
|
| typedef struct PSI_mutex* (*init_mutex_v1_t) | | typedef void (*register_stage_v1_t) | |
| (PSI_mutex_key key, const void *identity); | | (const char *category, struct PSI_stage_info_v1 **info, int count); | |
| | | | |
| | | /** | |
| | | Statement registration API. | |
| | | @param category a category name | |
| | | @param info an array of stage info to register | |
| | | @param count the size of the info array | |
| | | */ | |
| | | typedef void (*register_statement_v1_t) | |
| | | (const char *category, struct PSI_statement_info_v1 *info, int count); | |
| | | | |
| | | /** | |
| | | Socket registration API. | |
| | | @param category a category name (typically a plugin name) | |
| | | @param info an array of socket info to register | |
| | | @param count the size of the info array | |
| | | */ | |
| | | typedef void (*register_socket_v1_t) | |
| | | (const char *category, struct PSI_socket_info_v1 *info, int count); | |
| | | | |
| | | /** | |
| | | Mutex instrumentation initialisation API. | |
| | | @param key the registered mutex key | |
| | | @param identity the address of the mutex itself | |
| | | @return an instrumented mutex | |
| | | */ | |
| | | typedef struct PSI_mutex* (*init_mutex_v1_t) | |
| | | (PSI_mutex_key key, const void *identity); | |
| | | | |
| /** | | /** | |
| Mutex instrumentation destruction API. | | Mutex instrumentation destruction API. | |
| @param mutex the mutex to destroy | | @param mutex the mutex to destroy | |
| */ | | */ | |
| typedef void (*destroy_mutex_v1_t)(struct PSI_mutex *mutex); | | typedef void (*destroy_mutex_v1_t)(struct PSI_mutex *mutex); | |
| | | | |
| /** | | /** | |
| Rwlock instrumentation initialisation API. | | Rwlock instrumentation initialisation API. | |
| @param key the registered rwlock key | | @param key the registered rwlock key | |
| | | | |
| skipping to change at line 687 | | skipping to change at line 1200 | |
| typedef struct PSI_cond* (*init_cond_v1_t) | | typedef struct PSI_cond* (*init_cond_v1_t) | |
| (PSI_cond_key key, const void *identity); | | (PSI_cond_key key, const void *identity); | |
| | | | |
| /** | | /** | |
| Cond instrumentation destruction API. | | Cond instrumentation destruction API. | |
| @param cond the rcond to destroy | | @param cond the rcond to destroy | |
| */ | | */ | |
| typedef void (*destroy_cond_v1_t)(struct PSI_cond *cond); | | typedef void (*destroy_cond_v1_t)(struct PSI_cond *cond); | |
| | | | |
| /** | | /** | |
|
| Acquire a table info by name. | | Socket instrumentation initialisation API. | |
| @param schema_name name of the table schema | | @param key the registered mutex key | |
| @param schema_name_length length of schema_name | | @param socket descriptor | |
| @param table_name name of the table | | @param addr the socket ip address | |
| @param table_name_length length of table_name | | @param addr_len length of socket ip address | |
| @param identity table identity pointer, typically the table share | | @return an instrumented socket | |
| @return a table info, or NULL if the table is not instrumented | | */ | |
| | | typedef struct PSI_socket* (*init_socket_v1_t) | |
| | | (PSI_socket_key key, const my_socket *fd, | |
| | | const struct sockaddr *addr, socklen_t addr_len); | |
| | | | |
| | | /** | |
| | | socket instrumentation destruction API. | |
| | | @param socket the socket to destroy | |
| | | */ | |
| | | typedef void (*destroy_socket_v1_t)(struct PSI_socket *socket); | |
| | | | |
| | | /** | |
| | | Acquire a table share instrumentation. | |
| | | @param temporary True for temporary tables | |
| | | @param share The SQL layer table share | |
| | | @return a table share instrumentation, or NULL | |
| */ | | */ | |
| typedef struct PSI_table_share* (*get_table_share_v1_t) | | typedef struct PSI_table_share* (*get_table_share_v1_t) | |
|
| (const char *schema_name, int schema_name_length, const char *table_name, | | (my_bool temporary, struct TABLE_SHARE *share); | |
| int table_name_length, const void *identity); | | | |
| | | | |
| /** | | /** | |
| Release a table share. | | Release a table share. | |
| @param info the table share to release | | @param info the table share to release | |
| */ | | */ | |
| typedef void (*release_table_share_v1_t)(struct PSI_table_share *share); | | typedef void (*release_table_share_v1_t)(struct PSI_table_share *share); | |
| | | | |
| /** | | /** | |
|
| | | Drop a table share. | |
| | | @param temporary True for temporary tables | |
| | | @param schema_name the table schema name | |
| | | @param schema_name_length the table schema name length | |
| | | @param table_name the table name | |
| | | @param table_name_length the table name length | |
| | | */ | |
| | | typedef void (*drop_table_share_v1_t) | |
| | | (my_bool temporary, const char *schema_name, int schema_name_length, | |
| | | const char *table_name, int table_name_length); | |
| | | | |
| | | /** | |
| Open an instrumentation table handle. | | Open an instrumentation table handle. | |
| @param share the table to open | | @param share the table to open | |
| @param identity table handle identity | | @param identity table handle identity | |
| @return a table handle, or NULL | | @return a table handle, or NULL | |
| */ | | */ | |
| typedef struct PSI_table* (*open_table_v1_t) | | typedef struct PSI_table* (*open_table_v1_t) | |
| (struct PSI_table_share *share, const void *identity); | | (struct PSI_table_share *share, const void *identity); | |
| | | | |
| /** | | /** | |
|
| | | Unbind a table handle from the current thread. | |
| | | This operation happens when an opened table is added to the open table ca | |
| | | che. | |
| | | @param table the table to unbind | |
| | | */ | |
| | | typedef void (*unbind_table_v1_t) | |
| | | (struct PSI_table *table); | |
| | | | |
| | | /** | |
| | | Rebind a table handle to the current thread. | |
| | | This operation happens when a table from the open table cache | |
| | | is reused for a thread. | |
| | | @param table the table to unbind | |
| | | */ | |
| | | typedef PSI_table* (*rebind_table_v1_t) | |
| | | (PSI_table_share *share, const void *identity, PSI_table *table); | |
| | | | |
| | | /** | |
| Close an instrumentation table handle. | | Close an instrumentation table handle. | |
| Note that the table handle is invalid after this call. | | Note that the table handle is invalid after this call. | |
| @param table the table handle to close | | @param table the table handle to close | |
| */ | | */ | |
| typedef void (*close_table_v1_t)(struct PSI_table *table); | | typedef void (*close_table_v1_t)(struct PSI_table *table); | |
| | | | |
| /** | | /** | |
| Create a file instrumentation for a created file. | | Create a file instrumentation for a created file. | |
| This method does not create the file itself, but is used to notify the | | This method does not create the file itself, but is used to notify the | |
| instrumentation interface that a file was just created. | | instrumentation interface that a file was just created. | |
| | | | |
| skipping to change at line 753 | | skipping to change at line 1309 | |
| const pthread_attr_t *attr, | | const pthread_attr_t *attr, | |
| void *(*start_routine)(void*), void *arg); | | void *(*start_routine)(void*), void *arg); | |
| | | | |
| /** | | /** | |
| Create instrumentation for a thread. | | Create instrumentation for a thread. | |
| @param key the registered key | | @param key the registered key | |
| @param identity an address typical of the thread | | @param identity an address typical of the thread | |
| @return an instrumented thread | | @return an instrumented thread | |
| */ | | */ | |
| typedef struct PSI_thread* (*new_thread_v1_t) | | typedef struct PSI_thread* (*new_thread_v1_t) | |
|
| (PSI_thread_key key, const void *identity, ulong thread_id); | | (PSI_thread_key key, const void *identity, ulonglong thread_id); | |
| | | | |
| /** | | /** | |
| Assign an id to an instrumented thread. | | Assign an id to an instrumented thread. | |
| @param thread the instrumented thread | | @param thread the instrumented thread | |
| @param id the id to assign | | @param id the id to assign | |
| */ | | */ | |
| typedef void (*set_thread_id_v1_t)(struct PSI_thread *thread, | | typedef void (*set_thread_id_v1_t)(struct PSI_thread *thread, | |
|
| unsigned long id); | | ulonglong id); | |
| | | | |
| /** | | /** | |
| Get the instrumentation for the running thread. | | Get the instrumentation for the running thread. | |
| For this function to return a result, | | For this function to return a result, | |
| the thread instrumentation must have been attached to the | | the thread instrumentation must have been attached to the | |
| running thread using @c set_thread() | | running thread using @c set_thread() | |
| @return the instrumentation for the running thread | | @return the instrumentation for the running thread | |
| */ | | */ | |
| typedef struct PSI_thread* (*get_thread_v1_t)(void); | | typedef struct PSI_thread* (*get_thread_v1_t)(void); | |
| | | | |
| /** | | /** | |
|
| Attach a thread instrumentation to the running thread. | | Assign a user name to the instrumented thread. | |
| In case of thread pools, this method should be called when | | @param user the user name | |
| a worker thread picks a work item and runs it. | | @param user_len the user name length | |
| Also, this method should be called if the instrumented code does not | | | |
| keep the pointer returned by @c new_thread() and relies on @c get_thread( | | | |
| ) | | | |
| instead. | | | |
| @param thread the thread instrumentation | | | |
| */ | | */ | |
|
| typedef void (*set_thread_v1_t)(struct PSI_thread *thread); | | typedef void (*set_thread_user_v1_t)(const char *user, int user_len); | |
| | | | |
|
| /** Delete the current thread instrumentation. */ | | /** | |
| typedef void (*delete_current_thread_v1_t)(void); | | Assign a user name and host name to the instrumented thread. | |
| | | @param user the user name | |
| | | @param user_len the user name length | |
| | | @param host the host name | |
| | | @param host_len the host name length | |
| | | */ | |
| | | typedef void (*set_thread_user_host_v1_t)(const char *user, int user_len, | |
| | | const char *host, int host_len); | |
| | | | |
|
| /** Delete a thread instrumentation. */ | | /** | |
| typedef void (*delete_thread_v1_t)(struct PSI_thread *thread); | | Assign a current database to the instrumented thread. | |
| | | @param db the database name | |
| | | @param db_len the database name length | |
| | | */ | |
| | | typedef void (*set_thread_db_v1_t)(const char* db, int db_len); | |
| | | | |
| /** | | /** | |
|
| Get a mutex instrumentation locker. | | Assign a current command to the instrumented thread. | |
| @param state data storage for the locker | | @param command the current command | |
| @param mutex the instrumented mutex to lock | | | |
| @return a mutex locker, or NULL | | | |
| */ | | */ | |
|
| typedef struct PSI_mutex_locker* (*get_thread_mutex_locker_v1_t) | | typedef void (*set_thread_command_v1_t)(int command); | |
| (struct PSI_mutex_locker_state_v1 *state, | | | |
| struct PSI_mutex *mutex, | | | |
| enum PSI_mutex_operation op); | | | |
| | | | |
| /** | | /** | |
|
| Get a rwlock instrumentation locker. | | Assign a start time to the instrumented thread. | |
| @param state data storage for the locker | | @param start_time the thread start time | |
| @param rwlock the instrumented rwlock to lock | | | |
| @return a rwlock locker, or NULL | | | |
| */ | | */ | |
|
| typedef struct PSI_rwlock_locker* (*get_thread_rwlock_locker_v1_t) | | typedef void (*set_thread_start_time_v1_t)(time_t start_time); | |
| (struct PSI_rwlock_locker_state_v1 *state, | | | |
| struct PSI_rwlock *rwlock, | | | |
| enum PSI_rwlock_operation op); | | | |
| | | | |
| /** | | /** | |
|
| Get a cond instrumentation locker. | | Assign a state to the instrumented thread. | |
| @param state data storage for the locker | | @param state the thread state | |
| @param cond the instrumented condition to wait on | | | |
| @param mutex the instrumented mutex associated with the condition | | | |
| @return a condition locker, or NULL | | | |
| */ | | */ | |
|
| typedef struct PSI_cond_locker* (*get_thread_cond_locker_v1_t) | | typedef void (*set_thread_state_v1_t)(const char* state); | |
| (struct PSI_cond_locker_state_v1 *state, | | | |
| struct PSI_cond *cond, struct PSI_mutex *mutex, | | | |
| enum PSI_cond_operation op); | | | |
| | | | |
| /** | | /** | |
|
| Get a table instrumentation locker. | | Assign a process info to the instrumented thread. | |
| @param state data storage for the locker | | @param info the process into string | |
| @param table the instrumented table to lock | | @param info_len the process into string length | |
| @return a table locker, or NULL | | | |
| */ | | */ | |
|
| typedef struct PSI_table_locker* (*get_thread_table_locker_v1_t) | | typedef void (*set_thread_info_v1_t)(const char* info, int info_len); | |
| (struct PSI_table_locker_state_v1 *state, | | | |
| struct PSI_table *table); | | /** | |
| | | Attach a thread instrumentation to the running thread. | |
| | | In case of thread pools, this method should be called when | |
| | | a worker thread picks a work item and runs it. | |
| | | Also, this method should be called if the instrumented code does not | |
| | | keep the pointer returned by @c new_thread() and relies on @c get_thread( | |
| | | ) | |
| | | instead. | |
| | | @param thread the thread instrumentation | |
| | | */ | |
| | | typedef void (*set_thread_v1_t)(struct PSI_thread *thread); | |
| | | | |
| | | /** Delete the current thread instrumentation. */ | |
| | | typedef void (*delete_current_thread_v1_t)(void); | |
| | | | |
| | | /** Delete a thread instrumentation. */ | |
| | | typedef void (*delete_thread_v1_t)(struct PSI_thread *thread); | |
| | | | |
| /** | | /** | |
| Get a file instrumentation locker, for opening or creating a file. | | Get a file instrumentation locker, for opening or creating a file. | |
| @param state data storage for the locker | | @param state data storage for the locker | |
| @param key the file instrumentation key | | @param key the file instrumentation key | |
| @param op the operation to perform | | @param op the operation to perform | |
| @param name the file name | | @param name the file name | |
| @param identity a pointer representative of this file. | | @param identity a pointer representative of this file. | |
| @return a file locker, or NULL | | @return a file locker, or NULL | |
| */ | | */ | |
| | | | |
| skipping to change at line 897 | | skipping to change at line 1458 | |
| typedef void (*signal_cond_v1_t) | | typedef void (*signal_cond_v1_t) | |
| (struct PSI_cond *cond); | | (struct PSI_cond *cond); | |
| | | | |
| /** | | /** | |
| Record a condition instrumentation broadcast event. | | Record a condition instrumentation broadcast event. | |
| @param cond the cond instrumentation | | @param cond the cond instrumentation | |
| */ | | */ | |
| typedef void (*broadcast_cond_v1_t) | | typedef void (*broadcast_cond_v1_t) | |
| (struct PSI_cond *cond); | | (struct PSI_cond *cond); | |
| | | | |
|
| | | typedef struct PSI_idle_locker* (*start_idle_wait_v1_t) | |
| | | (struct PSI_idle_locker_state_v1 *state, const char *src_file, uint src_l | |
| | | ine); | |
| | | | |
| | | typedef void (*end_idle_wait_v1_t) | |
| | | (struct PSI_idle_locker *locker); | |
| | | | |
| /** | | /** | |
| Record a mutex instrumentation wait start event. | | Record a mutex instrumentation wait start event. | |
|
| @param locker a thread locker for the running thread | | @param state data storage for the locker | |
| | | @param mutex the instrumented mutex to lock | |
| | | @param op the operation to perform | |
| | | @param file the source file name | |
| | | @param line the source line number | |
| | | @return a mutex locker, or NULL | |
| */ | | */ | |
|
| typedef void (*start_mutex_wait_v1_t) | | typedef struct PSI_mutex_locker* (*start_mutex_wait_v1_t) | |
| (struct PSI_mutex_locker *locker, const char *src_file, uint src_line); | | (struct PSI_mutex_locker_state_v1 *state, | |
| | | struct PSI_mutex *mutex, | |
| | | enum PSI_mutex_operation op, | |
| | | const char *src_file, uint src_line); | |
| | | | |
| /** | | /** | |
| Record a mutex instrumentation wait end event. | | Record a mutex instrumentation wait end event. | |
| @param locker a thread locker for the running thread | | @param locker a thread locker for the running thread | |
| @param rc the wait operation return code | | @param rc the wait operation return code | |
| */ | | */ | |
| typedef void (*end_mutex_wait_v1_t) | | typedef void (*end_mutex_wait_v1_t) | |
| (struct PSI_mutex_locker *locker, int rc); | | (struct PSI_mutex_locker *locker, int rc); | |
| | | | |
| /** | | /** | |
| Record a rwlock instrumentation read wait start event. | | Record a rwlock instrumentation read wait start event. | |
| @param locker a thread locker for the running thread | | @param locker a thread locker for the running thread | |
| @param must must block: 1 for lock, 0 for trylock | | @param must must block: 1 for lock, 0 for trylock | |
| */ | | */ | |
|
| typedef void (*start_rwlock_rdwait_v1_t) | | typedef struct PSI_rwlock_locker* (*start_rwlock_rdwait_v1_t) | |
| (struct PSI_rwlock_locker *locker, const char *src_file, uint src_line); | | (struct PSI_rwlock_locker_state_v1 *state, | |
| | | struct PSI_rwlock *rwlock, | |
| | | enum PSI_rwlock_operation op, | |
| | | const char *src_file, uint src_line); | |
| | | | |
| /** | | /** | |
| Record a rwlock instrumentation read wait end event. | | Record a rwlock instrumentation read wait end event. | |
| @param locker a thread locker for the running thread | | @param locker a thread locker for the running thread | |
| @param rc the wait operation return code | | @param rc the wait operation return code | |
| */ | | */ | |
| typedef void (*end_rwlock_rdwait_v1_t) | | typedef void (*end_rwlock_rdwait_v1_t) | |
| (struct PSI_rwlock_locker *locker, int rc); | | (struct PSI_rwlock_locker *locker, int rc); | |
| | | | |
| /** | | /** | |
| Record a rwlock instrumentation write wait start event. | | Record a rwlock instrumentation write wait start event. | |
| @param locker a thread locker for the running thread | | @param locker a thread locker for the running thread | |
| @param must must block: 1 for lock, 0 for trylock | | @param must must block: 1 for lock, 0 for trylock | |
| */ | | */ | |
|
| typedef void (*start_rwlock_wrwait_v1_t) | | typedef struct PSI_rwlock_locker* (*start_rwlock_wrwait_v1_t) | |
| (struct PSI_rwlock_locker *locker, const char *src_file, uint src_line); | | (struct PSI_rwlock_locker_state_v1 *state, | |
| | | struct PSI_rwlock *rwlock, | |
| | | enum PSI_rwlock_operation op, | |
| | | const char *src_file, uint src_line); | |
| | | | |
| /** | | /** | |
| Record a rwlock instrumentation write wait end event. | | Record a rwlock instrumentation write wait end event. | |
| @param locker a thread locker for the running thread | | @param locker a thread locker for the running thread | |
| @param rc the wait operation return code | | @param rc the wait operation return code | |
| */ | | */ | |
| typedef void (*end_rwlock_wrwait_v1_t) | | typedef void (*end_rwlock_wrwait_v1_t) | |
| (struct PSI_rwlock_locker *locker, int rc); | | (struct PSI_rwlock_locker *locker, int rc); | |
| | | | |
| /** | | /** | |
| Record a condition instrumentation wait start event. | | Record a condition instrumentation wait start event. | |
| @param locker a thread locker for the running thread | | @param locker a thread locker for the running thread | |
| @param must must block: 1 for wait, 0 for timedwait | | @param must must block: 1 for wait, 0 for timedwait | |
| */ | | */ | |
|
| typedef void (*start_cond_wait_v1_t) | | typedef struct PSI_cond_locker* (*start_cond_wait_v1_t) | |
| (struct PSI_cond_locker *locker, const char *src_file, uint src_line); | | (struct PSI_cond_locker_state_v1 *state, | |
| | | struct PSI_cond *cond, | |
| | | struct PSI_mutex *mutex, | |
| | | enum PSI_cond_operation op, | |
| | | const char *src_file, uint src_line); | |
| | | | |
| /** | | /** | |
| Record a condition instrumentation wait end event. | | Record a condition instrumentation wait end event. | |
| @param locker a thread locker for the running thread | | @param locker a thread locker for the running thread | |
| @param rc the wait operation return code | | @param rc the wait operation return code | |
| */ | | */ | |
| typedef void (*end_cond_wait_v1_t) | | typedef void (*end_cond_wait_v1_t) | |
| (struct PSI_cond_locker *locker, int rc); | | (struct PSI_cond_locker *locker, int rc); | |
| | | | |
| /** | | /** | |
|
| Record a table instrumentation wait start event. | | Record a table instrumentation io wait start event. | |
| | | @param locker a table locker for the running thread | |
| | | @param file the source file name | |
| | | @param line the source line number | |
| | | */ | |
| | | typedef struct PSI_table_locker* (*start_table_io_wait_v1_t) | |
| | | (struct PSI_table_locker_state_v1 *state, | |
| | | struct PSI_table *table, | |
| | | enum PSI_table_io_operation op, | |
| | | uint index, | |
| | | const char *src_file, uint src_line); | |
| | | | |
| | | /** | |
| | | Record a table instrumentation io wait end event. | |
| | | @param locker a table locker for the running thread | |
| | | */ | |
| | | typedef void (*end_table_io_wait_v1_t)(struct PSI_table_locker *locker); | |
| | | | |
| | | /** | |
| | | Record a table instrumentation lock wait start event. | |
| @param locker a table locker for the running thread | | @param locker a table locker for the running thread | |
| @param file the source file name | | @param file the source file name | |
| @param line the source line number | | @param line the source line number | |
| */ | | */ | |
|
| typedef void (*start_table_wait_v1_t) | | typedef struct PSI_table_locker* (*start_table_lock_wait_v1_t) | |
| (struct PSI_table_locker *locker, const char *src_file, uint src_line); | | (struct PSI_table_locker_state_v1 *state, | |
| | | struct PSI_table *table, | |
| | | enum PSI_table_lock_operation op, | |
| | | ulong flags, | |
| | | const char *src_file, uint src_line); | |
| | | | |
| /** | | /** | |
|
| Record a table instrumentation wait end event. | | Record a table instrumentation lock wait end event. | |
| @param locker a table locker for the running thread | | @param locker a table locker for the running thread | |
| */ | | */ | |
|
| typedef void (*end_table_wait_v1_t)(struct PSI_table_locker *locker); | | typedef void (*end_table_lock_wait_v1_t)(struct PSI_table_locker *locker); | |
| | | | |
| /** | | /** | |
| Start a file instrumentation open operation. | | Start a file instrumentation open operation. | |
| @param locker the file locker | | @param locker the file locker | |
| @param op the operation to perform | | @param op the operation to perform | |
| @param src_file the source file name | | @param src_file the source file name | |
| @param src_line the source line number | | @param src_line the source line number | |
|
| @return an instrumented file handle | | | |
| */ | | */ | |
|
| typedef struct PSI_file* (*start_file_open_wait_v1_t) | | typedef void (*start_file_open_wait_v1_t) | |
| (struct PSI_file_locker *locker, const char *src_file, uint src_line); | | (struct PSI_file_locker *locker, const char *src_file, uint src_line); | |
| | | | |
| /** | | /** | |
| End a file instrumentation open operation, for file streams. | | End a file instrumentation open operation, for file streams. | |
| @param locker the file locker. | | @param locker the file locker. | |
|
| | | @param result the opened file (NULL indicates failure, non NULL success). | |
| | | @return an instrumented file handle | |
| */ | | */ | |
|
| typedef void (*end_file_open_wait_v1_t)(struct PSI_file_locker *locker); | | typedef struct PSI_file* (*end_file_open_wait_v1_t) | |
| | | (struct PSI_file_locker *locker, void *result); | |
| | | | |
| /** | | /** | |
| End a file instrumentation open operation, for non stream files. | | End a file instrumentation open operation, for non stream files. | |
| @param locker the file locker. | | @param locker the file locker. | |
| @param file the file number assigned by open() or create() for this file. | | @param file the file number assigned by open() or create() for this file. | |
| */ | | */ | |
| typedef void (*end_file_open_wait_and_bind_to_descriptor_v1_t) | | typedef void (*end_file_open_wait_and_bind_to_descriptor_v1_t) | |
| (struct PSI_file_locker *locker, File file); | | (struct PSI_file_locker *locker, File file); | |
| | | | |
| /** | | /** | |
| | | | |
| skipping to change at line 1028 | | skipping to change at line 1638 | |
| @param count the number of bytes actually used in the operation, | | @param count the number of bytes actually used in the operation, | |
| or 0 if not applicable, or -1 if the operation failed | | or 0 if not applicable, or -1 if the operation failed | |
| @sa get_thread_file_name_locker | | @sa get_thread_file_name_locker | |
| @sa get_thread_file_stream_locker | | @sa get_thread_file_stream_locker | |
| @sa get_thread_file_descriptor_locker | | @sa get_thread_file_descriptor_locker | |
| */ | | */ | |
| typedef void (*end_file_wait_v1_t) | | typedef void (*end_file_wait_v1_t) | |
| (struct PSI_file_locker *locker, size_t count); | | (struct PSI_file_locker *locker, size_t count); | |
| | | | |
| /** | | /** | |
|
| | | Start a file instrumentation close operation. | |
| | | @param locker the file locker | |
| | | @param op the operation to perform | |
| | | @param src_file the source file name | |
| | | @param src_line the source line number | |
| | | */ | |
| | | typedef void (*start_file_close_wait_v1_t) | |
| | | (struct PSI_file_locker *locker, const char *src_file, uint src_line); | |
| | | | |
| | | /** | |
| | | End a file instrumentation close operation. | |
| | | @param locker the file locker. | |
| | | @param rc the close operation return code (0 for success). | |
| | | @return an instrumented file handle | |
| | | */ | |
| | | typedef void (*end_file_close_wait_v1_t) | |
| | | (struct PSI_file_locker *locker, int rc); | |
| | | | |
| | | /** | |
| | | Start a new stage, and implicitly end the previous stage. | |
| | | @param key the key of the new stage | |
| | | @param src_file the source file name | |
| | | @param src_line the source line number | |
| | | */ | |
| | | typedef void (*start_stage_v1_t) | |
| | | (PSI_stage_key key, const char *src_file, int src_line); | |
| | | | |
| | | /** End the current stage. */ | |
| | | typedef void (*end_stage_v1_t) (void); | |
| | | | |
| | | /** | |
| | | Get a statement instrumentation locker. | |
| | | @param state data storage for the locker | |
| | | @param key the statement instrumentation key | |
| | | @param charset client character set | |
| | | @return a statement locker, or NULL | |
| | | */ | |
| | | typedef struct PSI_statement_locker* (*get_thread_statement_locker_v1_t) | |
| | | (struct PSI_statement_locker_state_v1 *state, | |
| | | PSI_statement_key key, const void *charset); | |
| | | | |
| | | /** | |
| | | Refine a statement locker to a more specific key. | |
| | | Note that only events declared mutable can be refined. | |
| | | @param the statement locker for the current event | |
| | | @param key the new key for the event | |
| | | @sa PSI_FLAG_MUTABLE | |
| | | */ | |
| | | typedef struct PSI_statement_locker* (*refine_statement_v1_t) | |
| | | (struct PSI_statement_locker *locker, | |
| | | PSI_statement_key key); | |
| | | | |
| | | /** | |
| | | Start a new statement event. | |
| | | @param locker the statement locker for this event | |
| | | @param db the active database name for this statement | |
| | | @param db_length the active database name length for this statement | |
| | | @param src_file source file name | |
| | | @param src_line source line number | |
| | | */ | |
| | | typedef void (*start_statement_v1_t) | |
| | | (struct PSI_statement_locker *locker, | |
| | | const char *db, uint db_length, | |
| | | const char *src_file, uint src_line); | |
| | | | |
| | | /** | |
| | | Set the statement text for a statement event. | |
| | | @param locker the current statement locker | |
| | | @param text the statement text | |
| | | @param text_len the statement text length | |
| | | */ | |
| | | typedef void (*set_statement_text_v1_t) | |
| | | (struct PSI_statement_locker *locker, | |
| | | const char *text, uint text_len); | |
| | | | |
| | | /** | |
| | | Set a statement event lock time. | |
| | | @param locker the statement locker | |
| | | @param lock_time the locked time, in microseconds | |
| | | */ | |
| | | typedef void (*set_statement_lock_time_t) | |
| | | (struct PSI_statement_locker *locker, ulonglong lock_time); | |
| | | | |
| | | /** | |
| | | Set a statement event rows sent metric. | |
| | | @param locker the statement locker | |
| | | @param count the number of rows sent | |
| | | */ | |
| | | typedef void (*set_statement_rows_sent_t) | |
| | | (struct PSI_statement_locker *locker, ulonglong count); | |
| | | | |
| | | /** | |
| | | Set a statement event rows examined metric. | |
| | | @param locker the statement locker | |
| | | @param count the number of rows examined | |
| | | */ | |
| | | typedef void (*set_statement_rows_examined_t) | |
| | | (struct PSI_statement_locker *locker, ulonglong count); | |
| | | | |
| | | /** | |
| | | Increment a statement event "created tmp disk tables" metric. | |
| | | @param locker the statement locker | |
| | | @param count the metric increment value | |
| | | */ | |
| | | typedef void (*inc_statement_created_tmp_disk_tables_t) | |
| | | (struct PSI_statement_locker *locker, ulong count); | |
| | | | |
| | | /** | |
| | | Increment a statement event "created tmp tables" metric. | |
| | | @param locker the statement locker | |
| | | @param count the metric increment value | |
| | | */ | |
| | | typedef void (*inc_statement_created_tmp_tables_t) | |
| | | (struct PSI_statement_locker *locker, ulong count); | |
| | | | |
| | | /** | |
| | | Increment a statement event "select full join" metric. | |
| | | @param locker the statement locker | |
| | | @param count the metric increment value | |
| | | */ | |
| | | typedef void (*inc_statement_select_full_join_t) | |
| | | (struct PSI_statement_locker *locker, ulong count); | |
| | | | |
| | | /** | |
| | | Increment a statement event "select full range join" metric. | |
| | | @param locker the statement locker | |
| | | @param count the metric increment value | |
| | | */ | |
| | | typedef void (*inc_statement_select_full_range_join_t) | |
| | | (struct PSI_statement_locker *locker, ulong count); | |
| | | | |
| | | /** | |
| | | Increment a statement event "select range join" metric. | |
| | | @param locker the statement locker | |
| | | @param count the metric increment value | |
| | | */ | |
| | | typedef void (*inc_statement_select_range_t) | |
| | | (struct PSI_statement_locker *locker, ulong count); | |
| | | | |
| | | /** | |
| | | Increment a statement event "select range check" metric. | |
| | | @param locker the statement locker | |
| | | @param count the metric increment value | |
| | | */ | |
| | | typedef void (*inc_statement_select_range_check_t) | |
| | | (struct PSI_statement_locker *locker, ulong count); | |
| | | | |
| | | /** | |
| | | Increment a statement event "select scan" metric. | |
| | | @param locker the statement locker | |
| | | @param count the metric increment value | |
| | | */ | |
| | | typedef void (*inc_statement_select_scan_t) | |
| | | (struct PSI_statement_locker *locker, ulong count); | |
| | | | |
| | | /** | |
| | | Increment a statement event "sort merge passes" metric. | |
| | | @param locker the statement locker | |
| | | @param count the metric increment value | |
| | | */ | |
| | | typedef void (*inc_statement_sort_merge_passes_t) | |
| | | (struct PSI_statement_locker *locker, ulong count); | |
| | | | |
| | | /** | |
| | | Increment a statement event "sort range" metric. | |
| | | @param locker the statement locker | |
| | | @param count the metric increment value | |
| | | */ | |
| | | typedef void (*inc_statement_sort_range_t) | |
| | | (struct PSI_statement_locker *locker, ulong count); | |
| | | | |
| | | /** | |
| | | Increment a statement event "sort rows" metric. | |
| | | @param locker the statement locker | |
| | | @param count the metric increment value | |
| | | */ | |
| | | typedef void (*inc_statement_sort_rows_t) | |
| | | (struct PSI_statement_locker *locker, ulong count); | |
| | | | |
| | | /** | |
| | | Increment a statement event "sort scan" metric. | |
| | | @param locker the statement locker | |
| | | @param count the metric increment value | |
| | | */ | |
| | | typedef void (*inc_statement_sort_scan_t) | |
| | | (struct PSI_statement_locker *locker, ulong count); | |
| | | | |
| | | /** | |
| | | Set a statement event "no index used" metric. | |
| | | @param locker the statement locker | |
| | | @param count the metric value | |
| | | */ | |
| | | typedef void (*set_statement_no_index_used_t) | |
| | | (struct PSI_statement_locker *locker); | |
| | | | |
| | | /** | |
| | | Set a statement event "no good index used" metric. | |
| | | @param locker the statement locker | |
| | | @param count the metric value | |
| | | */ | |
| | | typedef void (*set_statement_no_good_index_used_t) | |
| | | (struct PSI_statement_locker *locker); | |
| | | | |
| | | /** | |
| | | End a statement event. | |
| | | @param locker the statement locker | |
| | | @param stmt_da the statement diagnostics area. | |
| | | @sa Diagnostics_area | |
| | | */ | |
| | | typedef void (*end_statement_v1_t) | |
| | | (struct PSI_statement_locker *locker, void *stmt_da); | |
| | | | |
| | | /** | |
| | | Record a socket instrumentation start event. | |
| | | @param locker a socket locker for the running thread | |
| | | @param op socket operation to be performed | |
| | | @param count the number of bytes requested, or 0 if not applicable | |
| | | @param src_file the source file name | |
| | | @param src_line the source line number | |
| | | */ | |
| | | typedef struct PSI_socket_locker* (*start_socket_wait_v1_t) | |
| | | (struct PSI_socket_locker_state_v1 *state, | |
| | | struct PSI_socket *socket, | |
| | | enum PSI_socket_operation op, | |
| | | size_t count, | |
| | | const char *src_file, uint src_line); | |
| | | | |
| | | /** | |
| | | Record a socket instrumentation end event. | |
| | | Note that for socket close operations, the instrumented socket handle | |
| | | associated with the socket (which was provided to obtain a locker) | |
| | | is invalid after this call. | |
| | | @param locker a socket locker for the running thread | |
| | | @param count the number of bytes actually used in the operation, | |
| | | or 0 if not applicable, or -1 if the operation failed | |
| | | @sa get_thread_socket_locker | |
| | | */ | |
| | | typedef void (*end_socket_wait_v1_t) | |
| | | (struct PSI_socket_locker *locker, size_t count); | |
| | | | |
| | | /** | |
| | | Set the socket state for an instrumented socket. | |
| | | @param socket the instrumented socket | |
| | | @param state socket state | |
| | | */ | |
| | | typedef void (*set_socket_state_v1_t)(struct PSI_socket *socket, | |
| | | enum PSI_socket_state state); | |
| | | | |
| | | /** | |
| | | Set the socket info for an instrumented socket. | |
| | | @param socket the instrumented socket | |
| | | @param fd the socket descriptor | |
| | | @param addr the socket ip address | |
| | | @param addr_len length of socket ip address | |
| | | @param thread_id associated thread id | |
| | | */ | |
| | | typedef void (*set_socket_info_v1_t)(struct PSI_socket *socket, | |
| | | const my_socket *fd, | |
| | | const struct sockaddr *addr, | |
| | | socklen_t addr_len); | |
| | | | |
| | | /** | |
| | | Bind a socket to the thread that owns it. | |
| | | @param socket instrumented socket | |
| | | */ | |
| | | typedef void (*set_socket_thread_owner_v1_t)(struct PSI_socket *socket); | |
| | | | |
| | | typedef struct PSI_digest_locker * (*digest_start_v1_t) | |
| | | (struct PSI_statement_locker *locker); | |
| | | | |
| | | typedef struct PSI_digest_locker* (*digest_add_token_v1_t) | |
| | | (struct PSI_digest_locker *locker, uint token, struct OPAQUE_LEX_YYSTYPE | |
| | | *yylval); | |
| | | | |
| | | /** | |
| | | Stores an array of connection attributes | |
| | | @param buffer char array of length encoded connection attributes | |
| | | in network format | |
| | | @param length legnth of the data in buffer | |
| | | @param from_cs charset in which @buffer is encodded | |
| | | @return state | |
| | | @retval non-0 attributes truncated | |
| | | @retval 0 stored the attribute | |
| | | */ | |
| | | typedef int (*set_thread_connect_attrs_v1_t)(const char *buffer, uint lengt | |
| | | h, | |
| | | const void *from_cs); | |
| | | | |
| | | /** | |
| Performance Schema Interface, version 1. | | Performance Schema Interface, version 1. | |
| @since PSI_VERSION_1 | | @since PSI_VERSION_1 | |
| */ | | */ | |
| struct PSI_v1 | | struct PSI_v1 | |
| { | | { | |
| /** @sa register_mutex_v1_t. */ | | /** @sa register_mutex_v1_t. */ | |
| register_mutex_v1_t register_mutex; | | register_mutex_v1_t register_mutex; | |
| /** @sa register_rwlock_v1_t. */ | | /** @sa register_rwlock_v1_t. */ | |
| register_rwlock_v1_t register_rwlock; | | register_rwlock_v1_t register_rwlock; | |
| /** @sa register_cond_v1_t. */ | | /** @sa register_cond_v1_t. */ | |
| register_cond_v1_t register_cond; | | register_cond_v1_t register_cond; | |
| /** @sa register_thread_v1_t. */ | | /** @sa register_thread_v1_t. */ | |
| register_thread_v1_t register_thread; | | register_thread_v1_t register_thread; | |
| /** @sa register_file_v1_t. */ | | /** @sa register_file_v1_t. */ | |
| register_file_v1_t register_file; | | register_file_v1_t register_file; | |
|
| | | /** @sa register_stage_v1_t. */ | |
| | | register_stage_v1_t register_stage; | |
| | | /** @sa register_statement_v1_t. */ | |
| | | register_statement_v1_t register_statement; | |
| | | /** @sa register_socket_v1_t. */ | |
| | | register_socket_v1_t register_socket; | |
| /** @sa init_mutex_v1_t. */ | | /** @sa init_mutex_v1_t. */ | |
| init_mutex_v1_t init_mutex; | | init_mutex_v1_t init_mutex; | |
| /** @sa destroy_mutex_v1_t. */ | | /** @sa destroy_mutex_v1_t. */ | |
| destroy_mutex_v1_t destroy_mutex; | | destroy_mutex_v1_t destroy_mutex; | |
| /** @sa init_rwlock_v1_t. */ | | /** @sa init_rwlock_v1_t. */ | |
| init_rwlock_v1_t init_rwlock; | | init_rwlock_v1_t init_rwlock; | |
| /** @sa destroy_rwlock_v1_t. */ | | /** @sa destroy_rwlock_v1_t. */ | |
| destroy_rwlock_v1_t destroy_rwlock; | | destroy_rwlock_v1_t destroy_rwlock; | |
| /** @sa init_cond_v1_t. */ | | /** @sa init_cond_v1_t. */ | |
| init_cond_v1_t init_cond; | | init_cond_v1_t init_cond; | |
| /** @sa destroy_cond_v1_t. */ | | /** @sa destroy_cond_v1_t. */ | |
| destroy_cond_v1_t destroy_cond; | | destroy_cond_v1_t destroy_cond; | |
|
| | | /** @sa init_socket_v1_t. */ | |
| | | init_socket_v1_t init_socket; | |
| | | /** @sa destroy_socket_v1_t. */ | |
| | | destroy_socket_v1_t destroy_socket; | |
| /** @sa get_table_share_v1_t. */ | | /** @sa get_table_share_v1_t. */ | |
| get_table_share_v1_t get_table_share; | | get_table_share_v1_t get_table_share; | |
| /** @sa release_table_share_v1_t. */ | | /** @sa release_table_share_v1_t. */ | |
| release_table_share_v1_t release_table_share; | | release_table_share_v1_t release_table_share; | |
|
| | | /** @sa drop_table_share_v1_t. */ | |
| | | drop_table_share_v1_t drop_table_share; | |
| /** @sa open_table_v1_t. */ | | /** @sa open_table_v1_t. */ | |
| open_table_v1_t open_table; | | open_table_v1_t open_table; | |
|
| | | /** @sa unbind_table_v1_t. */ | |
| | | unbind_table_v1_t unbind_table; | |
| | | /** @sa rebind_table_v1_t. */ | |
| | | rebind_table_v1_t rebind_table; | |
| /** @sa close_table_v1_t. */ | | /** @sa close_table_v1_t. */ | |
| close_table_v1_t close_table; | | close_table_v1_t close_table; | |
| /** @sa create_file_v1_t. */ | | /** @sa create_file_v1_t. */ | |
| create_file_v1_t create_file; | | create_file_v1_t create_file; | |
| /** @sa spawn_thread_v1_t. */ | | /** @sa spawn_thread_v1_t. */ | |
| spawn_thread_v1_t spawn_thread; | | spawn_thread_v1_t spawn_thread; | |
| /** @sa new_thread_v1_t. */ | | /** @sa new_thread_v1_t. */ | |
| new_thread_v1_t new_thread; | | new_thread_v1_t new_thread; | |
| /** @sa set_thread_id_v1_t. */ | | /** @sa set_thread_id_v1_t. */ | |
| set_thread_id_v1_t set_thread_id; | | set_thread_id_v1_t set_thread_id; | |
| /** @sa get_thread_v1_t. */ | | /** @sa get_thread_v1_t. */ | |
| get_thread_v1_t get_thread; | | get_thread_v1_t get_thread; | |
|
| | | /** @sa set_thread_user_v1_t. */ | |
| | | set_thread_user_v1_t set_thread_user; | |
| | | /** @sa set_thread_user_host_v1_t. */ | |
| | | set_thread_user_host_v1_t set_thread_user_host; | |
| | | /** @sa set_thread_db_v1_t. */ | |
| | | set_thread_db_v1_t set_thread_db; | |
| | | /** @sa set_thread_command_v1_t. */ | |
| | | set_thread_command_v1_t set_thread_command; | |
| | | /** @sa set_thread_start_time_v1_t. */ | |
| | | set_thread_start_time_v1_t set_thread_start_time; | |
| | | /** @sa set_thread_state_v1_t. */ | |
| | | set_thread_state_v1_t set_thread_state; | |
| | | /** @sa set_thread_info_v1_t. */ | |
| | | set_thread_info_v1_t set_thread_info; | |
| /** @sa set_thread_v1_t. */ | | /** @sa set_thread_v1_t. */ | |
| set_thread_v1_t set_thread; | | set_thread_v1_t set_thread; | |
| /** @sa delete_current_thread_v1_t. */ | | /** @sa delete_current_thread_v1_t. */ | |
| delete_current_thread_v1_t delete_current_thread; | | delete_current_thread_v1_t delete_current_thread; | |
| /** @sa delete_thread_v1_t. */ | | /** @sa delete_thread_v1_t. */ | |
| delete_thread_v1_t delete_thread; | | delete_thread_v1_t delete_thread; | |
|
| /** @sa get_thread_mutex_locker_v1_t. */ | | | |
| get_thread_mutex_locker_v1_t get_thread_mutex_locker; | | | |
| /** @sa get_thread_rwlock_locker_v1_t. */ | | | |
| get_thread_rwlock_locker_v1_t get_thread_rwlock_locker; | | | |
| /** @sa get_thread_cond_locker_v1_t. */ | | | |
| get_thread_cond_locker_v1_t get_thread_cond_locker; | | | |
| /** @sa get_thread_table_locker_v1_t. */ | | | |
| get_thread_table_locker_v1_t get_thread_table_locker; | | | |
| /** @sa get_thread_file_name_locker_v1_t. */ | | /** @sa get_thread_file_name_locker_v1_t. */ | |
| get_thread_file_name_locker_v1_t get_thread_file_name_locker; | | get_thread_file_name_locker_v1_t get_thread_file_name_locker; | |
| /** @sa get_thread_file_stream_locker_v1_t. */ | | /** @sa get_thread_file_stream_locker_v1_t. */ | |
| get_thread_file_stream_locker_v1_t get_thread_file_stream_locker; | | get_thread_file_stream_locker_v1_t get_thread_file_stream_locker; | |
| /** @sa get_thread_file_descriptor_locker_v1_t. */ | | /** @sa get_thread_file_descriptor_locker_v1_t. */ | |
| get_thread_file_descriptor_locker_v1_t get_thread_file_descriptor_locker; | | get_thread_file_descriptor_locker_v1_t get_thread_file_descriptor_locker; | |
| /** @sa unlock_mutex_v1_t. */ | | /** @sa unlock_mutex_v1_t. */ | |
| unlock_mutex_v1_t unlock_mutex; | | unlock_mutex_v1_t unlock_mutex; | |
| /** @sa unlock_rwlock_v1_t. */ | | /** @sa unlock_rwlock_v1_t. */ | |
| unlock_rwlock_v1_t unlock_rwlock; | | unlock_rwlock_v1_t unlock_rwlock; | |
| /** @sa signal_cond_v1_t. */ | | /** @sa signal_cond_v1_t. */ | |
| signal_cond_v1_t signal_cond; | | signal_cond_v1_t signal_cond; | |
| /** @sa broadcast_cond_v1_t. */ | | /** @sa broadcast_cond_v1_t. */ | |
| broadcast_cond_v1_t broadcast_cond; | | broadcast_cond_v1_t broadcast_cond; | |
|
| | | /** @sa start_idle_wait_v1_t. */ | |
| | | start_idle_wait_v1_t start_idle_wait; | |
| | | /** @sa end_idle_wait_v1_t. */ | |
| | | end_idle_wait_v1_t end_idle_wait; | |
| /** @sa start_mutex_wait_v1_t. */ | | /** @sa start_mutex_wait_v1_t. */ | |
| start_mutex_wait_v1_t start_mutex_wait; | | start_mutex_wait_v1_t start_mutex_wait; | |
| /** @sa end_mutex_wait_v1_t. */ | | /** @sa end_mutex_wait_v1_t. */ | |
| end_mutex_wait_v1_t end_mutex_wait; | | end_mutex_wait_v1_t end_mutex_wait; | |
| /** @sa start_rwlock_rdwait_v1_t. */ | | /** @sa start_rwlock_rdwait_v1_t. */ | |
| start_rwlock_rdwait_v1_t start_rwlock_rdwait; | | start_rwlock_rdwait_v1_t start_rwlock_rdwait; | |
| /** @sa end_rwlock_rdwait_v1_t. */ | | /** @sa end_rwlock_rdwait_v1_t. */ | |
| end_rwlock_rdwait_v1_t end_rwlock_rdwait; | | end_rwlock_rdwait_v1_t end_rwlock_rdwait; | |
| /** @sa start_rwlock_wrwait_v1_t. */ | | /** @sa start_rwlock_wrwait_v1_t. */ | |
| start_rwlock_wrwait_v1_t start_rwlock_wrwait; | | start_rwlock_wrwait_v1_t start_rwlock_wrwait; | |
| /** @sa end_rwlock_wrwait_v1_t. */ | | /** @sa end_rwlock_wrwait_v1_t. */ | |
| end_rwlock_wrwait_v1_t end_rwlock_wrwait; | | end_rwlock_wrwait_v1_t end_rwlock_wrwait; | |
| /** @sa start_cond_wait_v1_t. */ | | /** @sa start_cond_wait_v1_t. */ | |
| start_cond_wait_v1_t start_cond_wait; | | start_cond_wait_v1_t start_cond_wait; | |
| /** @sa end_cond_wait_v1_t. */ | | /** @sa end_cond_wait_v1_t. */ | |
| end_cond_wait_v1_t end_cond_wait; | | end_cond_wait_v1_t end_cond_wait; | |
|
| /** @sa start_table_wait_v1_t. */ | | /** @sa start_table_io_wait_v1_t. */ | |
| start_table_wait_v1_t start_table_wait; | | start_table_io_wait_v1_t start_table_io_wait; | |
| /** @sa end_table_wait_v1_t. */ | | /** @sa end_table_io_wait_v1_t. */ | |
| end_table_wait_v1_t end_table_wait; | | end_table_io_wait_v1_t end_table_io_wait; | |
| | | /** @sa start_table_lock_wait_v1_t. */ | |
| | | start_table_lock_wait_v1_t start_table_lock_wait; | |
| | | /** @sa end_table_lock_wait_v1_t. */ | |
| | | end_table_lock_wait_v1_t end_table_lock_wait; | |
| /** @sa start_file_open_wait_v1_t. */ | | /** @sa start_file_open_wait_v1_t. */ | |
| start_file_open_wait_v1_t start_file_open_wait; | | start_file_open_wait_v1_t start_file_open_wait; | |
| /** @sa end_file_open_wait_v1_t. */ | | /** @sa end_file_open_wait_v1_t. */ | |
| end_file_open_wait_v1_t end_file_open_wait; | | end_file_open_wait_v1_t end_file_open_wait; | |
| /** @sa end_file_open_wait_and_bind_to_descriptor_v1_t. */ | | /** @sa end_file_open_wait_and_bind_to_descriptor_v1_t. */ | |
| end_file_open_wait_and_bind_to_descriptor_v1_t | | end_file_open_wait_and_bind_to_descriptor_v1_t | |
| end_file_open_wait_and_bind_to_descriptor; | | end_file_open_wait_and_bind_to_descriptor; | |
| /** @sa start_file_wait_v1_t. */ | | /** @sa start_file_wait_v1_t. */ | |
| start_file_wait_v1_t start_file_wait; | | start_file_wait_v1_t start_file_wait; | |
| /** @sa end_file_wait_v1_t. */ | | /** @sa end_file_wait_v1_t. */ | |
| end_file_wait_v1_t end_file_wait; | | end_file_wait_v1_t end_file_wait; | |
|
| | | /** @sa start_file_close_wait_v1_t. */ | |
| | | start_file_close_wait_v1_t start_file_close_wait; | |
| | | /** @sa end_file_close_wait_v1_t. */ | |
| | | end_file_close_wait_v1_t end_file_close_wait; | |
| | | /** @sa start_stage_v1_t. */ | |
| | | start_stage_v1_t start_stage; | |
| | | /** @sa end_stage_v1_t. */ | |
| | | end_stage_v1_t end_stage; | |
| | | /** @sa get_thread_statement_locker_v1_t. */ | |
| | | get_thread_statement_locker_v1_t get_thread_statement_locker; | |
| | | /** @sa refine_statement_v1_t. */ | |
| | | refine_statement_v1_t refine_statement; | |
| | | /** @sa start_statement_v1_t. */ | |
| | | start_statement_v1_t start_statement; | |
| | | /** @sa set_statement_text_v1_t. */ | |
| | | set_statement_text_v1_t set_statement_text; | |
| | | /** @sa set_statement_lock_time_t. */ | |
| | | set_statement_lock_time_t set_statement_lock_time; | |
| | | /** @sa set_statement_rows_sent_t. */ | |
| | | set_statement_rows_sent_t set_statement_rows_sent; | |
| | | /** @sa set_statement_rows_examined_t. */ | |
| | | set_statement_rows_examined_t set_statement_rows_examined; | |
| | | /** @sa inc_statement_created_tmp_disk_tables. */ | |
| | | inc_statement_created_tmp_disk_tables_t inc_statement_created_tmp_disk_ta | |
| | | bles; | |
| | | /** @sa inc_statement_created_tmp_tables. */ | |
| | | inc_statement_created_tmp_tables_t inc_statement_created_tmp_tables; | |
| | | /** @sa inc_statement_select_full_join. */ | |
| | | inc_statement_select_full_join_t inc_statement_select_full_join; | |
| | | /** @sa inc_statement_select_full_range_join. */ | |
| | | inc_statement_select_full_range_join_t inc_statement_select_full_range_jo | |
| | | in; | |
| | | /** @sa inc_statement_select_range. */ | |
| | | inc_statement_select_range_t inc_statement_select_range; | |
| | | /** @sa inc_statement_select_range_check. */ | |
| | | inc_statement_select_range_check_t inc_statement_select_range_check; | |
| | | /** @sa inc_statement_select_scan. */ | |
| | | inc_statement_select_scan_t inc_statement_select_scan; | |
| | | /** @sa inc_statement_sort_merge_passes. */ | |
| | | inc_statement_sort_merge_passes_t inc_statement_sort_merge_passes; | |
| | | /** @sa inc_statement_sort_range. */ | |
| | | inc_statement_sort_range_t inc_statement_sort_range; | |
| | | /** @sa inc_statement_sort_rows. */ | |
| | | inc_statement_sort_rows_t inc_statement_sort_rows; | |
| | | /** @sa inc_statement_sort_scan. */ | |
| | | inc_statement_sort_scan_t inc_statement_sort_scan; | |
| | | /** @sa set_statement_no_index_used. */ | |
| | | set_statement_no_index_used_t set_statement_no_index_used; | |
| | | /** @sa set_statement_no_good_index_used. */ | |
| | | set_statement_no_good_index_used_t set_statement_no_good_index_used; | |
| | | /** @sa end_statement_v1_t. */ | |
| | | end_statement_v1_t end_statement; | |
| | | /** @sa start_socket_wait_v1_t. */ | |
| | | start_socket_wait_v1_t start_socket_wait; | |
| | | /** @sa end_socket_wait_v1_t. */ | |
| | | end_socket_wait_v1_t end_socket_wait; | |
| | | /** @sa set_socket_state_v1_t. */ | |
| | | set_socket_state_v1_t set_socket_state; | |
| | | /** @sa set_socket_info_v1_t. */ | |
| | | set_socket_info_v1_t set_socket_info; | |
| | | /** @sa set_socket_thread_owner_v1_t. */ | |
| | | set_socket_thread_owner_v1_t set_socket_thread_owner; | |
| | | /** @sa digest_start_v1_t. */ | |
| | | digest_start_v1_t digest_start; | |
| | | /** @sa digest_add_token_v1_t. */ | |
| | | digest_add_token_v1_t digest_add_token; | |
| | | /** @sa set_thread_connect_attrs_v1_t. */ | |
| | | set_thread_connect_attrs_v1_t set_thread_connect_attrs; | |
| }; | | }; | |
| | | | |
| /** @} (end of group Group_PSI_v1) */ | | /** @} (end of group Group_PSI_v1) */ | |
| | | | |
| #endif /* HAVE_PSI_1 */ | | #endif /* HAVE_PSI_1 */ | |
| | | | |
| #ifdef USE_PSI_2 | | #ifdef USE_PSI_2 | |
| #define HAVE_PSI_2 | | #define HAVE_PSI_2 | |
| #endif | | #endif | |
| | | | |
| | | | |
| skipping to change at line 1197 | | skipping to change at line 2190 | |
| int placeholder; | | int placeholder; | |
| }; | | }; | |
| | | | |
| /** Placeholder */ | | /** Placeholder */ | |
| struct PSI_file_info_v2 | | struct PSI_file_info_v2 | |
| { | | { | |
| /** Placeholder */ | | /** Placeholder */ | |
| int placeholder; | | int placeholder; | |
| }; | | }; | |
| | | | |
|
| | | /** Placeholder */ | |
| | | struct PSI_stage_info_v2 | |
| | | { | |
| | | /** Placeholder */ | |
| | | int placeholder; | |
| | | }; | |
| | | | |
| | | /** Placeholder */ | |
| | | struct PSI_statement_info_v2 | |
| | | { | |
| | | /** Placeholder */ | |
| | | int placeholder; | |
| | | }; | |
| | | | |
| | | /** Placeholder */ | |
| | | struct PSI_idle_locker_state_v2 | |
| | | { | |
| | | /** Placeholder */ | |
| | | int placeholder; | |
| | | }; | |
| | | | |
| | | /** Placeholder */ | |
| struct PSI_mutex_locker_state_v2 | | struct PSI_mutex_locker_state_v2 | |
| { | | { | |
| /** Placeholder */ | | /** Placeholder */ | |
| int placeholder; | | int placeholder; | |
| }; | | }; | |
| | | | |
|
| | | /** Placeholder */ | |
| struct PSI_rwlock_locker_state_v2 | | struct PSI_rwlock_locker_state_v2 | |
| { | | { | |
| /** Placeholder */ | | /** Placeholder */ | |
| int placeholder; | | int placeholder; | |
| }; | | }; | |
| | | | |
|
| | | /** Placeholder */ | |
| struct PSI_cond_locker_state_v2 | | struct PSI_cond_locker_state_v2 | |
| { | | { | |
| /** Placeholder */ | | /** Placeholder */ | |
| int placeholder; | | int placeholder; | |
| }; | | }; | |
| | | | |
|
| | | /** Placeholder */ | |
| struct PSI_file_locker_state_v2 | | struct PSI_file_locker_state_v2 | |
| { | | { | |
| /** Placeholder */ | | /** Placeholder */ | |
| int placeholder; | | int placeholder; | |
| }; | | }; | |
| | | | |
|
| | | /** Placeholder */ | |
| struct PSI_table_locker_state_v2 | | struct PSI_table_locker_state_v2 | |
| { | | { | |
| /** Placeholder */ | | /** Placeholder */ | |
| int placeholder; | | int placeholder; | |
| }; | | }; | |
| | | | |
|
| | | /** Placeholder */ | |
| | | struct PSI_statement_locker_state_v2 | |
| | | { | |
| | | /** Placeholder */ | |
| | | int placeholder; | |
| | | }; | |
| | | | |
| | | /** Placeholder */ | |
| | | struct PSI_socket_locker_state_v2 | |
| | | { | |
| | | /** Placeholder */ | |
| | | int placeholder; | |
| | | }; | |
| | | | |
| /** @} (end of group Group_PSI_v2) */ | | /** @} (end of group Group_PSI_v2) */ | |
| | | | |
| #endif /* HAVE_PSI_2 */ | | #endif /* HAVE_PSI_2 */ | |
| | | | |
| /** | | /** | |
| @typedef PSI | | @typedef PSI | |
| The instrumentation interface for the current version. | | The instrumentation interface for the current version. | |
| @sa PSI_CURRENT_VERSION | | @sa PSI_CURRENT_VERSION | |
| */ | | */ | |
| | | | |
| | | | |
| skipping to change at line 1270 | | skipping to change at line 2303 | |
| */ | | */ | |
| | | | |
| /* Export the required version */ | | /* Export the required version */ | |
| #ifdef USE_PSI_1 | | #ifdef USE_PSI_1 | |
| typedef struct PSI_v1 PSI; | | typedef struct PSI_v1 PSI; | |
| typedef struct PSI_mutex_info_v1 PSI_mutex_info; | | typedef struct PSI_mutex_info_v1 PSI_mutex_info; | |
| typedef struct PSI_rwlock_info_v1 PSI_rwlock_info; | | typedef struct PSI_rwlock_info_v1 PSI_rwlock_info; | |
| typedef struct PSI_cond_info_v1 PSI_cond_info; | | typedef struct PSI_cond_info_v1 PSI_cond_info; | |
| typedef struct PSI_thread_info_v1 PSI_thread_info; | | typedef struct PSI_thread_info_v1 PSI_thread_info; | |
| typedef struct PSI_file_info_v1 PSI_file_info; | | typedef struct PSI_file_info_v1 PSI_file_info; | |
|
| | | typedef struct PSI_stage_info_v1 PSI_stage_info; | |
| | | typedef struct PSI_statement_info_v1 PSI_statement_info; | |
| | | typedef struct PSI_socket_info_v1 PSI_socket_info; | |
| | | typedef struct PSI_idle_locker_state_v1 PSI_idle_locker_state; | |
| typedef struct PSI_mutex_locker_state_v1 PSI_mutex_locker_state; | | typedef struct PSI_mutex_locker_state_v1 PSI_mutex_locker_state; | |
| typedef struct PSI_rwlock_locker_state_v1 PSI_rwlock_locker_state; | | typedef struct PSI_rwlock_locker_state_v1 PSI_rwlock_locker_state; | |
| typedef struct PSI_cond_locker_state_v1 PSI_cond_locker_state; | | typedef struct PSI_cond_locker_state_v1 PSI_cond_locker_state; | |
| typedef struct PSI_file_locker_state_v1 PSI_file_locker_state; | | typedef struct PSI_file_locker_state_v1 PSI_file_locker_state; | |
| typedef struct PSI_table_locker_state_v1 PSI_table_locker_state; | | typedef struct PSI_table_locker_state_v1 PSI_table_locker_state; | |
|
| | | typedef struct PSI_statement_locker_state_v1 PSI_statement_locker_state; | |
| | | typedef struct PSI_socket_locker_state_v1 PSI_socket_locker_state; | |
| #endif | | #endif | |
| | | | |
| #ifdef USE_PSI_2 | | #ifdef USE_PSI_2 | |
| typedef struct PSI_v2 PSI; | | typedef struct PSI_v2 PSI; | |
| typedef struct PSI_mutex_info_v2 PSI_mutex_info; | | typedef struct PSI_mutex_info_v2 PSI_mutex_info; | |
| typedef struct PSI_rwlock_info_v2 PSI_rwlock_info; | | typedef struct PSI_rwlock_info_v2 PSI_rwlock_info; | |
| typedef struct PSI_cond_info_v2 PSI_cond_info; | | typedef struct PSI_cond_info_v2 PSI_cond_info; | |
| typedef struct PSI_thread_info_v2 PSI_thread_info; | | typedef struct PSI_thread_info_v2 PSI_thread_info; | |
| typedef struct PSI_file_info_v2 PSI_file_info; | | typedef struct PSI_file_info_v2 PSI_file_info; | |
|
| | | typedef struct PSI_stage_info_v2 PSI_stage_info; | |
| | | typedef struct PSI_statement_info_v2 PSI_statement_info; | |
| | | typedef struct PSI_socket_info_v2 PSI_socket_info; | |
| | | typedef struct PSI_idle_locker_state_v2 PSI_idle_locker_state; | |
| typedef struct PSI_mutex_locker_state_v2 PSI_mutex_locker_state; | | typedef struct PSI_mutex_locker_state_v2 PSI_mutex_locker_state; | |
| typedef struct PSI_rwlock_locker_state_v2 PSI_rwlock_locker_state; | | typedef struct PSI_rwlock_locker_state_v2 PSI_rwlock_locker_state; | |
| typedef struct PSI_cond_locker_state_v2 PSI_cond_locker_state; | | typedef struct PSI_cond_locker_state_v2 PSI_cond_locker_state; | |
| typedef struct PSI_file_locker_state_v2 PSI_file_locker_state; | | typedef struct PSI_file_locker_state_v2 PSI_file_locker_state; | |
| typedef struct PSI_table_locker_state_v2 PSI_table_locker_state; | | typedef struct PSI_table_locker_state_v2 PSI_table_locker_state; | |
|
| | | typedef struct PSI_statement_locker_state_v2 PSI_statement_locker_state; | |
| | | typedef struct PSI_socket_locker_state_v2 PSI_socket_locker_state; | |
| #endif | | #endif | |
| | | | |
| #else /* HAVE_PSI_INTERFACE */ | | #else /* HAVE_PSI_INTERFACE */ | |
| | | | |
| /** | | /** | |
| Dummy structure, used to declare PSI_server when no instrumentation | | Dummy structure, used to declare PSI_server when no instrumentation | |
| is available. | | is available. | |
| The content does not matter, since PSI_server will be NULL. | | The content does not matter, since PSI_server will be NULL. | |
| */ | | */ | |
| struct PSI_none | | struct PSI_none | |
| { | | { | |
| int opaque; | | int opaque; | |
| }; | | }; | |
| typedef struct PSI_none PSI; | | typedef struct PSI_none PSI; | |
| | | | |
|
| | | /** | |
| | | Stage instrument information. | |
| | | @since PSI_VERSION_1 | |
| | | This structure is used to register an instrumented stage. | |
| | | */ | |
| | | struct PSI_stage_info_none | |
| | | { | |
| | | /** Unused stage key. */ | |
| | | unsigned int m_key; | |
| | | /** The name of the stage instrument. */ | |
| | | const char *m_name; | |
| | | /** Unused stage flags. */ | |
| | | int m_flags; | |
| | | }; | |
| | | | |
| | | /** | |
| | | The stage instrumentation has to co exist with the legacy | |
| | | THD::set_proc_info instrumentation. | |
| | | To avoid duplication of the instrumentation in the server, | |
| | | the common PSI_stage_info structure is used, | |
| | | so we export it here, even when not building | |
| | | with HAVE_PSI_INTERFACE. | |
| | | */ | |
| | | typedef struct PSI_stage_info_none PSI_stage_info; | |
| | | | |
| #endif /* HAVE_PSI_INTERFACE */ | | #endif /* HAVE_PSI_INTERFACE */ | |
| | | | |
| extern MYSQL_PLUGIN_IMPORT PSI *PSI_server; | | extern MYSQL_PLUGIN_IMPORT PSI *PSI_server; | |
| | | | |
|
| | | /* | |
| | | Allow to override PSI_XXX_CALL at compile time | |
| | | with more efficient implementations, if available. | |
| | | If nothing better is available, | |
| | | make a dynamic call using the PSI_server function pointer. | |
| | | */ | |
| | | | |
| | | #ifndef PSI_MUTEX_CALL | |
| | | #define PSI_MUTEX_CALL(M) PSI_DYNAMIC_CALL(M) | |
| | | #endif | |
| | | | |
| | | #ifndef PSI_RWLOCK_CALL | |
| | | #define PSI_RWLOCK_CALL(M) PSI_DYNAMIC_CALL(M) | |
| | | #endif | |
| | | | |
| | | #ifndef PSI_COND_CALL | |
| | | #define PSI_COND_CALL(M) PSI_DYNAMIC_CALL(M) | |
| | | #endif | |
| | | | |
| | | #ifndef PSI_THREAD_CALL | |
| | | #define PSI_THREAD_CALL(M) PSI_DYNAMIC_CALL(M) | |
| | | #endif | |
| | | | |
| | | #ifndef PSI_FILE_CALL | |
| | | #define PSI_FILE_CALL(M) PSI_DYNAMIC_CALL(M) | |
| | | #endif | |
| | | | |
| | | #ifndef PSI_SOCKET_CALL | |
| | | #define PSI_SOCKET_CALL(M) PSI_DYNAMIC_CALL(M) | |
| | | #endif | |
| | | | |
| | | #ifndef PSI_STAGE_CALL | |
| | | #define PSI_STAGE_CALL(M) PSI_DYNAMIC_CALL(M) | |
| | | #endif | |
| | | | |
| | | #ifndef PSI_STATEMENT_CALL | |
| | | #define PSI_STATEMENT_CALL(M) PSI_DYNAMIC_CALL(M) | |
| | | #endif | |
| | | | |
| | | #ifndef PSI_TABLE_CALL | |
| | | #define PSI_TABLE_CALL(M) PSI_DYNAMIC_CALL(M) | |
| | | #endif | |
| | | | |
| | | #ifndef PSI_IDLE_CALL | |
| | | #define PSI_IDLE_CALL(M) PSI_DYNAMIC_CALL(M) | |
| | | #endif | |
| | | | |
| | | #define PSI_DYNAMIC_CALL(M) PSI_server->M | |
| | | | |
| /** @} */ | | /** @} */ | |
| | | | |
| C_MODE_END | | C_MODE_END | |
| #endif /* MYSQL_PERFORMANCE_SCHEMA_INTERFACE_H */ | | #endif /* MYSQL_PERFORMANCE_SCHEMA_INTERFACE_H */ | |
| | | | |
End of changes. 101 change blocks. |
| 138 lines changed or deleted | | 1273 lines changed or added | |
|