| m_ctype.h | | m_ctype.h | |
| | | | |
| skipping to change at line 351 | | skipping to change at line 351 | |
| | | | |
| extern CHARSET_INFO my_charset_utf8_general_ci; | | extern CHARSET_INFO my_charset_utf8_general_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_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 + (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 + (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(CHARSET_INFO *, uchar *, size_t, | |
| const uchar *, size_t); | | const uchar *, size_t); | |
| size_t my_strnxfrmlen_simple(CHARSET_INFO *, size_t); | | size_t my_strnxfrmlen_simple(CHARSET_INFO *, size_t); | |
| extern int my_strnncoll_simple(CHARSET_INFO *, const uchar *, size_t, | | extern int my_strnncoll_simple(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(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)
; | |
| | | | |
| skipping to change at line 424 | | skipping to change at line 449 | |
| | | | |
| ulonglong my_strntoull10rnd_8bit(CHARSET_INFO *cs, | | ulonglong my_strntoull10rnd_8bit(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(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(CHARSET_INFO *cs, char* to, size_t l, int fill); | |
| | | | |
|
| | | /* For 8-bit character set */ | |
| my_bool my_like_range_simple(CHARSET_INFO *cs, | | my_bool my_like_range_simple(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 */ | |
| my_bool my_like_range_mb(CHARSET_INFO *cs, | | my_bool my_like_range_mb(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); | |
| | | | |
|
| my_bool my_like_range_ucs2(CHARSET_INFO *cs, | | /* For other character sets, with arbitrary mbminlen and mbmaxlen numbers * | |
| const char *ptr, size_t ptr_length, | | / | |
| pbool escape, pbool w_one, pbool w_many, | | my_bool my_like_range_generic(CHARSET_INFO *cs, | |
| size_t res_length, | | const char *ptr, size_t ptr_length, | |
| char *min_str, char *max_str, | | pbool escape, pbool w_one, pbool w_many, | |
| size_t *min_length, size_t *max_length); | | size_t res_length, | |
| | | char *min_str, char *max_str, | |
| my_bool my_like_range_utf16(CHARSET_INFO *cs, | | size_t *min_length, size_t *max_length); | |
| const char *ptr, size_t ptr_length, | | | |
| pbool escape, pbool w_one, pbool w_many, | | | |
| size_t res_length, | | | |
| char *min_str, char *max_str, | | | |
| size_t *min_length, size_t *max_length); | | | |
| | | | |
| my_bool my_like_range_utf32(CHARSET_INFO *cs, | | | |
| const char *ptr, size_t ptr_length, | | | |
| pbool escape, pbool w_one, pbool w_many, | | | |
| size_t res_length, | | | |
| char *min_str, char *max_str, | | | |
| size_t *min_length, size_t *max_length); | | | |
| | | | |
| int my_wildcmp_8bit(CHARSET_INFO *, | | int my_wildcmp_8bit(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(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); | |
| | | | |
| skipping to change at line 547 | | skipping to change at line 561 | |
| int my_wildcmp_unicode(CHARSET_INFO *cs, | | int my_wildcmp_unicode(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(const char *bug, size_t len, | |
| int (*add)(CHARSET_INFO *cs)); | | int (*add)(CHARSET_INFO *cs)); | |
| extern char *my_strchr(CHARSET_INFO *cs, const char *str, const char *end, | | extern char *my_strchr(CHARSET_INFO *cs, const char *str, const char *end, | |
| pchar c); | | pchar c); | |
|
| | | extern size_t my_strcspn(CHARSET_INFO *cs, const char *str, const char *end | |
| | | , | |
| | | const char *accept); | |
| | | | |
| my_bool my_propagate_simple(CHARSET_INFO *cs, const uchar *str, size_t len)
; | | my_bool my_propagate_simple(CHARSET_INFO *cs, const uchar *str, size_t len)
; | |
| my_bool my_propagate_complex(CHARSET_INFO *cs, const uchar *str, size_t len
); | | my_bool my_propagate_complex(CHARSET_INFO *cs, const uchar *str, size_t len
); | |
| | | | |
| uint my_string_repertoire(CHARSET_INFO *cs, const char *str, ulong len); | | uint my_string_repertoire(CHARSET_INFO *cs, const char *str, ulong len); | |
| my_bool my_charset_is_ascii_based(CHARSET_INFO *cs); | | my_bool my_charset_is_ascii_based(CHARSET_INFO *cs); | |
| my_bool my_charset_is_8bit_pure_ascii(CHARSET_INFO *cs); | | my_bool my_charset_is_8bit_pure_ascii(CHARSET_INFO *cs); | |
| uint my_charset_repertoire(CHARSET_INFO *cs); | | uint my_charset_repertoire(CHARSET_INFO *cs); | |
| | | | |
| my_bool my_charset_is_ascii_compatible(CHARSET_INFO *cs); | | my_bool my_charset_is_ascii_compatible(CHARSET_INFO *cs); | |
| | | | |
End of changes. 5 change blocks. |
| 20 lines changed or deleted | | 38 lines changed or added | |
|
| my_config.h | | my_config.h | |
|
| /* Copyright (C) 2009 Sun Microsystems, Inc | | /* Copyright (C) 2009, 2011, 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 229 | | skipping to change at line 230 | |
| #define HAVE_PTHREAD_KEY_DELETE 1 | | #define HAVE_PTHREAD_KEY_DELETE 1 | |
| #define HAVE_PTHREAD_KEY_DELETE 1 | | #define HAVE_PTHREAD_KEY_DELETE 1 | |
| /* #undef HAVE_PTHREAD_KILL */ | | /* #undef HAVE_PTHREAD_KILL */ | |
| #define HAVE_PTHREAD_RWLOCK_RDLOCK 1 | | #define HAVE_PTHREAD_RWLOCK_RDLOCK 1 | |
| /* #undef HAVE_PTHREAD_SETPRIO_NP */ | | /* #undef HAVE_PTHREAD_SETPRIO_NP */ | |
| /* #undef HAVE_PTHREAD_SETSCHEDPARAM */ | | /* #undef HAVE_PTHREAD_SETSCHEDPARAM */ | |
| #define HAVE_PTHREAD_SIGMASK 1 | | #define HAVE_PTHREAD_SIGMASK 1 | |
| /* #undef HAVE_PTHREAD_THREADMASK */ | | /* #undef HAVE_PTHREAD_THREADMASK */ | |
| /* #undef HAVE_PTHREAD_YIELD_NP */ | | /* #undef HAVE_PTHREAD_YIELD_NP */ | |
| #define HAVE_PTHREAD_YIELD_ZERO_ARG 1 | | #define HAVE_PTHREAD_YIELD_ZERO_ARG 1 | |
|
| | | #define PTHREAD_ONCE_INITIALIZER PTHREAD_ONCE_INIT | |
| #define HAVE_PUTENV 1 | | #define HAVE_PUTENV 1 | |
| #define HAVE_RE_COMP 1 | | #define HAVE_RE_COMP 1 | |
| #define HAVE_REGCOMP 1 | | #define HAVE_REGCOMP 1 | |
| #define HAVE_READDIR_R 1 | | #define HAVE_READDIR_R 1 | |
| #define HAVE_READLINK 1 | | #define HAVE_READLINK 1 | |
| #define HAVE_REALPATH 1 | | #define HAVE_REALPATH 1 | |
| #define HAVE_RENAME 1 | | #define HAVE_RENAME 1 | |
| #define HAVE_RINT 1 | | #define HAVE_RINT 1 | |
| /* #undef HAVE_RWLOCK_INIT */ | | /* #undef HAVE_RWLOCK_INIT */ | |
| #define HAVE_SCHED_YIELD 1 | | #define HAVE_SCHED_YIELD 1 | |
| | | | |
| skipping to change at line 408 | | skipping to change at line 410 | |
| /* Define to `__inline__' or `__inline' if that's what the C compiler calls | | /* Define to `__inline__' or `__inline' if that's what the C compiler calls | |
| it, or to nothing if 'inline' is not supported under any name. */ | | it, or to nothing if 'inline' is not supported under any name. */ | |
| #define C_HAS_inline 1 | | #define C_HAS_inline 1 | |
| #if !(C_HAS_inline) | | #if !(C_HAS_inline) | |
| #ifndef __cplusplus | | #ifndef __cplusplus | |
| # define inline | | # define inline | |
| #endif | | #endif | |
| #endif | | #endif | |
| | | | |
| #define TARGET_OS_LINUX 1 | | #define TARGET_OS_LINUX 1 | |
|
| /* #undef TARGET_OS_SOLARIS */ | | | |
| | | | |
| #define HAVE_WCTYPE_H 1 | | #define HAVE_WCTYPE_H 1 | |
| #define HAVE_WCHAR_H 1 | | #define HAVE_WCHAR_H 1 | |
| #define HAVE_LANGINFO_H 1 | | #define HAVE_LANGINFO_H 1 | |
| #define HAVE_MBRLEN | | #define HAVE_MBRLEN | |
| /* #undef HAVE_MBSCMP */ | | /* #undef HAVE_MBSCMP */ | |
| #define HAVE_MBSRTOWCS | | #define HAVE_MBSRTOWCS | |
| #define HAVE_WCRTOMB | | #define HAVE_WCRTOMB | |
| #define HAVE_MBRTOWC | | #define HAVE_MBRTOWC | |
| #define HAVE_WCSCOLL | | #define HAVE_WCSCOLL | |
| | | | |
| skipping to change at line 469 | | skipping to change at line 470 | |
| | | | |
| /* #undef _LARGE_FILES */ | | /* #undef _LARGE_FILES */ | |
| #define _LARGEFILE_SOURCE 1 | | #define _LARGEFILE_SOURCE 1 | |
| /* #undef _LARGEFILE64_SOURCE */ | | /* #undef _LARGEFILE64_SOURCE */ | |
| #define _FILE_OFFSET_BITS 64 | | #define _FILE_OFFSET_BITS 64 | |
| | | | |
| #define TIME_WITH_SYS_TIME 1 | | #define TIME_WITH_SYS_TIME 1 | |
| | | | |
| #define STACK_DIRECTION -1 | | #define STACK_DIRECTION -1 | |
| | | | |
|
| #define THREAD 1 | | | |
| #define THREAD_SAFE_CLIENT 1 | | | |
| | | | |
| #define SYSTEM_TYPE "Linux" | | #define SYSTEM_TYPE "Linux" | |
| #define MACHINE_TYPE "i686" | | #define MACHINE_TYPE "i686" | |
| /* #undef HAVE_DTRACE */ | | /* #undef HAVE_DTRACE */ | |
| | | | |
| #define SIGNAL_WITH_VIO_CLOSE 1 | | #define SIGNAL_WITH_VIO_CLOSE 1 | |
| | | | |
| /* Windows stuff, mostly functions, that have Posix analogs but named diffe
rently */ | | /* Windows stuff, mostly functions, that have Posix analogs but named diffe
rently */ | |
| /* #undef S_IROTH */ | | /* #undef S_IROTH */ | |
| /* #undef S_IFIFO */ | | /* #undef S_IFIFO */ | |
| /* #undef IPPROTO_IPV6 */ | | /* #undef IPPROTO_IPV6 */ | |
| | | | |
| skipping to change at line 589 | | skipping to change at line 587 | |
| #define WITH_MYISAMMRG_STORAGE_ENGINE 1 | | #define WITH_MYISAMMRG_STORAGE_ENGINE 1 | |
| #define WITH_HEAP_STORAGE_ENGINE 1 | | #define WITH_HEAP_STORAGE_ENGINE 1 | |
| #define WITH_CSV_STORAGE_ENGINE 1 | | #define WITH_CSV_STORAGE_ENGINE 1 | |
| #define WITH_PARTITION_STORAGE_ENGINE 1 | | #define WITH_PARTITION_STORAGE_ENGINE 1 | |
| #define WITH_PERFSCHEMA_STORAGE_ENGINE 1 | | #define WITH_PERFSCHEMA_STORAGE_ENGINE 1 | |
| /* #undef WITH_NDBCLUSTER_STORAGE_ENGINE */ | | /* #undef WITH_NDBCLUSTER_STORAGE_ENGINE */ | |
| #if (WITH_NDBCLUSTER_STORAGE_ENGINE) && !defined(EMBEDDED_LIBRARY) | | #if (WITH_NDBCLUSTER_STORAGE_ENGINE) && !defined(EMBEDDED_LIBRARY) | |
| # define HAVE_NDB_BINLOG 1 | | # define HAVE_NDB_BINLOG 1 | |
| #endif | | #endif | |
| | | | |
|
| #define DEFAULT_MYSQL_HOME "/home/ut/testing/mysql/5.5.8" | | #define DEFAULT_MYSQL_HOME "/home/ut/testing/mysql/5.5.9" | |
| #define SHAREDIR "/home/ut/testing/mysql/5.5.8/share" | | #define SHAREDIR "/home/ut/testing/mysql/5.5.9/share" | |
| #define DEFAULT_BASEDIR "/home/ut/testing/mysql/5.5.8" | | #define DEFAULT_BASEDIR "/home/ut/testing/mysql/5.5.9" | |
| #define MYSQL_DATADIR "/home/ut/testing/mysql/5.5.8/data" | | #define MYSQL_DATADIR "/home/ut/testing/mysql/5.5.9/data" | |
| #define DEFAULT_CHARSET_HOME "/home/ut/testing/mysql/5.5.8" | | #define DEFAULT_CHARSET_HOME "/home/ut/testing/mysql/5.5.9" | |
| #define PLUGINDIR "/home/ut/testing/mysql/5.5.8/lib/plugin" | | #define PLUGINDIR "/home/ut/testing/mysql/5.5.9/lib/plugin" | |
| #define DEFAULT_SYSCONFDIR "/home/ut/testing/mysql/5.5.8/etc" | | #define DEFAULT_SYSCONFDIR "/home/ut/testing/mysql/5.5.9/etc" | |
| | | | |
| /* #undef SO_EXT */ | | /* #undef SO_EXT */ | |
| | | | |
|
| | | #define MYSQL_MAJOR_VERSION 5 | |
| | | #define MYSQL_MINOR_VERSION 5 | |
| | | | |
| #define PACKAGE "mysql" | | #define PACKAGE "mysql" | |
| #define PACKAGE_BUGREPORT "" | | #define PACKAGE_BUGREPORT "" | |
| #define PACKAGE_NAME "MySQL Server" | | #define PACKAGE_NAME "MySQL Server" | |
|
| #define PACKAGE_STRING "MySQL Server 5.5.8" | | #define PACKAGE_STRING "MySQL Server 5.5.9" | |
| #define PACKAGE_TARNAME "mysql" | | #define PACKAGE_TARNAME "mysql" | |
|
| #define PACKAGE_VERSION "5.5.8" | | #define PACKAGE_VERSION "5.5.9" | |
| #define VERSION "5.5.8" | | #define VERSION "5.5.9" | |
| #define PROTOCOL_VERSION 10 | | #define PROTOCOL_VERSION 10 | |
| | | | |
| #endif | | #endif | |
| | | | |
End of changes. 8 change blocks. |
| 15 lines changed or deleted | | 16 lines changed or added | |
|
| my_global.h | | my_global.h | |
| | | | |
| skipping to change at line 213 | | skipping to change at line 213 | |
| #endif | | #endif | |
| | | | |
| /* | | /* | |
| Temporary solution to solve bug#7156. Include "sys/types.h" before | | Temporary solution to solve bug#7156. Include "sys/types.h" before | |
| the thread headers, else the function madvise() will not be defined | | the thread headers, else the function madvise() will not be defined | |
| */ | | */ | |
| #if defined(HAVE_SYS_TYPES_H) && ( defined(sun) || defined(__sun) ) | | #if defined(HAVE_SYS_TYPES_H) && ( defined(sun) || defined(__sun) ) | |
| #include <sys/types.h> | | #include <sys/types.h> | |
| #endif | | #endif | |
| | | | |
|
| /* The client defines this to avoid all thread code */ | | | |
| #if defined(MYSQL_CLIENT_NO_THREADS) || defined(UNDEF_THREADS_HACK) | | | |
| #undef THREAD | | | |
| #undef HAVE_LINUXTHREADS | | | |
| #undef HAVE_NPTL | | | |
| #endif | | | |
| | | | |
| #ifdef HAVE_THREADS_WITHOUT_SOCKETS | | #ifdef HAVE_THREADS_WITHOUT_SOCKETS | |
| /* MIT pthreads does not work with unix sockets */ | | /* MIT pthreads does not work with unix sockets */ | |
| #undef HAVE_SYS_UN_H | | #undef HAVE_SYS_UN_H | |
| #endif | | #endif | |
| | | | |
| #define __EXTENSIONS__ 1 /* We want some extension */ | | #define __EXTENSIONS__ 1 /* We want some extension */ | |
| #ifndef __STDC_EXT__ | | #ifndef __STDC_EXT__ | |
| #define __STDC_EXT__ 1 /* To get large file support on hpux */ | | #define __STDC_EXT__ 1 /* To get large file support on hpux */ | |
| #endif | | #endif | |
| | | | |
| | | | |
| skipping to change at line 262 | | skipping to change at line 255 | |
| Cleaner solutions are welcome. | | Cleaner solutions are welcome. | |
| */ | | */ | |
| #ifdef __sun | | #ifdef __sun | |
| #if __STDC_VERSION__ - 0 >= 199901L | | #if __STDC_VERSION__ - 0 >= 199901L | |
| #define _XOPEN_SOURCE 600 | | #define _XOPEN_SOURCE 600 | |
| #else | | #else | |
| #define _XOPEN_SOURCE 500 | | #define _XOPEN_SOURCE 500 | |
| #endif | | #endif | |
| #endif | | #endif | |
| | | | |
|
| #if defined(THREAD) && !defined(__WIN__) | | #if !defined(__WIN__) | |
| #ifndef _POSIX_PTHREAD_SEMANTICS | | #ifndef _POSIX_PTHREAD_SEMANTICS | |
| #define _POSIX_PTHREAD_SEMANTICS /* We want posix threads */ | | #define _POSIX_PTHREAD_SEMANTICS /* We want posix threads */ | |
| #endif | | #endif | |
| | | | |
| #if !defined(SCO) | | #if !defined(SCO) | |
| #define _REENTRANT 1 /* Some thread libraries require this */ | | #define _REENTRANT 1 /* Some thread libraries require this */ | |
| #endif | | #endif | |
| #if !defined(_THREAD_SAFE) && !defined(_AIX) | | #if !defined(_THREAD_SAFE) && !defined(_AIX) | |
| #define _THREAD_SAFE /* Required for OSF1 */ | | #define _THREAD_SAFE /* Required for OSF1 */ | |
| #endif | | #endif | |
| #if defined(HPUX10) || defined(HPUX11) | | #if defined(HPUX10) || defined(HPUX11) | |
| C_MODE_START /* HPUX needs this, signal.h bug */ | | C_MODE_START /* HPUX needs this, signal.h bug */ | |
| #include <pthread.h> | | #include <pthread.h> | |
| C_MODE_END | | C_MODE_END | |
| #else | | #else | |
| #include <pthread.h> /* AIX must have this included first */ | | #include <pthread.h> /* AIX must have this included first */ | |
| #endif | | #endif | |
| #if !defined(SCO) && !defined(_REENTRANT) | | #if !defined(SCO) && !defined(_REENTRANT) | |
| #define _REENTRANT 1 /* Threads requires reentrant code */ | | #define _REENTRANT 1 /* Threads requires reentrant code */ | |
| #endif | | #endif | |
|
| #endif /* THREAD */ | | #endif /* !defined(__WIN__) */ | |
| | | | |
| /* Go around some bugs in different OS and compilers */ | | /* Go around some bugs in different OS and compilers */ | |
| #ifdef _AIX /* By soren@t.dk */ | | #ifdef _AIX /* By soren@t.dk */ | |
| #define _H_STRINGS | | #define _H_STRINGS | |
| #define _SYS_STREAM_H | | #define _SYS_STREAM_H | |
| /* #define _AIX32_CURSES */ /* XXX: this breaks AIX 4.3.3 (others?). */ | | /* #define _AIX32_CURSES */ /* XXX: this breaks AIX 4.3.3 (others?). */ | |
| #define ulonglong2double(A) my_ulonglong2double(A) | | #define ulonglong2double(A) my_ulonglong2double(A) | |
| #define my_off_t2double(A) my_ulonglong2double(A) | | #define my_off_t2double(A) my_ulonglong2double(A) | |
| C_MODE_START | | C_MODE_START | |
| double my_ulonglong2double(unsigned long long A); | | double my_ulonglong2double(unsigned long long A); | |
| | | | |
| skipping to change at line 416 | | skipping to change at line 409 | |
| #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 | |
| | | | |
| #if defined(_HPUX_SOURCE) && defined(HAVE_SYS_STREAM_H) | | #if defined(_HPUX_SOURCE) && defined(HAVE_SYS_STREAM_H) | |
| #include <sys/stream.h> /* HPUX 10.20 defines ulong here. UG
LY !!! */ | | #include <sys/stream.h> /* HPUX 10.20 defines ulong here. UG
LY !!! */ | |
| #define HAVE_ULONG | | #define HAVE_ULONG | |
| #endif | | #endif | |
|
| #if defined(HPUX10) && defined(_LARGEFILE64_SOURCE) && defined(THREAD) | | #if defined(HPUX10) && defined(_LARGEFILE64_SOURCE) | |
| /* Fix bug in setrlimit */ | | /* Fix bug in setrlimit */ | |
| #undef setrlimit | | #undef setrlimit | |
| #define setrlimit cma_setrlimit64 | | #define setrlimit cma_setrlimit64 | |
| #endif | | #endif | |
| /* Declare madvise where it is not declared for C++, like Solaris */ | | /* Declare madvise where it is not declared for C++, like Solaris */ | |
| #if HAVE_MADVISE && !HAVE_DECL_MADVISE && defined(__cplusplus) | | #if HAVE_MADVISE && !HAVE_DECL_MADVISE && defined(__cplusplus) | |
| extern "C" int madvise(void *addr, size_t len, int behav); | | extern "C" int madvise(void *addr, size_t len, int behav); | |
| #endif | | #endif | |
| | | | |
| #define QUOTE_ARG(x) #x /* Quote argument (before cpp) */ | | #define QUOTE_ARG(x) #x /* Quote argument (before cpp) */ | |
| | | | |
| skipping to change at line 611 | | skipping to change at line 604 | |
| #define FN_EXTLEN 20 /* Max length of extension (part of FN_LEN)
*/ | | #define FN_EXTLEN 20 /* Max length of extension (part of FN_LEN)
*/ | |
| #define FN_REFLEN 512 /* Max length of full path-name */ | | #define FN_REFLEN 512 /* Max length of full path-name */ | |
| #define FN_EXTCHAR '.' | | #define FN_EXTCHAR '.' | |
| #define FN_HOMELIB '~' /* ~/ is used as abbrev for home dir */ | | #define FN_HOMELIB '~' /* ~/ is used as abbrev for home dir */ | |
| #define FN_CURLIB '.' /* ./ is used as abbrev for current dir */ | | #define FN_CURLIB '.' /* ./ is used as abbrev for current dir */ | |
| #define FN_PARENTDIR ".." /* Parent directory; Must be a string */ | | #define FN_PARENTDIR ".." /* Parent directory; Must be a string */ | |
| | | | |
| #ifdef _WIN32 | | #ifdef _WIN32 | |
| #define FN_LIBCHAR '\\' | | #define FN_LIBCHAR '\\' | |
| #define FN_LIBCHAR2 '/' | | #define FN_LIBCHAR2 '/' | |
|
| | | #define FN_DIRSEP "/\\" /* Valid directory separators *
/ | |
| #define FN_ROOTDIR "\\" | | #define FN_ROOTDIR "\\" | |
| #define FN_DEVCHAR ':' | | #define FN_DEVCHAR ':' | |
| #define FN_NETWORK_DRIVES /* Uses \\ to indicate network drives */ | | #define FN_NETWORK_DRIVES /* Uses \\ to indicate network drives */ | |
| #define FN_NO_CASE_SENCE /* Files are not case-sensitive */ | | #define FN_NO_CASE_SENCE /* Files are not case-sensitive */ | |
| #else | | #else | |
| #define FN_LIBCHAR '/' | | #define FN_LIBCHAR '/' | |
| #define FN_LIBCHAR2 '/' | | #define FN_LIBCHAR2 '/' | |
|
| | | #define FN_DIRSEP "/" /* Valid directory separators */ | |
| #define FN_ROOTDIR "/" | | #define FN_ROOTDIR "/" | |
| #endif | | #endif | |
| | | | |
| /* | | /* | |
| MY_FILE_MIN is Windows speciality and is used to quickly detect | | MY_FILE_MIN is Windows speciality and is used to quickly detect | |
| the mismatch of CRT and mysys file IO usage on Windows at runtime. | | the mismatch of CRT and mysys file IO usage on Windows at runtime. | |
| CRT file descriptors can be in the range 0-2047, whereas descriptors retu
rned | | CRT file descriptors can be in the range 0-2047, whereas descriptors retu
rned | |
| by my_open() will start with 2048. If a file descriptor with value less t
hen | | by my_open() will start with 2048. If a file descriptor with value less t
hen | |
| MY_FILE_MIN is passed to mysys IO function, chances are it stemms from | | MY_FILE_MIN is passed to mysys IO function, chances are it stemms from | |
| open()/fileno() and not my_open()/my_fileno. | | open()/fileno() and not my_open()/my_fileno. | |
| | | | |
| skipping to change at line 1337 | | skipping to change at line 1332 | |
| #endif | | #endif | |
| #ifndef doubleget | | #ifndef doubleget | |
| #define doubleget(V,M) memcpy(&V, (M), sizeof(double)) | | #define doubleget(V,M) memcpy(&V, (M), sizeof(double)) | |
| #define doublestore(T,V) memcpy((T), (void *) &V, sizeof(double)) | | #define doublestore(T,V) memcpy((T), (void *) &V, sizeof(double)) | |
| #endif /* doubleget */ | | #endif /* doubleget */ | |
| #define longlongget(V,M) memcpy(&V, (M), sizeof(ulonglong)) | | #define longlongget(V,M) memcpy(&V, (M), sizeof(ulonglong)) | |
| #define longlongstore(T,V) memcpy((T), &V, sizeof(ulonglong)) | | #define longlongstore(T,V) memcpy((T), &V, sizeof(ulonglong)) | |
| | | | |
| #endif /* WORDS_BIGENDIAN */ | | #endif /* WORDS_BIGENDIAN */ | |
| | | | |
|
| #ifndef THREAD | | | |
| #define thread_safe_increment(V,L) (V)++ | | | |
| #define thread_safe_decrement(V,L) (V)-- | | | |
| #define thread_safe_add(V,C,L) (V)+=(C) | | | |
| #define thread_safe_sub(V,C,L) (V)-=(C) | | | |
| #define statistic_increment(V,L) (V)++ | | | |
| #define statistic_decrement(V,L) (V)-- | | | |
| #define statistic_add(V,C,L) (V)+=(C) | | | |
| #define statistic_sub(V,C,L) (V)-=(C) | | | |
| #endif | | | |
| | | | |
| #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 | |
| | | | |
| | | | |
End of changes. 7 change blocks. |
| 21 lines changed or deleted | | 5 lines changed or added | |
|
| my_pthread.h | | my_pthread.h | |
| | | | |
| skipping to change at line 213 | | skipping to change at line 213 | |
| #endif | | #endif | |
| | | | |
| #define pthread_key(T,V) pthread_key_t V | | #define pthread_key(T,V) pthread_key_t V | |
| #define my_pthread_getspecific_ptr(T,V) my_pthread_getspecific(T,(V)) | | #define my_pthread_getspecific_ptr(T,V) my_pthread_getspecific(T,(V)) | |
| #define my_pthread_setspecific_ptr(T,V) pthread_setspecific(T,(void*) (V)) | | #define my_pthread_setspecific_ptr(T,V) pthread_setspecific(T,(void*) (V)) | |
| #define pthread_detach_this_thread() | | #define pthread_detach_this_thread() | |
| #define pthread_handler_t EXTERNC void * | | #define pthread_handler_t EXTERNC void * | |
| typedef void *(* pthread_handler)(void *); | | typedef void *(* pthread_handler)(void *); | |
| | | | |
| #define my_pthread_once_t pthread_once_t | | #define my_pthread_once_t pthread_once_t | |
|
| | | #if defined(PTHREAD_ONCE_INITIALIZER) | |
| | | #define MY_PTHREAD_ONCE_INIT PTHREAD_ONCE_INITIALIZER | |
| | | #else | |
| #define MY_PTHREAD_ONCE_INIT PTHREAD_ONCE_INIT | | #define MY_PTHREAD_ONCE_INIT PTHREAD_ONCE_INIT | |
|
| | | #endif | |
| #define my_pthread_once(C,F) pthread_once(C,F) | | #define my_pthread_once(C,F) pthread_once(C,F) | |
| | | | |
| /* Test first for RTS or FSU threads */ | | /* Test first for RTS or FSU threads */ | |
| | | | |
| #if defined(PTHREAD_SCOPE_GLOBAL) && !defined(PTHREAD_SCOPE_SYSTEM) | | #if defined(PTHREAD_SCOPE_GLOBAL) && !defined(PTHREAD_SCOPE_SYSTEM) | |
| #define HAVE_rts_threads | | #define HAVE_rts_threads | |
| extern int my_pthread_create_detached; | | extern int my_pthread_create_detached; | |
| #define pthread_sigmask(A,B,C) sigprocmask((A),(B),(C)) | | #define pthread_sigmask(A,B,C) sigprocmask((A),(B),(C)) | |
| #define PTHREAD_CREATE_DETACHED &my_pthread_create_detached | | #define PTHREAD_CREATE_DETACHED &my_pthread_create_detached | |
| #define PTHREAD_SCOPE_SYSTEM PTHREAD_SCOPE_GLOBAL | | #define PTHREAD_SCOPE_SYSTEM PTHREAD_SCOPE_GLOBAL | |
| | | | |
| skipping to change at line 871 | | skipping to change at line 875 | |
| extern uint thd_lib_detected; | | extern uint thd_lib_detected; | |
| | | | |
| /* | | /* | |
| thread_safe_xxx functions are for critical statistic or counters. | | thread_safe_xxx functions are for critical statistic or counters. | |
| The implementation is guaranteed to be thread safe, on all platforms. | | The implementation is guaranteed to be thread safe, on all platforms. | |
| Note that the calling code should *not* assume the counter is protected | | Note that the calling code should *not* assume the counter is protected | |
| by the mutex given, as the implementation of these helpers may change | | by the mutex given, as the implementation of these helpers may change | |
| to use my_atomic operations instead. | | to use my_atomic operations instead. | |
| */ | | */ | |
| | | | |
|
| /* | | | |
| Warning: | | | |
| When compiling without threads, this file is not included. | | | |
| See the *other* declarations of thread_safe_xxx in include/my_global.h | | | |
| */ | | | |
| #ifdef THREAD | | | |
| #ifndef thread_safe_increment | | #ifndef thread_safe_increment | |
| #ifdef _WIN32 | | #ifdef _WIN32 | |
| #define thread_safe_increment(V,L) InterlockedIncrement((long*) &(V)) | | #define thread_safe_increment(V,L) InterlockedIncrement((long*) &(V)) | |
| #define thread_safe_decrement(V,L) InterlockedDecrement((long*) &(V)) | | #define thread_safe_decrement(V,L) InterlockedDecrement((long*) &(V)) | |
| #else | | #else | |
| #define thread_safe_increment(V,L) \ | | #define thread_safe_increment(V,L) \ | |
| (mysql_mutex_lock((L)), (V)++, mysql_mutex_unlock((L))) | | (mysql_mutex_lock((L)), (V)++, mysql_mutex_unlock((L))) | |
| #define thread_safe_decrement(V,L) \ | | #define thread_safe_decrement(V,L) \ | |
| (mysql_mutex_lock((L)), (V)--, mysql_mutex_unlock((L))) | | (mysql_mutex_lock((L)), (V)--, mysql_mutex_unlock((L))) | |
| #endif | | #endif | |
| | | | |
| skipping to change at line 900 | | skipping to change at line 898 | |
| #ifdef _WIN32 | | #ifdef _WIN32 | |
| #define thread_safe_add(V,C,L) InterlockedExchangeAdd((long*) &(V),(C)) | | #define thread_safe_add(V,C,L) InterlockedExchangeAdd((long*) &(V),(C)) | |
| #define thread_safe_sub(V,C,L) InterlockedExchangeAdd((long*) &(V),-(long)
(C)) | | #define thread_safe_sub(V,C,L) InterlockedExchangeAdd((long*) &(V),-(long)
(C)) | |
| #else | | #else | |
| #define thread_safe_add(V,C,L) \ | | #define thread_safe_add(V,C,L) \ | |
| (mysql_mutex_lock((L)), (V)+=(C), mysql_mutex_unlock((L))) | | (mysql_mutex_lock((L)), (V)+=(C), mysql_mutex_unlock((L))) | |
| #define thread_safe_sub(V,C,L) \ | | #define thread_safe_sub(V,C,L) \ | |
| (mysql_mutex_lock((L)), (V)-=(C), mysql_mutex_unlock((L))) | | (mysql_mutex_lock((L)), (V)-=(C), mysql_mutex_unlock((L))) | |
| #endif | | #endif | |
| #endif | | #endif | |
|
| #endif | | | |
| | | | |
| /* | | /* | |
| statistics_xxx functions are for non critical statistic, | | statistics_xxx functions are for non critical statistic, | |
| maintained in global variables. | | maintained in global variables. | |
| When compiling with SAFE_STATISTICS: | | When compiling with SAFE_STATISTICS: | |
| - race conditions can not occur. | | - race conditions can not occur. | |
| - some locking occurs, which may cause performance degradation. | | - some locking occurs, which may cause performance degradation. | |
| | | | |
| When compiling without SAFE_STATISTICS: | | When compiling without SAFE_STATISTICS: | |
| - race conditions can occur, making the result slightly inaccurate. | | - race conditions can occur, making the result slightly inaccurate. | |
| | | | |
End of changes. 4 change blocks. |
| 7 lines changed or deleted | | 4 lines changed or added | |
|
| my_sys.h | | my_sys.h | |
|
| /* Copyright (C) 2000-2003 MySQL AB, 2008-2009 Sun Microsystems, Inc | | /* Copyright (c) 2000, 2010, 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 44 | | skipping to change at line 44 | |
| # define MEM_NOACCESS(a,len) VALGRIND_MAKE_MEM_NOACCESS(a,len) | | # define MEM_NOACCESS(a,len) VALGRIND_MAKE_MEM_NOACCESS(a,len) | |
| # define MEM_CHECK_ADDRESSABLE(a,len) VALGRIND_CHECK_MEM_IS_ADDRESSABLE(a,l
en) | | # define MEM_CHECK_ADDRESSABLE(a,len) VALGRIND_CHECK_MEM_IS_ADDRESSABLE(a,l
en) | |
| # define MEM_CHECK_DEFINED(a,len) VALGRIND_CHECK_MEM_IS_DEFINED(a,len) | | # define MEM_CHECK_DEFINED(a,len) VALGRIND_CHECK_MEM_IS_DEFINED(a,len) | |
| #else /* HAVE_VALGRIND */ | | #else /* HAVE_VALGRIND */ | |
| # define MEM_UNDEFINED(a,len) ((void) 0) | | # define MEM_UNDEFINED(a,len) ((void) 0) | |
| # define MEM_NOACCESS(a,len) ((void) 0) | | # define MEM_NOACCESS(a,len) ((void) 0) | |
| # define MEM_CHECK_ADDRESSABLE(a,len) ((void) 0) | | # define MEM_CHECK_ADDRESSABLE(a,len) ((void) 0) | |
| # define MEM_CHECK_DEFINED(a,len) ((void) 0) | | # define MEM_CHECK_DEFINED(a,len) ((void) 0) | |
| #endif /* HAVE_VALGRIND */ | | #endif /* HAVE_VALGRIND */ | |
| | | | |
|
| #ifndef THREAD | | | |
| extern int my_errno; /* Last error in mysys */ | | | |
| #else | | | |
| #include <my_pthread.h> | | #include <my_pthread.h> | |
|
| #endif | | | |
| | | | |
| #include <m_ctype.h> /* for CHARSET_INFO */ | | #include <m_ctype.h> /* for CHARSET_INFO */ | |
| #include <stdarg.h> | | #include <stdarg.h> | |
| #include <typelib.h> | | #include <typelib.h> | |
| #ifdef _WIN32 | | #ifdef _WIN32 | |
| #include <malloc.h> /*for alloca*/ | | #include <malloc.h> /*for alloca*/ | |
| #endif | | #endif | |
| | | | |
| #define MY_INIT(name) { my_progname= name; my_init(); } | | #define MY_INIT(name) { my_progname= name; my_init(); } | |
| | | | |
| | | | |
| skipping to change at line 316 | | skipping to change at line 312 | |
| }; | | }; | |
| | | | |
| struct st_my_file_info | | struct st_my_file_info | |
| { | | { | |
| char *name; | | char *name; | |
| #ifdef _WIN32 | | #ifdef _WIN32 | |
| HANDLE fhandle; /* win32 file handle */ | | HANDLE fhandle; /* win32 file handle */ | |
| int oflag; /* open flags, e.g O_APPEND */ | | int oflag; /* open flags, e.g O_APPEND */ | |
| #endif | | #endif | |
| enum file_type type; | | enum file_type type; | |
|
| #if defined(THREAD) && !defined(HAVE_PREAD) && !defined(_WIN32) | | #if !defined(HAVE_PREAD) && !defined(_WIN32) | |
| mysql_mutex_t mutex; | | mysql_mutex_t mutex; | |
| #endif | | #endif | |
| }; | | }; | |
| | | | |
| extern struct st_my_file_info *my_file_info; | | extern struct st_my_file_info *my_file_info; | |
| | | | |
| typedef struct st_dynamic_array | | typedef struct st_dynamic_array | |
| { | | { | |
| uchar *buffer; | | uchar *buffer; | |
| uint elements,max_element; | | uint elements,max_element; | |
| uint alloc_increment; | | uint alloc_increment; | |
| uint size_of_element; | | uint size_of_element; | |
| } DYNAMIC_ARRAY; | | } DYNAMIC_ARRAY; | |
| | | | |
| typedef struct st_my_tmpdir | | typedef struct st_my_tmpdir | |
| { | | { | |
| DYNAMIC_ARRAY full_list; | | DYNAMIC_ARRAY full_list; | |
| char **list; | | char **list; | |
| uint cur, max; | | uint cur, max; | |
|
| #ifdef THREAD | | | |
| mysql_mutex_t mutex; | | mysql_mutex_t mutex; | |
|
| #endif | | | |
| } MY_TMPDIR; | | } MY_TMPDIR; | |
| | | | |
| typedef struct st_dynamic_string | | typedef struct st_dynamic_string | |
| { | | { | |
| char *str; | | char *str; | |
| size_t length,max_length,alloc_increment; | | size_t length,max_length,alloc_increment; | |
| } DYNAMIC_STRING; | | } DYNAMIC_STRING; | |
| | | | |
| struct st_io_cache; | | struct st_io_cache; | |
| typedef int (*IO_CACHE_CALLBACK)(struct st_io_cache*); | | typedef int (*IO_CACHE_CALLBACK)(struct st_io_cache*); | |
| | | | |
|
| #ifdef THREAD | | | |
| typedef struct st_io_cache_share | | typedef struct st_io_cache_share | |
| { | | { | |
| mysql_mutex_t mutex; /* To sync on reads into buffer. */ | | mysql_mutex_t mutex; /* To sync on reads into buffer. */ | |
| mysql_cond_t cond; /* To wait for signals. */ | | mysql_cond_t cond; /* To wait for signals. */ | |
| mysql_cond_t cond_writer; /* For a synchronized writer. */ | | mysql_cond_t cond_writer; /* For a synchronized writer. */ | |
| /* Offset in file corresponding to the first byte of buffer. */ | | /* Offset in file corresponding to the first byte of buffer. */ | |
| my_off_t pos_in_file; | | my_off_t pos_in_file; | |
| /* If a synchronized write cache is the source of the data. */ | | /* If a synchronized write cache is the source of the data. */ | |
| struct st_io_cache *source_cache; | | struct st_io_cache *source_cache; | |
| uchar *buffer; /* The read buffer. */ | | uchar *buffer; /* The read buffer. */ | |
| uchar *read_end; /* Behind last valid byte of buffe
r. */ | | uchar *read_end; /* Behind last valid byte of buffe
r. */ | |
| int running_threads; /* threads not in lock. */ | | int running_threads; /* threads not in lock. */ | |
| int total_threads; /* threads sharing the cache. */ | | int total_threads; /* threads sharing the cache. */ | |
| int error; /* Last error. */ | | int error; /* Last error. */ | |
| #ifdef NOT_YET_IMPLEMENTED | | #ifdef NOT_YET_IMPLEMENTED | |
| /* whether the structure should be free'd */ | | /* whether the structure should be free'd */ | |
| my_bool alloced; | | my_bool alloced; | |
| #endif | | #endif | |
| } IO_CACHE_SHARE; | | } IO_CACHE_SHARE; | |
|
| #endif | | | |
| | | | |
| typedef struct st_io_cache /* Used when cacheing files */ | | typedef struct st_io_cache /* Used when cacheing files */ | |
| { | | { | |
| /* Offset in file corresponding to the first byte of uchar* buffer. */ | | /* Offset in file corresponding to the first byte of uchar* buffer. */ | |
| my_off_t pos_in_file; | | my_off_t pos_in_file; | |
| /* | | /* | |
| The offset of end of file for READ_CACHE and WRITE_CACHE. | | The offset of end of file for READ_CACHE and WRITE_CACHE. | |
| For SEQ_READ_APPEND it the maximum of the actual end of file and | | For SEQ_READ_APPEND it the maximum of the actual end of file and | |
| the position represented by read_end. | | the position represented by read_end. | |
| */ | | */ | |
| | | | |
| skipping to change at line 411 | | skipping to change at line 403 | |
| /* The non-inclusive boundary of the valid write area */ | | /* The non-inclusive boundary of the valid write area */ | |
| uchar *write_end; | | uchar *write_end; | |
| | | | |
| /* | | /* | |
| Current_pos and current_end are convenience variables used by | | Current_pos and current_end are convenience variables used by | |
| my_b_tell() and other routines that need to know the current offset | | my_b_tell() and other routines that need to know the current offset | |
| current_pos points to &write_pos, and current_end to &write_end in a | | current_pos points to &write_pos, and current_end to &write_end in a | |
| WRITE_CACHE, and &read_pos and &read_end respectively otherwise | | WRITE_CACHE, and &read_pos and &read_end respectively otherwise | |
| */ | | */ | |
| uchar **current_pos, **current_end; | | uchar **current_pos, **current_end; | |
|
| #ifdef THREAD | | | |
| /* | | /* | |
| The lock is for append buffer used in SEQ_READ_APPEND cache | | The lock is for append buffer used in SEQ_READ_APPEND cache | |
| need mutex copying from append buffer to read buffer. | | need mutex copying from append buffer to read buffer. | |
| */ | | */ | |
| mysql_mutex_t append_buffer_lock; | | mysql_mutex_t append_buffer_lock; | |
| /* | | /* | |
| The following is used when several threads are reading the | | The following is used when several threads are reading the | |
| same file in parallel. They are synchronized on disk | | same file in parallel. They are synchronized on disk | |
| accesses reading the cached part of the file asynchronously. | | accesses reading the cached part of the file asynchronously. | |
| It should be set to NULL to disable the feature. Only | | It should be set to NULL to disable the feature. Only | |
| READ_CACHE mode is supported. | | READ_CACHE mode is supported. | |
| */ | | */ | |
| IO_CACHE_SHARE *share; | | IO_CACHE_SHARE *share; | |
|
| #endif | | | |
| /* | | /* | |
| A caller will use my_b_read() macro to read from the cache | | A caller will use my_b_read() macro to read from the cache | |
| if the data is already in cache, it will be simply copied with | | if the data is already in cache, it will be simply copied with | |
| memcpy() and internal variables will be accordinging updated with | | memcpy() and internal variables will be accordinging updated with | |
| no functions invoked. However, if the data is not fully in the cache, | | no functions invoked. However, if the data is not fully in the cache, | |
| my_b_read() will call read_function to fetch the data. read_function | | my_b_read() will call read_function to fetch the data. read_function | |
| must never be invoked directly. | | must never be invoked directly. | |
| */ | | */ | |
| int (*read_function)(struct st_io_cache *,uchar *,size_t); | | int (*read_function)(struct st_io_cache *,uchar *,size_t); | |
| /* | | /* | |
| | | | |
| skipping to change at line 458 | | skipping to change at line 450 | |
| are currently used for binary logging of LOAD DATA INFILE - when a | | are currently used for binary logging of LOAD DATA INFILE - when a | |
| block is read from the file, we create a block create/append event, and | | block is read from the file, we create a block create/append event, and | |
| when IO_CACHE is closed, we create an end event. These functions could, | | when IO_CACHE is closed, we create an end event. These functions could, | |
| of course be used for other things | | of course be used for other things | |
| */ | | */ | |
| IO_CACHE_CALLBACK pre_read; | | IO_CACHE_CALLBACK pre_read; | |
| IO_CACHE_CALLBACK post_read; | | IO_CACHE_CALLBACK post_read; | |
| IO_CACHE_CALLBACK pre_close; | | IO_CACHE_CALLBACK pre_close; | |
| /* | | /* | |
| Counts the number of times, when we were forced to use disk. We use it
to | | Counts the number of times, when we were forced to use disk. We use it
to | |
|
| increase the binlog_cache_disk_use status variable. | | increase the binlog_cache_disk_use and binlog_stmt_cache_disk_use statu | |
| | | s | |
| | | variables. | |
| */ | | */ | |
| ulong disk_writes; | | ulong disk_writes; | |
| void* arg; /* for use by pre/post_read */ | | void* arg; /* for use by pre/post_read */ | |
| char *file_name; /* if used with 'open_cached_file' *
/ | | char *file_name; /* if used with 'open_cached_file' *
/ | |
| char *dir,*prefix; | | char *dir,*prefix; | |
| File file; /* file descriptor */ | | File file; /* file descriptor */ | |
| /* | | /* | |
| seek_not_done is set by my_b_seek() to inform the upcoming read/write | | seek_not_done is set by my_b_seek() to inform the upcoming read/write | |
| operation that a seek needs to be preformed prior to the actual I/O | | operation that a seek needs to be preformed prior to the actual I/O | |
| error is 0 if the cache operation was successful, -1 if there was a | | error is 0 if the cache operation was successful, -1 if there was a | |
| | | | |
| skipping to change at line 630 | | skipping to change at line 623 | |
| /* Windows-only functions (CRT equivalents)*/ | | /* Windows-only functions (CRT equivalents)*/ | |
| extern HANDLE my_get_osfhandle(File fd); | | extern HANDLE my_get_osfhandle(File fd); | |
| extern void my_osmaperr(unsigned long last_error); | | extern void my_osmaperr(unsigned long last_error); | |
| #endif | | #endif | |
| | | | |
| extern void init_glob_errs(void); | | extern void init_glob_errs(void); | |
| extern const char** get_global_errmsgs(); | | extern const char** get_global_errmsgs(); | |
| extern void wait_for_free_space(const char *filename, int errors); | | extern void wait_for_free_space(const char *filename, int errors); | |
| extern FILE *my_fopen(const char *FileName,int Flags,myf MyFlags); | | extern FILE *my_fopen(const char *FileName,int Flags,myf MyFlags); | |
| 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 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 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 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); | |
| | | | |
| skipping to change at line 654 | | skipping to change at line 648 | |
| 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_basic_init(void); | | extern my_bool my_basic_init(void); | |
| 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); | |
| | | | |
|
| #ifndef THREAD | | | |
| extern void dont_break(void); | | | |
| extern void allow_break(void); | | | |
| #else | | | |
| #define dont_break() | | | |
| #define allow_break() | | | |
| #endif | | | |
| | | | |
| #ifdef EXTRA_DEBUG | | #ifdef EXTRA_DEBUG | |
| void my_print_open_files(void); | | void my_print_open_files(void); | |
| #else | | #else | |
| #define my_print_open_files() | | #define my_print_open_files() | |
| #endif | | #endif | |
| | | | |
| extern my_bool init_tmpdir(MY_TMPDIR *tmpdir, const char *pathlist); | | extern my_bool init_tmpdir(MY_TMPDIR *tmpdir, const char *pathlist); | |
| extern char *my_tmpdir(MY_TMPDIR *tmpdir); | | extern char *my_tmpdir(MY_TMPDIR *tmpdir); | |
| extern void free_tmpdir(MY_TMPDIR *tmpdir); | | extern void free_tmpdir(MY_TMPDIR *tmpdir); | |
| | | | |
| | | | |
| skipping to change at line 734 | | skipping to change at line 720 | |
| 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); | |
| extern int _my_b_read(IO_CACHE *info,uchar *Buffer,size_t Count); | | extern int _my_b_read(IO_CACHE *info,uchar *Buffer,size_t Count); | |
|
| #ifdef THREAD | | | |
| extern int _my_b_read_r(IO_CACHE *info,uchar *Buffer,size_t Count); | | extern int _my_b_read_r(IO_CACHE *info,uchar *Buffer,size_t Count); | |
| extern void init_io_cache_share(IO_CACHE *read_cache, IO_CACHE_SHARE *cshar
e, | | extern void init_io_cache_share(IO_CACHE *read_cache, IO_CACHE_SHARE *cshar
e, | |
| IO_CACHE *write_cache, uint num_threads); | | IO_CACHE *write_cache, uint num_threads); | |
| extern void remove_io_thread(IO_CACHE *info); | | extern void remove_io_thread(IO_CACHE *info); | |
|
| #endif | | | |
| extern int _my_b_seq_read(IO_CACHE *info,uchar *Buffer,size_t Count); | | extern int _my_b_seq_read(IO_CACHE *info,uchar *Buffer,size_t Count); | |
| extern int _my_b_net_read(IO_CACHE *info,uchar *Buffer,size_t Count); | | extern int _my_b_net_read(IO_CACHE *info,uchar *Buffer,size_t Count); | |
| extern int _my_b_get(IO_CACHE *info); | | extern int _my_b_get(IO_CACHE *info); | |
| extern int _my_b_async_read(IO_CACHE *info,uchar *Buffer,size_t Count); | | extern int _my_b_async_read(IO_CACHE *info,uchar *Buffer,size_t Count); | |
| extern int _my_b_write(IO_CACHE *info,const uchar *Buffer,size_t Count); | | extern int _my_b_write(IO_CACHE *info,const uchar *Buffer,size_t Count); | |
| extern int my_b_append(IO_CACHE *info,const uchar *Buffer,size_t Count); | | extern int my_b_append(IO_CACHE *info,const uchar *Buffer,size_t Count); | |
| extern int my_b_safe_write(IO_CACHE *info,const uchar *Buffer,size_t Count)
; | | extern int my_b_safe_write(IO_CACHE *info,const uchar *Buffer,size_t Count)
; | |
| | | | |
| extern int my_block_write(IO_CACHE *info, const uchar *Buffer, | | extern int my_block_write(IO_CACHE *info, const uchar *Buffer, | |
| size_t Count, my_off_t pos); | | size_t Count, my_off_t pos); | |
| | | | |
End of changes. 15 change blocks. |
| 23 lines changed or deleted | | 8 lines changed or added | |
|
| plugin_audit.h | | plugin_audit.h | |
| | | | |
| skipping to change at line 44 | | skipping to change at line 44 | |
| { | | { | |
| unsigned int event_class; | | unsigned int event_class; | |
| }; | | }; | |
| | | | |
| /************************************************************************* | | /************************************************************************* | |
| AUDIT CLASS : GENERAL | | AUDIT CLASS : GENERAL | |
| | | | |
| LOG events occurs before emitting to the general query log. | | LOG events occurs before emitting to the general query log. | |
| ERROR events occur before transmitting errors to the user. | | ERROR events occur before transmitting errors to the user. | |
| RESULT events occur after transmitting a resultset to the user. | | RESULT events occur after transmitting a resultset to the user. | |
|
| | | STATUS events occur after transmitting a resultset or errors | |
| | | to the user. | |
| */ | | */ | |
| | | | |
| #define MYSQL_AUDIT_GENERAL_CLASS 0 | | #define MYSQL_AUDIT_GENERAL_CLASS 0 | |
| #define MYSQL_AUDIT_GENERAL_CLASSMASK (1 << MYSQL_AUDIT_GENERAL_CLASS) | | #define MYSQL_AUDIT_GENERAL_CLASSMASK (1 << MYSQL_AUDIT_GENERAL_CLASS) | |
| #define MYSQL_AUDIT_GENERAL_LOG 0 | | #define MYSQL_AUDIT_GENERAL_LOG 0 | |
| #define MYSQL_AUDIT_GENERAL_ERROR 1 | | #define MYSQL_AUDIT_GENERAL_ERROR 1 | |
| #define MYSQL_AUDIT_GENERAL_RESULT 2 | | #define MYSQL_AUDIT_GENERAL_RESULT 2 | |
|
| | | #define MYSQL_AUDIT_GENERAL_STATUS 3 | |
| | | | |
| struct mysql_event_general | | struct mysql_event_general | |
| { | | { | |
| unsigned int event_class; | | unsigned int event_class; | |
| unsigned int event_subclass; | | unsigned int event_subclass; | |
| int general_error_code; | | int general_error_code; | |
| unsigned long general_thread_id; | | unsigned long general_thread_id; | |
| const char *general_user; | | const char *general_user; | |
| unsigned int general_user_length; | | unsigned int general_user_length; | |
| const char *general_command; | | const char *general_command; | |
| unsigned int general_command_length; | | unsigned int general_command_length; | |
| const char *general_query; | | const char *general_query; | |
| unsigned int general_query_length; | | unsigned int general_query_length; | |
| struct charset_info_st *general_charset; | | struct charset_info_st *general_charset; | |
| unsigned long long general_time; | | unsigned long long general_time; | |
| unsigned long long general_rows; | | unsigned long long general_rows; | |
| }; | | }; | |
| | | | |
|
| | | /* | |
| | | AUDIT CLASS : CONNECTION | |
| | | | |
| | | CONNECT occurs after authentication phase is completed. | |
| | | DISCONNECT occurs after connection is terminated. | |
| | | CHANGE_USER occurs after COM_CHANGE_USER RPC is completed. | |
| | | */ | |
| | | | |
| | | #define MYSQL_AUDIT_CONNECTION_CLASS 1 | |
| | | #define MYSQL_AUDIT_CONNECTION_CLASSMASK (1 << MYSQL_AUDIT_CONNECTION_CLASS | |
| | | ) | |
| | | #define MYSQL_AUDIT_CONNECTION_CONNECT 0 | |
| | | #define MYSQL_AUDIT_CONNECTION_DISCONNECT 1 | |
| | | #define MYSQL_AUDIT_CONNECTION_CHANGE_USER 2 | |
| | | | |
| | | struct mysql_event_connection | |
| | | { | |
| | | unsigned int event_class; | |
| | | unsigned int event_subclass; | |
| | | int status; | |
| | | unsigned long thread_id; | |
| | | const char *user; | |
| | | unsigned int user_length; | |
| | | const char *priv_user; | |
| | | unsigned int priv_user_length; | |
| | | const char *external_user; | |
| | | unsigned int external_user_length; | |
| | | const char *proxy_user; | |
| | | unsigned int proxy_user_length; | |
| | | const char *host; | |
| | | unsigned int host_length; | |
| | | const char *ip; | |
| | | unsigned int ip_length; | |
| | | const char *database; | |
| | | unsigned int database_length; | |
| | | }; | |
| | | | |
| /************************************************************************* | | /************************************************************************* | |
| Here we define the descriptor structure, that is referred from | | Here we define the descriptor structure, that is referred from | |
| st_mysql_plugin. | | st_mysql_plugin. | |
| | | | |
| release_thd() event occurs when the event class consumer is to be | | release_thd() event occurs when the event class consumer is to be | |
| disassociated from the specified THD. This would typically occur | | disassociated from the specified THD. This would typically occur | |
| before some operation which may require sleeping - such as when | | before some operation which may require sleeping - such as when | |
| waiting for the next query from the client. | | waiting for the next query from the client. | |
| | | | |
| event_notify() is invoked whenever an event occurs which is of any | | event_notify() is invoked whenever an event occurs which is of any | |
| | | | |
End of changes. 3 change blocks. |
| 0 lines changed or deleted | | 40 lines changed or added | |
|