errmsg.h   errmsg.h 
skipping to change at line 104 skipping to change at line 104
#define CR_SECURE_AUTH 2049 #define CR_SECURE_AUTH 2049
#define CR_FETCH_CANCELED 2050 #define CR_FETCH_CANCELED 2050
#define CR_NO_DATA 2051 #define CR_NO_DATA 2051
#define CR_NO_STMT_METADATA 2052 #define CR_NO_STMT_METADATA 2052
#define CR_NO_RESULT_SET 2053 #define CR_NO_RESULT_SET 2053
#define CR_NOT_IMPLEMENTED 2054 #define CR_NOT_IMPLEMENTED 2054
#define CR_SERVER_LOST_EXTENDED 2055 #define CR_SERVER_LOST_EXTENDED 2055
#define CR_STMT_CLOSED 2056 #define CR_STMT_CLOSED 2056
#define CR_NEW_STMT_METADATA 2057 #define CR_NEW_STMT_METADATA 2057
#define CR_ALREADY_CONNECTED 2058 #define CR_ALREADY_CONNECTED 2058
#define CR_ERROR_LAST /*Copy last error nr:*/ 2058 #define CR_AUTH_PLUGIN_CANNOT_LOAD 2059
#define CR_ERROR_LAST /*Copy last error nr:*/ 2059
/* Add error numbers before CR_ERROR_LAST and change it accordingly. */ /* Add error numbers before CR_ERROR_LAST and change it accordingly. */
#endif /* ERRMSG_INCLUDED */ #endif /* ERRMSG_INCLUDED */
 End of changes. 1 change blocks. 
1 lines changed or deleted 2 lines changed or added


 m_ctype.h   m_ctype.h 
skipping to change at line 532 skipping to change at line 532
int my_strcasecmp_mb_bin(CHARSET_INFO * cs __attribute__((unused)), int my_strcasecmp_mb_bin(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(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_unicode(CHARSET_INFO *,
uchar *dst, size_t dstlen, uchar *dst, size_t dstlen,
const uchar *src, size_t srclen); const uchar *src, size_t srclen);
size_t my_strnxfrm_unicode_full_bin(CHARSET_INFO *,
uchar *dst, size_t dstlen,
const uchar *src, size_t srclen);
size_t my_strnxfrmlen_unicode_full_bin(CHARSET_INFO *, size_t);
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);
 End of changes. 1 change blocks. 
0 lines changed or deleted 5 lines changed or added


 m_string.h   m_string.h 
skipping to change at line 39 skipping to change at line 39
#if defined(HAVE_STRINGS_H) #if defined(HAVE_STRINGS_H)
#include <strings.h> #include <strings.h>
#endif #endif
#if defined(HAVE_STRING_H) #if defined(HAVE_STRING_H)
#include <string.h> #include <string.h>
#endif #endif
/* need by my_vsnprintf */ /* need by my_vsnprintf */
#include <stdarg.h> #include <stdarg.h>
#ifdef _AIX
#undef HAVE_BCMP
#endif
/* This is needed for the definitions of bzero... on solaris */ /* This is needed for the definitions of bzero... on solaris */
#if defined(HAVE_STRINGS_H) #if defined(HAVE_STRINGS_H)
#include <strings.h> #include <strings.h>
#endif #endif
/* This is needed for the definitions of memcpy... on solaris */ /* This is needed for the definitions of memcpy... on solaris */
#if defined(HAVE_MEMORY_H) && !defined(__cplusplus) #if defined(HAVE_MEMORY_H) && !defined(__cplusplus)
#include <memory.h> #include <memory.h>
#endif #endif
#if !defined(HAVE_MEMCPY) && !defined(HAVE_MEMMOVE) #if !defined(HAVE_MEMCPY) && !defined(HAVE_MEMMOVE)
# define memcpy(d, s, n) bcopy ((s), (d), (n)) # define memcpy(d, s, n) bcopy ((s), (d), (n))
# define memset(A,C,B) bfill((A),(B),(C)) # define memset(A,C,B) bfill((A),(B),(C))
# define memmove(d, s, n) bmove ((d), (s), (n)) # define memmove(d, s, n) bmove ((d), (s), (n))
#elif defined(HAVE_MEMMOVE) #elif defined(HAVE_MEMMOVE)
# define bmove(d, s, n) memmove((d), (s), (n)) # define bmove(d, s, n) memmove((d), (s), (n))
#else
# define memmove(d, s, n) bmove((d), (s), (n)) /* our bmove */
#endif #endif
/* Unixware 7 */ /* Unixware 7 */
#if !defined(HAVE_BFILL) #if !defined(HAVE_BFILL)
# define bfill(A,B,C) memset((A),(C),(B)) # define bfill(A,B,C) memset((A),(C),(B))
# define bmove_align(A,B,C) memcpy((A),(B),(C))
#endif #endif
#if !defined(HAVE_BCMP) #if !defined(bzero) && !defined(HAVE_BZERO)
# define bcopy(s, d, n) memcpy((d), (s), (n)) # define bzero(A,B) memset((A),0,(B))
# define bcmp(A,B,C) memcmp((A),(B),(C))
# define bzero(A,B) memset((A),0,(B))
# define bmove_align(A,B,C) memcpy((A),(B),(C))
#endif #endif
#if defined(__cplusplus) #if defined(__cplusplus)
extern "C" { extern "C" {
#endif #endif
/* /*
my_str_malloc() and my_str_free() are assigned to implementations in my_str_malloc() and my_str_free() are assigned to implementations in
strings/alloc.c, but can be overridden in the calling program. strings/alloc.c, but can be overridden in the calling program.
*/ */
extern void *(*my_str_malloc)(size_t); extern void *(*my_str_malloc)(size_t);
extern void (*my_str_free)(void *); extern void (*my_str_free)(void *);
#if defined(HAVE_STPCPY) #if defined(HAVE_STPCPY) && MY_GNUC_PREREQ(3, 4) && !defined(__INTEL_COMPIL
ER)
#define strmov(A,B) __builtin_stpcpy((A),(B))
#elif defined(HAVE_STPCPY)
#define strmov(A,B) stpcpy((A),(B)) #define strmov(A,B) stpcpy((A),(B))
#ifndef stpcpy #ifndef stpcpy
extern char *stpcpy(char *, const char *); /* For AIX with gcc 2.95.3 * / extern char *stpcpy(char *, const char *); /* For AIX with gcc 2.95.3 * /
#endif #endif
#endif #endif
/* Declared in int2str() */ /* Declared in int2str() */
extern char NEAR _dig_vec_upper[]; extern char _dig_vec_upper[];
extern char NEAR _dig_vec_lower[]; extern char _dig_vec_lower[];
#ifndef strmov #ifndef strmov
#define strmov_overlapp(A,B) strmov(A,B) #define strmov_overlapp(A,B) strmov(A,B)
#define strmake_overlapp(A,B,C) strmake(A,B,C) #define strmake_overlapp(A,B,C) strmake(A,B,C)
#endif #endif
#ifdef BAD_MEMCPY /* Problem with gcc on Alpha */
#define memcpy_fixed(A,B,C) bmove((A),(B),(C))
#else
#define memcpy_fixed(A,B,C) memcpy((A),(B),(C))
#endif
#if (!defined(USE_BMOVE512) || defined(HAVE_purify)) && !defined(bmove512)
#define bmove512(A,B,C) memcpy(A,B,C)
#endif
/* Prototypes for string functions */ /* Prototypes for string functions */
#if !defined(bfill) && !defined(HAVE_BFILL)
extern void bfill(uchar *dst,size_t len,pchar fill);
#endif
#if !defined(bzero) && !defined(HAVE_BZERO)
extern void bzero(uchar * dst,size_t len);
#endif
#if !defined(bcmp) && !defined(HAVE_BCMP)
extern size_t bcmp(const uchar *s1,const uchar *s2,size_t len);
#endif
#ifdef HAVE_purify
extern size_t my_bcmp(const uchar *s1,const uchar *s2,size_t len);
#undef bcmp
#define bcmp(A,B,C) my_bcmp((A),(B),(C))
#endif /* HAVE_purify */
#ifndef bmove512
extern void bmove512(uchar *dst,const uchar *src,size_t len);
#endif
#if !defined(HAVE_BMOVE) && !defined(bmove)
extern void bmove(uuchar *dst, const uchar *src,size_t len);
#endif
extern void bmove_upp(uchar *dst,const uchar *src,size_t len); extern void bmove_upp(uchar *dst,const uchar *src,size_t len);
extern void bchange(uchar *dst,size_t old_len,const uchar *src, extern void bchange(uchar *dst,size_t old_len,const uchar *src,
size_t new_len,size_t tot_len); size_t new_len,size_t tot_len);
extern void strappend(char *s,size_t len,pchar fill); extern void strappend(char *s,size_t len,pchar fill);
extern char *strend(const char *s); extern char *strend(const char *s);
extern char *strcend(const char *, pchar); extern char *strcend(const char *, pchar);
extern char *strfield(char *src,int fields,int chars,int blanks,
int tabch);
extern char *strfill(char * s,size_t len,pchar fill); extern char *strfill(char * s,size_t len,pchar fill);
extern size_t strinstr(const char *str,const char *search);
extern size_t r_strinstr(const char *str, size_t from, const char *search)
;
extern char *strkey(char *dst,char *head,char *tail,char *flags);
extern char *strmake(char *dst,const char *src,size_t length); extern char *strmake(char *dst,const char *src,size_t length);
#ifndef strmov #ifndef strmov
extern char *strmov(char *dst,const char *src); extern char *strmov(char *dst,const char *src);
#else #else
extern char *strmov_overlapp(char *dst,const char *src); extern char *strmov_overlapp(char *dst,const char *src);
#endif #endif
extern char *strnmov(char *dst,const char *src,size_t n); extern char *strnmov(char *dst, const char *src, size_t n);
extern char *strsuff(const char *src,const char *suffix); extern char *strcont(const char *src, const char *set);
extern char *strcont(const char *src,const char *set); extern char *strxmov(char *dst, const char *src, ...);
extern char *strxcat _VARARGS((char *dst,const char *src, ...)); extern char *strxnmov(char *dst, size_t len, const char *src, ...);
extern char *strxmov _VARARGS((char *dst,const char *src, ...));
extern char *strxcpy _VARARGS((char *dst,const char *src, ...));
extern char *strxncat _VARARGS((char *dst,size_t len, const char *src, ...)
);
extern char *strxnmov _VARARGS((char *dst,size_t len, const char *src, ...)
);
extern char *strxncpy _VARARGS((char *dst,size_t len, const char *src, ...)
);
/* Prototypes of normal stringfunctions (with may ours) */ /* Prototypes of normal stringfunctions (with may ours) */
#ifdef WANT_STRING_PROTOTYPES
extern char *strcat(char *, const char *);
extern char *strchr(const char *, pchar);
extern char *strrchr(const char *, pchar);
extern char *strcpy(char *, const char *);
extern int strcmp(const char *, const char *);
#ifndef __GNUC__
extern size_t strlen(const char *);
#endif
#endif
#ifndef HAVE_STRNLEN #ifndef HAVE_STRNLEN
extern size_t strnlen(const char *s, size_t n); extern size_t strnlen(const char *s, size_t n);
#endif #endif
#if !defined(__cplusplus)
#ifndef HAVE_STRPBRK
extern char *strpbrk(const char *, const char *);
#endif
#ifndef HAVE_STRSTR
extern char *strstr(const char *, const char *);
#endif
#endif
extern int is_prefix(const char *, const char *); extern int is_prefix(const char *, const char *);
/* Conversion routines */ /* Conversion routines */
typedef enum { typedef enum {
MY_GCVT_ARG_FLOAT, MY_GCVT_ARG_FLOAT,
MY_GCVT_ARG_DOUBLE MY_GCVT_ARG_DOUBLE
} my_gcvt_arg_type; } my_gcvt_arg_type;
double my_strtod(const char *str, char **end, int *error); double my_strtod(const char *str, char **end, int *error);
double my_atof(const char *nptr); double my_atof(const char *nptr);
 End of changes. 13 change blocks. 
87 lines changed or deleted 12 lines changed or added


 my_attribute.h   my_attribute.h 
skipping to change at line 24 skipping to change at line 24
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 US A */ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 US A */
/* /*
Helper macros used for setting different __attributes__ Helper macros used for setting different __attributes__
on functions in a portable fashion on functions in a portable fashion
*/ */
#ifndef _my_attribute_h #ifndef _my_attribute_h
#define _my_attribute_h #define _my_attribute_h
#if defined(__GNUC__)
# ifndef GCC_VERSION
# define GCC_VERSION (__GNUC__ * 1000 + __GNUC_MINOR__)
# endif
#endif
/* /*
Disable __attribute__() on gcc < 2.7, g++ < 3.4, and non-gcc compilers. Disable __attribute__() on gcc < 2.7, g++ < 3.4, and non-gcc compilers.
Some forms of __attribute__ are actually supported in earlier versions of Some forms of __attribute__ are actually supported in earlier versions of
g++, but we just disable them all because we only use them to generate g++, but we just disable them all because we only use them to generate
compilation warnings. compilation warnings.
*/ */
#ifndef __attribute__ #ifndef __attribute__
# if !defined(__GNUC__) # if !defined(__GNUC__)
# define __attribute__(A) # define __attribute__(A)
# elif GCC_VERSION < 2008 # elif GCC_VERSION < 2008
 End of changes. 1 change blocks. 
0 lines changed or deleted 6 lines changed or added


 my_config.h   my_config.h 
skipping to change at line 106 skipping to change at line 106
#define HAVE_TERMIO_H 1 #define HAVE_TERMIO_H 1
#define HAVE_TERMCAP_H 1 #define HAVE_TERMCAP_H 1
#define HAVE_TIME_H 1 #define HAVE_TIME_H 1
#define HAVE_UNISTD_H 1 #define HAVE_UNISTD_H 1
#define HAVE_UTIME_H 1 #define HAVE_UTIME_H 1
/* #undef HAVE_VARARGS_H */ /* #undef HAVE_VARARGS_H */
/* #undef HAVE_VIS_H */ /* #undef HAVE_VIS_H */
/* #undef HAVE_SYS_UTIME_H */ /* #undef HAVE_SYS_UTIME_H */
#define HAVE_SYS_WAIT_H 1 #define HAVE_SYS_WAIT_H 1
#define HAVE_SYS_PARAM_H 1 #define HAVE_SYS_PARAM_H 1
/* #undef HAVE_XFS_XFS_H */
/* Libraries */ /* Libraries */
/* #undef HAVE_LIBPTHREAD */ /* #undef HAVE_LIBPTHREAD */
#define HAVE_LIBM 1 #define HAVE_LIBM 1
#define HAVE_LIBDL 1 #define HAVE_LIBDL 1
#define HAVE_LIBRT 1 #define HAVE_LIBRT 1
/* #undef HAVE_LIBSOCKET */ /* #undef HAVE_LIBSOCKET */
/* #undef HAVE_LIBNSL */ /* #undef HAVE_LIBNSL */
#define HAVE_LIBCRYPT 1 #define HAVE_LIBCRYPT 1
/* #undef HAVE_LIBMTMALLOC */ /* #undef HAVE_LIBMTMALLOC */
skipping to change at line 134 skipping to change at line 133
/* #undef USE_NEW_READLINE_INTERFACE */ /* #undef USE_NEW_READLINE_INTERFACE */
#define FIONREAD_IN_SYS_IOCTL 1 #define FIONREAD_IN_SYS_IOCTL 1
#define GWINSZ_IN_SYS_IOCTL 1 #define GWINSZ_IN_SYS_IOCTL 1
/* #undef TIOCSTAT_IN_SYS_IOCTL */ /* #undef TIOCSTAT_IN_SYS_IOCTL */
/* Functions we may want to use. */ /* Functions we may want to use. */
/* #undef HAVE_AIOWAIT */ /* #undef HAVE_AIOWAIT */
#define HAVE_ALARM 1 #define HAVE_ALARM 1
#define HAVE_ALLOCA 1 #define HAVE_ALLOCA 1
#define HAVE_BCMP 1
/* #undef HAVE_BFILL */ /* #undef HAVE_BFILL */
/* #undef HAVE_BMOVE */ /* #undef HAVE_BMOVE */
#define HAVE_BZERO 1 #define HAVE_BZERO 1
#define HAVE_INDEX 1 #define HAVE_INDEX 1
#define HAVE_CHOWN 1 #define HAVE_CHOWN 1
#define HAVE_CLOCK_GETTIME 1 #define HAVE_CLOCK_GETTIME 1
#define HAVE_CRYPT 1 #define HAVE_CRYPT 1
#define HAVE_CUSERID 1 #define HAVE_CUSERID 1
#define HAVE_CXX_NEW 1 #define HAVE_CXX_NEW 1
/* #undef HAVE_DIRECTIO */ /* #undef HAVE_DIRECTIO */
skipping to change at line 225 skipping to change at line 223
/* #undef HAVE_PTHREAD_ATTR_SETSCHEDPARAM */ /* #undef HAVE_PTHREAD_ATTR_SETSCHEDPARAM */
#define HAVE_PTHREAD_ATTR_SETSCOPE 1 #define HAVE_PTHREAD_ATTR_SETSCOPE 1
#define HAVE_PTHREAD_ATTR_SETSTACKSIZE 1 #define HAVE_PTHREAD_ATTR_SETSTACKSIZE 1
/* #undef HAVE_PTHREAD_CONDATTR_CREATE */ /* #undef HAVE_PTHREAD_CONDATTR_CREATE */
#define HAVE_PTHREAD_CONDATTR_SETCLOCK 1 #define HAVE_PTHREAD_CONDATTR_SETCLOCK 1
/* #undef HAVE_PTHREAD_INIT */ /* #undef HAVE_PTHREAD_INIT */
#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
#define HAVE_PTHREAD_RWLOCKATTR_SETKIND_NP 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 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
skipping to change at line 256 skipping to change at line 253
#define HAVE_SIGADDSET 1 #define HAVE_SIGADDSET 1
#define HAVE_SIGEMPTYSET 1 #define HAVE_SIGEMPTYSET 1
#define HAVE_SIGHOLD 1 #define HAVE_SIGHOLD 1
#define HAVE_SIGSET 1 #define HAVE_SIGSET 1
#define HAVE_SIGSET_T 1 #define HAVE_SIGSET_T 1
#define HAVE_SIGACTION 1 #define HAVE_SIGACTION 1
/* #undef HAVE_SIGTHREADMASK */ /* #undef HAVE_SIGTHREADMASK */
#define HAVE_SIGWAIT 1 #define HAVE_SIGWAIT 1
#define HAVE_SLEEP 1 #define HAVE_SLEEP 1
#define HAVE_SNPRINTF 1 #define HAVE_SNPRINTF 1
/* Some that currently are not real defines, internal to CMake setup */
/* #define HAVE_FCNTL_NONBLOCK 1 */
/* #define HAVE_FINITE_IN_MATH_H 1 */
/* #define HAVE_SOCKADDR_STORAGE_SS_FAMILY 1 */
/* #undef HAVE_SOCKADDR_STORAGE___SS_FAMILY */
/* #undef HAVE_SOCKET_SIZE_T_AS_int */
/* #undef HAVE_SOCKET_SIZE_T_AS_size_t */
/* #define HAVE_SOCKET_SIZE_T_AS_socklen_t */
/* #define HAVE_SOCKET_TIMEOUT */
#define HAVE_STPCPY 1 #define HAVE_STPCPY 1
#define HAVE_STRERROR 1 #define HAVE_STRERROR 1
#define HAVE_STRCOLL 1 #define HAVE_STRCOLL 1
#define HAVE_STRSIGNAL 1 #define HAVE_STRSIGNAL 1
/* #undef HAVE_STRLCPY */ /* #undef HAVE_STRLCPY */
/* #undef HAVE_STRLCAT */ /* #undef HAVE_STRLCAT */
/* #undef HAVE_FGETLN */ /* #undef HAVE_FGETLN */
#define HAVE_STRNLEN 1 #define HAVE_STRNLEN 1
#define HAVE_STRPBRK 1 #define HAVE_STRPBRK 1
#define HAVE_STRSEP 1 #define HAVE_STRSEP 1
skipping to change at line 322 skipping to change at line 310
/* #undef HAVE_SOCKADDR_IN_SIN_LEN */ /* #undef HAVE_SOCKADDR_IN_SIN_LEN */
/* #undef HAVE_SOCKADDR_IN6_SIN6_LEN */ /* #undef HAVE_SOCKADDR_IN6_SIN6_LEN */
/* #undef HAVE_TIMESPEC_TS_SEC */ /* #undef HAVE_TIMESPEC_TS_SEC */
#define STRUCT_DIRENT_HAS_D_INO 1 #define STRUCT_DIRENT_HAS_D_INO 1
/* #undef STRUCT_DIRENT_HAS_D_NAMLEN */ /* #undef STRUCT_DIRENT_HAS_D_NAMLEN */
#define SPRINTF_RETURNS_INT 1 #define SPRINTF_RETURNS_INT 1
#define USE_MB 1 #define USE_MB 1
#define USE_MB_IDENT 1 #define USE_MB_IDENT 1
/* #undef HAVE_VALGRIND */
/* Types we may use */ /* Types we may use */
#ifdef __APPLE__ #ifdef __APPLE__
/* /*
Special handling required for OSX to support universal binaries that Special handling required for OSX to support universal binaries that
mix 32 and 64 bit architectures. mix 32 and 64 bit architectures.
*/ */
#if(__LP64__) #if(__LP64__)
#define SIZEOF_LONG 8 #define SIZEOF_LONG 8
#else #else
#define SIZEOF_LONG 4 #define SIZEOF_LONG 4
skipping to change at line 577 skipping to change at line 567
#define HAVE_CHARSET_ujis 1 #define HAVE_CHARSET_ujis 1
#define HAVE_CHARSET_utf8mb4 1 #define HAVE_CHARSET_utf8mb4 1
/* #undef HAVE_CHARSET_utf8mb3 */ /* #undef HAVE_CHARSET_utf8mb3 */
#define HAVE_CHARSET_utf8 1 #define HAVE_CHARSET_utf8 1
#define HAVE_CHARSET_utf16 1 #define HAVE_CHARSET_utf16 1
#define HAVE_CHARSET_utf32 1 #define HAVE_CHARSET_utf32 1
#define HAVE_UCA_COLLATIONS 1 #define HAVE_UCA_COLLATIONS 1
#define HAVE_COMPRESS 1 #define HAVE_COMPRESS 1
/* /*
Hard coded platform settings
*/
/* This is ugly, but we need lots of tweaks for HP-UX */
/* #undef HPUX11 */
/* #undef DO_NOT_REMOVE_THREAD_WRAPPERS */
/* #undef HAVE_BROKEN_PREAD */
/* #undef HAVE_BROKEN_PTHREAD_COND_TIMEDWAIT */
/* #undef SNPRINTF_RETURN_TRUNC */
/* #undef _INCLUDE_LONGLONG */
/* Mac OS X */
/* #undef SIGNALS_DONT_BREAK_READ */
/* #undef IGNORE_SIGHUP_SIGQUIT */
/* #undef _P1003_1B_VISIBLE */
/* #undef DONT_DECLARE_CXA_PURE_VIRTUAL */
/*
Stuff that always need to be defined (compile breaks without it) Stuff that always need to be defined (compile breaks without it)
*/ */
#define HAVE_SPATIAL 1 #define HAVE_SPATIAL 1
#define HAVE_RTREE_KEYS 1 #define HAVE_RTREE_KEYS 1
#define HAVE_QUERY_CACHE 1 #define HAVE_QUERY_CACHE 1
#define BIG_TABLES 1 #define BIG_TABLES 1
/* /*
Important storage engines (those that really need define Important storage engines (those that really need define
WITH_<ENGINE>_STORAGE_ENGINE for the whole server) WITH_<ENGINE>_STORAGE_ENGINE for the whole server)
skipping to change at line 617 skipping to change at line 589
#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 "/usr/local/mysql" #define DEFAULT_MYSQL_HOME "/home/ut/testing/mysql/5.5.8"
#define SHAREDIR "/usr/local/mysql/share" #define SHAREDIR "/home/ut/testing/mysql/5.5.8/share"
#define DEFAULT_BASEDIR "/usr/local/mysql" #define DEFAULT_BASEDIR "/home/ut/testing/mysql/5.5.8"
#define MYSQL_DATADIR "/usr/local/mysql/data" #define MYSQL_DATADIR "/home/ut/testing/mysql/5.5.8/data"
#define DEFAULT_CHARSET_HOME "/usr/local/mysql" #define DEFAULT_CHARSET_HOME "/home/ut/testing/mysql/5.5.8"
#define PLUGINDIR "/usr/local/mysql/lib/plugin" #define PLUGINDIR "/home/ut/testing/mysql/5.5.8/lib/plugin"
#define DEFAULT_SYSCONFDIR "/usr/local/mysql/etc" #define DEFAULT_SYSCONFDIR "/home/ut/testing/mysql/5.5.8/etc"
/* #undef SO_EXT */
#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.5-m3" #define PACKAGE_STRING "MySQL Server 5.5.8"
#define PACKAGE_TARNAME "mysql" #define PACKAGE_TARNAME "mysql"
#define PACKAGE_VERSION "5.5.5-m3" #define PACKAGE_VERSION "5.5.8"
#define VERSION "5.5.5-m3" #define VERSION "5.5.8"
#define PROTOCOL_VERSION 10 #define PROTOCOL_VERSION 10
#endif #endif
 End of changes. 9 change blocks. 
40 lines changed or deleted 14 lines changed or added


 my_dbug.h   my_dbug.h 
/* Copyright (C) 2000 MySQL AB /* Copyright (c) 2010, 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.
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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 US A */ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 US A */
#ifndef _dbug_h #ifndef MY_DBUG_INCLUDED
#define _dbug_h #define MY_DBUG_INCLUDED
#ifndef __WIN__
#ifdef HAVE_SYS_TYPES_H
#include <sys/types.h>
#endif
#ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif
#include <signal.h>
#endif /* not __WIN__ */
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {
#endif #endif
#if !defined(DBUG_OFF) && !defined(_lint) #if !defined(DBUG_OFF) && !defined(_lint)
struct _db_stack_frame_ { struct _db_stack_frame_ {
const char *func; /* function name of the previous stack frame */ const char *func; /* function name of the previous stack frame */
const char *file; /* filename of the function of previous frame */ const char *file; /* filename of the function of previous frame */
uint level; /* this nesting level, highest bit enables tracing */ uint level; /* this nesting level, highest bit enables tracing */
skipping to change at line 48 skipping to change at line 58
extern void _db_longjmp_(void); extern void _db_longjmp_(void);
extern void _db_process_(const char *name); extern void _db_process_(const char *name);
extern void _db_push_(const char *control); extern void _db_push_(const char *control);
extern void _db_pop_(void); extern void _db_pop_(void);
extern void _db_set_(const char *control); extern void _db_set_(const char *control);
extern void _db_set_init_(const char *control); extern void _db_set_init_(const char *control);
extern void _db_enter_(const char *_func_, const char *_file_, uint _line_, extern void _db_enter_(const char *_func_, const char *_file_, uint _line_,
struct _db_stack_frame_ *_stack_frame_); struct _db_stack_frame_ *_stack_frame_);
extern void _db_return_(uint _line_, struct _db_stack_frame_ *_stack_frame _); extern void _db_return_(uint _line_, struct _db_stack_frame_ *_stack_frame _);
extern void _db_pargs_(uint _line_,const char *keyword); extern void _db_pargs_(uint _line_,const char *keyword);
extern void _db_doprnt_ _VARARGS((const char *format,...)) extern void _db_doprnt_(const char *format,...)
ATTRIBUTE_FORMAT(printf, 1, 2); ATTRIBUTE_FORMAT(printf, 1, 2);
extern void _db_dump_(uint _line_,const char *keyword, extern void _db_dump_(uint _line_,const char *keyword,
const unsigned char *memory, size_t length); const unsigned char *memory, size_t length);
extern void _db_end_(void); extern void _db_end_(void);
extern void _db_lock_file_(void); extern void _db_lock_file_(void);
extern void _db_unlock_file_(void); extern void _db_unlock_file_(void);
extern FILE *_db_fp_(void); extern FILE *_db_fp_(void);
extern void _db_flush_(); extern void _db_flush_();
extern const char* _db_get_func_(void); extern const char* _db_get_func_(void);
skipping to change at line 114 skipping to change at line 124
#define DBUG_CHECK_CRASH(func, op) \ #define DBUG_CHECK_CRASH(func, op) \
do { char _dbuf_[255]; strxnmov(_dbuf_, sizeof(_dbuf_)-1, (func), (op)); \ do { char _dbuf_[255]; strxnmov(_dbuf_, sizeof(_dbuf_)-1, (func), (op)); \
DBUG_EXECUTE_IF(_dbuf_, DBUG_ABORT()); } while(0) DBUG_EXECUTE_IF(_dbuf_, DBUG_ABORT()); } while(0)
#define DBUG_CRASH_ENTER(func) \ #define DBUG_CRASH_ENTER(func) \
DBUG_ENTER(func); DBUG_CHECK_CRASH(func, "_crash_enter") DBUG_ENTER(func); DBUG_CHECK_CRASH(func, "_crash_enter")
#define DBUG_CRASH_RETURN(val) \ #define DBUG_CRASH_RETURN(val) \
DBUG_CHECK_CRASH(_db_get_func_(), "_crash_return") DBUG_CHECK_CRASH(_db_get_func_(), "_crash_return")
#define DBUG_CRASH_VOID_RETURN \ #define DBUG_CRASH_VOID_RETURN \
DBUG_CHECK_CRASH (_db_get_func_(), "_crash_return") DBUG_CHECK_CRASH (_db_get_func_(), "_crash_return")
/*
Make the program fail, without creating a core file.
abort() will send SIGABRT which (most likely) generates core.
Use SIGKILL instead, which cannot be caught.
We also pause the current thread, until the signal is actually delivered.
An alternative would be to use _exit(EXIT_FAILURE),
but then valgrind would report lots of memory leaks.
*/
#ifdef __WIN__
#define DBUG_SUICIDE() DBUG_ABORT()
#else
#define DBUG_SUICIDE() (_db_flush_(), kill(getpid(), SIGKILL), pause())
#endif
#else /* No debugger */ #else /* No debugger */
#define DBUG_ENTER(a1) #define DBUG_ENTER(a1)
#define DBUG_LEAVE #define DBUG_LEAVE
#define DBUG_RETURN(a1) do { return(a1); } while(0) #define DBUG_RETURN(a1) do { return(a1); } while(0)
#define DBUG_VOID_RETURN do { return; } while(0) #define DBUG_VOID_RETURN do { return; } while(0)
#define DBUG_EXECUTE(keyword,a1) do { } while(0) #define DBUG_EXECUTE(keyword,a1) do { } while(0)
#define DBUG_EXECUTE_IF(keyword,a1) do { } while(0) #define DBUG_EXECUTE_IF(keyword,a1) do { } while(0)
#define DBUG_EVALUATE(keyword,a1,a2) (a2) #define DBUG_EVALUATE(keyword,a1,a2) (a2)
#define DBUG_EVALUATE_IF(keyword,a1,a2) (a2) #define DBUG_EVALUATE_IF(keyword,a1,a2) (a2)
skipping to change at line 142 skipping to change at line 166
#define DBUG_DUMP(keyword,a1,a2) do { } while(0) #define DBUG_DUMP(keyword,a1,a2) do { } while(0)
#define DBUG_END() do { } while(0) #define DBUG_END() do { } while(0)
#define DBUG_ASSERT(A) do { } while(0) #define DBUG_ASSERT(A) do { } while(0)
#define DBUG_LOCK_FILE do { } while(0) #define DBUG_LOCK_FILE do { } while(0)
#define DBUG_FILE (stderr) #define DBUG_FILE (stderr)
#define DBUG_UNLOCK_FILE do { } while(0) #define DBUG_UNLOCK_FILE do { } while(0)
#define DBUG_EXPLAIN(buf,len) #define DBUG_EXPLAIN(buf,len)
#define DBUG_EXPLAIN_INITIAL(buf,len) #define DBUG_EXPLAIN_INITIAL(buf,len)
#define DEBUGGER_OFF do { } while(0) #define DEBUGGER_OFF do { } while(0)
#define DEBUGGER_ON do { } while(0) #define DEBUGGER_ON do { } while(0)
#define DBUG_ABORT() abort() #define DBUG_ABORT() do { } while(0)
#define DBUG_CRASH_ENTER(func) #define DBUG_CRASH_ENTER(func)
#define DBUG_CRASH_RETURN(val) do { return(val); } while(0) #define DBUG_CRASH_RETURN(val) do { return(val); } while(0)
#define DBUG_CRASH_VOID_RETURN do { return; } while(0) #define DBUG_CRASH_VOID_RETURN do { return; } while(0)
#define DBUG_SUICIDE() do { } while(0)
#endif #endif
#ifdef EXTRA_DEBUG #ifdef EXTRA_DEBUG
/** /**
Sync points allow us to force the server to reach a certain line of code Sync points allow us to force the server to reach a certain line of code
and block there until the client tells the server it is ok to go on. and block there until the client tells the server it is ok to go on.
The client tells the server to block with SELECT GET_LOCK() The client tells the server to block with SELECT GET_LOCK()
and unblocks it with SELECT RELEASE_LOCK(). Used for debugging difficult and unblocks it with SELECT RELEASE_LOCK(). Used for debugging difficult
concurrency problems concurrency problems
skipping to change at line 167 skipping to change at line 192
#define DBUG_SYNC_POINT(lock_name,lock_timeout) \ #define DBUG_SYNC_POINT(lock_name,lock_timeout) \
debug_sync_point(lock_name,lock_timeout) debug_sync_point(lock_name,lock_timeout)
void debug_sync_point(const char* lock_name, uint lock_timeout); void debug_sync_point(const char* lock_name, uint lock_timeout);
#else #else
#define DBUG_SYNC_POINT(lock_name,lock_timeout) #define DBUG_SYNC_POINT(lock_name,lock_timeout)
#endif /* EXTRA_DEBUG */ #endif /* EXTRA_DEBUG */
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif #endif
#endif
#endif /* MY_DBUG_INCLUDED */
 End of changes. 7 change blocks. 
5 lines changed or deleted 30 lines changed or added


 my_getopt.h   my_getopt.h 
skipping to change at line 42 skipping to change at line 42
#define GET_STR_ALLOC 10 #define GET_STR_ALLOC 10
#define GET_DISABLED 11 #define GET_DISABLED 11
#define GET_ENUM 12 #define GET_ENUM 12
#define GET_SET 13 #define GET_SET 13
#define GET_DOUBLE 14 #define GET_DOUBLE 14
#define GET_FLAGSET 15 #define GET_FLAGSET 15
#define GET_ASK_ADDR 128 #define GET_ASK_ADDR 128
#define GET_TYPE_MASK 127 #define GET_TYPE_MASK 127
/**
Enumeration of the my_option::arg_type attributes.
It should be noted that for historical reasons variables with the combina
tion
arg_type=NO_ARG, my_option::var_type=GET_BOOL still accepts
arguments. This is someone counter intuitive and care should be taken
if the code is refactored.
*/
enum get_opt_arg_type { NO_ARG, OPT_ARG, REQUIRED_ARG }; enum get_opt_arg_type { NO_ARG, OPT_ARG, REQUIRED_ARG };
struct st_typelib; struct st_typelib;
struct my_option struct my_option
{ {
const char *name; /**< Name of the option. name=NULL const char *name; /**< Name of the option. name=NULL
marks the end of the my_option[] marks the end of the my_option[]
array. array.
*/ */
 End of changes. 1 change blocks. 
0 lines changed or deleted 8 lines changed or added


 my_global.h   my_global.h 
skipping to change at line 49 skipping to change at line 49
#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__ */
#if defined(__QNXNTO__) && !defined(FD_SETSIZE)
#define FD_SETSIZE 1024 /* Max number of file descriptor bits in
fd_set, used when calling 'select'
Must be defined before including
"sys/select.h" and "sys/time.h"
*/
#endif
/* to make command line shorter we'll define USE_PRAGMA_INTERFACE here */ /* to make command line shorter we'll define USE_PRAGMA_INTERFACE here */
#ifdef USE_PRAGMA_IMPLEMENTATION #ifdef USE_PRAGMA_IMPLEMENTATION
#define USE_PRAGMA_INTERFACE #define USE_PRAGMA_INTERFACE
#endif #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__)
skipping to change at line 84 skipping to change at line 76
#else #else
#define C_MODE_START #define C_MODE_START
#define C_MODE_END #define C_MODE_END
#endif #endif
#ifdef __cplusplus #ifdef __cplusplus
#define CPP_UNNAMED_NS_START namespace { #define CPP_UNNAMED_NS_START namespace {
#define CPP_UNNAMED_NS_END } #define CPP_UNNAMED_NS_END }
#endif #endif
#if defined(_WIN32)
#include <my_config.h>
#elif defined(__NETWARE__)
#include <my_config.h> #include <my_config.h>
#include <config-netware.h>
#if defined(__cplusplus) && defined(inline)
#undef inline /* fix configure problem */
#endif
#else
#include <my_config.h>
#if defined(__cplusplus) && defined(inline)
#undef inline /* fix configure problem */
#endif
#endif /* _WIN32... */
#ifdef WITH_PERFSCHEMA_STORAGE_ENGINE #ifdef WITH_PERFSCHEMA_STORAGE_ENGINE
#define HAVE_PSI_INTERFACE #define HAVE_PSI_INTERFACE
#endif /* WITH_PERFSCHEMA_STORAGE_ENGINE */ #endif /* WITH_PERFSCHEMA_STORAGE_ENGINE */
/* Make it easier to add conditional code in _expressions_ */ /* Make it easier to add conditional code in _expressions_ */
#ifdef __WIN__ #ifdef __WIN__
#define IF_WIN(A,B) A #define IF_WIN(A,B) A
#else #else
#define IF_WIN(A,B) B #define IF_WIN(A,B) B
#endif #endif
#ifdef __NETWARE__
#define IF_NETWARE(A,B) A
#else
#define IF_NETWARE(A,B) B
#endif
#ifndef DBUG_OFF
#define IF_DBUG(A,B) A
#else
#define IF_DBUG(A,B) B
#endif
#ifdef HAVE_purify #ifdef HAVE_purify
#define IF_PURIFY(A,B) A #define IF_PURIFY(A,B) A
#else #else
#define IF_PURIFY(A,B) B #define IF_PURIFY(A,B) B
#endif #endif
#ifdef DISABLE_GRANT_OPTIONS
#define IF_DISABLE_GRANT_OPTIONS(A,B) A
#else
#define IF_DISABLE_GRANT_OPTIONS(A,B) B
#endif
#ifndef EMBEDDED_LIBRARY #ifndef EMBEDDED_LIBRARY
#ifdef WITH_NDB_BINLOG #ifdef WITH_NDB_BINLOG
#define HAVE_NDB_BINLOG 1 #define HAVE_NDB_BINLOG 1
#endif #endif
#endif /* !EMBEDDED_LIBRARY */ #endif /* !EMBEDDED_LIBRARY */
#ifndef EMBEDDED_LIBRARY #ifndef EMBEDDED_LIBRARY
#define HAVE_REPLICATION #define HAVE_REPLICATION
#define HAVE_EXTERNAL_CLIENT #define HAVE_EXTERNAL_CLIENT
#endif #endif
/* Some defines to avoid ifdefs in the code */
#ifndef NETWARE_YIELD
#define NETWARE_YIELD
#define NETWARE_SET_SCREEN_MODE(A)
#endif
#if defined (_WIN32) #if defined (_WIN32)
/* /*
off_t is 32 bit long. We do not use C runtime functions off_t is 32 bit long. We do not use C runtime functions
with off_t but native Win32 file IO APIs, that work with with off_t but native Win32 file IO APIs, that work with
64 bit offsets. 64 bit offsets.
*/ */
#undef SIZEOF_OFF_T #undef SIZEOF_OFF_T
#define SIZEOF_OFF_T 8 #define SIZEOF_OFF_T 8
/* /*
skipping to change at line 244 skipping to change at line 199
other reason to use them is for documentation other reason to use them is for documentation
*/ */
#if !defined(__GNUC__) || (__GNUC__ == 2 && __GNUC_MINOR__ < 96) #if !defined(__GNUC__) || (__GNUC__ == 2 && __GNUC_MINOR__ < 96)
#define __builtin_expect(x, expected_value) (x) #define __builtin_expect(x, expected_value) (x)
#endif #endif
#define likely(x) __builtin_expect((x),1) #define likely(x) __builtin_expect((x),1)
#define unlikely(x) __builtin_expect((x),0) #define unlikely(x) __builtin_expect((x),0)
/*
The macros below are useful in optimising places where it has been
discovered that cache misses stall the process and where a prefetch
of the cache line can improve matters. This is available in GCC 3.1.1
and later versions.
PREFETCH_READ says that addr is going to be used for reading and that
it is to be kept in caches if possible for a while
PREFETCH_WRITE also says that the item to be cached is likely to be
updated.
The *LOCALITY scripts are also available for experimentation purposes
mostly and should only be used if they are verified to improve matters.
For more input see GCC manual (available in GCC 3.1.1 and later)
*/
#if (__GNUC__ > 3) || (__GNUC__ == 3 && __GNUC_MINOR > 10)
#define PREFETCH_READ(addr) __builtin_prefetch(addr, 0, 3)
#define PREFETCH_WRITE(addr) \
__builtin_prefetch(addr, 1, 3)
#define PREFETCH_READ_LOCALITY(addr, locality) \
__builtin_prefetch(addr, 0, locality)
#define PREFETCH_WRITE_LOCALITY(addr, locality) \
__builtin_prefetch(addr, 1, locality)
#else
#define PREFETCH_READ(addr)
#define PREFETCH_READ_LOCALITY(addr, locality)
#define PREFETCH_WRITE(addr)
#define PREFETCH_WRITE_LOCALITY(addr, locality)
#endif
/*
The following macro is used to ensure that code often used in most
SQL statements and definitely for parts of the SQL processing are
kept in a code segment by itself. This has the advantage that the
risk of common code being overlapping in caches of the CPU is less.
This can be a cause of big performance problems.
Routines should be put in this category with care and when they are
put there one should also strive to make as much of the error handling
as possible (or uncommon code of the routine) to execute in a
separate method to avoid moving to much code to this code segment.
It is very easy to use, simply add HOT_METHOD at the end of the
function declaration.
For more input see GCC manual (available in GCC 2.95 and later)
*/
#if (__GNUC__ > 2) || (__GNUC__ == 2 && __GNUC_MINOR > 94)
#define HOT_METHOD \
__attribute__ ((section ("hot_code_section")))
#else
#define HOT_METHOD
#endif
/*
The following macro is used to ensure that popular global variables
are located next to each other to avoid that they contend for the
same cache lines.
It is very easy to use, simply add HOT_DATA at the end of the declaration
of the variable, the variable must be initialised because of the way
that linker works so a declaration using HOT_DATA should look like:
uint global_hot_data HOT_DATA = 0;
For more input see GCC manual (available in GCC 2.95 and later)
*/
#if (__GNUC__ > 2) || (__GNUC__ == 2 && __GNUC_MINOR > 94)
#define HOT_DATA \
__attribute__ ((section ("hot_data_section")))
#else
#define HOT_DATA
#endif
/*
now let's figure out if inline functions are supported
autoconf defines 'inline' to be empty, if not
*/
#define inline_test_1(X) X ## 1
#define inline_test_2(X) inline_test_1(X)
#if inline_test_2(inline) != 1
#define HAVE_INLINE
#else
#warning No "inline" support in C, all "static inline" functions will be in
stantiated in every .o file!!!
#endif
#undef inline_test_2
#undef inline_test_1
/* helper macro for "instantiating" inline functions */
#define STATIC_INLINE static inline
/*
The following macros are used to control inlining a bit more than
usual. These macros are used to ensure that inlining always or
never occurs (independent of compilation mode).
For more input see GCC manual (available in GCC 3.1.1 and later)
*/
#if (__GNUC__ > 3) || (__GNUC__ == 3 && __GNUC_MINOR > 10)
#define ALWAYS_INLINE __attribute__ ((always_inline))
#define NEVER_INLINE __attribute__ ((noinline))
#else
#define ALWAYS_INLINE
#define NEVER_INLINE
#endif
/* Fix problem with S_ISLNK() on Linux */ /* Fix problem with S_ISLNK() on Linux */
#if defined(TARGET_OS_LINUX) || defined(__GLIBC__) #if defined(TARGET_OS_LINUX) || defined(__GLIBC__)
#undef _GNU_SOURCE #undef _GNU_SOURCE
#define _GNU_SOURCE 1 #define _GNU_SOURCE 1
#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
*/ */
skipping to change at line 455 skipping to change at line 308
#undef HAVE_SNPRINTF #undef HAVE_SNPRINTF
#endif #endif
#ifdef HAVE_BROKEN_PREAD #ifdef HAVE_BROKEN_PREAD
/* /*
pread()/pwrite() are not 64 bit safe on HP-UX 11.0 without pread()/pwrite() are not 64 bit safe on HP-UX 11.0 without
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
#if defined(HAVE_BROKEN_INLINE) && !defined(__cplusplus)
#undef inline
#define inline
#endif
#ifdef UNDEF_HAVE_GETHOSTBYNAME_R /* For OSF4.x */ #ifdef UNDEF_HAVE_GETHOSTBYNAME_R /* For OSF4.x */
#undef HAVE_GETHOSTBYNAME_R #undef HAVE_GETHOSTBYNAME_R
#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 */ /* gcc/egcs issues */
#if defined(__GNUC) && defined(__EXCEPTIONS) #if defined(__GNUC) && defined(__EXCEPTIONS)
#error "Please add -fno-exceptions to CXXFLAGS and reconfigure/recompile" #error "Please add -fno-exceptions to CXXFLAGS and reconfigure/recompile"
#endif #endif
/* Fix a bug in gcc 2.8.0 on IRIX 6.2 */
#if SIZEOF_LONG == 4 && defined(__LONG_MAX__) && (__GNUC__ == 2 && __GNUC_M
INOR__ == 8)
#undef __LONG_MAX__ /* Is a longlong value in gcc 2.8.0 ??? */
#define __LONG_MAX__ 2147483647
#endif
/* egcs 1.1.2 has a problem with memcpy on Alpha */
#if defined(__GNUC__) && defined(__alpha__) && ! (__GNUC__ > 2 || (__GNUC__
== 2 && __GNUC_MINOR__ >= 95))
#define BAD_MEMCPY
#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 588 skipping to change at line 426
#if defined(HPUX10) && defined(_LARGEFILE64_SOURCE) && defined(THREAD) #if defined(HPUX10) && defined(_LARGEFILE64_SOURCE) && defined(THREAD)
/* 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
#ifdef __QNXNTO__
/* This has to be after include limits.h */
#define HAVE_ERRNO_AS_DEFINE
#define HAVE_FCNTL_LOCK
#undef HAVE_FINITE
#undef LONGLONG_MIN /* These get wrongly defined in QNX 6.2 */
#undef LONGLONG_MAX /* standard system library 'limits.h' */
#ifdef __cplusplus
#ifndef HAVE_RINT
#define HAVE_RINT
#endif /* rint() and isnan() functions are not */
#define rint(a) std::rint(a) /* visible in C++ scope due to an error */
#define isnan(a) std::isnan(a) /* in the usr/include/math.h on QNX */
#endif
#endif
/* We can not live without the following defines */
#define USE_MYFUNC 1 /* Must use syscall indirection */
#define MASTER 1 /* Compile without unireg */
#define ENGLISH 1 /* Messages in English */
#define POSIX_MISTAKE 1 /* regexp: Fix stupid spec error */
#define USE_REGEX 1 /* We want the use the regex library */
/* Do not define for ultra sparcs */
#define USE_BMOVE512 1 /* Use this unless system bmove is faster */
#define QUOTE_ARG(x) #x /* Quote argument (before cpp) */ #define QUOTE_ARG(x) #x /* Quote argument (before cpp) */
#define STRINGIFY_ARG(x) QUOTE_ARG(x) /* Quote argument, after cpp */ #define STRINGIFY_ARG(x) QUOTE_ARG(x) /* Quote argument, after cpp */
/* Paranoid settings. Define I_AM_PARANOID if you are paranoid */ /* Paranoid settings. Define I_AM_PARANOID if you are paranoid */
#ifdef I_AM_PARANOID #ifdef I_AM_PARANOID
#define DONT_ALLOW_USER_CHANGE 1 #define DONT_ALLOW_USER_CHANGE 1
#define DONT_USE_MYSQL_PWD 1 #define DONT_USE_MYSQL_PWD 1
#endif #endif
/* Does the system remember a signal handler after a signal ? */ /* Does the system remember a signal handler after a signal ? */
#ifndef HAVE_BSD_SIGNALS #if !defined(HAVE_BSD_SIGNALS) && !defined(HAVE_SIGACTION)
#define DONT_REMEMBER_SIGNAL #define SIGNAL_HANDLER_RESET_ON_DELIVERY
#endif #endif
#if defined(_lint) || defined(FORCE_INIT_OF_VARS) /*
#define LINT_INIT(var) var=0 /* No uninitialize-warning * Deprecated workaround for false-positive uninitialized variables
/ warnings. Those should be silenced using tool-specific heuristics.
Enabled by default for g++ due to the bug referenced below.
*/
#if defined(_lint) || defined(FORCE_INIT_OF_VARS) || \
(defined(__GNUC__) && defined(__cplusplus))
#define LINT_INIT(var) var= 0
#else #else
#define LINT_INIT(var) #define LINT_INIT(var)
#endif #endif
#ifndef SO_EXT
#ifdef _WIN32
#define SO_EXT ".dll"
#elif defined(__APPLE__)
#define SO_EXT ".dylib"
#else
#define SO_EXT ".so"
#endif
#endif
/* /*
Suppress uninitialized variable warning without generating code. Suppress uninitialized variable warning without generating code.
The _cplusplus is a temporary workaround for C++ code pending a fix The _cplusplus is a temporary workaround for C++ code pending a fix
for a g++ bug (http://gcc.gnu.org/bugzilla/show_bug.cgi?id=34772). for a g++ bug (http://gcc.gnu.org/bugzilla/show_bug.cgi?id=34772).
*/ */
#if defined(_lint) || defined(FORCE_INIT_OF_VARS) || defined(__cplusplus) | #if defined(_lint) || defined(FORCE_INIT_OF_VARS) || \
| \ defined(__cplusplus) || !defined(__GNUC__)
!defined(__GNUC__)
#define UNINIT_VAR(x) x= 0 #define UNINIT_VAR(x) x= 0
#else #else
/* GCC specific self-initialization which inhibits the warning. */
#define UNINIT_VAR(x) x= x #define UNINIT_VAR(x) x= x
#endif #endif
/* Define some useful general macros */
#if !defined(max)
#define max(a, b) ((a) > (b) ? (a) : (b))
#define min(a, b) ((a) < (b) ? (a) : (b))
#endif
#if !defined(HAVE_UINT) #if !defined(HAVE_UINT)
#undef HAVE_UINT #undef HAVE_UINT
#define HAVE_UINT #define HAVE_UINT
typedef unsigned int uint; typedef unsigned int uint;
typedef unsigned short ushort; typedef unsigned short ushort;
#endif #endif
#define CMP_NUM(a,b) (((a) < (b)) ? -1 : ((a) == (b)) ? 0 : 1)
#define sgn(a) (((a) < 0) ? -1 : ((a) > 0) ? 1 : 0)
#define swap_variables(t, a, b) { t dummy; dummy= a; a= b; b= dummy; } #define swap_variables(t, a, b) { t dummy; dummy= a; a= b; b= dummy; }
#define test(a) ((a) ? 1 : 0) #define test(a) ((a) ? 1 : 0)
#define set_if_bigger(a,b) do { if ((a) < (b)) (a)=(b); } while(0) #define set_if_bigger(a,b) do { if ((a) < (b)) (a)=(b); } while(0)
#define set_if_smaller(a,b) do { if ((a) > (b)) (a)=(b); } while(0) #define set_if_smaller(a,b) do { if ((a) > (b)) (a)=(b); } while(0)
#define test_all_bits(a,b) (((a) & (b)) == (b)) #define test_all_bits(a,b) (((a) & (b)) == (b))
#define set_bits(type, bit_count) (sizeof(type)*8 <= (bit_count) ? ~(type) 0 : ((((type) 1) << (bit_count)) - (type) 1))
#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
#if defined(__GNUC__) #include <my_compiler.h>
#define function_volatile volatile
#define my_reinterpret_cast(A) reinterpret_cast<A>
#define my_const_cast(A) const_cast<A>
# ifndef GCC_VERSION
# define GCC_VERSION (__GNUC__ * 1000 + __GNUC_MINOR__)
# endif
#elif !defined(my_reinterpret_cast)
#define my_reinterpret_cast(A) (A)
#define my_const_cast(A) (A)
#endif
#include <my_attribute.h>
/* /*
Wen using the embedded library, users might run into link problems, Wen using the embedded library, users might run into link problems,
duplicate declaration of __cxa_pure_virtual, solved by declaring it a duplicate declaration of __cxa_pure_virtual, solved by declaring it a
weak symbol. weak symbol.
*/ */
#if defined(USE_MYSYS_NEW) && ! defined(DONT_DECLARE_CXA_PURE_VIRTUAL) #if defined(USE_MYSYS_NEW) && ! defined(DONT_DECLARE_CXA_PURE_VIRTUAL)
C_MODE_START C_MODE_START
int __cxa_pure_virtual () __attribute__ ((weak)); int __cxa_pure_virtual () __attribute__ ((weak));
C_MODE_END C_MODE_END
#endif #endif
/* From old s-system.h */
/*
Support macros for non ansi & other old compilers. Since such
things are no longer supported we do nothing. We keep then since
some of our code may still be needed to upgrade old customers.
*/
#define _VARARGS(X) X
#define _STATIC_VARARGS(X) X
/* 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
# endif # endif
#endif #endif
#define MIN_ARRAY_SIZE 0 /* Zero or One. Gcc allows zero*/
#define ASCII_BITS_USED 8 /* Bit char used */
#define NEAR_F /* No near function handling */
/* Some types that is different between systems */ /* Some types that is different between systems */
typedef int File; /* File descriptor */ typedef int File; /* File descriptor */
#ifdef _WIN32 #ifdef _WIN32
typedef SOCKET my_socket; typedef SOCKET my_socket;
#else #else
typedef int my_socket; /* File descriptor for sockets */ typedef int my_socket; /* File descriptor for sockets */
#define INVALID_SOCKET -1 #define INVALID_SOCKET -1
#endif #endif
/* Type for fuctions that handles signals */ /* Type for fuctions that handles signals */
skipping to change at line 803 skipping to change at line 598
#endif #endif
/* additional file share flags for win32 */ /* additional file share flags for win32 */
#ifdef __WIN__ #ifdef __WIN__
#define _SH_DENYRWD 0x110 /* deny read/write mode & delete */ #define _SH_DENYRWD 0x110 /* deny read/write mode & delete */
#define _SH_DENYWRD 0x120 /* deny write mode & delete */ #define _SH_DENYWRD 0x120 /* deny write mode & delete */
#define _SH_DENYRDD 0x130 /* deny read mode & delete */ #define _SH_DENYRDD 0x130 /* deny read mode & delete */
#define _SH_DENYDEL 0x140 /* deny delete only */ #define _SH_DENYDEL 0x140 /* deny delete only */
#endif /* __WIN__ */ #endif /* __WIN__ */
/* #define USE_RECORD_LOCK */ /* General constants */
/* Unsigned types supported by the compiler */
#define UNSINT8 /* unsigned int8 (char) */
#define UNSINT16 /* unsigned int16 */
#define UNSINT32 /* unsigned int32 */
/* General constants */
#define FN_LEN 256 /* Max file name len */ #define FN_LEN 256 /* Max file name len */
#define FN_HEADLEN 253 /* Max length of filepart of file name */ #define FN_HEADLEN 253 /* Max length of filepart of file name */
#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
skipping to change at line 871 skipping to change at line 659
#ifdef _WIN32 #ifdef _WIN32
#define MY_NFILE (16384 + MY_FILE_MIN) #define MY_NFILE (16384 + MY_FILE_MIN)
#else #else
#define MY_NFILE 64 #define MY_NFILE 64
#endif #endif
#ifndef OS_FILE_LIMIT #ifndef OS_FILE_LIMIT
#define OS_FILE_LIMIT UINT_MAX #define OS_FILE_LIMIT UINT_MAX
#endif #endif
/* #define EXT_IN_LIBNAME */
/* #define FN_NO_CASE_SENSE */
/* #define FN_UPPER_CASE TRUE */
/* /*
Io buffer size; Must be a power of 2 and a multiple of 512. May be Io buffer size; Must be a power of 2 and a multiple of 512. May be
smaller what the disk page size. This influences the speed of the smaller what the disk page size. This influences the speed of the
isam btree library. eg to big to slow. isam btree library. eg to big to slow.
*/ */
#define IO_SIZE 4096 #define IO_SIZE 4096
/* /*
How much overhead does malloc have. The code often allocates How much overhead does malloc have. The code often allocates
something like 1024-MALLOC_OVERHEAD bytes something like 1024-MALLOC_OVERHEAD bytes
*/ */
#ifdef SAFEMALLOC
#define MALLOC_OVERHEAD (8+24+4)
#else
#define MALLOC_OVERHEAD 8 #define MALLOC_OVERHEAD 8
#endif
/* get memory in huncs */ /* get memory in huncs */
#define ONCE_ALLOC_INIT (uint) (4096-MALLOC_OVERHEAD) #define ONCE_ALLOC_INIT (uint) (4096-MALLOC_OVERHEAD)
/* Typical record cash */ /* Typical record cash */
#define RECORD_CACHE_SIZE (uint) (64*1024-MALLOC_OVERHEAD) #define RECORD_CACHE_SIZE (uint) (64*1024-MALLOC_OVERHEAD)
/* Typical key cash */ /* Typical key cash */
#define KEY_CACHE_SIZE (uint) (8*1024*1024) #define KEY_CACHE_SIZE (uint) (8*1024*1024)
/* Default size of a key cache block */ /* Default size of a key cache block */
#define KEY_CACHE_BLOCK_SIZE (uint) 1024 #define KEY_CACHE_BLOCK_SIZE (uint) 1024
/* Some things that this system doesn't have */ /* Some things that this system doesn't have */
#define NO_HASH /* Not needed anymore */
#ifdef _WIN32 #ifdef _WIN32
#define NO_DIR_LIBRARY /* Not standard dir-library */ #define NO_DIR_LIBRARY /* Not standard dir-library */
#endif #endif
/* Some defines of functions for portability */ /* Some defines of functions for portability */
#undef remove /* Crashes MySQL on SCO 5.0.0 */ #undef remove /* Crashes MySQL on SCO 5.0.0 */
#ifndef __WIN__ #ifndef __WIN__
#define closesocket(A) close(A) #define closesocket(A) close(A)
#endif #endif
skipping to change at line 948 skipping to change at line 728
#define my_off_t2double(A) ((double) (my_off_t) (A)) #define my_off_t2double(A) ((double) (my_off_t) (A))
#endif #endif
#ifndef double2ulonglong #ifndef double2ulonglong
#define double2ulonglong(A) ((ulonglong) (double) (A)) #define double2ulonglong(A) ((ulonglong) (double) (A))
#endif #endif
#ifndef offsetof #ifndef offsetof
#define offsetof(TYPE, MEMBER) ((size_t) &((TYPE *)0)->MEMBER) #define offsetof(TYPE, MEMBER) ((size_t) &((TYPE *)0)->MEMBER)
#endif #endif
#define ulong_to_double(X) ((double) (ulong) (X)) #define ulong_to_double(X) ((double) (ulong) (X))
#define SET_STACK_SIZE(X) /* Not needed on real machines */
#ifndef STACK_DIRECTION #ifndef STACK_DIRECTION
#error "please add -DSTACK_DIRECTION=1 or -1 to your CPPFLAGS" #error "please add -DSTACK_DIRECTION=1 or -1 to your CPPFLAGS"
#endif #endif
#if !defined(HAVE_STRTOK_R) #if !defined(HAVE_STRTOK_R)
#define strtok_r(A,B,C) strtok((A),(B)) #define strtok_r(A,B,C) strtok((A),(B))
#endif #endif
/* This is from the old m-machine.h file */ /* This is from the old m-machine.h file */
#if SIZEOF_LONG_LONG > 4 #if SIZEOF_LONG_LONG > 4
#define HAVE_LONG_LONG 1 #define HAVE_LONG_LONG 1
#endif #endif
/* /*
Some pre-ANSI-C99 systems like AIX 5.1 and Linux/GCC 2.95 define Some pre-ANSI-C99 systems like AIX 5.1 and Linux/GCC 2.95 define
ULONGLONG_MAX, LONGLONG_MIN, LONGLONG_MAX; we use them if they're defined . ULONGLONG_MAX, LONGLONG_MIN, LONGLONG_MAX; we use them if they're defined .
Also on Windows we define these constants by hand in config-win.h.
*/ */
#if defined(HAVE_LONG_LONG) && !defined(LONGLONG_MIN) #if defined(HAVE_LONG_LONG) && !defined(LONGLONG_MIN)
#define LONGLONG_MIN ((long long) 0x8000000000000000LL) #define LONGLONG_MIN ((long long) 0x8000000000000000LL)
#define LONGLONG_MAX ((long long) 0x7FFFFFFFFFFFFFFFLL) #define LONGLONG_MAX ((long long) 0x7FFFFFFFFFFFFFFFLL)
#endif #endif
#if defined(HAVE_LONG_LONG) && !defined(ULONGLONG_MAX) #if defined(HAVE_LONG_LONG) && !defined(ULONGLONG_MAX)
/* First check for ANSI C99 definition: */ /* First check for ANSI C99 definition: */
#ifdef ULLONG_MAX #ifdef ULLONG_MAX
skipping to change at line 1065 skipping to change at line 843
*/ */
#if SIZEOF_CHARP == 4 #if SIZEOF_CHARP == 4
typedef long my_ptrdiff_t; typedef long my_ptrdiff_t;
#else #else
typedef long long my_ptrdiff_t; typedef long long my_ptrdiff_t;
#endif #endif
#define MY_ALIGN(A,L) (((A) + (L) - 1) & ~((L) - 1)) #define MY_ALIGN(A,L) (((A) + (L) - 1) & ~((L) - 1))
#define ALIGN_SIZE(A) MY_ALIGN((A),sizeof(double)) #define ALIGN_SIZE(A) MY_ALIGN((A),sizeof(double))
/* Size to make adressable obj. */ /* Size to make adressable obj. */
#define ALIGN_PTR(A, t) ((t*) MY_ALIGN((A),sizeof(t)))
/* Offset of field f in structure t */
#define OFFSET(t, f) ((size_t)(char *)&((t *)0)->f)
#define ADD_TO_PTR(ptr,size,type) (type) ((uchar*) (ptr)+size) #define ADD_TO_PTR(ptr,size,type) (type) ((uchar*) (ptr)+size)
#define PTR_BYTE_DIFF(A,B) (my_ptrdiff_t) ((uchar*) (A) - (uchar*) (B)) #define PTR_BYTE_DIFF(A,B) (my_ptrdiff_t) ((uchar*) (A) - (uchar*) (B))
#define MY_DIV_UP(A, B) (((A) + (B) - 1) / (B))
#define MY_ALIGNED_BYTE_ARRAY(N, S, T) T N[MY_DIV_UP(S, sizeof(T))]
#ifdef __cplusplus
template <size_t sz> struct Aligned_char_array
{
union {
void *v; // Ensures alignment.
char arr[sz]; // The actual buffer.
} u;
void* arr() { return &u.arr[0]; }
};
#endif /* __cplusplus */
/* /*
Custom version of standard offsetof() macro which can be used to get Custom version of standard offsetof() macro which can be used to get
offsets of members in class for non-POD types (according to the current offsets of members in class for non-POD types (according to the current
version of C++ standard offsetof() macro can't be used in such cases and version of C++ standard offsetof() macro can't be used in such cases and
attempt to do so causes warnings to be emitted, OTOH in many cases it is attempt to do so causes warnings to be emitted, OTOH in many cases it is
still OK to assume that all instances of the class has the same offsets still OK to assume that all instances of the class has the same offsets
for the same members). for the same members).
This is temporary solution which should be removed once File_parser class This is temporary solution which should be removed once File_parser class
and related routines are refactored. and related routines are refactored.
*/ */
#define my_offsetof(TYPE, MEMBER) \ #define my_offsetof(TYPE, MEMBER) \
((size_t)((char *)&(((TYPE *)0x10)->MEMBER) - (char*)0x10)) ((size_t)((char *)&(((TYPE *)0x10)->MEMBER) - (char*)0x10))
#define NullS (char *) 0 #define NullS (char *) 0
/* Nowdays we do not support MessyDos */
#ifndef NEAR
#define NEAR /* Who needs segments ? */
#define FAR /* On a good machine */
#ifndef HUGE_PTR
#define HUGE_PTR
#endif
#endif
#ifdef STDCALL #ifdef STDCALL
#undef STDCALL #undef STDCALL
#endif #endif
#ifdef _WIN32 #ifdef _WIN32
#define STDCALL __stdcall #define STDCALL __stdcall
#else #else
#define STDCALL #define STDCALL
#endif #endif
skipping to change at line 1200 skipping to change at line 953
#elif SIZEOF_CHARP == SIZEOF_LONG #elif SIZEOF_CHARP == SIZEOF_LONG
typedef long intptr; typedef long intptr;
#elif SIZEOF_CHARP == SIZEOF_LONG_LONG #elif SIZEOF_CHARP == SIZEOF_LONG_LONG
typedef long long intptr; typedef long long intptr;
#else #else
#error sizeof(void *) is neither sizeof(int) nor sizeof(long) nor sizeof(lo ng long) #error sizeof(void *) is neither sizeof(int) nor sizeof(long) nor sizeof(lo ng long)
#endif #endif
#define MY_ERRPTR ((void*)(intptr)1) #define MY_ERRPTR ((void*)(intptr)1)
#ifdef USE_RAID
/*
The following is done with a if to not get problems with pre-processors
with late define evaluation
*/
#if SIZEOF_OFF_T == 4
#define SYSTEM_SIZEOF_OFF_T 4
#else
#define SYSTEM_SIZEOF_OFF_T 8
#endif
#undef SIZEOF_OFF_T
#define SIZEOF_OFF_T 8
#else
#define SYSTEM_SIZEOF_OFF_T SIZEOF_OFF_T
#endif /* USE_RAID */
#if defined(_WIN32) #if defined(_WIN32)
typedef unsigned long long my_off_t; typedef unsigned long long my_off_t;
typedef unsigned long long os_off_t; typedef unsigned long long os_off_t;
#else #else
typedef off_t os_off_t; typedef off_t os_off_t;
#if SIZEOF_OFF_T > 4 #if SIZEOF_OFF_T > 4
typedef ulonglong my_off_t; typedef ulonglong my_off_t;
#else #else
typedef unsigned long my_off_t; typedef unsigned long my_off_t;
#endif #endif
skipping to change at line 1256 skipping to change at line 993
#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_ETIMEDOUT SOCKET_EINTR
#define SOCKET_EWOULDBLOCK EWOULDBLOCK #define SOCKET_EWOULDBLOCK EWOULDBLOCK
#define SOCKET_EADDRINUSE EADDRINUSE #define SOCKET_EADDRINUSE EADDRINUSE
#define SOCKET_ENFILE ENFILE #define SOCKET_ENFILE ENFILE
#define SOCKET_EMFILE EMFILE #define SOCKET_EMFILE EMFILE
#endif #endif
typedef uint8 int7; /* Most effective integer 0 <= x <= 127 */
typedef short int15; /* Most effective integer 0 <= x <= 32767 */
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 */
#define INT8(v) (int8) (v) /* Macros for converting *constants* to the right type */
#define INT16(v) (int16) (v)
#define INT32(v) (int32) (v)
#define MYF(v) (myf) (v) #define MYF(v) (myf) (v)
#ifndef LL #ifndef LL
#ifdef HAVE_LONG_LONG #ifdef HAVE_LONG_LONG
#define LL(A) A ## LL #define LL(A) A ## LL
#else #else
#define LL(A) A ## L #define LL(A) A ## L
#endif #endif
#endif #endif
skipping to change at line 1307 skipping to change at line 1040
#define reg11 register #define reg11 register
#define reg12 register #define reg12 register
#define reg13 register #define reg13 register
#define reg14 register #define reg14 register
#define reg15 register #define reg15 register
#define reg16 register #define reg16 register
#endif #endif
#include <my_dbug.h> #include <my_dbug.h>
/*
Sometimes we want to make sure that the variable is not put into
a register in debugging mode so we can see its value in the core
*/
#ifndef DBUG_OFF
#define dbug_volatile volatile
#else
#define dbug_volatile
#endif
/* Some helper macros */ /* Some helper macros */
#define YESNO(X) ((X) ? "yes" : "no") #define YESNO(X) ((X) ? "yes" : "no")
/* Defines for time function */
#define SCALE_SEC 100
#define SCALE_USEC 10000
#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 */
/* /*
Define-funktions for reading and storing in machine independent format Define-funktions for reading and storing in machine independent format
(low byte first) (low byte first)
*/ */
/* Optimized store functions for Intel x86 */ /* Optimized store functions for Intel x86 */
#if defined(__i386__) || defined(_WIN32) #if defined(__i386__) || defined(_WIN32)
skipping to change at line 1519 skipping to change at line 1238
((uchar*) &def_temp)[0]=(M)[7];\ ((uchar*) &def_temp)[0]=(M)[7];\
((uchar*) &def_temp)[1]=(M)[6];\ ((uchar*) &def_temp)[1]=(M)[6];\
((uchar*) &def_temp)[2]=(M)[5];\ ((uchar*) &def_temp)[2]=(M)[5];\
((uchar*) &def_temp)[3]=(M)[4];\ ((uchar*) &def_temp)[3]=(M)[4];\
((uchar*) &def_temp)[4]=(M)[3];\ ((uchar*) &def_temp)[4]=(M)[3];\
((uchar*) &def_temp)[5]=(M)[2];\ ((uchar*) &def_temp)[5]=(M)[2];\
((uchar*) &def_temp)[6]=(M)[1];\ ((uchar*) &def_temp)[6]=(M)[1];\
((uchar*) &def_temp)[7]=(M)[0];\ ((uchar*) &def_temp)[7]=(M)[0];\
(V) = def_temp; } while(0) (V) = def_temp; } while(0)
#else #else
#define float4get(V,M) memcpy_fixed((uchar*) &V,(uchar*) (M),sizeof(float #define float4get(V,M) memcpy(&V, (M), sizeof(float))
)) #define float4store(V,M) memcpy(V, (&M), sizeof(float))
#define float4store(V,M) memcpy_fixed((uchar*) V,(uchar*) (&M),sizeof(float
))
#if defined(__FLOAT_WORD_ORDER) && (__FLOAT_WORD_ORDER == __BIG_ENDIAN) #if defined(__FLOAT_WORD_ORDER) && (__FLOAT_WORD_ORDER == __BIG_ENDIAN)
#define doublestore(T,V) do { *(((char*)T)+0)=(char) ((uchar *) &V)[4];\ #define doublestore(T,V) do { *(((char*)T)+0)=(char) ((uchar *) &V)[4];\
*(((char*)T)+1)=(char) ((uchar *) &V)[5];\ *(((char*)T)+1)=(char) ((uchar *) &V)[5];\
*(((char*)T)+2)=(char) ((uchar *) &V)[6];\ *(((char*)T)+2)=(char) ((uchar *) &V)[6];\
*(((char*)T)+3)=(char) ((uchar *) &V)[7];\ *(((char*)T)+3)=(char) ((uchar *) &V)[7];\
*(((char*)T)+4)=(char) ((uchar *) &V)[0];\ *(((char*)T)+4)=(char) ((uchar *) &V)[0];\
*(((char*)T)+5)=(char) ((uchar *) &V)[1];\ *(((char*)T)+5)=(char) ((uchar *) &V)[1];\
*(((char*)T)+6)=(char) ((uchar *) &V)[2];\ *(((char*)T)+6)=(char) ((uchar *) &V)[2];\
*(((char*)T)+7)=(char) ((uchar *) &V)[3]; }\ *(((char*)T)+7)=(char) ((uchar *) &V)[3]; }\
skipping to change at line 1590 skipping to change at line 1309
((uchar*) &def_temp)[3]=(M)[3];\ ((uchar*) &def_temp)[3]=(M)[3];\
(V)=def_temp; } while(0) (V)=def_temp; } while(0)
#define shortstore(T,A) do { uint def_temp=(uint) (A) ;\ #define shortstore(T,A) do { uint def_temp=(uint) (A) ;\
*(((char*)T)+1)=(char)(def_temp); \ *(((char*)T)+1)=(char)(def_temp); \
*(((char*)T)+0)=(char)(def_temp >> 8); } while (0) *(((char*)T)+0)=(char)(def_temp >> 8); } while (0)
#define longstore(T,A) do { *(((char*)T)+3)=((A));\ #define longstore(T,A) do { *(((char*)T)+3)=((A));\
*(((char*)T)+2)=(((A) >> 8));\ *(((char*)T)+2)=(((A) >> 8));\
*(((char*)T)+1)=(((A) >> 16));\ *(((char*)T)+1)=(((A) >> 16));\
*(((char*)T)+0)=(((A) >> 24)); } while(0) *(((char*)T)+0)=(((A) >> 24)); } while(0)
#define floatget(V,M) memcpy_fixed((uchar*) &V,(uchar*) (M),sizeof(float #define floatget(V,M) memcpy(&V, (M), sizeof(float))
)) #define floatstore(T,V) memcpy((T), (void*) (&V), sizeof(float))
#define floatstore(T,V) memcpy_fixed((uchar*) (T),(uchar*)(&V),sizeof(floa #define doubleget(V,M) memcpy(&V, (M), sizeof(double))
t)) #define doublestore(T,V) memcpy((T), (void *) &V, sizeof(double))
#define doubleget(V,M) memcpy_fixed((uchar*) &V,(uchar*) (M),sizeof(double #define longlongget(V,M) memcpy(&V, (M), sizeof(ulonglong))
)) #define longlongstore(T,V) memcpy((T), &V, sizeof(ulonglong))
#define doublestore(T,V) memcpy_fixed((uchar*) (T),(uchar*) &V,sizeof(doubl
e))
#define longlongget(V,M) memcpy_fixed((uchar*) &V,(uchar*) (M),sizeof(ulong
long))
#define longlongstore(T,V) memcpy_fixed((uchar*) (T),(uchar*) &V,sizeof(ulo
nglong))
#else #else
#define ushortget(V,M) do { V = uint2korr(M); } while(0) #define ushortget(V,M) do { V = uint2korr(M); } while(0)
#define shortget(V,M) do { V = sint2korr(M); } while(0) #define shortget(V,M) do { V = sint2korr(M); } while(0)
#define longget(V,M) do { V = sint4korr(M); } while(0) #define longget(V,M) do { V = sint4korr(M); } while(0)
#define ulongget(V,M) do { V = uint4korr(M); } while(0) #define ulongget(V,M) do { V = uint4korr(M); } while(0)
#define shortstore(T,V) int2store(T,V) #define shortstore(T,V) int2store(T,V)
#define longstore(T,V) int4store(T,V) #define longstore(T,V) int4store(T,V)
#ifndef floatstore #ifndef floatstore
#define floatstore(T,V) memcpy_fixed((uchar*) (T),(uchar*) (&V),sizeof(flo #define floatstore(T,V) memcpy((T), (void *) (&V), sizeof(float))
at)) #define floatget(V,M) memcpy(&V, (M), sizeof(float))
#define floatget(V,M) memcpy_fixed((uchar*) &V, (uchar*) (M), sizeof(flo
at))
#endif #endif
#ifndef doubleget #ifndef doubleget
#define doubleget(V,M) memcpy_fixed((uchar*) &V,(uchar*) (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_fixed((uchar*) (T),(uchar*) &V,sizeof(doubl
e))
#endif /* doubleget */ #endif /* doubleget */
#define longlongget(V,M) memcpy_fixed((uchar*) &V,(uchar*) (M),sizeof(ulong #define longlongget(V,M) memcpy(&V, (M), sizeof(ulonglong))
long)) #define longlongstore(T,V) memcpy((T), &V, sizeof(ulonglong))
#define longlongstore(T,V) memcpy_fixed((uchar*) (T),(uchar*) &V,sizeof(ulo
nglong))
#endif /* WORDS_BIGENDIAN */ #endif /* WORDS_BIGENDIAN */
/* sprintf does not always return the number of bytes :- */
#ifdef SPRINTF_RETURNS_INT
#define my_sprintf(buff,args) sprintf args
#else
#ifdef SPRINTF_RETURNS_PTR
#define my_sprintf(buff,args) ((int)(sprintf args - buff))
#else
#define my_sprintf(buff,args) ((ulong) sprintf args, (ulong) strlen(buff))
#endif
#endif
#ifndef THREAD #ifndef THREAD
#define thread_safe_increment(V,L) (V)++ #define thread_safe_increment(V,L) (V)++
#define thread_safe_decrement(V,L) (V)-- #define thread_safe_decrement(V,L) (V)--
#define thread_safe_add(V,C,L) (V)+=(C) #define thread_safe_add(V,C,L) (V)+=(C)
#define thread_safe_sub(V,C,L) (V)-=(C) #define thread_safe_sub(V,C,L) (V)-=(C)
#define statistic_increment(V,L) (V)++ #define statistic_increment(V,L) (V)++
#define statistic_decrement(V,L) (V)-- #define statistic_decrement(V,L) (V)--
#define statistic_add(V,C,L) (V)+=(C) #define statistic_add(V,C,L) (V)+=(C)
#define statistic_sub(V,C,L) (V)-=(C) #define statistic_sub(V,C,L) (V)-=(C)
#endif #endif
skipping to change at line 1654 skipping to change at line 1362
#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
#if defined(_WIN32) #if defined(_WIN32)
#define dlsym(lib, name) (void*)GetProcAddress((HMODULE)lib, name) #define dlsym(lib, name) (void*)GetProcAddress((HMODULE)lib, name)
#define dlopen(libname, unused) LoadLibraryEx(libname, NULL, 0) #define dlopen(libname, unused) LoadLibraryEx(libname, NULL, 0)
#define dlclose(lib) FreeLibrary((HMODULE)lib) #define dlclose(lib) FreeLibrary((HMODULE)lib)
#ifndef HAVE_DLOPEN
#define HAVE_DLOPEN #define HAVE_DLOPEN
#endif #endif
#endif
#ifdef HAVE_DLOPEN #ifdef HAVE_DLOPEN
#if defined(HAVE_DLFCN_H) #if defined(HAVE_DLFCN_H)
#include <dlfcn.h> #include <dlfcn.h>
#endif #endif
#endif #endif
/* FreeBSD 2.2.2 does not define RTLD_NOW) */
#ifndef RTLD_NOW
#define RTLD_NOW 1
#endif
#ifndef HAVE_DLERROR #ifndef HAVE_DLERROR
#ifdef _WIN32
#define dlerror() "" #define dlerror() ""
#else
#define dlerror() "No support for dynamic loading (static build?)"
#endif
#endif #endif
#ifndef __NETWARE__
/* /*
* 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
#else
/*
* Define placement versions of operator new and operator delete since
* we don't have <new> when building for Netware.
*/
#ifdef __cplusplus
inline void *operator new(size_t, void *ptr) { return ptr; }
inline void *operator new[](size_t, void *ptr) { return ptr; }
inline void operator delete(void*, void*) { /* Do nothing */ }
inline void operator delete[](void*, void*) { /* Do nothing */ }
#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 11
/* 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 21
/* 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) #if !defined(max)
#define max(a, b) ((a) > (b) ? (a) : (b)) #define max(a, b) ((a) > (b) ? (a) : (b))
#define min(a, b) ((a) < (b) ? (a) : (b)) #define min(a, b) ((a) < (b) ? (a) : (b))
#endif #endif
#define x_free(A) \
do { my_free((uchar*)(A), MYF(MY_WME|MY_FAE|MY_ALLOW_ZERO_PTR)); } while
(0)
#define safeFree(X) \
do { if (X) { my_free((uchar*)(X), MYF(0)); (X) = NULL; } } while (0)
/* /*
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
#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()
skipping to change at line 1795 skipping to change at line 1486
#endif #endif
#endif #endif
/* Defines that are unique to the embedded version of MySQL */ /* Defines that are unique to the embedded version of MySQL */
#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_PSTACK /* No stacktrace */
#undef HAVE_OPENSSL #undef HAVE_OPENSSL
#undef HAVE_SMEM /* No shared memory */ #undef HAVE_SMEM /* No shared memory */
#undef HAVE_NDBCLUSTER_DB /* No NDB cluster */ #undef HAVE_NDBCLUSTER_DB /* No NDB cluster */
#define DONT_USE_RAID
#endif /* EMBEDDED_LIBRARY */ #endif /* EMBEDDED_LIBRARY */
#endif /* my_global_h */ #endif /* my_global_h */
 End of changes. 52 change blocks. 
381 lines changed or deleted 49 lines changed or added


 my_list.h   my_list.h 
skipping to change at line 40 skipping to change at line 40
extern LIST *list_add(LIST *root,LIST *element); extern LIST *list_add(LIST *root,LIST *element);
extern LIST *list_delete(LIST *root,LIST *element); extern LIST *list_delete(LIST *root,LIST *element);
extern LIST *list_cons(void *data,LIST *root); extern LIST *list_cons(void *data,LIST *root);
extern LIST *list_reverse(LIST *root); extern LIST *list_reverse(LIST *root);
extern void list_free(LIST *root,unsigned int free_data); extern void list_free(LIST *root,unsigned int free_data);
extern unsigned int list_length(LIST *); extern unsigned int list_length(LIST *);
extern int list_walk(LIST *,list_walk_action action,unsigned char * argumen t); extern int list_walk(LIST *,list_walk_action action,unsigned char * argumen t);
#define list_rest(a) ((a)->next) #define list_rest(a) ((a)->next)
#define list_push(a,b) (a)=list_cons((b),(a)) #define list_push(a,b) (a)=list_cons((b),(a))
#define list_pop(A) {LIST *old=(A); (A)=list_delete(old,old) ; my_free((uns igned char *) old,MYF(MY_FAE)); } #define list_pop(A) {LIST *old=(A); (A)=list_delete(old,old); my_free(old); }
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif #endif
#endif #endif
 End of changes. 1 change blocks. 
1 lines changed or deleted 1 lines changed or added


 my_net.h   my_net.h 
skipping to change at line 17 skipping to change at line 17
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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 US A */ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 US A */
/* /*
thread safe version of some common functions:
my_inet_ntoa
This file is also used to make handling of sockets and ioctl() This file is also used to make handling of sockets and ioctl()
portable accross systems. portable accross systems.
*/ */
#ifndef _my_net_h #ifndef _my_net_h
#define _my_net_h #define _my_net_h
#include "my_global.h" /* C_MODE_START, C_MODE_END */ #include "my_global.h" /* C_MODE_START, C_MODE_END */
skipping to change at line 49 skipping to change at line 46
#ifdef HAVE_ARPA_INET_H #ifdef HAVE_ARPA_INET_H
#include <arpa/inet.h> #include <arpa/inet.h>
#endif #endif
#ifdef HAVE_POLL #ifdef HAVE_POLL
#include <sys/poll.h> #include <sys/poll.h>
#endif #endif
#ifdef HAVE_SYS_IOCTL_H #ifdef HAVE_SYS_IOCTL_H
#include <sys/ioctl.h> #include <sys/ioctl.h>
#endif #endif
#if !defined(__WIN__) && !defined(HAVE_BROKEN_NETINET_INCLUDES) && !defined (__NETWARE__) #if !defined(__WIN__) && !defined(HAVE_BROKEN_NETINET_INCLUDES)
#include <netinet/in_systm.h> #include <netinet/in_systm.h>
#include <netinet/in.h> #include <netinet/in.h>
#include <netinet/ip.h> #include <netinet/ip.h>
#if !defined(alpha_linux_port) #if !defined(alpha_linux_port)
#include <netinet/tcp.h> #include <netinet/tcp.h>
#endif #endif
#endif #endif
#if defined(__WIN__) #if defined(__WIN__)
#define O_NONBLOCK 1 /* For emulation of fcntl() */ #define O_NONBLOCK 1 /* For emulation of fcntl() */
skipping to change at line 79 skipping to change at line 76
/* /*
On OSes which don't have the in_addr_t, we guess that using uint32 is the best On OSes which don't have the in_addr_t, we guess that using uint32 is the best
possible choice. We guess this from the fact that on HP-UX64bit & FreeBSD 64bit possible choice. We guess this from the fact that on HP-UX64bit & FreeBSD 64bit
& Solaris64bit, in_addr_t is equivalent to uint32. And on Linux32bit too. & Solaris64bit, in_addr_t is equivalent to uint32. And on Linux32bit too.
*/ */
#ifndef HAVE_IN_ADDR_T #ifndef HAVE_IN_ADDR_T
#define in_addr_t uint32 #define in_addr_t uint32
#endif #endif
/* Thread safe or portable version of some functions */
void my_inet_ntoa(struct in_addr in, char *buf);
/* /*
Handling of gethostbyname_r() Handling of gethostbyname_r()
*/ */
#if !defined(HAVE_GETHOSTBYNAME_R) #if !defined(HAVE_GETHOSTBYNAME_R)
struct hostent *my_gethostbyname_r(const char *name, struct hostent *my_gethostbyname_r(const char *name,
struct hostent *result, char *buffer, struct hostent *result, char *buffer,
int buflen, int *h_errnop); int buflen, int *h_errnop);
void my_gethostbyname_r_free(); void my_gethostbyname_r_free();
#elif defined(HAVE_PTHREAD_ATTR_CREATE) || defined(_AIX) || defined(HAVE_GE THOSTBYNAME_R_GLIBC2_STYLE) #elif defined(HAVE_PTHREAD_ATTR_CREATE) || defined(_AIX) || defined(HAVE_GE THOSTBYNAME_R_GLIBC2_STYLE)
 End of changes. 3 change blocks. 
8 lines changed or deleted 1 lines changed or added


 my_no_pthread.h   my_no_pthread.h 
skipping to change at line 48 skipping to change at line 48
*/ */
#define pthread_mutex_init(A,B) #define pthread_mutex_init(A,B)
#define pthread_mutex_lock(A) #define pthread_mutex_lock(A)
#define pthread_mutex_unlock(A) #define pthread_mutex_unlock(A)
#define pthread_mutex_destroy(A) #define pthread_mutex_destroy(A)
#define my_rwlock_init(A,B) #define my_rwlock_init(A,B)
#define rw_rdlock(A) #define rw_rdlock(A)
#define rw_wrlock(A) #define rw_wrlock(A)
#define rw_unlock(A) #define rw_unlock(A)
#define rwlock_destroy(A) #define rwlock_destroy(A)
#define safe_mutex_assert_owner(mp)
#define mysql_mutex_init(A, B, C) do {} while (0) #define mysql_mutex_init(A, B, C) do {} while (0)
#define mysql_mutex_lock(A) do {} while (0) #define mysql_mutex_lock(A) do {} while (0)
#define mysql_mutex_unlock(A) do {} while (0) #define mysql_mutex_unlock(A) do {} while (0)
#define mysql_mutex_destroy(A) do {} while (0) #define mysql_mutex_destroy(A) do {} while (0)
#define mysql_rwlock_init(A, B, C) do {} while (0) #define mysql_rwlock_init(A, B, C) do {} while (0)
#define mysql_rwlock_rdlock(A) do {} while (0) #define mysql_rwlock_rdlock(A) do {} while (0)
#define mysql_rwlock_wrlock(A) do {} while (0) #define mysql_rwlock_wrlock(A) do {} while (0)
#define mysql_rwlock_unlock(A) do {} while (0) #define mysql_rwlock_unlock(A) do {} while (0)
 End of changes. 1 change blocks. 
0 lines changed or deleted 1 lines changed or added


 my_pthread.h   my_pthread.h 
skipping to change at line 51 skipping to change at line 51
typedef struct { int dummy; } pthread_condattr_t; typedef struct { int dummy; } pthread_condattr_t;
/* Implementation of posix conditions */ /* Implementation of posix conditions */
typedef struct st_pthread_link { typedef struct st_pthread_link {
DWORD thread_id; DWORD thread_id;
struct st_pthread_link *next; struct st_pthread_link *next;
} pthread_link; } pthread_link;
typedef struct { /**
uint32 waiting; Implementation of Windows condition variables.
CRITICAL_SECTION lock_waiting; We use native conditions on Vista and later, and fallback to own
implementation on earlier OS version.
enum { */
SIGNAL= 0, typedef union
BROADCAST= 1, {
MAX_EVENTS= 2 /* Native condition (used on Vista and later) */
} EVENTS; CONDITION_VARIABLE native_cond;
HANDLE events[MAX_EVENTS];
HANDLE broadcast_block_event;
/* Own implementation (used on XP) */
struct
{
uint32 waiting;
CRITICAL_SECTION lock_waiting;
enum
{
SIGNAL= 0,
BROADCAST= 1,
MAX_EVENTS= 2
} EVENTS;
HANDLE events[MAX_EVENTS];
HANDLE broadcast_block_event;
};
} pthread_cond_t; } pthread_cond_t;
typedef int pthread_mutexattr_t; typedef int pthread_mutexattr_t;
#define pthread_self() GetCurrentThreadId() #define pthread_self() GetCurrentThreadId()
#define pthread_handler_t EXTERNC void * __cdecl #define pthread_handler_t EXTERNC void * __cdecl
typedef void * (__cdecl *pthread_handler)(void *); typedef void * (__cdecl *pthread_handler)(void *);
typedef volatile LONG my_pthread_once_t; typedef volatile LONG my_pthread_once_t;
#define MY_PTHREAD_ONCE_INIT 0 #define MY_PTHREAD_ONCE_INIT 0
#define MY_PTHREAD_ONCE_INPROGRESS 1 #define MY_PTHREAD_ONCE_INPROGRESS 1
skipping to change at line 194 skipping to change at line 205
#ifdef HAVE_THR_SETCONCURRENCY #ifdef HAVE_THR_SETCONCURRENCY
#include <thread.h> /* Probably solaris */ #include <thread.h> /* Probably solaris */
#endif #endif
#ifdef HAVE_SCHED_H #ifdef HAVE_SCHED_H
#include <sched.h> #include <sched.h>
#endif #endif
#ifdef HAVE_SYNCH_H #ifdef HAVE_SYNCH_H
#include <synch.h> #include <synch.h>
#endif #endif
#ifdef __NETWARE__
void my_pthread_exit(void *status);
#define pthread_exit(A) my_pthread_exit(A)
#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
#define MY_PTHREAD_ONCE_INIT PTHREAD_ONCE_INIT #define MY_PTHREAD_ONCE_INIT PTHREAD_ONCE_INIT
#define my_pthread_once(C,F) pthread_once(C,F) #define my_pthread_once(C,F) pthread_once(C,F)
skipping to change at line 258 skipping to change at line 264
int sigwait(sigset_t *setp, int *sigp); /* Use our implement ion */ int sigwait(sigset_t *setp, int *sigp); /* Use our implement ion */
#endif #endif
/* /*
We define my_sigset() and use that instead of the system sigset() so that We define my_sigset() and use that instead of the system sigset() so that
we can favor an implementation based on sigaction(). On some systems, suc h we can favor an implementation based on sigaction(). On some systems, suc h
as Mac OS X, sigset() results in flags such as SA_RESTART being set, and as Mac OS X, sigset() results in flags such as SA_RESTART being set, and
we want to make sure that no such flags are set. we want to make sure that no such flags are set.
*/ */
#if defined(HAVE_SIGACTION) && !defined(my_sigset) #if defined(HAVE_SIGACTION) && !defined(my_sigset)
#define my_sigset(A,B) do { struct sigaction l_s; sigset_t l_set; int l_rc; \ #define my_sigset(A,B) do { struct sigaction l_s; sigset_t l_set; \
DBUG_ASSERT((A) != 0); \ DBUG_ASSERT((A) != 0); \
sigemptyset(&l_set); \ sigemptyset(&l_set); \
l_s.sa_handler = (B); \ l_s.sa_handler = (B); \
l_s.sa_mask = l_set; \ l_s.sa_mask = l_set; \
l_s.sa_flags = 0; \ l_s.sa_flags = 0; \
l_rc= sigaction((A), &l_s, (struct sigaction *) sigaction((A), &l_s, NULL);
NULL);\ \
DBUG_ASSERT(l_rc == 0);
\
} while (0) } while (0)
#elif defined(HAVE_SIGSET) && !defined(my_sigset) #elif defined(HAVE_SIGSET) && !defined(my_sigset)
#define my_sigset(A,B) sigset((A),(B)) #define my_sigset(A,B) sigset((A),(B))
#elif !defined(my_sigset) #elif !defined(my_sigset)
#define my_sigset(A,B) signal((A),(B)) #define my_sigset(A,B) signal((A),(B))
#endif #endif
#if !defined(HAVE_PTHREAD_ATTR_SETSCOPE) || defined(HAVE_DEC_3_2_THREADS) #if !defined(HAVE_PTHREAD_ATTR_SETSCOPE) || defined(HAVE_DEC_3_2_THREADS)
#define pthread_attr_setscope(A,B) #define pthread_attr_setscope(A,B)
#undef HAVE_GETHOSTBYADDR_R /* No definition */ #undef HAVE_GETHOSTBYADDR_R /* No definition */
skipping to change at line 354 skipping to change at line 359
#define pthread_attr_init(A) pthread_attr_create(A) #define pthread_attr_init(A) pthread_attr_create(A)
#define pthread_attr_destroy(A) pthread_attr_delete(A) #define pthread_attr_destroy(A) pthread_attr_delete(A)
#define pthread_attr_setdetachstate(A,B) pthread_dummy(0) #define pthread_attr_setdetachstate(A,B) pthread_dummy(0)
#define pthread_create(A,B,C,D) pthread_create((A),*(B),(C),(D)) #define pthread_create(A,B,C,D) pthread_create((A),*(B),(C),(D))
#ifndef pthread_sigmask #ifndef pthread_sigmask
#define pthread_sigmask(A,B,C) sigprocmask((A),(B),(C)) #define pthread_sigmask(A,B,C) sigprocmask((A),(B),(C))
#endif #endif
#define pthread_kill(A,B) pthread_dummy((A) ? 0 : ESRCH) #define pthread_kill(A,B) pthread_dummy((A) ? 0 : ESRCH)
#undef pthread_detach_this_thread #undef pthread_detach_this_thread
#define pthread_detach_this_thread() { pthread_t tmp=pthread_self() ; pthre ad_detach(&tmp); } #define pthread_detach_this_thread() { pthread_t tmp=pthread_self() ; pthre ad_detach(&tmp); }
#elif !defined(__NETWARE__) /* HAVE_PTHREAD_ATTR_CREATE && !HAVE_SIGWAIT */ #else /* HAVE_PTHREAD_ATTR_CREATE && !HAVE_SIGWAIT */
#define HAVE_PTHREAD_KILL #define HAVE_PTHREAD_KILL
#endif #endif
#endif /* defined(__WIN__) */ #endif /* defined(__WIN__) */
#if defined(HPUX10) && !defined(DONT_REMAP_PTHREAD_FUNCTIONS) #if defined(HPUX10) && !defined(DONT_REMAP_PTHREAD_FUNCTIONS)
#undef pthread_cond_timedwait #undef pthread_cond_timedwait
#define pthread_cond_timedwait(a,b,c) my_pthread_cond_timedwait((a),(b),(c) ) #define pthread_cond_timedwait(a,b,c) my_pthread_cond_timedwait((a),(b),(c) )
int my_pthread_cond_timedwait(pthread_cond_t *cond, pthread_mutex_t *mutex, int my_pthread_cond_timedwait(pthread_cond_t *cond, pthread_mutex_t *mutex,
struct timespec *abstime); struct timespec *abstime);
skipping to change at line 459 skipping to change at line 464
#define cmp_timespec(TS1, TS2) \ #define cmp_timespec(TS1, TS2) \
((TS1.tv_sec > TS2.tv_sec || \ ((TS1.tv_sec > TS2.tv_sec || \
(TS1.tv_sec == TS2.tv_sec && TS1.tv_nsec > TS2.tv_nsec)) ? 1 : \ (TS1.tv_sec == TS2.tv_sec && TS1.tv_nsec > TS2.tv_nsec)) ? 1 : \
((TS1.tv_sec < TS2.tv_sec || \ ((TS1.tv_sec < TS2.tv_sec || \
(TS1.tv_sec == TS2.tv_sec && TS1.tv_nsec < TS2.tv_nsec)) ? -1 : 0)) (TS1.tv_sec == TS2.tv_sec && TS1.tv_nsec < TS2.tv_nsec)) ? -1 : 0))
#endif /* !cmp_timespec */ #endif /* !cmp_timespec */
#endif /* HAVE_TIMESPEC_TS_SEC */ #endif /* HAVE_TIMESPEC_TS_SEC */
/* safe_mutex adds checking to mutex for easier debugging */ /* safe_mutex adds checking to mutex for easier debugging */
#if defined(__NETWARE__) && !defined(SAFE_MUTEX_DETECT_DESTROY)
#define SAFE_MUTEX_DETECT_DESTROY
#endif
typedef struct st_safe_mutex_t typedef struct st_safe_mutex_t
{ {
pthread_mutex_t global,mutex; pthread_mutex_t global,mutex;
const char *file; const char *file;
uint line,count; uint line,count;
pthread_t thread; pthread_t thread;
#ifdef SAFE_MUTEX_DETECT_DESTROY #ifdef SAFE_MUTEX_DETECT_DESTROY
struct st_safe_mutex_info_t *info; /* to track destroying of mutexes */ struct st_safe_mutex_info_t *info; /* to track destroying of mutexes */
#endif #endif
} safe_mutex_t; } safe_mutex_t;
skipping to change at line 498 skipping to change at line 499
#endif /* SAFE_MUTEX_DETECT_DESTROY */ #endif /* SAFE_MUTEX_DETECT_DESTROY */
int safe_mutex_init(safe_mutex_t *mp, const pthread_mutexattr_t *attr, int safe_mutex_init(safe_mutex_t *mp, const pthread_mutexattr_t *attr,
const char *file, uint line); const char *file, uint line);
int safe_mutex_lock(safe_mutex_t *mp, my_bool try_lock, const char *file, u int line); int safe_mutex_lock(safe_mutex_t *mp, my_bool try_lock, const char *file, u int line);
int safe_mutex_unlock(safe_mutex_t *mp,const char *file, uint line); int safe_mutex_unlock(safe_mutex_t *mp,const char *file, uint line);
int safe_mutex_destroy(safe_mutex_t *mp,const char *file, uint line); int safe_mutex_destroy(safe_mutex_t *mp,const char *file, uint line);
int safe_cond_wait(pthread_cond_t *cond, safe_mutex_t *mp,const char *file, int safe_cond_wait(pthread_cond_t *cond, safe_mutex_t *mp,const char *file,
uint line); uint line);
int safe_cond_timedwait(pthread_cond_t *cond, safe_mutex_t *mp, int safe_cond_timedwait(pthread_cond_t *cond, safe_mutex_t *mp,
struct timespec *abstime, const char *file, uint lin const struct timespec *abstime,
e); const char *file, uint line);
void safe_mutex_global_init(void); void safe_mutex_global_init(void);
void safe_mutex_end(FILE *file); void safe_mutex_end(FILE *file);
/* Wrappers if safe mutex is actually used */ /* Wrappers if safe mutex is actually used */
#ifdef SAFE_MUTEX #ifdef SAFE_MUTEX
#undef pthread_mutex_init #undef pthread_mutex_init
#undef pthread_mutex_lock #undef pthread_mutex_lock
#undef pthread_mutex_unlock #undef pthread_mutex_unlock
#undef pthread_mutex_destroy #undef pthread_mutex_destroy
#undef pthread_mutex_wait #undef pthread_mutex_wait
skipping to change at line 602 skipping to change at line 604
#define rwlock_destroy(A) pthread_rwlock_destroy(A) #define rwlock_destroy(A) pthread_rwlock_destroy(A)
#elif defined(HAVE_RWLOCK_INIT) #elif defined(HAVE_RWLOCK_INIT)
#ifdef HAVE_RWLOCK_T /* For example Solaris 2.6-> */ #ifdef HAVE_RWLOCK_T /* For example Solaris 2.6-> */
#define rw_lock_t rwlock_t #define rw_lock_t rwlock_t
#endif #endif
#define my_rwlock_init(A,B) rwlock_init((A),USYNC_THREAD,0) #define my_rwlock_init(A,B) rwlock_init((A),USYNC_THREAD,0)
#else #else
/* Use our own version of read/write locks */ /* Use our own version of read/write locks */
#define NEED_MY_RW_LOCK 1 #define NEED_MY_RW_LOCK 1
#define rw_lock_t my_rw_lock_t #define rw_lock_t my_rw_lock_t
#define my_rwlock_init(A,B) my_rw_init((A), 0) #define my_rwlock_init(A,B) my_rw_init((A))
#define rw_rdlock(A) my_rw_rdlock((A)) #define rw_rdlock(A) my_rw_rdlock((A))
#define rw_wrlock(A) my_rw_wrlock((A)) #define rw_wrlock(A) my_rw_wrlock((A))
#define rw_tryrdlock(A) my_rw_tryrdlock((A)) #define rw_tryrdlock(A) my_rw_tryrdlock((A))
#define rw_trywrlock(A) my_rw_trywrlock((A)) #define rw_trywrlock(A) my_rw_trywrlock((A))
#define rw_unlock(A) my_rw_unlock((A)) #define rw_unlock(A) my_rw_unlock((A))
#define rwlock_destroy(A) my_rw_destroy((A)) #define rwlock_destroy(A) my_rw_destroy((A))
#define rw_lock_assert_write_owner(A) my_rw_lock_assert_write_owner((A))
#define rw_lock_assert_not_write_owner(A) my_rw_lock_assert_not_write_owner
((A))
#endif /* USE_MUTEX_INSTEAD_OF_RW_LOCKS */ #endif /* USE_MUTEX_INSTEAD_OF_RW_LOCKS */
/* /**
Portable read-write locks which prefer readers. Portable implementation of special type of read-write locks.
Required by some algorithms in order to provide correctness. These locks have two properties which are unusual for rwlocks:
*/ 1) They "prefer readers" in the sense that they do not allow
situations in which rwlock is rd-locked and there is a
pending rd-lock which is blocked (e.g. due to pending
request for wr-lock).
This is a stronger guarantee than one which is provided for
PTHREAD_RWLOCK_PREFER_READER_NP rwlocks in Linux.
MDL subsystem deadlock detector relies on this property for
its correctness.
2) They are optimized for uncontended wr-lock/unlock case.
This is scenario in which they are most oftenly used
within MDL subsystem. Optimizing for it gives significant
performance improvements in some of tests involving many
connections.
Another important requirement imposed on this type of rwlock
by the MDL subsystem is that it should be OK to destroy rwlock
object which is in unlocked state even though some threads might
have not yet fully left unlock operation for it (of course there
is an external guarantee that no thread will try to lock rwlock
which is destroyed).
Putting it another way the unlock operation should not access
rwlock data after changing its state to unlocked.
#if defined(HAVE_PTHREAD_RWLOCK_RDLOCK) && defined(HAVE_PTHREAD_RWLOCKATTR_ TODO/FIXME: We should consider alleviating this requirement as
SETKIND_NP) it blocks us from doing certain performance optimizations.
/*
On systems which have a way to specify that readers should
be preferred through attribute mechanism (e.g. Linux) we use
system implementation of read/write locks.
*/ */
#define rw_pr_lock_t pthread_rwlock_t
typedef struct st_rw_pr_lock_t {
/**
Lock which protects the structure.
Also held for the duration of wr-lock.
*/
pthread_mutex_t lock;
/**
Condition variable which is used to wake-up
writers waiting for readers to go away.
*/
pthread_cond_t no_active_readers;
/** Number of active readers. */
uint active_readers;
/** Number of writers waiting for readers to go away. */
uint writers_waiting_readers;
/** Indicates whether there is an active writer. */
my_bool active_writer;
#ifdef SAFE_MUTEX
/** Thread holding wr-lock (for debug purposes only). */
pthread_t writer_thread;
#endif
} rw_pr_lock_t;
extern int rw_pr_init(rw_pr_lock_t *); extern int rw_pr_init(rw_pr_lock_t *);
#define rw_pr_rdlock(A) pthread_rwlock_rdlock(A) extern int rw_pr_rdlock(rw_pr_lock_t *);
#define rw_pr_wrlock(A) pthread_rwlock_wrlock(A) extern int rw_pr_wrlock(rw_pr_lock_t *);
#define rw_pr_tryrdlock(A) pthread_rwlock_tryrdlock(A) extern int rw_pr_unlock(rw_pr_lock_t *);
#define rw_pr_trywrlock(A) pthread_rwlock_trywrlock(A) extern int rw_pr_destroy(rw_pr_lock_t *);
#define rw_pr_unlock(A) pthread_rwlock_unlock(A) #ifdef SAFE_MUTEX
#define rw_pr_destroy(A) pthread_rwlock_destroy(A) #define rw_pr_lock_assert_write_owner(A) \
DBUG_ASSERT((A)->active_writer && pthread_equal(pthread_self(), \
(A)->writer_thread))
#define rw_pr_lock_assert_not_write_owner(A) \
DBUG_ASSERT(! (A)->active_writer || ! pthread_equal(pthread_self(), \
(A)->writer_thread))
#else #else
/* Otherwise we have to use our own implementation of read/write locks. */ #define rw_pr_lock_assert_write_owner(A)
#define NEED_MY_RW_LOCK 1 #define rw_pr_lock_assert_not_write_owner(A)
struct st_my_rw_lock_t; #endif /* SAFE_MUTEX */
#define rw_pr_lock_t my_rw_lock_t
extern int rw_pr_init(struct st_my_rw_lock_t *);
#define rw_pr_rdlock(A) my_rw_rdlock((A))
#define rw_pr_wrlock(A) my_rw_wrlock((A))
#define rw_pr_tryrdlock(A) my_rw_tryrdlock((A))
#define rw_pr_trywrlock(A) my_rw_trywrlock((A))
#define rw_pr_unlock(A) my_rw_unlock((A))
#define rw_pr_destroy(A) my_rw_destroy((A))
#endif /* defined(HAVE_PTHREAD_RWLOCK_RDLOCK) && defined(HAVE_PTHREAD_RWLOC
KATTR_SETKIND_NP) */
#ifdef NEED_MY_RW_LOCK #ifdef NEED_MY_RW_LOCK
#ifdef _WIN32
/**
Implementation of Windows rwlock.
We use native (slim) rwlocks on Win7 and later, and fallback to portable
implementation on earlier Windows.
slim rwlock are also available on Vista/WS2008, but we do not use it
("trylock" APIs are missing on Vista)
*/
typedef union
{
/* Native rwlock (is_srwlock == TRUE) */
struct
{
SRWLOCK srwlock; /* native reader writer lock */
BOOL have_exclusive_srwlock; /* used for unlock */
};
/*
Portable implementation (is_srwlock == FALSE)
Fields are identical with Unix my_rw_lock_t fields.
*/
struct
{
pthread_mutex_t lock; /* lock for structure */
pthread_cond_t readers; /* waiting readers */
pthread_cond_t writers; /* waiting writers */
int state; /* -1:writer,0:free,>0:readers */
int waiters; /* number of waiting writers */
#ifdef SAFE_MUTEX
pthread_t write_thread;
#endif
};
} my_rw_lock_t;
#else /* _WIN32 */
/* /*
On systems which don't support native read/write locks, or don't support On systems which don't support native read/write locks we have
read/write locks which prefer readers we have to use own implementation. to use own implementation.
*/ */
typedef struct st_my_rw_lock_t { typedef struct st_my_rw_lock_t {
pthread_mutex_t lock; /* lock for structure */ pthread_mutex_t lock; /* lock for structure */
pthread_cond_t readers; /* waiting readers */ pthread_cond_t readers; /* waiting readers */
pthread_cond_t writers; /* waiting writers */ pthread_cond_t writers; /* waiting writers */
int state; /* -1:writer,0:free,>0:readers */ int state; /* -1:writer,0:free,>0:readers */
int waiters; /* number of waiting writers */ int waiters; /* number of waiting writers */
my_bool prefer_readers; #ifdef SAFE_MUTEX
pthread_t write_thread;
#endif
} my_rw_lock_t; } my_rw_lock_t;
extern int my_rw_init(my_rw_lock_t *, my_bool *); #endif /*! _WIN32 */
extern int my_rw_init(my_rw_lock_t *);
extern int my_rw_destroy(my_rw_lock_t *); extern int my_rw_destroy(my_rw_lock_t *);
extern int my_rw_rdlock(my_rw_lock_t *); extern int my_rw_rdlock(my_rw_lock_t *);
extern int my_rw_wrlock(my_rw_lock_t *); extern int my_rw_wrlock(my_rw_lock_t *);
extern int my_rw_unlock(my_rw_lock_t *); extern int my_rw_unlock(my_rw_lock_t *);
extern int my_rw_tryrdlock(my_rw_lock_t *); extern int my_rw_tryrdlock(my_rw_lock_t *);
extern int my_rw_trywrlock(my_rw_lock_t *); extern int my_rw_trywrlock(my_rw_lock_t *);
#ifdef SAFE_MUTEX
#define my_rw_lock_assert_write_owner(A) \
DBUG_ASSERT((A)->state == -1 && pthread_equal(pthread_self(), \
(A)->write_thread))
#define my_rw_lock_assert_not_write_owner(A) \
DBUG_ASSERT((A)->state >= 0 || ! pthread_equal(pthread_self(), \
(A)->write_thread))
#else
#define my_rw_lock_assert_write_owner(A)
#define my_rw_lock_assert_not_write_owner(A)
#endif
#endif /* NEED_MY_RW_LOCK */ #endif /* NEED_MY_RW_LOCK */
#define GETHOSTBYADDR_BUFF_SIZE 2048 #define GETHOSTBYADDR_BUFF_SIZE 2048
#ifndef HAVE_THR_SETCONCURRENCY #ifndef HAVE_THR_SETCONCURRENCY
#define thr_setconcurrency(A) pthread_dummy(0) #define thr_setconcurrency(A) pthread_dummy(0)
#endif #endif
#if !defined(HAVE_PTHREAD_ATTR_SETSTACKSIZE) && ! defined(pthread_attr_sets tacksize) #if !defined(HAVE_PTHREAD_ATTR_SETSTACKSIZE) && ! defined(pthread_attr_sets tacksize)
#define pthread_attr_setstacksize(A,B) pthread_dummy(0) #define pthread_attr_setstacksize(A,B) pthread_dummy(0)
#endif #endif
 End of changes. 21 change blocks. 
64 lines changed or deleted 157 lines changed or added


 my_sys.h   my_sys.h 
skipping to change at line 45 skipping to change at line 45
# 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 #ifndef THREAD
extern int NEAR my_errno; /* Last error in mysys */ extern int my_errno; /* Last error in mysys */
#else #else
#include <my_pthread.h> #include <my_pthread.h>
#endif #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
skipping to change at line 81 skipping to change at line 81
/* 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 */
#define MY_IGNORE_BADFD 32 /* my_sync: ignore 'bad descriptor' errors */ #define MY_IGNORE_BADFD 32 /* my_sync: ignore 'bad descriptor' errors */
#define MY_SYNC_DIR 8192 /* my_create/delete/rename: sync directory */ #define MY_SYNC_DIR 8192 /* my_create/delete/rename: sync directory */
#define MY_RAID 64 /* Support for RAID */ #define MY_UNUSED 64 /* Unused (was support for RAID) */
#define MY_FULL_IO 512 /* For my_read - loop intil I/O is complete */ #define MY_FULL_IO 512 /* For my_read - loop intil I/O is complete */
#define MY_DONT_CHECK_FILESIZE 128 /* Option to init_io_cache() */ #define MY_DONT_CHECK_FILESIZE 128 /* Option to init_io_cache() */
#define MY_LINK_WARNING 32 /* my_redel() gives warning if links */ #define MY_LINK_WARNING 32 /* my_redel() gives warning if links */
#define MY_COPYTIME 64 /* my_redel() copys time */ #define MY_COPYTIME 64 /* my_redel() copys time */
#define MY_DELETE_OLD 256 /* my_create_with_symlink() */ #define MY_DELETE_OLD 256 /* my_create_with_symlink() */
#define MY_RESOLVE_LINK 128 /* my_realpath(); Only resolve links */ #define MY_RESOLVE_LINK 128 /* my_realpath(); Only resolve links */
#define MY_HOLD_ORIGINAL_MODES 128 /* my_copy() holds to file modes */ #define MY_HOLD_ORIGINAL_MODES 128 /* my_copy() holds to file modes */
#define MY_REDEL_MAKE_BACKUP 256 #define MY_REDEL_MAKE_BACKUP 256
#define MY_SEEK_NOT_DONE 32 /* my_lock may have to do a seek */ #define MY_SEEK_NOT_DONE 32 /* my_lock may have to do a seek */
#define MY_DONT_WAIT 64 /* my_lock() don't wait if can't lock */ #define MY_DONT_WAIT 64 /* my_lock() don't wait if can't lock */
skipping to change at line 104 skipping to change at line 104
#define MY_FREE_ON_ERROR 128 /* my_realloc() ; Free old ptr on error */ #define MY_FREE_ON_ERROR 128 /* my_realloc() ; Free old ptr on error */
#define MY_HOLD_ON_ERROR 256 /* my_realloc() ; Return old ptr on error */ #define MY_HOLD_ON_ERROR 256 /* my_realloc() ; Return old ptr on error */
#define MY_DONT_OVERWRITE_FILE 1024 /* my_copy: Don't overwrite file */ #define MY_DONT_OVERWRITE_FILE 1024 /* my_copy: Don't overwrite file */
#define MY_THREADSAFE 2048 /* my_seek(): lock fd mutex */ #define MY_THREADSAFE 2048 /* my_seek(): lock fd mutex */
#define MY_SYNC 4096 /* my_copy(): sync dst file */ #define MY_SYNC 4096 /* my_copy(): sync dst file */
#define MY_CHECK_ERROR 1 /* Params to my_end; Check open-close */ #define MY_CHECK_ERROR 1 /* Params to my_end; Check open-close */
#define MY_GIVE_INFO 2 /* Give time info about process*/ #define MY_GIVE_INFO 2 /* Give time info about process*/
#define MY_DONT_FREE_DBUG 4 /* Do not call DBUG_END() in my_end() */ #define MY_DONT_FREE_DBUG 4 /* Do not call DBUG_END() in my_end() */
#define MY_REMOVE_NONE 0 /* Params for modify_defaults_file */
#define MY_REMOVE_OPTION 1
#define MY_REMOVE_SECTION 2
#define ME_HIGHBYTE 8 /* Shift for colours */ #define ME_HIGHBYTE 8 /* Shift for colours */
#define ME_NOCUR 1 /* Don't use curses message */ #define ME_NOCUR 1 /* Don't use curses message */
#define ME_OLDWIN 2 /* Use old window */ #define ME_OLDWIN 2 /* Use old window */
#define ME_BELL 4 /* Ring bell then printing message * / #define ME_BELL 4 /* Ring bell then printing message * /
#define ME_HOLDTANG 8 /* Don't delete last keys */ #define ME_HOLDTANG 8 /* Don't delete last keys */
#define ME_WAITTOT 16 /* Wait for errtime secs of for a action */ #define ME_WAITTOT 16 /* Wait for errtime secs of for a action */
#define ME_WAITTANG 32 /* Wait for a user action */ #define ME_WAITTANG 32 /* Wait for a user action */
#define ME_NOREFRESH 64 /* Dont refresh screen */ #define ME_NOREFRESH 64 /* Dont refresh screen */
#define ME_NOINPUT 128 /* Dont use the input libary */ #define ME_NOINPUT 128 /* Dont use the input libary */
#define ME_COLOUR1 ((1 << ME_HIGHBYTE)) /* Possibly error-colours */ #define ME_COLOUR1 ((1 << ME_HIGHBYTE)) /* Possibly error-colours */
skipping to change at line 160 skipping to change at line 156
#define MY_ERRNO_ERANGE 34 #define MY_ERRNO_ERANGE 34
/* Bits for get_date timeflag */ /* Bits for get_date timeflag */
#define GETDATE_DATE_TIME 1 #define GETDATE_DATE_TIME 1
#define GETDATE_SHORT_DATE 2 #define GETDATE_SHORT_DATE 2
#define GETDATE_HHMMSSTIME 4 #define GETDATE_HHMMSSTIME 4
#define GETDATE_GMT 8 #define GETDATE_GMT 8
#define GETDATE_FIXEDLENGTH 16 #define GETDATE_FIXEDLENGTH 16
/* defines when allocating data */ /* defines when allocating data */
#ifdef SAFEMALLOC
#define my_malloc(SZ,FLAG) _mymalloc((SZ), __FILE__, __LINE__, FLAG )
#define my_malloc_ci(SZ,FLAG) _mymalloc((SZ), sFile, uLine, FLAG )
#define my_realloc(PTR,SZ,FLAG) _myrealloc((PTR), (SZ), __FILE__, __LINE__,
FLAG )
#define my_checkmalloc() _sanity( __FILE__, __LINE__ )
#define my_free(PTR,FLAG) _myfree((PTR), __FILE__, __LINE__,FLAG)
#define my_memdup(A,B,C) _my_memdup((A),(B), __FILE__,__LINE__,C)
#define my_strdup(A,C) _my_strdup((A), __FILE__,__LINE__,C)
#define my_strndup(A,B,C) _my_strndup((A),(B),__FILE__,__LINE__,C)
#define TRASH(A,B) do { bfill(A, B, 0x8F); MEM_UNDEFINED(A, B); } while (0)
#define QUICK_SAFEMALLOC sf_malloc_quick=1
#define NORMAL_SAFEMALLOC sf_malloc_quick=0
extern uint sf_malloc_prehunc,sf_malloc_endhunc,sf_malloc_quick;
extern ulonglong sf_malloc_mem_limit;
#define CALLER_INFO_PROTO , const char *sFile, uint uLine
#define CALLER_INFO , __FILE__, __LINE__
#define ORIG_CALLER_INFO , sFile, uLine
#else
#define my_checkmalloc()
#undef TERMINATE
#define TERMINATE(A,B) {}
#define QUICK_SAFEMALLOC
#define NORMAL_SAFEMALLOC
extern void *my_malloc(size_t Size,myf MyFlags); extern void *my_malloc(size_t Size,myf MyFlags);
#define my_malloc_ci(SZ,FLAG) my_malloc( SZ, FLAG ) 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_no_flags_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);
/* we do use FG (as a no-op) in below so that a typo on FG is caught */
#define my_free(PTR,FG) ((void)FG,my_no_flags_free(PTR))
#define CALLER_INFO_PROTO /* nothing */
#define CALLER_INFO /* nothing */
#define ORIG_CALLER_INFO /* nothing */
#define TRASH(A,B) do{MEM_CHECK_ADDRESSABLE(A,B);MEM_UNDEFINED(A,B);} while (0) #define TRASH(A,B) do{MEM_CHECK_ADDRESSABLE(A,B);MEM_UNDEFINED(A,B);} 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)
#else #else
#define DEBUG_SYNC_C(_sync_point_name_) #define DEBUG_SYNC_C(_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, myf my_flags); 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,B) my_free_lock((A),(B)) #define my_large_free(A) my_free_lock((A))
#endif /* HAVE_LARGE_PAGES */ #endif /* HAVE_LARGE_PAGES */
#ifdef HAVE_ALLOCA #ifdef HAVE_ALLOCA
#if defined(_AIX) && !defined(__GNUC__) && !defined(_AIX43) #if defined(_AIX) && !defined(__GNUC__) && !defined(_AIX43)
#pragma alloca #pragma alloca
#endif /* _AIX */ #endif /* _AIX */
#if defined(__MWERKS__) #if defined(__MWERKS__)
#undef alloca #undef alloca
#define alloca _alloca #define alloca _alloca
#endif /* __MWERKS__ */ #endif /* __MWERKS__ */
#if defined(__GNUC__) && !defined(HAVE_ALLOCA_H) && ! defined(alloca) #if defined(__GNUC__) && !defined(HAVE_ALLOCA_H) && ! defined(alloca)
#define alloca __builtin_alloca #define alloca __builtin_alloca
#endif /* GNUC */ #endif /* GNUC */
#define my_alloca(SZ) alloca((size_t) (SZ)) #define my_alloca(SZ) alloca((size_t) (SZ))
#define my_afree(PTR) {} #define my_afree(PTR) {}
#else #else
#define my_alloca(SZ) my_malloc(SZ,MYF(0)) #define my_alloca(SZ) my_malloc(SZ,MYF(MY_FAE))
#define my_afree(PTR) my_free(PTR,MYF(MY_WME)) #define my_afree(PTR) my_free(PTR)
#endif /* HAVE_ALLOCA */ #endif /* HAVE_ALLOCA */
#ifndef errno /* did we already get it? */ #ifndef errno /* did we already get it? */
#ifdef HAVE_ERRNO_AS_DEFINE #ifdef HAVE_ERRNO_AS_DEFINE
#include <errno.h> /* errno is a define */ #include <errno.h> /* errno is a define */
#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 NEAR 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 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 const char *(*proc_info_hook)(void *, const char *, const char *,
const char *, const unsigned int); const char *, const unsigned int);
#ifdef HAVE_LARGE_PAGES #ifdef HAVE_LARGE_PAGES
skipping to change at line 280 skipping to change at line 245
extern ulong my_file_total_opened; extern ulong my_file_total_opened;
extern uint mysys_usage_id; 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 NEAR my_umask; /* Default creation extern MYSQL_PLUGIN_IMPORT int my_umask; /* Default creation
mask */ mask */
extern int NEAR my_umask_dir, extern int my_umask_dir,
NEAR my_recived_signals, /* Signals we have got */ my_recived_signals, /* Signals we have got */
NEAR my_safe_to_handle_signal, /* Set when allowed to SIGTSTP */ my_safe_to_handle_signal, /* Set when allowed to SIGTSTP */
NEAR my_dont_interrupt; /* call remember_intr when set */ my_dont_interrupt; /* call remember_intr when set */
extern my_bool NEAR my_use_symdir; extern my_bool my_use_symdir;
extern size_t sf_malloc_cur_memory, sf_malloc_max_memory;
extern ulong my_default_record_cache_size; extern ulong my_default_record_cache_size;
extern my_bool NEAR my_disable_locking,NEAR my_disable_async_io, extern my_bool my_disable_locking, my_disable_async_io,
NEAR my_disable_flush_key_blocks, NEAR 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 */ /* from default.c */
extern char *my_defaults_extra_file; extern const char *my_defaults_extra_file;
extern const char *my_defaults_group_suffix; extern const char *my_defaults_group_suffix;
extern const char *my_defaults_file; extern const char *my_defaults_file;
extern my_bool timed_mutexes; extern my_bool timed_mutexes;
typedef struct wild_file_pack /* Struct to hold info when selecting files
*/
{
uint wilds; /* How many wildcards */
uint not_pos; /* Start of not-theese-files */
char * *wild; /* Pointer to wildcards */
} WF_PACK;
enum loglevel { enum loglevel {
ERROR_LEVEL, ERROR_LEVEL,
WARNING_LEVEL, WARNING_LEVEL,
INFORMATION_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 */,
skipping to change at line 601 skipping to change at line 558
/* Define the type of function to be passed to process_default_option_files */ /* Define the type of function to be passed to process_default_option_files */
typedef int (*Process_option_func)(void *ctx, const char *group_name, typedef int (*Process_option_func)(void *ctx, const char *group_name,
const char *option); 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_append(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);
extern void my_once_free(void); extern void my_once_free(void);
extern char *my_once_strdup(const char *src,myf myflags); extern char *my_once_strdup(const char *src,myf myflags);
extern void *my_once_memdup(const void *src, size_t len, myf myflags); extern void *my_once_memdup(const void *src, size_t len, myf myflags);
extern File my_open(const char *FileName,int Flags,myf MyFlags); extern File my_open(const char *FileName,int Flags,myf MyFlags);
extern File my_register_filename(File fd, const char *FileName, extern File my_register_filename(File fd, const char *FileName,
enum file_type type_of_file, enum file_type type_of_file,
uint error_message_number, myf MyFlags); uint error_message_number, myf MyFlags);
extern File my_create(const char *FileName,int CreateFlags, extern File my_create(const char *FileName,int CreateFlags,
int AccessFlags, myf MyFlags); int AccessFlags, myf MyFlags);
extern int my_close(File Filedes,myf MyFlags); extern int my_close(File Filedes,myf MyFlags);
extern File my_dup(File file, myf MyFlags);
extern int my_mkdir(const char *dir, int Flags, myf MyFlags); extern int my_mkdir(const char *dir, int Flags, myf MyFlags);
extern int my_readlink(char *to, const char *filename, myf MyFlags); extern int my_readlink(char *to, const char *filename, myf MyFlags);
extern int my_is_symlink(const char *filename); extern int my_is_symlink(const char *filename);
extern int my_realpath(char *to, const char *filename, myf MyFlags); extern int my_realpath(char *to, const char *filename, myf MyFlags);
extern File my_create_with_symlink(const char *linkname, const char *filena me, extern File my_create_with_symlink(const char *linkname, const char *filena me,
int createflags, int access_flags, int createflags, int access_flags,
myf MyFlags); myf MyFlags);
extern int my_delete_with_symlink(const char *name, myf MyFlags); extern int my_delete_with_symlink(const char *name, myf MyFlags);
extern int my_rename_with_symlink(const char *from,const char *to,myf MyFla gs); extern int my_rename_with_symlink(const char *from,const char *to,myf MyFla gs);
extern int my_symlink(const char *content, const char *linkname, myf MyFlag s); extern int my_symlink(const char *content, const char *linkname, myf MyFlag s);
skipping to change at line 643 skipping to change at line 598
extern my_off_t my_tell(File fd,myf MyFlags); extern my_off_t my_tell(File fd,myf MyFlags);
extern size_t my_write(File Filedes,const uchar *Buffer,size_t Count, extern size_t my_write(File Filedes,const uchar *Buffer,size_t Count,
myf MyFlags); myf MyFlags);
extern size_t my_pwrite(File Filedes,const uchar *Buffer,size_t Count, extern size_t my_pwrite(File Filedes,const uchar *Buffer,size_t Count,
my_off_t offset,myf MyFlags); my_off_t offset,myf MyFlags);
extern size_t my_fread(FILE *stream,uchar *Buffer,size_t Count,myf MyFlags) ; extern size_t my_fread(FILE *stream,uchar *Buffer,size_t Count,myf MyFlags) ;
extern size_t my_fwrite(FILE *stream,const uchar *Buffer,size_t Count, extern size_t my_fwrite(FILE *stream,const uchar *Buffer,size_t Count,
myf MyFlags); myf MyFlags);
extern my_off_t my_fseek(FILE *stream,my_off_t pos,int whence,myf MyFlags); extern my_off_t my_fseek(FILE *stream,my_off_t pos,int whence,myf MyFlags);
extern my_off_t my_ftell(FILE *stream,myf MyFlags); extern my_off_t my_ftell(FILE *stream,myf MyFlags);
extern void *_mymalloc(size_t uSize,const char *sFile,
uint uLine, myf MyFlag);
extern void *_myrealloc(void *pPtr,size_t uSize,const char *sFile,
uint uLine, myf MyFlag);
extern void * my_multi_malloc _VARARGS((myf MyFlags, ...));
extern void _myfree(void *pPtr,const char *sFile,uint uLine, myf MyFlag);
extern int _sanity(const char *sFile, uint uLine);
extern void *_my_memdup(const void *from, size_t length,
const char *sFile, uint uLine,myf MyFlag);
extern char * _my_strdup(const char *from, const char *sFile, uint uLine,
myf MyFlag);
extern char *_my_strndup(const char *from, size_t length,
const char *sFile, uint uLine,
myf MyFlag);
/* implemented in my_memmem.c */ /* implemented in my_memmem.c */
extern void *my_memmem(const void *haystack, size_t haystacklen, extern void *my_memmem(const void *haystack, size_t haystacklen,
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
skipping to change at line 684 skipping to change at line 625
#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)*/
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
#ifndef TERMINATE
extern void TERMINATE(FILE *file, uint flag);
#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 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 _VARARGS((int nr,myf MyFlags, ...)); extern void my_error(int nr,myf MyFlags, ...);
extern void my_printf_error _VARARGS((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 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);
skipping to change at line 762 skipping to change at line 700
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);
extern int wild_compare(const char *str,const char *wildstr, extern int wild_compare(const char *str,const char *wildstr,
pbool str_is_pattern); pbool str_is_pattern);
extern WF_PACK *wf_comp(char * str);
extern int wf_test(struct wild_file_pack *wf_pack,const char *name);
extern void wf_end(struct wild_file_pack *buffer);
extern my_bool array_append_string_unique(const char *str, extern my_bool array_append_string_unique(const char *str,
const char **array, size_t size); const char **array, size_t size);
extern void get_date(char * to,int timeflag,time_t use_time); extern void get_date(char * to,int timeflag,time_t use_time);
extern void soundex(CHARSET_INFO *, char * out_pntr, char * in_pntr, extern void soundex(CHARSET_INFO *, char * out_pntr, char * in_pntr,
pbool remove_garbage); pbool remove_garbage);
extern int init_record_cache(RECORD_CACHE *info,size_t cachesize,File file, extern int init_record_cache(RECORD_CACHE *info,size_t cachesize,File file,
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 long my_clock(void);
extern sig_handler sigtstp_handler(int signal_number);
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 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, void *cmp_argument);
skipping to change at line 835 skipping to change at line 768
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, ...);
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 CAL #define my_init_dynamic_array(A,B,C,D) init_dynamic_array2(A,B,NULL,C,D)
LER_INFO) #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)
ORIG_CALLER_INFO) #define my_init_dynamic_array2_ci(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 CAL extern my_bool init_dynamic_array2(DYNAMIC_ARRAY *array, uint element_size,
LER_INFO)
#define my_init_dynamic_array2_ci(A,B,C,D,E) init_dynamic_array2(A,B,C,D,E
ORIG_CALLER_INFO)
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);
CALLER_INFO_PROTO);
/* 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);
CALLER_INFO_PROTO);
extern my_bool insert_dynamic(DYNAMIC_ARRAY *array,uchar * element); extern my_bool insert_dynamic(DYNAMIC_ARRAY *array,uchar * element);
extern uchar *alloc_dynamic(DYNAMIC_ARRAY *array); extern uchar *alloc_dynamic(DYNAMIC_ARRAY *array);
extern uchar *pop_dynamic(DYNAMIC_ARRAY*); extern uchar *pop_dynamic(DYNAMIC_ARRAY*);
extern my_bool set_dynamic(DYNAMIC_ARRAY *array,uchar * element,uint array_ index); extern my_bool set_dynamic(DYNAMIC_ARRAY *array,uchar * element,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 ex); extern void get_dynamic(DYNAMIC_ARRAY *array,uchar * element,uint array_ind ex);
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); extern int get_index_dynamic(DYNAMIC_ARRAY *array, uchar * element);
skipping to change at line 876 skipping to change at line 807
my_bool dynstr_append_mem(DYNAMIC_STRING *str, const char *append, my_bool dynstr_append_mem(DYNAMIC_STRING *str, const char *append,
size_t length); size_t length);
extern my_bool dynstr_append_os_quoted(DYNAMIC_STRING *str, const char *app end, extern my_bool dynstr_append_os_quoted(DYNAMIC_STRING *str, const char *app end,
...); ...);
extern my_bool dynstr_set(DYNAMIC_STRING *str, const char *init_str); extern my_bool dynstr_set(DYNAMIC_STRING *str, const char *init_str);
extern my_bool dynstr_realloc(DYNAMIC_STRING *str, size_t additional_size); extern my_bool dynstr_realloc(DYNAMIC_STRING *str, size_t additional_size);
extern my_bool dynstr_trunc(DYNAMIC_STRING *str, size_t n); extern my_bool dynstr_trunc(DYNAMIC_STRING *str, size_t n);
extern void dynstr_free(DYNAMIC_STRING *str); extern void dynstr_free(DYNAMIC_STRING *str);
#ifdef HAVE_MLOCK #ifdef HAVE_MLOCK
extern void *my_malloc_lock(size_t length,myf flags); extern void *my_malloc_lock(size_t length,myf flags);
extern void my_free_lock(void *ptr,myf flags); extern void my_free_lock(void *ptr);
#else #else
#define my_malloc_lock(A,B) my_malloc((A),(B)) #define my_malloc_lock(A,B) my_malloc((A),(B))
#define my_free_lock(A,B) my_free((A),(B)) #define my_free_lock(A) my_free((A))
#endif #endif
#define alloc_root_inited(A) ((A)->min_malloc != 0) #define alloc_root_inited(A) ((A)->min_malloc != 0)
#define ALLOC_ROOT_MIN_BLOCK_SIZE (MALLOC_OVERHEAD + sizeof(USED_MEM) + 8) #define ALLOC_ROOT_MIN_BLOCK_SIZE (MALLOC_OVERHEAD + sizeof(USED_MEM) + 8)
#define clear_alloc_root(A) do { (A)->free= (A)->used= (A)->pre_alloc= 0; ( A)->min_malloc=0;} while(0) #define clear_alloc_root(A) do { (A)->free= (A)->used= (A)->pre_alloc= 0; ( A)->min_malloc=0;} while(0)
extern void init_alloc_root(MEM_ROOT *mem_root, size_t block_size, extern void init_alloc_root(MEM_ROOT *mem_root, size_t block_size,
size_t pre_alloc_size); size_t pre_alloc_size);
extern void *alloc_root(MEM_ROOT *mem_root, size_t Size); extern void *alloc_root(MEM_ROOT *mem_root, size_t Size);
extern void *multi_alloc_root(MEM_ROOT *mem_root, ...); extern void *multi_alloc_root(MEM_ROOT *mem_root, ...);
extern void free_root(MEM_ROOT *root, myf MyFLAGS); extern void free_root(MEM_ROOT *root, myf MyFLAGS);
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)
{
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, extern int get_defaults_options(int argc, char **argv,
char **defaults, char **extra_defaults, char **defaults, char **extra_defaults,
char **group_suffix); char **group_suffix);
extern const char *args_separator; extern const char *args_separator;
extern int my_load_defaults(const char *conf_file, const char **groups, extern int my_load_defaults(const char *conf_file, const char **groups,
int *argc, char ***argv, const char ***); int *argc, char ***argv, const char ***);
extern int load_defaults(const char *conf_file, const char **groups, extern int load_defaults(const char *conf_file, const char **groups,
int *argc, char ***argv); int *argc, char ***argv);
extern int modify_defaults_file(const char *file_location, const char *opti
on,
const char *option_value,
const char *section_name, int remove_option
);
extern int my_search_option_files(const char *conf_file, int *argc, extern int my_search_option_files(const char *conf_file, int *argc,
char ***argv, uint *args_used, char ***argv, uint *args_used,
Process_option_func func, void *func_ctx, Process_option_func func, void *func_ctx,
const char **default_directories); const char **default_directories);
extern void free_defaults(char **argv); extern void free_defaults(char **argv);
extern void my_print_default_files(const char *conf_file); extern void my_print_default_files(const char *conf_file);
extern void print_defaults(const char *conf_file, const char **groups); 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,
skipping to change at line 963 skipping to change at line 895
/* not a complete set of mmap() flags, but only those that nesessary */ /* not a complete set of mmap() flags, but only those that nesessary */
#define PROT_READ 1 #define PROT_READ 1
#define PROT_WRITE 2 #define PROT_WRITE 2
#define MAP_NORESERVE 0 #define MAP_NORESERVE 0
#define MAP_SHARED 0x0001 #define MAP_SHARED 0x0001
#define MAP_PRIVATE 0x0002 #define MAP_PRIVATE 0x0002
#define MAP_NOSYNC 0x0800 #define MAP_NOSYNC 0x0800
#define MAP_FAILED ((void *)-1) #define MAP_FAILED ((void *)-1)
#define MS_SYNC 0x0000 #define MS_SYNC 0x0000
#ifndef __NETWARE__
#define HAVE_MMAP #define HAVE_MMAP
#endif
void *my_mmap(void *, size_t, int, int, int, my_off_t); void *my_mmap(void *, size_t, int, int, int, my_off_t);
int my_munmap(void *, size_t); int my_munmap(void *, size_t);
#endif #endif
/* 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
skipping to change at line 1031 skipping to change at line 960
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); char* my_cgets(char *string, size_t clen, size_t* plen);
#endif #endif
#ifdef __NETWARE__
void netware_reg_user(const char *ip, const char *user,
const char *application);
#endif
#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;
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;
 End of changes. 33 change blocks. 
120 lines changed or deleted 37 lines changed or added


 mysql.h   mysql.h 
skipping to change at line 20 skipping to change at line 20
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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 US A */ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 US A */
/* /*
This file defines the client API to MySQL and also the ABI of the This file defines the client API to MySQL and also the ABI of the
dynamically linked libmysqlclient. dynamically linked libmysqlclient.
The ABI should never be changed in a released product of MySQL The ABI should never be changed in a released product of MySQL,
thus you need to take great care when changing the file. In case thus you need to take great care when changing the file. In case
the file is changed so the ABI is broken, you must also the file is changed so the ABI is broken, you must also update
update the SHAREDLIB_MAJOR_VERSION in configure.in . the SHARED_LIB_MAJOR_VERSION in cmake/mysql_version.cmake
*/ */
#ifndef _mysql_h #ifndef _mysql_h
#define _mysql_h #define _mysql_h
#ifdef _AIX /* large-file support will break without this */ #ifdef _AIX /* large-file support will break without this */
#include <standards.h> #include <standards.h>
#endif #endif
#ifdef __CYGWIN__ /* CYGWIN implements a UNIX API */ #ifdef __CYGWIN__ /* CYGWIN implements a UNIX API */
skipping to change at line 47 skipping to change at line 46
#undef _WIN32 #undef _WIN32
#undef _WIN64 #undef _WIN64
#undef __WIN__ #undef __WIN__
#endif #endif
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {
#endif #endif
#ifndef _global_h /* If not standard header */ #ifndef _global_h /* If not standard header */
#ifndef MYSQL_ABI_CHECK
#include <sys/types.h> #include <sys/types.h>
#endif
#ifdef __LCC__ #ifdef __LCC__
#include <winsock2.h> /* For windows */ #include <winsock2.h> /* For windows */
#endif #endif
typedef char my_bool; typedef char my_bool;
#if (defined(_WIN32) || defined(_WIN64)) && !defined(__WIN__) #if (defined(_WIN32) || defined(_WIN64)) && !defined(__WIN__)
#define __WIN__ #define __WIN__
#endif #endif
#if !defined(__WIN__) #if !defined(__WIN__)
#define STDCALL #define STDCALL
#else #else
skipping to change at line 82 skipping to change at line 83
#include "mysql_time.h" #include "mysql_time.h"
#include "my_list.h" /* for LISTs used in 'MYSQL' and 'MYSQL_STMT' */ #include "my_list.h" /* for LISTs used in 'MYSQL' and 'MYSQL_STMT' */
extern unsigned int mysql_port; extern unsigned int mysql_port;
extern char *mysql_unix_port; extern char *mysql_unix_port;
#define CLIENT_NET_READ_TIMEOUT 365*24*3600 /* Timeout o n read */ #define CLIENT_NET_READ_TIMEOUT 365*24*3600 /* Timeout o n read */
#define CLIENT_NET_WRITE_TIMEOUT 365*24*3600 /* Timeout on write */ #define CLIENT_NET_WRITE_TIMEOUT 365*24*3600 /* Timeout on write */
#ifdef __NETWARE__
#pragma pack(push, 8) /* 8 byte alignment */
#endif
#define IS_PRI_KEY(n) ((n) & PRI_KEY_FLAG) #define IS_PRI_KEY(n) ((n) & PRI_KEY_FLAG)
#define IS_NOT_NULL(n) ((n) & NOT_NULL_FLAG) #define IS_NOT_NULL(n) ((n) & NOT_NULL_FLAG)
#define IS_BLOB(n) ((n) & BLOB_FLAG) #define IS_BLOB(n) ((n) & BLOB_FLAG)
/** /**
Returns true if the value is a number which does not need quotes for Returns true if the value is a number which does not need quotes for
the sql_lex.cc parser to parse correctly. the sql_lex.cc parser to parse correctly.
*/ */
#define IS_NUM(t) (((t) <= MYSQL_TYPE_INT24 && (t) != MYSQL_TYPE_TIMES TAMP) || (t) == MYSQL_TYPE_YEAR || (t) == MYSQL_TYPE_NEWDECIMAL) #define IS_NUM(t) (((t) <= MYSQL_TYPE_INT24 && (t) != MYSQL_TYPE_TIMES TAMP) || (t) == MYSQL_TYPE_YEAR || (t) == MYSQL_TYPE_NEWDECIMAL)
#define IS_LONGDATA(t) ((t) >= MYSQL_TYPE_TINY_BLOB && (t) <= MYSQL_TYPE_ST RING) #define IS_LONGDATA(t) ((t) >= MYSQL_TYPE_TINY_BLOB && (t) <= MYSQL_TYPE_ST RING)
skipping to change at line 171 skipping to change at line 168
enum mysql_option enum mysql_option
{ {
MYSQL_OPT_CONNECT_TIMEOUT, MYSQL_OPT_COMPRESS, MYSQL_OPT_NAMED_PIPE, MYSQL_OPT_CONNECT_TIMEOUT, MYSQL_OPT_COMPRESS, MYSQL_OPT_NAMED_PIPE,
MYSQL_INIT_COMMAND, MYSQL_READ_DEFAULT_FILE, MYSQL_READ_DEFAULT_GROUP, MYSQL_INIT_COMMAND, MYSQL_READ_DEFAULT_FILE, MYSQL_READ_DEFAULT_GROUP,
MYSQL_SET_CHARSET_DIR, MYSQL_SET_CHARSET_NAME, MYSQL_OPT_LOCAL_INFILE, MYSQL_SET_CHARSET_DIR, MYSQL_SET_CHARSET_NAME, MYSQL_OPT_LOCAL_INFILE,
MYSQL_OPT_PROTOCOL, MYSQL_SHARED_MEMORY_BASE_NAME, MYSQL_OPT_READ_TIMEOUT , MYSQL_OPT_PROTOCOL, MYSQL_SHARED_MEMORY_BASE_NAME, MYSQL_OPT_READ_TIMEOUT ,
MYSQL_OPT_WRITE_TIMEOUT, MYSQL_OPT_USE_RESULT, MYSQL_OPT_WRITE_TIMEOUT, MYSQL_OPT_USE_RESULT,
MYSQL_OPT_USE_REMOTE_CONNECTION, MYSQL_OPT_USE_EMBEDDED_CONNECTION, MYSQL_OPT_USE_REMOTE_CONNECTION, MYSQL_OPT_USE_EMBEDDED_CONNECTION,
MYSQL_OPT_GUESS_CONNECTION, MYSQL_SET_CLIENT_IP, MYSQL_SECURE_AUTH, MYSQL_OPT_GUESS_CONNECTION, MYSQL_SET_CLIENT_IP, MYSQL_SECURE_AUTH,
MYSQL_REPORT_DATA_TRUNCATION, MYSQL_OPT_RECONNECT, MYSQL_REPORT_DATA_TRUNCATION, MYSQL_OPT_RECONNECT,
MYSQL_OPT_SSL_VERIFY_SERVER_CERT MYSQL_OPT_SSL_VERIFY_SERVER_CERT, MYSQL_PLUGIN_DIR, MYSQL_DEFAULT_AUTH
}; };
/**
@todo remove the "extension", move st_mysql_options completely
out of mysql.h
*/
struct st_mysql_options_extention;
struct st_mysql_options { struct st_mysql_options {
unsigned int connect_timeout, read_timeout, write_timeout; unsigned int connect_timeout, read_timeout, write_timeout;
unsigned int port, protocol; unsigned int port, protocol;
unsigned long client_flag; unsigned long client_flag;
char *host,*user,*password,*unix_socket,*db; char *host,*user,*password,*unix_socket,*db;
struct st_dynamic_array *init_commands; struct st_dynamic_array *init_commands;
char *my_cnf_file,*my_cnf_group, *charset_dir, *charset_name; char *my_cnf_file,*my_cnf_group, *charset_dir, *charset_name;
char *ssl_key; /* PEM key file */ char *ssl_key; /* PEM key file */
char *ssl_cert; /* PEM cert file */ char *ssl_cert; /* PEM cert file */
char *ssl_ca; /* PEM CA file */ char *ssl_ca; /* PEM CA file */
skipping to change at line 207 skipping to change at line 210
my_bool secure_auth; my_bool secure_auth;
/* 0 - never report, 1 - always report (default) */ /* 0 - never report, 1 - always report (default) */
my_bool report_data_truncation; my_bool report_data_truncation;
/* function pointers for local infile support */ /* function pointers for local infile support */
int (*local_infile_init)(void **, const char *, void *); int (*local_infile_init)(void **, const char *, void *);
int (*local_infile_read)(void *, char *, unsigned int); int (*local_infile_read)(void *, char *, unsigned int);
void (*local_infile_end)(void *); void (*local_infile_end)(void *);
int (*local_infile_error)(void *, char *, unsigned int); int (*local_infile_error)(void *, char *, unsigned int);
void *local_infile_userdata; void *local_infile_userdata;
void *extension; struct st_mysql_options_extention *extension;
}; };
enum mysql_status enum mysql_status
{ {
MYSQL_STATUS_READY,MYSQL_STATUS_GET_RESULT,MYSQL_STATUS_USE_RESULT MYSQL_STATUS_READY, MYSQL_STATUS_GET_RESULT, MYSQL_STATUS_USE_RESULT,
MYSQL_STATUS_STATEMENT_GET_RESULT
}; };
enum mysql_protocol_type enum mysql_protocol_type
{ {
MYSQL_PROTOCOL_DEFAULT, MYSQL_PROTOCOL_TCP, MYSQL_PROTOCOL_SOCKET, MYSQL_PROTOCOL_DEFAULT, MYSQL_PROTOCOL_TCP, MYSQL_PROTOCOL_SOCKET,
MYSQL_PROTOCOL_PIPE, MYSQL_PROTOCOL_MEMORY MYSQL_PROTOCOL_PIPE, MYSQL_PROTOCOL_MEMORY
}; };
typedef struct character_set typedef struct character_set
{ {
skipping to change at line 635 skipping to change at line 639
etc) etc)
*/ */
STMT_ATTR_CURSOR_TYPE, STMT_ATTR_CURSOR_TYPE,
/* /*
Amount of rows to retrieve from server per one fetch if using cursors. Amount of rows to retrieve from server per one fetch if using cursors.
Accepts unsigned long attribute in the range 1 - ulong_max Accepts unsigned long attribute in the range 1 - ulong_max
*/ */
STMT_ATTR_PREFETCH_ROWS STMT_ATTR_PREFETCH_ROWS
}; };
typedef struct st_mysql_methods
{
my_bool (*read_query_result)(MYSQL *mysql);
my_bool (*advanced_command)(MYSQL *mysql,
enum enum_server_command command,
const unsigned char *header,
unsigned long header_length,
const unsigned char *arg,
unsigned long arg_length,
my_bool skip_check,
MYSQL_STMT *stmt);
MYSQL_DATA *(*read_rows)(MYSQL *mysql,MYSQL_FIELD *mysql_fields,
unsigned int fields);
MYSQL_RES * (*use_result)(MYSQL *mysql);
void (*fetch_lengths)(unsigned long *to,
MYSQL_ROW column, unsigned int field_count);
void (*flush_use_result)(MYSQL *mysql, my_bool flush_all_results);
#if !defined(MYSQL_SERVER) || defined(EMBEDDED_LIBRARY)
MYSQL_FIELD * (*list_fields)(MYSQL *mysql);
my_bool (*read_prepare_result)(MYSQL *mysql, MYSQL_STMT *stmt);
int (*stmt_execute)(MYSQL_STMT *stmt);
int (*read_binary_rows)(MYSQL_STMT *stmt);
int (*unbuffered_fetch)(MYSQL *mysql, char **row);
void (*free_embedded_thd)(MYSQL *mysql);
const char *(*read_statistics)(MYSQL *mysql);
my_bool (*next_result)(MYSQL *mysql);
int (*read_change_user_result)(MYSQL *mysql, char *buff, const char *pass
wd);
int (*read_rows_from_cursor)(MYSQL_STMT *stmt);
#endif
} MYSQL_METHODS;
MYSQL_STMT * STDCALL mysql_stmt_init(MYSQL *mysql); MYSQL_STMT * STDCALL mysql_stmt_init(MYSQL *mysql);
int STDCALL mysql_stmt_prepare(MYSQL_STMT *stmt, const char *query, int STDCALL mysql_stmt_prepare(MYSQL_STMT *stmt, const char *query,
unsigned long length); unsigned long length);
int STDCALL mysql_stmt_execute(MYSQL_STMT *stmt); int STDCALL mysql_stmt_execute(MYSQL_STMT *stmt);
int STDCALL mysql_stmt_fetch(MYSQL_STMT *stmt); int STDCALL mysql_stmt_fetch(MYSQL_STMT *stmt);
int STDCALL mysql_stmt_fetch_column(MYSQL_STMT *stmt, MYSQL_BIND *bind_arg, int STDCALL mysql_stmt_fetch_column(MYSQL_STMT *stmt, MYSQL_BIND *bind_arg,
unsigned int column, unsigned int column,
unsigned long offset); unsigned long offset);
int STDCALL mysql_stmt_store_result(MYSQL_STMT *stmt); int STDCALL mysql_stmt_store_result(MYSQL_STMT *stmt);
unsigned long STDCALL mysql_stmt_param_count(MYSQL_STMT * stmt); unsigned long STDCALL mysql_stmt_param_count(MYSQL_STMT * stmt);
skipping to change at line 727 skipping to change at line 700
#define mysql_reload(mysql) mysql_refresh((mysql),REFRESH_GRANT) #define mysql_reload(mysql) mysql_refresh((mysql),REFRESH_GRANT)
#ifdef USE_OLD_FUNCTIONS #ifdef USE_OLD_FUNCTIONS
MYSQL * STDCALL mysql_connect(MYSQL *mysql, const char *host , MYSQL * STDCALL mysql_connect(MYSQL *mysql, const char *host ,
const char *user, const char *passwd); const char *user, const char *passwd);
int STDCALL mysql_create_db(MYSQL *mysql, const char *DB); int STDCALL mysql_create_db(MYSQL *mysql, const char *DB);
int STDCALL mysql_drop_db(MYSQL *mysql, const char *DB); int STDCALL mysql_drop_db(MYSQL *mysql, const char *DB);
#endif #endif
#define HAVE_MYSQL_REAL_CONNECT #define HAVE_MYSQL_REAL_CONNECT
/*
The following functions are mainly exported because of mysqlbinlog;
They are not for general usage
*/
#define simple_command(mysql, command, arg, length, skip_check) \
(*(mysql)->methods->advanced_command)(mysql, command, 0, \
0, arg, length, skip_check, NULL)
#define stmt_command(mysql, command, arg, length, stmt) \
(*(mysql)->methods->advanced_command)(mysql, command, 0, \
0, arg, length, 1, stmt)
#ifdef __NETWARE__
#pragma pack(pop) /* restore alignment */
#endif
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif #endif
#endif /* _mysql_h */ #endif /* _mysql_h */
 End of changes. 11 change blocks. 
59 lines changed or deleted 15 lines changed or added


 mysql_com.h   mysql_com.h 
skipping to change at line 162 skipping to change at line 162
#define CLIENT_INTERACTIVE 1024 /* This is an interactive client */ #define CLIENT_INTERACTIVE 1024 /* This is an interactive client */
#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_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
#define CAN_CLIENT_COMPRESS CLIENT_COMPRESS
#else
#define CAN_CLIENT_COMPRESS 0
#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 | \
skipping to change at line 186 skipping to change at line 194
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)
/* /*
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 246 skipping to change at line 255
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|\
SERVER_STATUS_METADATA_CHANGED) SERVER_STATUS_METADATA_CHANGED |\
SERVER_QUERY_WAS_SLOW |\
SERVER_STATUS_DB_DROPPED |\
SERVER_STATUS_CURSOR_EXISTS|\
SERVER_STATUS_LAST_ROW_SENT)
#define MYSQL_ERRMSG_SIZE 512 #define MYSQL_ERRMSG_SIZE 512
#define NET_READ_TIMEOUT 30 /* Timeout on read */ #define NET_READ_TIMEOUT 30 /* Timeout on read */
#define NET_WRITE_TIMEOUT 60 /* Timeout on write */ #define NET_WRITE_TIMEOUT 60 /* Timeout on write */
#define NET_WAIT_TIMEOUT 8*60*60 /* Wait for new query */ #define NET_WAIT_TIMEOUT 8*60*60 /* Wait for new query */
#define ONLY_KILL_QUERY 1 #define ONLY_KILL_QUERY 1
struct st_vio; /* Only C */ struct st_vio; /* Only C */
typedef struct st_vio Vio; typedef struct st_vio Vio;
skipping to change at line 513 skipping to change at line 526
*/ */
void randominit(struct rand_struct *, unsigned long seed1, void randominit(struct rand_struct *, unsigned long seed1,
unsigned long seed2); unsigned long seed2);
double my_rnd(struct rand_struct *); double my_rnd(struct rand_struct *);
void create_random_string(char *to, unsigned int length, struct rand_struct *rand_st); void create_random_string(char *to, unsigned int length, struct rand_struct *rand_st);
void hash_password(unsigned long *to, const char *password, unsigned int pa ssword_len); void hash_password(unsigned long *to, const char *password, unsigned int pa ssword_len);
void make_scrambled_password_323(char *to, const char *password); void make_scrambled_password_323(char *to, const char *password);
void scramble_323(char *to, const char *message, const char *password); void scramble_323(char *to, const char *message, const char *password);
my_bool check_scramble_323(const char *, const char *message, my_bool check_scramble_323(const unsigned char *reply, const char *message,
unsigned long *salt); unsigned long *salt);
void get_salt_from_password_323(unsigned long *res, const char *password); void get_salt_from_password_323(unsigned long *res, const char *password);
void make_password_from_salt_323(char *to, const unsigned long *salt); void make_password_from_salt_323(char *to, const unsigned long *salt);
void make_scrambled_password(char *to, const char *password); void make_scrambled_password(char *to, const char *password);
void scramble(char *to, const char *message, const char *password); void scramble(char *to, const char *message, const char *password);
my_bool check_scramble(const char *reply, const char *message, my_bool check_scramble(const unsigned char *reply, const char *message,
const unsigned char *hash_stage2); const unsigned char *hash_stage2);
void get_salt_from_password(unsigned char *res, const char *password); void get_salt_from_password(unsigned char *res, const char *password);
void make_password_from_salt(char *to, const unsigned char *hash_stage2); void make_password_from_salt(char *to, const unsigned char *hash_stage2);
char *octet2hex(char *to, const char *str, unsigned int len); char *octet2hex(char *to, const char *str, unsigned int len);
/* 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);
 End of changes. 6 change blocks. 
4 lines changed or deleted 18 lines changed or added


 mysql_embed.h   mysql_embed.h 
skipping to change at line 26 skipping to change at line 26
along with this program; if not, write to the Free Software along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 US A */ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 US A */
/* Defines that are unique to the embedded version of MySQL */ /* Defines that are unique to the embedded version of MySQL */
#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_PSTACK /* No stacktrace */
#undef HAVE_DLOPEN /* No udf functions */ #undef HAVE_DLOPEN /* No udf functions */
#undef HAVE_SMEM /* No shared memory */ #undef HAVE_SMEM /* No shared memory */
#undef HAVE_NDBCLUSTER_DB /* No NDB cluster */ #undef HAVE_NDBCLUSTER_DB /* No NDB cluster */
#define DONT_USE_RAID
#endif /* EMBEDDED_LIBRARY */ #endif /* EMBEDDED_LIBRARY */
#endif /* MYSQL_EMBED_INCLUDED */ #endif /* MYSQL_EMBED_INCLUDED */
 End of changes. 2 change blocks. 
3 lines changed or deleted 0 lines changed or added


 mysql_file.h   mysql_file.h 
/* Copyright (C) 2008-2009 Sun Microsystems, Inc /* Copyright (c) 2008, 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.
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,
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 51 Franklin Street, Suite 500, Boston, MA 02110-1335 USA */
*/
#ifndef MYSQL_FILE_H #ifndef MYSQL_FILE_H
#define MYSQL_FILE_H #define MYSQL_FILE_H
/* For strlen() */ /* For strlen() */
#include <string.h> #include <string.h>
/* For MY_STAT */ /* For MY_STAT */
#include <my_dir.h> #include <my_dir.h>
/* For my_chsize */ /* For my_chsize */
#include <my_sys.h> #include <my_sys.h>
skipping to change at line 509 skipping to change at line 509
static inline char * static inline char *
inline_mysql_file_fgets( inline_mysql_file_fgets(
#ifdef HAVE_PSI_INTERFACE #ifdef HAVE_PSI_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_INTERFACE
struct PSI_file_locker *locker= NULL; struct PSI_file_locker *locker= NULL;
PSI_file_locker_state state;
if (likely(PSI_server && file->m_psi)) if (likely(PSI_server && file->m_psi))
{ {
locker= PSI_server->get_thread_file_stream_locker(file->m_psi, locker= PSI_server->get_thread_file_stream_locker(&state, file->m_psi,
PSI_FILE_READ); PSI_FILE_READ);
if (likely(locker != NULL)) if (likely(locker != NULL))
PSI_server->start_file_wait(locker, (size_t) size, src_file, src_line ); PSI_server->start_file_wait(locker, (size_t) size, src_file, src_line );
} }
#endif #endif
result= fgets(str, size, file->m_file); result= fgets(str, size, file->m_file);
#ifdef HAVE_PSI_INTERFACE #ifdef HAVE_PSI_INTERFACE
if (likely(locker != NULL)) if (likely(locker != NULL))
PSI_server->end_file_wait(locker, result ? strlen(result) : 0); PSI_server->end_file_wait(locker, result ? strlen(result) : 0);
#endif #endif
skipping to change at line 535 skipping to change at line 536
static inline int static inline int
inline_mysql_file_fgetc( inline_mysql_file_fgetc(
#ifdef HAVE_PSI_INTERFACE #ifdef HAVE_PSI_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_INTERFACE
struct PSI_file_locker *locker= NULL; struct PSI_file_locker *locker= NULL;
PSI_file_locker_state state;
if (likely(PSI_server && file->m_psi)) if (likely(PSI_server && file->m_psi))
{ {
locker= PSI_server->get_thread_file_stream_locker(file->m_psi, locker= PSI_server->get_thread_file_stream_locker(&state, file->m_psi,
PSI_FILE_READ); PSI_FILE_READ);
if (likely(locker != NULL)) if (likely(locker != NULL))
PSI_server->start_file_wait(locker, (size_t) 1, src_file, src_line); PSI_server->start_file_wait(locker, (size_t) 1, src_file, src_line);
} }
#endif #endif
result= fgetc(file->m_file); result= fgetc(file->m_file);
#ifdef HAVE_PSI_INTERFACE #ifdef HAVE_PSI_INTERFACE
if (likely(locker != NULL)) if (likely(locker != NULL))
PSI_server->end_file_wait(locker, (size_t) 1); PSI_server->end_file_wait(locker, (size_t) 1);
#endif #endif
skipping to change at line 561 skipping to change at line 563
static inline int static inline int
inline_mysql_file_fputs( inline_mysql_file_fputs(
#ifdef HAVE_PSI_INTERFACE #ifdef HAVE_PSI_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_INTERFACE
struct PSI_file_locker *locker= NULL; struct PSI_file_locker *locker= NULL;
PSI_file_locker_state state;
size_t bytes= 0; size_t bytes= 0;
if (likely(PSI_server && file->m_psi)) if (likely(PSI_server && file->m_psi))
{ {
locker= PSI_server->get_thread_file_stream_locker(file->m_psi, locker= PSI_server->get_thread_file_stream_locker(&state, file->m_psi,
PSI_FILE_WRITE); PSI_FILE_WRITE);
if (likely(locker != NULL)) if (likely(locker != NULL))
{ {
bytes= str ? strlen(str) : 0; bytes= str ? strlen(str) : 0;
PSI_server->start_file_wait(locker, bytes, src_file, src_line); 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 #ifdef HAVE_PSI_INTERFACE
skipping to change at line 591 skipping to change at line 594
static inline int static inline int
inline_mysql_file_fputc( inline_mysql_file_fputc(
#ifdef HAVE_PSI_INTERFACE #ifdef HAVE_PSI_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_INTERFACE
struct PSI_file_locker *locker= NULL; struct PSI_file_locker *locker= NULL;
PSI_file_locker_state state;
if (likely(PSI_server && file->m_psi)) if (likely(PSI_server && file->m_psi))
{ {
locker= PSI_server->get_thread_file_stream_locker(file->m_psi, locker= PSI_server->get_thread_file_stream_locker(&state, file->m_psi,
PSI_FILE_WRITE); PSI_FILE_WRITE);
if (likely(locker != NULL)) if (likely(locker != NULL))
PSI_server->start_file_wait(locker, (size_t) 1, src_file, src_line); PSI_server->start_file_wait(locker, (size_t) 1, src_file, src_line);
} }
#endif #endif
result= fputc(c, file->m_file); result= fputc(c, file->m_file);
#ifdef HAVE_PSI_INTERFACE #ifdef HAVE_PSI_INTERFACE
if (likely(locker != NULL)) if (likely(locker != NULL))
PSI_server->end_file_wait(locker, (size_t) 1); PSI_server->end_file_wait(locker, (size_t) 1);
#endif #endif
skipping to change at line 617 skipping to change at line 621
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_INTERFACE
struct PSI_file_locker *locker= NULL; struct PSI_file_locker *locker= NULL;
PSI_file_locker_state state;
if (likely(PSI_server && file->m_psi)) if (likely(PSI_server && file->m_psi))
{ {
locker= PSI_server->get_thread_file_stream_locker(file->m_psi, locker= PSI_server->get_thread_file_stream_locker(&state, file->m_psi,
PSI_FILE_WRITE); PSI_FILE_WRITE);
if (likely(locker != NULL)) if (likely(locker != NULL))
PSI_server->start_file_wait(locker, (size_t) 0, __FILE__, __LINE__); PSI_server->start_file_wait(locker, (size_t) 0, __FILE__, __LINE__);
} }
#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 #ifdef HAVE_PSI_INTERFACE
if (likely(locker != NULL)) if (likely(locker != NULL))
skipping to change at line 645 skipping to change at line 650
static inline int static inline int
inline_mysql_file_vfprintf( inline_mysql_file_vfprintf(
#ifdef HAVE_PSI_INTERFACE #ifdef HAVE_PSI_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_INTERFACE
struct PSI_file_locker *locker= NULL; struct PSI_file_locker *locker= NULL;
PSI_file_locker_state state;
if (likely(PSI_server && file->m_psi)) if (likely(PSI_server && file->m_psi))
{ {
locker= PSI_server->get_thread_file_stream_locker(file->m_psi, locker= PSI_server->get_thread_file_stream_locker(&state, file->m_psi,
PSI_FILE_WRITE); PSI_FILE_WRITE);
if (likely(locker != NULL)) if (likely(locker != NULL))
PSI_server->start_file_wait(locker, (size_t) 0, src_file, src_line); PSI_server->start_file_wait(locker, (size_t) 0, src_file, src_line);
} }
#endif #endif
result= vfprintf(file->m_file, format, args); result= vfprintf(file->m_file, format, args);
#ifdef HAVE_PSI_INTERFACE #ifdef HAVE_PSI_INTERFACE
if (likely(locker != NULL)) if (likely(locker != NULL))
PSI_server->end_file_wait(locker, (size_t) result); PSI_server->end_file_wait(locker, (size_t) result);
#endif #endif
skipping to change at line 671 skipping to change at line 677
static inline int static inline int
inline_mysql_file_fflush( inline_mysql_file_fflush(
#ifdef HAVE_PSI_INTERFACE #ifdef HAVE_PSI_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_INTERFACE
struct PSI_file_locker *locker= NULL; struct PSI_file_locker *locker= NULL;
PSI_file_locker_state state;
if (likely(PSI_server && file->m_psi)) if (likely(PSI_server && file->m_psi))
{ {
locker= PSI_server->get_thread_file_stream_locker(file->m_psi, locker= PSI_server->get_thread_file_stream_locker(&state, file->m_psi,
PSI_FILE_FLUSH); PSI_FILE_FLUSH);
if (likely(locker != NULL)) if (likely(locker != NULL))
PSI_server->start_file_wait(locker, (size_t) 0, src_file, src_line); PSI_server->start_file_wait(locker, (size_t) 0, src_file, src_line);
} }
#endif #endif
result= fflush(file->m_file); result= fflush(file->m_file);
#ifdef HAVE_PSI_INTERFACE #ifdef HAVE_PSI_INTERFACE
if (likely(locker != NULL)) if (likely(locker != NULL))
PSI_server->end_file_wait(locker, (size_t) 0); PSI_server->end_file_wait(locker, (size_t) 0);
#endif #endif
skipping to change at line 703 skipping to change at line 710
static inline int static inline int
inline_mysql_file_fstat( inline_mysql_file_fstat(
#ifdef HAVE_PSI_INTERFACE #ifdef HAVE_PSI_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_INTERFACE
struct PSI_file_locker *locker= NULL; struct PSI_file_locker *locker= NULL;
PSI_file_locker_state state;
if (likely(PSI_server != NULL)) if (likely(PSI_server != NULL))
{ {
locker= PSI_server->get_thread_file_descriptor_locker(filenr, locker= PSI_server->get_thread_file_descriptor_locker(&state, filenr,
PSI_FILE_FSTAT); PSI_FILE_FSTAT);
if (likely(locker != NULL)) if (likely(locker != NULL))
PSI_server->start_file_wait(locker, (size_t) 0, src_file, src_line); PSI_server->start_file_wait(locker, (size_t) 0, src_file, src_line);
} }
#endif #endif
result= my_fstat(filenr, stat_area, flags); result= my_fstat(filenr, stat_area, flags);
#ifdef HAVE_PSI_INTERFACE #ifdef HAVE_PSI_INTERFACE
if (likely(locker != NULL)) if (likely(locker != NULL))
PSI_server->end_file_wait(locker, (size_t) 0); PSI_server->end_file_wait(locker, (size_t) 0);
#endif #endif
skipping to change at line 729 skipping to change at line 737
static inline MY_STAT * static inline MY_STAT *
inline_mysql_file_stat( inline_mysql_file_stat(
#ifdef HAVE_PSI_INTERFACE #ifdef HAVE_PSI_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_INTERFACE
struct PSI_file_locker *locker= NULL; struct PSI_file_locker *locker= NULL;
PSI_file_locker_state state;
if (likely(PSI_server != NULL)) if (likely(PSI_server != NULL))
{ {
locker= PSI_server->get_thread_file_name_locker(key, PSI_FILE_STAT, locker= PSI_server->get_thread_file_name_locker(&state,
key, PSI_FILE_STAT,
path, &locker); path, &locker);
if (likely(locker != NULL)) if (likely(locker != NULL))
PSI_server->start_file_open_wait(locker, src_file, src_line); 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 #ifdef HAVE_PSI_INTERFACE
if (likely(locker != NULL)) if (likely(locker != NULL))
PSI_server->end_file_wait(locker, (size_t) 0); PSI_server->end_file_wait(locker, (size_t) 0);
#endif #endif
skipping to change at line 755 skipping to change at line 765
static inline int static inline int
inline_mysql_file_chsize( inline_mysql_file_chsize(
#ifdef HAVE_PSI_INTERFACE #ifdef HAVE_PSI_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_INTERFACE
struct PSI_file_locker *locker= NULL; struct PSI_file_locker *locker= NULL;
PSI_file_locker_state state;
if (likely(PSI_server != NULL)) if (likely(PSI_server != NULL))
{ {
locker= PSI_server->get_thread_file_descriptor_locker(file, locker= PSI_server->get_thread_file_descriptor_locker(&state, file,
PSI_FILE_CHSIZE); PSI_FILE_CHSIZE);
if (likely(locker != NULL)) if (likely(locker != NULL))
PSI_server->start_file_wait(locker, (size_t) newlength, src_file, PSI_server->start_file_wait(locker, (size_t) newlength, src_file,
src_line); src_line);
} }
#endif #endif
result= my_chsize(file, newlength, filler, flags); result= my_chsize(file, newlength, filler, flags);
#ifdef HAVE_PSI_INTERFACE #ifdef HAVE_PSI_INTERFACE
if (likely(locker != NULL)) if (likely(locker != NULL))
PSI_server->end_file_wait(locker, (size_t) newlength); PSI_server->end_file_wait(locker, (size_t) newlength);
skipping to change at line 787 skipping to change at line 798
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; that->m_psi= NULL;
{ {
#ifdef HAVE_PSI_INTERFACE #ifdef HAVE_PSI_INTERFACE
struct PSI_file_locker *locker= NULL; struct PSI_file_locker *locker= NULL;
PSI_file_locker_state state;
if (likely(PSI_server != NULL)) if (likely(PSI_server != NULL))
{ {
locker= PSI_server->get_thread_file_name_locker locker= PSI_server->get_thread_file_name_locker
(key, PSI_FILE_STREAM_OPEN, filename, that); (&state, key, PSI_FILE_STREAM_OPEN, filename, that);
if (likely(locker != NULL)) if (likely(locker != NULL))
that->m_psi= PSI_server->start_file_open_wait(locker, src_file, that->m_psi= PSI_server->start_file_open_wait(locker, src_file,
src_line); src_line);
} }
#endif #endif
that->m_file= my_fopen(filename, flags, myFlags); that->m_file= my_fopen(filename, flags, myFlags);
#ifdef HAVE_PSI_INTERFACE #ifdef HAVE_PSI_INTERFACE
if (likely(locker != NULL)) if (likely(locker != NULL))
PSI_server->end_file_open_wait(locker); PSI_server->end_file_open_wait(locker);
#endif #endif
if (unlikely(that->m_file == NULL)) if (unlikely(that->m_file == NULL))
{ {
my_free(that, MYF(0)); my_free(that);
return NULL; 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_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_INTERFACE
struct PSI_file_locker *locker= NULL; struct PSI_file_locker *locker= NULL;
PSI_file_locker_state state;
DBUG_ASSERT(file != NULL); DBUG_ASSERT(file != NULL);
if (likely(PSI_server && file->m_psi)) if (likely(PSI_server && file->m_psi))
{ {
locker= PSI_server->get_thread_file_stream_locker(file->m_psi, locker= PSI_server->get_thread_file_stream_locker(&state, file->m_psi ,
PSI_FILE_STREAM_CLO SE); PSI_FILE_STREAM_CLO SE);
if (likely(locker != NULL)) if (likely(locker != NULL))
PSI_server->start_file_wait(locker, (size_t) 0, src_file, src_line) ; 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 #ifdef HAVE_PSI_INTERFACE
if (likely(locker != NULL)) if (likely(locker != NULL))
PSI_server->end_file_wait(locker, (size_t) 0); PSI_server->end_file_wait(locker, (size_t) 0);
#endif #endif
my_free(file, MYF(0)); 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_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= 0;
#ifdef HAVE_PSI_INTERFACE #ifdef HAVE_PSI_INTERFACE
struct PSI_file_locker *locker= NULL; struct PSI_file_locker *locker= NULL;
PSI_file_locker_state state;
if (likely(PSI_server && file->m_psi)) if (likely(PSI_server && file->m_psi))
{ {
locker= PSI_server->get_thread_file_stream_locker(file->m_psi, locker= PSI_server->get_thread_file_stream_locker(&state, file->m_psi,
PSI_FILE_READ); PSI_FILE_READ);
if (likely(locker != NULL)) if (likely(locker != NULL))
PSI_server->start_file_wait(locker, count, src_file, src_line); PSI_server->start_file_wait(locker, count, src_file, src_line);
} }
#endif #endif
result= my_fread(file->m_file, buffer, count, flags); result= my_fread(file->m_file, buffer, count, flags);
#ifdef HAVE_PSI_INTERFACE #ifdef HAVE_PSI_INTERFACE
if (likely(locker != NULL)) if (likely(locker != NULL))
{ {
size_t bytes_read; size_t bytes_read;
skipping to change at line 885 skipping to change at line 899
static inline size_t static inline size_t
inline_mysql_file_fwrite( inline_mysql_file_fwrite(
#ifdef HAVE_PSI_INTERFACE #ifdef HAVE_PSI_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= 0;
#ifdef HAVE_PSI_INTERFACE #ifdef HAVE_PSI_INTERFACE
struct PSI_file_locker *locker= NULL; struct PSI_file_locker *locker= NULL;
PSI_file_locker_state state;
if (likely(PSI_server && file->m_psi)) if (likely(PSI_server && file->m_psi))
{ {
locker= PSI_server->get_thread_file_stream_locker(file->m_psi, locker= PSI_server->get_thread_file_stream_locker(&state, file->m_psi,
PSI_FILE_WRITE); PSI_FILE_WRITE);
if (likely(locker != NULL)) if (likely(locker != NULL))
PSI_server->start_file_wait(locker, count, src_file, src_line); PSI_server->start_file_wait(locker, count, src_file, src_line);
} }
#endif #endif
result= my_fwrite(file->m_file, buffer, count, flags); result= my_fwrite(file->m_file, buffer, count, flags);
#ifdef HAVE_PSI_INTERFACE #ifdef HAVE_PSI_INTERFACE
if (likely(locker != NULL)) if (likely(locker != NULL))
{ {
size_t bytes_written; size_t bytes_written;
skipping to change at line 918 skipping to change at line 933
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_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_INTERFACE
struct PSI_file_locker *locker= NULL; struct PSI_file_locker *locker= NULL;
PSI_file_locker_state state;
if (likely(PSI_server && file->m_psi)) if (likely(PSI_server && file->m_psi))
{ {
locker= PSI_server->get_thread_file_stream_locker(file->m_psi, locker= PSI_server->get_thread_file_stream_locker(&state, file->m_psi,
PSI_FILE_SEEK); PSI_FILE_SEEK);
if (likely(locker != NULL)) if (likely(locker != NULL))
PSI_server->start_file_wait(locker, (size_t) 0, src_file, src_line); PSI_server->start_file_wait(locker, (size_t) 0, src_file, src_line);
} }
#endif #endif
result= my_fseek(file->m_file, pos, whence, flags); result= my_fseek(file->m_file, pos, whence, flags);
#ifdef HAVE_PSI_INTERFACE #ifdef HAVE_PSI_INTERFACE
if (likely(locker != NULL)) if (likely(locker != NULL))
PSI_server->end_file_wait(locker, (size_t) 0); PSI_server->end_file_wait(locker, (size_t) 0);
#endif #endif
skipping to change at line 944 skipping to change at line 960
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_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_INTERFACE
struct PSI_file_locker *locker= NULL; struct PSI_file_locker *locker= NULL;
PSI_file_locker_state state;
if (likely(PSI_server && file->m_psi)) if (likely(PSI_server && file->m_psi))
{ {
locker= PSI_server->get_thread_file_stream_locker(file->m_psi, locker= PSI_server->get_thread_file_stream_locker(&state, file->m_psi,
PSI_FILE_TELL); PSI_FILE_TELL);
if (likely(locker != NULL)) if (likely(locker != NULL))
PSI_server->start_file_wait(locker, (size_t) 0, src_file, src_line); PSI_server->start_file_wait(locker, (size_t) 0, src_file, src_line);
} }
#endif #endif
result= my_ftell(file->m_file, flags); result= my_ftell(file->m_file, flags);
#ifdef HAVE_PSI_INTERFACE #ifdef HAVE_PSI_INTERFACE
if (likely(locker != NULL)) if (likely(locker != NULL))
PSI_server->end_file_wait(locker, (size_t) 0); PSI_server->end_file_wait(locker, (size_t) 0);
#endif #endif
skipping to change at line 970 skipping to change at line 987
static inline File static inline File
inline_mysql_file_create( inline_mysql_file_create(
#ifdef HAVE_PSI_INTERFACE #ifdef HAVE_PSI_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_INTERFACE
struct PSI_file_locker *locker= NULL; struct PSI_file_locker *locker= NULL;
PSI_file_locker_state state;
if (likely(PSI_server != NULL)) if (likely(PSI_server != NULL))
{ {
locker= PSI_server->get_thread_file_name_locker(key, PSI_FILE_CREATE, locker= PSI_server->get_thread_file_name_locker(&state, key, PSI_FILE_C REATE,
filename, &locker); filename, &locker);
if (likely(locker != NULL)) if (likely(locker != NULL))
PSI_server->start_file_open_wait(locker, src_file, src_line); 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 #ifdef HAVE_PSI_INTERFACE
if (likely(locker != NULL)) if (likely(locker != NULL))
PSI_server->end_file_open_wait_and_bind_to_descriptor(locker, file); PSI_server->end_file_open_wait_and_bind_to_descriptor(locker, file);
#endif #endif
skipping to change at line 1017 skipping to change at line 1035
static inline File static inline File
inline_mysql_file_open( inline_mysql_file_open(
#ifdef HAVE_PSI_INTERFACE #ifdef HAVE_PSI_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_INTERFACE
struct PSI_file_locker *locker= NULL; struct PSI_file_locker *locker= NULL;
PSI_file_locker_state state;
if (likely(PSI_server != NULL)) if (likely(PSI_server != NULL))
{ {
locker= PSI_server->get_thread_file_name_locker(key, PSI_FILE_OPEN, locker= PSI_server->get_thread_file_name_locker(&state, key, PSI_FILE_O PEN,
filename, &locker); filename, &locker);
if (likely(locker != NULL)) if (likely(locker != NULL))
PSI_server->start_file_open_wait(locker, src_file, src_line); 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 #ifdef HAVE_PSI_INTERFACE
if (likely(locker != NULL)) if (likely(locker != NULL))
PSI_server->end_file_open_wait_and_bind_to_descriptor(locker, file); PSI_server->end_file_open_wait_and_bind_to_descriptor(locker, file);
#endif #endif
skipping to change at line 1043 skipping to change at line 1062
static inline int static inline int
inline_mysql_file_close( inline_mysql_file_close(
#ifdef HAVE_PSI_INTERFACE #ifdef HAVE_PSI_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_INTERFACE
struct PSI_file_locker *locker= NULL; struct PSI_file_locker *locker= NULL;
PSI_file_locker_state state;
if (likely(PSI_server != NULL)) if (likely(PSI_server != NULL))
{ {
locker= PSI_server->get_thread_file_descriptor_locker(file, locker= PSI_server->get_thread_file_descriptor_locker(&state, file,
PSI_FILE_CLOSE); PSI_FILE_CLOSE);
if (likely(locker != NULL)) if (likely(locker != NULL))
PSI_server->start_file_wait(locker, (size_t) 0, src_file, src_line); PSI_server->start_file_wait(locker, (size_t) 0, src_file, src_line);
} }
#endif #endif
result= my_close(file, flags); result= my_close(file, flags);
#ifdef HAVE_PSI_INTERFACE #ifdef HAVE_PSI_INTERFACE
if (likely(locker != NULL)) if (likely(locker != NULL))
PSI_server->end_file_wait(locker, (size_t) 0); PSI_server->end_file_wait(locker, (size_t) 0);
#endif #endif
skipping to change at line 1069 skipping to change at line 1089
static inline size_t static inline size_t
inline_mysql_file_read( inline_mysql_file_read(
#ifdef HAVE_PSI_INTERFACE #ifdef HAVE_PSI_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= 0;
#ifdef HAVE_PSI_INTERFACE #ifdef HAVE_PSI_INTERFACE
struct PSI_file_locker *locker= NULL; struct PSI_file_locker *locker= NULL;
PSI_file_locker_state state;
if (likely(PSI_server != NULL)) if (likely(PSI_server != NULL))
{ {
locker= PSI_server->get_thread_file_descriptor_locker(file, locker= PSI_server->get_thread_file_descriptor_locker(&state, file,
PSI_FILE_READ); PSI_FILE_READ);
if (likely(locker != NULL)) if (likely(locker != NULL))
PSI_server->start_file_wait(locker, count, src_file, src_line); PSI_server->start_file_wait(locker, count, src_file, src_line);
} }
#endif #endif
result= my_read(file, buffer, count, flags); result= my_read(file, buffer, count, flags);
#ifdef HAVE_PSI_INTERFACE #ifdef HAVE_PSI_INTERFACE
if (likely(locker != NULL)) if (likely(locker != NULL))
{ {
size_t bytes_read; size_t bytes_read;
skipping to change at line 1102 skipping to change at line 1123
static inline size_t static inline size_t
inline_mysql_file_write( inline_mysql_file_write(
#ifdef HAVE_PSI_INTERFACE #ifdef HAVE_PSI_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_INTERFACE
struct PSI_file_locker *locker= NULL; struct PSI_file_locker *locker= NULL;
PSI_file_locker_state state;
if (likely(PSI_server != NULL)) if (likely(PSI_server != NULL))
{ {
locker= PSI_server->get_thread_file_descriptor_locker(file, locker= PSI_server->get_thread_file_descriptor_locker(&state, file,
PSI_FILE_WRITE); PSI_FILE_WRITE);
if (likely(locker != NULL)) if (likely(locker != NULL))
PSI_server->start_file_wait(locker, count, src_file, src_line); PSI_server->start_file_wait(locker, count, src_file, src_line);
} }
#endif #endif
result= my_write(file, buffer, count, flags); result= my_write(file, buffer, count, flags);
#ifdef HAVE_PSI_INTERFACE #ifdef HAVE_PSI_INTERFACE
if (likely(locker != NULL)) if (likely(locker != NULL))
{ {
size_t bytes_written; size_t bytes_written;
skipping to change at line 1135 skipping to change at line 1157
static inline size_t static inline size_t
inline_mysql_file_pread( inline_mysql_file_pread(
#ifdef HAVE_PSI_INTERFACE #ifdef HAVE_PSI_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_INTERFACE
struct PSI_file_locker *locker= NULL; struct PSI_file_locker *locker= NULL;
PSI_file_locker_state state;
if (likely(PSI_server != NULL)) if (likely(PSI_server != NULL))
{ {
locker= PSI_server->get_thread_file_descriptor_locker(file, PSI_FILE_RE AD); locker= PSI_server->get_thread_file_descriptor_locker(&state, file, PSI _FILE_READ);
if (likely(locker != NULL)) if (likely(locker != NULL))
PSI_server->start_file_wait(locker, count, src_file, src_line); PSI_server->start_file_wait(locker, count, src_file, src_line);
} }
#endif #endif
result= my_pread(file, buffer, count, offset, flags); result= my_pread(file, buffer, count, offset, flags);
#ifdef HAVE_PSI_INTERFACE #ifdef HAVE_PSI_INTERFACE
if (likely(locker != NULL)) if (likely(locker != NULL))
{ {
size_t bytes_read; size_t bytes_read;
if (flags & (MY_NABP | MY_FNABP)) if (flags & (MY_NABP | MY_FNABP))
skipping to change at line 1167 skipping to change at line 1190
static inline size_t static inline size_t
inline_mysql_file_pwrite( inline_mysql_file_pwrite(
#ifdef HAVE_PSI_INTERFACE #ifdef HAVE_PSI_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_INTERFACE
struct PSI_file_locker *locker= NULL; struct PSI_file_locker *locker= NULL;
PSI_file_locker_state state;
if (likely(PSI_server != NULL)) if (likely(PSI_server != NULL))
{ {
locker= PSI_server->get_thread_file_descriptor_locker(file, locker= PSI_server->get_thread_file_descriptor_locker(&state, file,
PSI_FILE_WRITE); PSI_FILE_WRITE);
if (likely(locker != NULL)) if (likely(locker != NULL))
PSI_server->start_file_wait(locker, count, src_file, src_line); PSI_server->start_file_wait(locker, count, src_file, src_line);
} }
#endif #endif
result= my_pwrite(file, buffer, count, offset, flags); result= my_pwrite(file, buffer, count, offset, flags);
#ifdef HAVE_PSI_INTERFACE #ifdef HAVE_PSI_INTERFACE
if (likely(locker != NULL)) if (likely(locker != NULL))
{ {
size_t bytes_written; size_t bytes_written;
skipping to change at line 1200 skipping to change at line 1224
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_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_INTERFACE
struct PSI_file_locker *locker= NULL; struct PSI_file_locker *locker= NULL;
PSI_file_locker_state state;
if (likely(PSI_server != NULL)) if (likely(PSI_server != NULL))
{ {
locker= PSI_server->get_thread_file_descriptor_locker(file, PSI_FILE_SE EK); locker= PSI_server->get_thread_file_descriptor_locker(&state, file, PSI _FILE_SEEK);
if (likely(locker != NULL)) if (likely(locker != NULL))
PSI_server->start_file_wait(locker, (size_t) 0, src_file, src_line); PSI_server->start_file_wait(locker, (size_t) 0, src_file, src_line);
} }
#endif #endif
result= my_seek(file, pos, whence, flags); result= my_seek(file, pos, whence, flags);
#ifdef HAVE_PSI_INTERFACE #ifdef HAVE_PSI_INTERFACE
if (likely(locker != NULL)) if (likely(locker != NULL))
PSI_server->end_file_wait(locker, (size_t) 0); PSI_server->end_file_wait(locker, (size_t) 0);
#endif #endif
return result; return result;
skipping to change at line 1225 skipping to change at line 1250
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_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_INTERFACE
struct PSI_file_locker *locker= NULL; struct PSI_file_locker *locker= NULL;
PSI_file_locker_state state;
if (likely(PSI_server != NULL)) if (likely(PSI_server != NULL))
{ {
locker= PSI_server->get_thread_file_descriptor_locker(file, PSI_FILE_TE LL); locker= PSI_server->get_thread_file_descriptor_locker(&state, file, PSI _FILE_TELL);
if (likely(locker != NULL)) if (likely(locker != NULL))
PSI_server->start_file_wait(locker, (size_t) 0, src_file, src_line); PSI_server->start_file_wait(locker, (size_t) 0, src_file, src_line);
} }
#endif #endif
result= my_tell(file, flags); result= my_tell(file, flags);
#ifdef HAVE_PSI_INTERFACE #ifdef HAVE_PSI_INTERFACE
if (likely(locker != NULL)) if (likely(locker != NULL))
PSI_server->end_file_wait(locker, (size_t) 0); PSI_server->end_file_wait(locker, (size_t) 0);
#endif #endif
return result; return result;
skipping to change at line 1250 skipping to change at line 1276
static inline int static inline int
inline_mysql_file_delete( inline_mysql_file_delete(
#ifdef HAVE_PSI_INTERFACE #ifdef HAVE_PSI_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_INTERFACE
struct PSI_file_locker *locker= NULL; struct PSI_file_locker *locker= NULL;
PSI_file_locker_state state;
if (likely(PSI_server != NULL)) if (likely(PSI_server != NULL))
{ {
locker= PSI_server->get_thread_file_name_locker(key, PSI_FILE_DELETE, locker= PSI_server->get_thread_file_name_locker(&state, key, PSI_FILE_D ELETE,
name, &locker); name, &locker);
if (likely(locker != NULL)) if (likely(locker != NULL))
PSI_server->start_file_wait(locker, (size_t) 0, src_file, src_line); 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 #ifdef HAVE_PSI_INTERFACE
if (likely(locker != NULL)) if (likely(locker != NULL))
PSI_server->end_file_wait(locker, (size_t) 0); PSI_server->end_file_wait(locker, (size_t) 0);
#endif #endif
skipping to change at line 1276 skipping to change at line 1303
static inline int static inline int
inline_mysql_file_rename( inline_mysql_file_rename(
#ifdef HAVE_PSI_INTERFACE #ifdef HAVE_PSI_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_INTERFACE
struct PSI_file_locker *locker= NULL; struct PSI_file_locker *locker= NULL;
PSI_file_locker_state state;
if (likely(PSI_server != NULL)) if (likely(PSI_server != NULL))
{ {
locker= PSI_server->get_thread_file_name_locker(key, PSI_FILE_RENAME, locker= PSI_server->get_thread_file_name_locker(&state, key, PSI_FILE_R ENAME,
to, &locker); to, &locker);
if (likely(locker != NULL)) if (likely(locker != NULL))
PSI_server->start_file_wait(locker, (size_t) 0, src_file, src_line); 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 #ifdef HAVE_PSI_INTERFACE
if (likely(locker != NULL)) if (likely(locker != NULL))
PSI_server->end_file_wait(locker, (size_t) 0); PSI_server->end_file_wait(locker, (size_t) 0);
#endif #endif
skipping to change at line 1303 skipping to change at line 1331
inline_mysql_file_create_with_symlink( inline_mysql_file_create_with_symlink(
#ifdef HAVE_PSI_INTERFACE #ifdef HAVE_PSI_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_INTERFACE
struct PSI_file_locker *locker= NULL; struct PSI_file_locker *locker= NULL;
PSI_file_locker_state state;
if (likely(PSI_server != NULL)) if (likely(PSI_server != NULL))
{ {
locker= PSI_server->get_thread_file_name_locker(key, PSI_FILE_CREATE, locker= PSI_server->get_thread_file_name_locker(&state, key, PSI_FILE_C REATE,
filename, &locker); filename, &locker);
if (likely(locker != NULL)) if (likely(locker != NULL))
PSI_server->start_file_open_wait(locker, src_file, src_line); PSI_server->start_file_open_wait(locker, src_file, src_line);
} }
#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 #ifdef HAVE_PSI_INTERFACE
if (likely(locker != NULL)) if (likely(locker != NULL))
PSI_server->end_file_open_wait_and_bind_to_descriptor(locker, file); PSI_server->end_file_open_wait_and_bind_to_descriptor(locker, file);
skipping to change at line 1330 skipping to change at line 1359
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_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_INTERFACE
struct PSI_file_locker *locker= NULL; struct PSI_file_locker *locker= NULL;
PSI_file_locker_state state;
if (likely(PSI_server != NULL)) if (likely(PSI_server != NULL))
{ {
locker= PSI_server->get_thread_file_name_locker(key, PSI_FILE_DELETE, locker= PSI_server->get_thread_file_name_locker(&state, key, PSI_FILE_D ELETE,
name, &locker); name, &locker);
if (likely(locker != NULL)) if (likely(locker != NULL))
PSI_server->start_file_wait(locker, (size_t) 0, src_file, src_line); 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 #ifdef HAVE_PSI_INTERFACE
if (likely(locker != NULL)) if (likely(locker != NULL))
PSI_server->end_file_wait(locker, (size_t) 0); PSI_server->end_file_wait(locker, (size_t) 0);
#endif #endif
skipping to change at line 1356 skipping to change at line 1386
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_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_INTERFACE
struct PSI_file_locker *locker= NULL; struct PSI_file_locker *locker= NULL;
PSI_file_locker_state state;
if (likely(PSI_server != NULL)) if (likely(PSI_server != NULL))
{ {
locker= PSI_server->get_thread_file_name_locker(key, PSI_FILE_RENAME, locker= PSI_server->get_thread_file_name_locker(&state, key, PSI_FILE_R ENAME,
to, &locker); to, &locker);
if (likely(locker != NULL)) if (likely(locker != NULL))
PSI_server->start_file_wait(locker, (size_t) 0, src_file, src_line); 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 #ifdef HAVE_PSI_INTERFACE
if (likely(locker != NULL)) if (likely(locker != NULL))
PSI_server->end_file_wait(locker, (size_t) 0); PSI_server->end_file_wait(locker, (size_t) 0);
#endif #endif
skipping to change at line 1382 skipping to change at line 1413
static inline int static inline int
inline_mysql_file_sync( inline_mysql_file_sync(
#ifdef HAVE_PSI_INTERFACE #ifdef HAVE_PSI_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_INTERFACE
struct PSI_file_locker *locker= NULL; struct PSI_file_locker *locker= NULL;
PSI_file_locker_state state;
if (likely(PSI_server != NULL)) if (likely(PSI_server != NULL))
{ {
locker= PSI_server->get_thread_file_descriptor_locker(fd, PSI_FILE_SYNC ); locker= PSI_server->get_thread_file_descriptor_locker(&state, fd, PSI_F ILE_SYNC);
if (likely(locker != NULL)) if (likely(locker != NULL))
PSI_server->start_file_wait(locker, (size_t) 0, src_file, src_line); PSI_server->start_file_wait(locker, (size_t) 0, src_file, src_line);
} }
#endif #endif
result= my_sync(fd, flags); result= my_sync(fd, flags);
#ifdef HAVE_PSI_INTERFACE #ifdef HAVE_PSI_INTERFACE
if (likely(locker != NULL)) if (likely(locker != NULL))
PSI_server->end_file_wait(locker, (size_t) 0); PSI_server->end_file_wait(locker, (size_t) 0);
#endif #endif
return result; return result;
 End of changes. 66 change blocks. 
37 lines changed or deleted 68 lines changed or added


 mysql_thread.h   mysql_thread.h 
/* Copyright (C) 2008-2009 Sun Microsystems, Inc /* Copyright (c) 2008, 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.
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,
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 51 Franklin Street, Suite 500, Boston, MA 02110-1335 USA */
*/
#ifndef MYSQL_THREAD_H #ifndef MYSQL_THREAD_H
#define MYSQL_THREAD_H #define MYSQL_THREAD_H
/** /**
@file mysql/psi/mysql_thread.h @file mysql/psi/mysql_thread.h
Instrumentation helpers for mysys threads, mutexes, Instrumentation helpers for mysys threads, mutexes,
read write locks and conditions. read write locks and conditions.
This header file provides the necessary declarations This header file provides the necessary declarations
to use the mysys thread API with the performance schema instrumentation. to use the mysys thread API with the performance schema instrumentation.
skipping to change at line 144 skipping to change at line 144
@sa mysql_rwlock_destroy @sa mysql_rwlock_destroy
*/ */
typedef struct st_mysql_rwlock mysql_rwlock_t; typedef struct st_mysql_rwlock mysql_rwlock_t;
/** /**
Type of an instrumented prlock. Type of an instrumented prlock.
A prlock is a read write lock that 'prefers readers' (pr). A prlock is a read write lock that 'prefers readers' (pr).
@c mysql_prlock_t is a drop-in replacement for @c rw_pr_lock_t. @c mysql_prlock_t is a drop-in replacement for @c rw_pr_lock_t.
@sa mysql_prlock_init @sa mysql_prlock_init
@sa mysql_prlock_rdlock @sa mysql_prlock_rdlock
@sa mysql_prlock_tryrdlock
@sa mysql_prlock_wrlock @sa mysql_prlock_wrlock
@sa mysql_prlock_trywrlock
@sa mysql_prlock_unlock @sa mysql_prlock_unlock
@sa mysql_prlock_destroy @sa mysql_prlock_destroy
*/ */
typedef struct st_mysql_prlock mysql_prlock_t; typedef struct st_mysql_prlock mysql_prlock_t;
/** /**
An instrumented cond structure. An instrumented cond structure.
@sa mysql_cond_t @sa mysql_cond_t
*/ */
struct st_mysql_cond struct st_mysql_cond
skipping to change at line 218 skipping to change at line 216
/** /**
@def mysql_mutex_assert_not_owner(M) @def mysql_mutex_assert_not_owner(M)
Wrapper, to use safe_mutex_assert_not_owner with instrumented mutexes. Wrapper, to use safe_mutex_assert_not_owner with instrumented mutexes.
@c mysql_mutex_assert_not_owner is a drop-in replacement @c mysql_mutex_assert_not_owner is a drop-in replacement
for @c safe_mutex_assert_not_owner. for @c safe_mutex_assert_not_owner.
*/ */
#define mysql_mutex_assert_not_owner(M) \ #define mysql_mutex_assert_not_owner(M) \
safe_mutex_assert_not_owner(&(M)->m_mutex) safe_mutex_assert_not_owner(&(M)->m_mutex)
/** Wrappers for instrumented prlock objects. */
#define mysql_prlock_assert_write_owner(M) \
rw_pr_lock_assert_write_owner(&(M)->m_prlock)
#define mysql_prlock_assert_not_write_owner(M) \
rw_pr_lock_assert_not_write_owner(&(M)->m_prlock)
/** /**
@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_INTERFACE
skipping to change at line 416 skipping to change at line 422
*/ */
#ifdef HAVE_PSI_INTERFACE #ifdef HAVE_PSI_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_prlock_tryrdlock(RW)
Instrumented rw_pr_tryrdlock.
@c mysql_prlock_tryrdlock is a drop-in replacement
for @c rw_pr_tryrdlock.
*/
#ifdef HAVE_PSI_INTERFACE
#define mysql_prlock_tryrdlock(RW) \
inline_mysql_prlock_tryrdlock(RW, __FILE__, __LINE__)
#else
#define mysql_prlock_tryrdlock(RW) \
inline_mysql_prlock_tryrdlock(RW)
#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_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_prlock_trywrlock(RW)
Instrumented rw_pr_trywrlock.
@c mysql_prlock_trywrlock is a drop-in replacement
for @c rw_pr_trywrlock.
*/
#ifdef HAVE_PSI_INTERFACE
#define mysql_prlock_trywrlock(RW) \
inline_mysql_prlock_trywrlock(RW, __FILE__, __LINE__)
#else
#define mysql_prlock_trywrlock(RW) \
inline_mysql_prlock_trywrlock(RW)
#endif
/**
@def mysql_rwlock_unlock(RW) @def mysql_rwlock_unlock(RW)
Instrumented rwlock_unlock. Instrumented rwlock_unlock.
@c mysql_rwlock_unlock is a drop-in replacement @c mysql_rwlock_unlock is a drop-in replacement
for @c pthread_rwlock_unlock. for @c pthread_rwlock_unlock.
*/ */
#define mysql_rwlock_unlock(RW) inline_mysql_rwlock_unlock(RW) #define mysql_rwlock_unlock(RW) inline_mysql_rwlock_unlock(RW)
/** /**
@def mysql_prlock_unlock(RW) @def mysql_prlock_unlock(RW)
Instrumented rw_pr_unlock. Instrumented rw_pr_unlock.
skipping to change at line 627 skipping to change at line 605
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_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 #ifdef HAVE_PSI_INTERFACE
struct PSI_mutex_locker *locker= NULL; struct PSI_mutex_locker *locker= NULL;
PSI_mutex_locker_state state;
if (likely(PSI_server && that->m_psi)) if (likely(PSI_server && that->m_psi))
{ {
locker= PSI_server->get_thread_mutex_locker(that->m_psi, PSI_MUTEX_LOCK ); locker= PSI_server->get_thread_mutex_locker(&state, that->m_psi, PSI_MU TEX_LOCK);
if (likely(locker != NULL)) if (likely(locker != NULL))
PSI_server->start_mutex_wait(locker, src_file, src_line); PSI_server->start_mutex_wait(locker, src_file, src_line);
} }
#endif #endif
#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);
#else #else
result= pthread_mutex_lock(&that->m_mutex); result= pthread_mutex_lock(&that->m_mutex);
#endif #endif
#ifdef HAVE_PSI_INTERFACE #ifdef HAVE_PSI_INTERFACE
skipping to change at line 656 skipping to change at line 635
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_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 #ifdef HAVE_PSI_INTERFACE
struct PSI_mutex_locker *locker= NULL; struct PSI_mutex_locker *locker= NULL;
PSI_mutex_locker_state state;
if (likely(PSI_server && that->m_psi)) if (likely(PSI_server && that->m_psi))
{ {
locker= PSI_server->get_thread_mutex_locker(that->m_psi, PSI_MUTEX_TRYL OCK); locker= PSI_server->get_thread_mutex_locker(&state, that->m_psi, PSI_MU TEX_TRYLOCK);
if (likely(locker != NULL)) if (likely(locker != NULL))
PSI_server->start_mutex_wait(locker, src_file, src_line); PSI_server->start_mutex_wait(locker, src_file, src_line);
} }
#endif #endif
#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);
#else #else
result= pthread_mutex_trylock(&that->m_mutex); result= pthread_mutex_trylock(&that->m_mutex);
#endif #endif
#ifdef HAVE_PSI_INTERFACE #ifdef HAVE_PSI_INTERFACE
skipping to change at line 684 skipping to change at line 664
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 #ifdef HAVE_PSI_INTERFACE
struct PSI_thread *thread;
if (likely(PSI_server && that->m_psi)) if (likely(PSI_server && that->m_psi))
{ PSI_server->unlock_mutex(that->m_psi);
thread= PSI_server->get_thread();
if (likely(thread != NULL))
PSI_server->unlock_mutex(thread, 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);
#else #else
result= pthread_mutex_unlock(&that->m_mutex); result= pthread_mutex_unlock(&that->m_mutex);
#endif #endif
return result; return result;
} }
static inline int inline_mysql_rwlock_init( static inline int inline_mysql_rwlock_init(
skipping to change at line 773 skipping to change at line 748
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_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 #ifdef HAVE_PSI_INTERFACE
struct PSI_rwlock_locker *locker= NULL; struct PSI_rwlock_locker *locker= NULL;
PSI_rwlock_locker_state state;
if (likely(PSI_server && that->m_psi)) if (likely(PSI_server && that->m_psi))
{ {
locker= PSI_server->get_thread_rwlock_locker(that->m_psi, locker= PSI_server->get_thread_rwlock_locker(&state, that->m_psi,
PSI_RWLOCK_READLOCK); PSI_RWLOCK_READLOCK);
if (likely(locker != NULL)) if (likely(locker != NULL))
PSI_server->start_rwlock_rdwait(locker, src_file, src_line); PSI_server->start_rwlock_rdwait(locker, src_file, src_line);
} }
#endif #endif
result= rw_rdlock(&that->m_rwlock); result= rw_rdlock(&that->m_rwlock);
#ifdef HAVE_PSI_INTERFACE #ifdef HAVE_PSI_INTERFACE
if (likely(locker != NULL)) if (likely(locker != NULL))
PSI_server->end_rwlock_rdwait(locker, result); PSI_server->end_rwlock_rdwait(locker, result);
#endif #endif
skipping to change at line 800 skipping to change at line 776
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_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 #ifdef HAVE_PSI_INTERFACE
struct PSI_rwlock_locker *locker= NULL; struct PSI_rwlock_locker *locker= NULL;
PSI_rwlock_locker_state state;
if (likely(PSI_server && that->m_psi)) if (likely(PSI_server && that->m_psi))
{ {
locker= PSI_server->get_thread_rwlock_locker(that->m_psi, locker= PSI_server->get_thread_rwlock_locker(&state, that->m_psi,
PSI_RWLOCK_READLOCK); PSI_RWLOCK_READLOCK);
if (likely(locker != NULL)) if (likely(locker != NULL))
PSI_server->start_rwlock_rdwait(locker, src_file, src_line); PSI_server->start_rwlock_rdwait(locker, src_file, src_line);
} }
#endif #endif
result= rw_pr_rdlock(&that->m_prlock); result= rw_pr_rdlock(&that->m_prlock);
#ifdef HAVE_PSI_INTERFACE #ifdef HAVE_PSI_INTERFACE
if (likely(locker != NULL)) if (likely(locker != NULL))
PSI_server->end_rwlock_rdwait(locker, result); PSI_server->end_rwlock_rdwait(locker, result);
#endif #endif
skipping to change at line 827 skipping to change at line 804
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_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 #ifdef HAVE_PSI_INTERFACE
struct PSI_rwlock_locker *locker= NULL; struct PSI_rwlock_locker *locker= NULL;
PSI_rwlock_locker_state state;
if (likely(PSI_server && that->m_psi)) if (likely(PSI_server && that->m_psi))
{ {
locker= PSI_server->get_thread_rwlock_locker(that->m_psi, locker= PSI_server->get_thread_rwlock_locker(&state, that->m_psi,
PSI_RWLOCK_WRITELOCK); PSI_RWLOCK_WRITELOCK);
if (likely(locker != NULL)) if (likely(locker != NULL))
PSI_server->start_rwlock_wrwait(locker, src_file, src_line); PSI_server->start_rwlock_wrwait(locker, src_file, src_line);
} }
#endif #endif
result= rw_wrlock(&that->m_rwlock); result= rw_wrlock(&that->m_rwlock);
#ifdef HAVE_PSI_INTERFACE #ifdef HAVE_PSI_INTERFACE
if (likely(locker != NULL)) if (likely(locker != NULL))
PSI_server->end_rwlock_wrwait(locker, result); PSI_server->end_rwlock_wrwait(locker, result);
#endif #endif
skipping to change at line 854 skipping to change at line 832
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_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 #ifdef HAVE_PSI_INTERFACE
struct PSI_rwlock_locker *locker= NULL; struct PSI_rwlock_locker *locker= NULL;
PSI_rwlock_locker_state state;
if (likely(PSI_server && that->m_psi)) if (likely(PSI_server && that->m_psi))
{ {
locker= PSI_server->get_thread_rwlock_locker(that->m_psi, locker= PSI_server->get_thread_rwlock_locker(&state, that->m_psi,
PSI_RWLOCK_WRITELOCK); PSI_RWLOCK_WRITELOCK);
if (likely(locker != NULL)) if (likely(locker != NULL))
PSI_server->start_rwlock_wrwait(locker, src_file, src_line); PSI_server->start_rwlock_wrwait(locker, src_file, src_line);
} }
#endif #endif
result= rw_pr_wrlock(&that->m_prlock); result= rw_pr_wrlock(&that->m_prlock);
#ifdef HAVE_PSI_INTERFACE #ifdef HAVE_PSI_INTERFACE
if (likely(locker != NULL)) if (likely(locker != NULL))
PSI_server->end_rwlock_wrwait(locker, result); PSI_server->end_rwlock_wrwait(locker, result);
#endif #endif
skipping to change at line 881 skipping to change at line 860
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_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 #ifdef HAVE_PSI_INTERFACE
struct PSI_rwlock_locker *locker= NULL; struct PSI_rwlock_locker *locker= NULL;
PSI_rwlock_locker_state state;
if (likely(PSI_server && that->m_psi)) if (likely(PSI_server && that->m_psi))
{ {
locker= PSI_server->get_thread_rwlock_locker(that->m_psi, locker= PSI_server->get_thread_rwlock_locker(&state, that->m_psi,
PSI_RWLOCK_TRYREADLOCK); PSI_RWLOCK_TRYREADLOCK);
if (likely(locker != NULL)) if (likely(locker != NULL))
PSI_server->start_rwlock_rdwait(locker, src_file, src_line); PSI_server->start_rwlock_rdwait(locker, src_file, src_line);
} }
#endif #endif
result= rw_tryrdlock(&that->m_rwlock); result= rw_tryrdlock(&that->m_rwlock);
#ifdef HAVE_PSI_INTERFACE #ifdef HAVE_PSI_INTERFACE
if (likely(locker != NULL)) if (likely(locker != NULL))
PSI_server->end_rwlock_rdwait(locker, result); PSI_server->end_rwlock_rdwait(locker, result);
#endif #endif
return result; return result;
} }
#ifndef DISABLE_MYSQL_PRLOCK_H
static inline int inline_mysql_prlock_tryrdlock(
mysql_prlock_t *that
#ifdef HAVE_PSI_INTERFACE
, const char *src_file, uint src_line
#endif
)
{
int result;
#ifdef HAVE_PSI_INTERFACE
struct PSI_rwlock_locker *locker= NULL;
if (likely(PSI_server && that->m_psi))
{
locker= PSI_server->get_thread_rwlock_locker(that->m_psi,
PSI_RWLOCK_TRYREADLOCK);
if (likely(locker != NULL))
PSI_server->start_rwlock_rdwait(locker, src_file, src_line);
}
#endif
result= rw_pr_tryrdlock(&that->m_prlock);
#ifdef HAVE_PSI_INTERFACE
if (likely(locker != NULL))
PSI_server->end_rwlock_rdwait(locker, result);
#endif
return result;
}
#endif
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_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 #ifdef HAVE_PSI_INTERFACE
struct PSI_rwlock_locker *locker= NULL; struct PSI_rwlock_locker *locker= NULL;
PSI_rwlock_locker_state state;
if (likely(PSI_server && that->m_psi)) if (likely(PSI_server && that->m_psi))
{ {
locker= PSI_server->get_thread_rwlock_locker(that->m_psi, locker= PSI_server->get_thread_rwlock_locker(&state, that->m_psi,
PSI_RWLOCK_TRYWRITELOCK); PSI_RWLOCK_TRYWRITELOCK);
if (likely(locker != NULL)) if (likely(locker != NULL))
PSI_server->start_rwlock_wrwait(locker, src_file, src_line); PSI_server->start_rwlock_wrwait(locker, src_file, src_line);
} }
#endif #endif
result= rw_trywrlock(&that->m_rwlock); result= rw_trywrlock(&that->m_rwlock);
#ifdef HAVE_PSI_INTERFACE #ifdef HAVE_PSI_INTERFACE
if (likely(locker != NULL)) if (likely(locker != NULL))
PSI_server->end_rwlock_wrwait(locker, result); PSI_server->end_rwlock_wrwait(locker, result);
#endif #endif
return result; return result;
} }
#ifndef DISABLE_MYSQL_PRLOCK_H
static inline int inline_mysql_prlock_trywrlock(
mysql_prlock_t *that
#ifdef HAVE_PSI_INTERFACE
, const char *src_file, uint src_line
#endif
)
{
int result;
#ifdef HAVE_PSI_INTERFACE
struct PSI_rwlock_locker *locker= NULL;
if (likely(PSI_server && that->m_psi))
{
locker= PSI_server->get_thread_rwlock_locker(that->m_psi,
PSI_RWLOCK_TRYWRITELOCK);
if (likely(locker != NULL))
PSI_server->start_rwlock_wrwait(locker, src_file, src_line);
}
#endif
result= rw_pr_trywrlock(&that->m_prlock);
#ifdef HAVE_PSI_INTERFACE
if (likely(locker != NULL))
PSI_server->end_rwlock_wrwait(locker, result);
#endif
return result;
}
#endif
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_INTERFACE
struct PSI_thread *thread;
if (likely(PSI_server && that->m_psi)) if (likely(PSI_server && that->m_psi))
{ PSI_server->unlock_rwlock(that->m_psi);
thread= PSI_server->get_thread();
if (likely(thread != NULL))
PSI_server->unlock_rwlock(thread, 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_INTERFACE
struct PSI_thread *thread;
if (likely(PSI_server && that->m_psi)) if (likely(PSI_server && that->m_psi))
{ PSI_server->unlock_rwlock(that->m_psi);
thread= PSI_server->get_thread();
if (likely(thread != NULL))
PSI_server->unlock_rwlock(thread, 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 int inline_mysql_cond_init( static inline int inline_mysql_cond_init(
#ifdef HAVE_PSI_INTERFACE #ifdef HAVE_PSI_INTERFACE
PSI_cond_key key, PSI_cond_key key,
#endif #endif
skipping to change at line 1055 skipping to change at line 970
mysql_cond_t *that, mysql_cond_t *that,
mysql_mutex_t *mutex mysql_mutex_t *mutex
#ifdef HAVE_PSI_INTERFACE #ifdef HAVE_PSI_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 #ifdef HAVE_PSI_INTERFACE
struct PSI_cond_locker *locker= NULL; struct PSI_cond_locker *locker= NULL;
PSI_cond_locker_state state;
if (likely(PSI_server && that->m_psi)) if (likely(PSI_server && that->m_psi))
{ {
locker= PSI_server->get_thread_cond_locker(that->m_psi, mutex->m_psi, locker= PSI_server->get_thread_cond_locker(&state, that->m_psi, mutex-> m_psi,
PSI_COND_WAIT); PSI_COND_WAIT);
if (likely(locker != NULL)) if (likely(locker != NULL))
PSI_server->start_cond_wait(locker, src_file, src_line); PSI_server->start_cond_wait(locker, src_file, src_line);
} }
#endif #endif
result= pthread_cond_wait(&that->m_cond, &mutex->m_mutex); result= pthread_cond_wait(&that->m_cond, &mutex->m_mutex);
#ifdef HAVE_PSI_INTERFACE #ifdef HAVE_PSI_INTERFACE
if (likely(locker != NULL)) if (likely(locker != NULL))
PSI_server->end_cond_wait(locker, result); PSI_server->end_cond_wait(locker, result);
#endif #endif
skipping to change at line 1083 skipping to change at line 999
mysql_mutex_t *mutex, mysql_mutex_t *mutex,
struct timespec *abstime struct timespec *abstime
#ifdef HAVE_PSI_INTERFACE #ifdef HAVE_PSI_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 #ifdef HAVE_PSI_INTERFACE
struct PSI_cond_locker *locker= NULL; struct PSI_cond_locker *locker= NULL;
PSI_cond_locker_state state;
if (likely(PSI_server && that->m_psi)) if (likely(PSI_server && that->m_psi))
{ {
locker= PSI_server->get_thread_cond_locker(that->m_psi, mutex->m_psi, locker= PSI_server->get_thread_cond_locker(&state, that->m_psi, mutex-> m_psi,
PSI_COND_TIMEDWAIT); PSI_COND_TIMEDWAIT);
if (likely(locker != NULL)) if (likely(locker != NULL))
PSI_server->start_cond_wait(locker, src_file, src_line); PSI_server->start_cond_wait(locker, src_file, src_line);
} }
#endif #endif
result= pthread_cond_timedwait(&that->m_cond, &mutex->m_mutex, abstime); result= pthread_cond_timedwait(&that->m_cond, &mutex->m_mutex, abstime);
#ifdef HAVE_PSI_INTERFACE #ifdef HAVE_PSI_INTERFACE
if (likely(locker != NULL)) if (likely(locker != NULL))
PSI_server->end_cond_wait(locker, result); PSI_server->end_cond_wait(locker, result);
#endif #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_INTERFACE
struct PSI_thread *thread;
if (likely(PSI_server && that->m_psi)) if (likely(PSI_server && that->m_psi))
{ PSI_server->signal_cond(that->m_psi);
thread= PSI_server->get_thread();
if (likely(thread != NULL))
PSI_server->signal_cond(thread, 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_INTERFACE
struct PSI_thread *thread;
if (likely(PSI_server && that->m_psi)) if (likely(PSI_server && that->m_psi))
{ PSI_server->broadcast_cond(that->m_psi);
thread= PSI_server->get_thread();
if (likely(thread != NULL))
PSI_server->broadcast_cond(thread, 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 #ifdef HAVE_PSI_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)
 End of changes. 39 change blocks. 
130 lines changed or deleted 36 lines changed or added


 mysql_version.h   mysql_version.h 
skipping to change at line 12 skipping to change at line 12
This file is public domain and comes with NO WARRANTY of any kind */ This file is public domain and comes with NO WARRANTY of any kind */
/* Version numbers for protocol & mysqld */ /* Version numbers for protocol & mysqld */
#ifndef _mysql_version_h #ifndef _mysql_version_h
#define _mysql_version_h #define _mysql_version_h
#ifdef _CUSTOMCONFIG_ #ifdef _CUSTOMCONFIG_
#include <custom_conf.h> #include <custom_conf.h>
#else #else
#define PROTOCOL_VERSION 10 #define PROTOCOL_VERSION 10
#define MYSQL_SERVER_VERSION "5.5.5-m3" #define MYSQL_SERVER_VERSION "5.5.8"
#define MYSQL_BASE_VERSION "mysqld-5.5" #define MYSQL_BASE_VERSION "mysqld-5.5"
#define MYSQL_SERVER_SUFFIX_DEF "" #define MYSQL_SERVER_SUFFIX_DEF ""
#define FRM_VER 6 #define FRM_VER 6
#define MYSQL_VERSION_ID 50505 #define MYSQL_VERSION_ID 50508
#define MYSQL_PORT 3306 #define MYSQL_PORT 3306
#define MYSQL_PORT_DEFAULT 0 #define MYSQL_PORT_DEFAULT 0
#define MYSQL_UNIX_ADDR "/tmp/mysql.sock" #define MYSQL_UNIX_ADDR "/tmp/mysql.sock"
#define MYSQL_CONFIG_NAME "my" #define MYSQL_CONFIG_NAME "my"
#define MYSQL_COMPILATION_COMMENT "Source distribution" #define MYSQL_COMPILATION_COMMENT "Source distribution"
/* mysqld compile time options */ /* mysqld compile time options */
#endif /* _CUSTOMCONFIG_ */ #endif /* _CUSTOMCONFIG_ */
#ifndef LICENSE #ifndef LICENSE
 End of changes. 2 change blocks. 
2 lines changed or deleted 2 lines changed or added


 mysqld_ername.h   mysqld_ername.h 
skipping to change at line 627 skipping to change at line 627
{ "ER_XA_RBDEADLOCK", 1614, "XA_RBDEADLOCK: Transaction branch was rolled b ack: deadlock was detected" }, { "ER_XA_RBDEADLOCK", 1614, "XA_RBDEADLOCK: Transaction branch was rolled b ack: deadlock was detected" },
{ "ER_NEED_REPREPARE", 1615, "Prepared statement needs to be re-prepared" } , { "ER_NEED_REPREPARE", 1615, "Prepared statement needs to be re-prepared" } ,
{ "ER_DELAYED_NOT_SUPPORTED", 1616, "DELAYED option not supported for table \'%-.192s\'" }, { "ER_DELAYED_NOT_SUPPORTED", 1616, "DELAYED option not supported for table \'%-.192s\'" },
{ "WARN_NO_MASTER_INFO", 1617, "The master info structure does not exist" } , { "WARN_NO_MASTER_INFO", 1617, "The master info structure does not exist" } ,
{ "WARN_OPTION_IGNORED", 1618, "<%-.64s> option ignored" }, { "WARN_OPTION_IGNORED", 1618, "<%-.64s> option ignored" },
{ "WARN_PLUGIN_DELETE_BUILTIN", 1619, "Built-in plugins cannot be deleted" }, { "WARN_PLUGIN_DELETE_BUILTIN", 1619, "Built-in plugins cannot be deleted" },
{ "WARN_PLUGIN_BUSY", 1620, "Plugin is busy and will be uninstalled on shut down" }, { "WARN_PLUGIN_BUSY", 1620, "Plugin is busy and will be uninstalled on shut down" },
{ "ER_VARIABLE_IS_READONLY", 1621, "%s variable \'%s\' is read-only. Use SE T %s to assign the value" }, { "ER_VARIABLE_IS_READONLY", 1621, "%s variable \'%s\' is read-only. Use SE T %s to assign the value" },
{ "ER_WARN_ENGINE_TRANSACTION_ROLLBACK", 1622, "Storage engine %s does not support rollback for this statement. Transaction rolled back and must be re started" }, { "ER_WARN_ENGINE_TRANSACTION_ROLLBACK", 1622, "Storage engine %s does not support rollback for this statement. Transaction rolled back and must be re started" },
{ "ER_SLAVE_HEARTBEAT_FAILURE", 1623, "Unexpected master\'s heartbeat data: %s" }, { "ER_SLAVE_HEARTBEAT_FAILURE", 1623, "Unexpected master\'s heartbeat data: %s" },
{ "ER_SLAVE_HEARTBEAT_VALUE_OUT_OF_RANGE", 1624, "The requested value for t he heartbeat period %s %s" }, { "ER_SLAVE_HEARTBEAT_VALUE_OUT_OF_RANGE", 1624, "The requested value for t he heartbeat period is either negative or exceeds the maximum allowed (%s s econds)." },
{ "ER_NDB_REPLICATION_SCHEMA_ERROR", 1625, "Bad schema for mysql.ndb_replic ation table. Message: %-.64s" }, { "ER_NDB_REPLICATION_SCHEMA_ERROR", 1625, "Bad schema for mysql.ndb_replic ation table. Message: %-.64s" },
{ "ER_CONFLICT_FN_PARSE_ERROR", 1626, "Error in parsing conflict function. Message: %-.64s" }, { "ER_CONFLICT_FN_PARSE_ERROR", 1626, "Error in parsing conflict function. Message: %-.64s" },
{ "ER_EXCEPTIONS_WRITE_ERROR", 1627, "Write to exceptions table failed. Mes sage: %-.128s\"" }, { "ER_EXCEPTIONS_WRITE_ERROR", 1627, "Write to exceptions table failed. Mes sage: %-.128s\"" },
{ "ER_TOO_LONG_TABLE_COMMENT", 1628, "Comment for table \'%-.64s\' is too l ong (max = %lu)" }, { "ER_TOO_LONG_TABLE_COMMENT", 1628, "Comment for table \'%-.64s\' is too l ong (max = %lu)" },
{ "ER_TOO_LONG_FIELD_COMMENT", 1629, "Comment for field \'%-.64s\' is too l ong (max = %lu)" }, { "ER_TOO_LONG_FIELD_COMMENT", 1629, "Comment for field \'%-.64s\' is too l ong (max = %lu)" },
{ "ER_FUNC_INEXISTENT_NAME_COLLISION", 1630, "FUNCTION %s does not exist. C heck the \'Function Name Parsing and Resolution\' section in the Reference Manual" }, { "ER_FUNC_INEXISTENT_NAME_COLLISION", 1630, "FUNCTION %s does not exist. C heck the \'Function Name Parsing and Resolution\' section in the Reference Manual" },
{ "ER_DATABASE_NAME", 1631, "Database" }, { "ER_DATABASE_NAME", 1631, "Database" },
{ "ER_TABLE_NAME", 1632, "Table" }, { "ER_TABLE_NAME", 1632, "Table" },
{ "ER_PARTITION_NAME", 1633, "Partition" }, { "ER_PARTITION_NAME", 1633, "Partition" },
{ "ER_SUBPARTITION_NAME", 1634, "Subpartition" }, { "ER_SUBPARTITION_NAME", 1634, "Subpartition" },
skipping to change at line 700 skipping to change at line 700
{ "ER_SPATIAL_MUST_HAVE_GEOM_COL", 1687, "A SPATIAL index may only contain a geometrical type column" }, { "ER_SPATIAL_MUST_HAVE_GEOM_COL", 1687, "A SPATIAL index may only contain a geometrical type column" },
{ "ER_TOO_LONG_INDEX_COMMENT", 1688, "Comment for index \'%-.64s\' is too l ong (max = %lu)" }, { "ER_TOO_LONG_INDEX_COMMENT", 1688, "Comment for index \'%-.64s\' is too l ong (max = %lu)" },
{ "ER_LOCK_ABORTED", 1689, "Wait on a lock was aborted due to a pending exc lusive lock" }, { "ER_LOCK_ABORTED", 1689, "Wait on a lock was aborted due to a pending exc lusive lock" },
{ "ER_DATA_OUT_OF_RANGE", 1690, "%s value is out of range in \'%s\'" }, { "ER_DATA_OUT_OF_RANGE", 1690, "%s value is out of range in \'%s\'" },
{ "ER_WRONG_SPVAR_TYPE_IN_LIMIT", 1691, "A variable of a non-integer type i n LIMIT clause" }, { "ER_WRONG_SPVAR_TYPE_IN_LIMIT", 1691, "A variable of a non-integer type i n LIMIT clause" },
{ "ER_BINLOG_UNSAFE_MULTIPLE_ENGINES_AND_SELF_LOGGING_ENGINE", 1692, "Mixin g self-logging and non-self-logging engines in a statement is unsafe." }, { "ER_BINLOG_UNSAFE_MULTIPLE_ENGINES_AND_SELF_LOGGING_ENGINE", 1692, "Mixin g self-logging and non-self-logging engines in a statement is unsafe." },
{ "ER_BINLOG_UNSAFE_MIXED_STATEMENT", 1693, "Statement accesses nontransact ional table as well as transactional or temporary table, and writes to any of them." }, { "ER_BINLOG_UNSAFE_MIXED_STATEMENT", 1693, "Statement accesses nontransact ional table as well as transactional or temporary table, and writes to any of them." },
{ "ER_INSIDE_TRANSACTION_PREVENTS_SWITCH_SQL_LOG_BIN", 1694, "Cannot modify @@session.sql_log_bin inside a transaction" }, { "ER_INSIDE_TRANSACTION_PREVENTS_SWITCH_SQL_LOG_BIN", 1694, "Cannot modify @@session.sql_log_bin inside a transaction" },
{ "ER_STORED_FUNCTION_PREVENTS_SWITCH_SQL_LOG_BIN", 1695, "Cannot change th e sql_log_bin inside a stored function or trigger" }, { "ER_STORED_FUNCTION_PREVENTS_SWITCH_SQL_LOG_BIN", 1695, "Cannot change th e sql_log_bin inside a stored function or trigger" },
{ "ER_FAILED_READ_FROM_PAR_FILE", 1696, "Failed to read from the .par file" }, { "ER_FAILED_READ_FROM_PAR_FILE", 1696, "Failed to read from the .par file" },
{ "ER_VALUES_IS_NOT_INT_TYPE_ERROR", 1697, "VALUES value for partition \'%-
.64s\' must have type INT" },
{ "ER_ACCESS_DENIED_NO_PASSWORD_ERROR", 1698, "Access denied for user \'%-.
48s\'@\'%-.64s\'" },
{ "ER_SET_PASSWORD_AUTH_PLUGIN", 1699, "SET PASSWORD has no significance fo
r users authenticating via plugins" },
{ "ER_GRANT_PLUGIN_USER_EXISTS", 1700, "GRANT with IDENTIFIED WITH is illeg
al because the user %-.*s already exists" },
{ "ER_TRUNCATE_ILLEGAL_FK", 1701, "Cannot truncate a table referenced in a
foreign key constraint (%.192s)" },
{ "ER_PLUGIN_IS_PERMANENT", 1702, "Plugin \'%s\' is force_plus_permanent an
d can not be unloaded" },
{ "ER_SLAVE_HEARTBEAT_VALUE_OUT_OF_RANGE_MIN", 1703, "The requested value f
or the heartbeat period is less than 1 millisecond. The value is reset to 0
, meaning that heartbeating will effectively be disabled." },
{ "ER_SLAVE_HEARTBEAT_VALUE_OUT_OF_RANGE_MAX", 1704, "The requested value f
or the heartbeat period exceeds the value of `slave_net_timeout\' seconds.
A sensible value for the period should be less than the timeout." },
 End of changes. 2 change blocks. 
1 lines changed or deleted 1 lines changed or added


 mysqld_error.h   mysqld_error.h 
skipping to change at line 701 skipping to change at line 701
#define ER_SPATIAL_MUST_HAVE_GEOM_COL 1687 #define ER_SPATIAL_MUST_HAVE_GEOM_COL 1687
#define ER_TOO_LONG_INDEX_COMMENT 1688 #define ER_TOO_LONG_INDEX_COMMENT 1688
#define ER_LOCK_ABORTED 1689 #define ER_LOCK_ABORTED 1689
#define ER_DATA_OUT_OF_RANGE 1690 #define ER_DATA_OUT_OF_RANGE 1690
#define ER_WRONG_SPVAR_TYPE_IN_LIMIT 1691 #define ER_WRONG_SPVAR_TYPE_IN_LIMIT 1691
#define ER_BINLOG_UNSAFE_MULTIPLE_ENGINES_AND_SELF_LOGGING_ENGINE 1692 #define ER_BINLOG_UNSAFE_MULTIPLE_ENGINES_AND_SELF_LOGGING_ENGINE 1692
#define ER_BINLOG_UNSAFE_MIXED_STATEMENT 1693 #define ER_BINLOG_UNSAFE_MIXED_STATEMENT 1693
#define ER_INSIDE_TRANSACTION_PREVENTS_SWITCH_SQL_LOG_BIN 1694 #define ER_INSIDE_TRANSACTION_PREVENTS_SWITCH_SQL_LOG_BIN 1694
#define ER_STORED_FUNCTION_PREVENTS_SWITCH_SQL_LOG_BIN 1695 #define ER_STORED_FUNCTION_PREVENTS_SWITCH_SQL_LOG_BIN 1695
#define ER_FAILED_READ_FROM_PAR_FILE 1696 #define ER_FAILED_READ_FROM_PAR_FILE 1696
#define ER_ERROR_LAST 1696 #define ER_VALUES_IS_NOT_INT_TYPE_ERROR 1697
#define ER_ACCESS_DENIED_NO_PASSWORD_ERROR 1698
#define ER_SET_PASSWORD_AUTH_PLUGIN 1699
#define ER_GRANT_PLUGIN_USER_EXISTS 1700
#define ER_TRUNCATE_ILLEGAL_FK 1701
#define ER_PLUGIN_IS_PERMANENT 1702
#define ER_SLAVE_HEARTBEAT_VALUE_OUT_OF_RANGE_MIN 1703
#define ER_SLAVE_HEARTBEAT_VALUE_OUT_OF_RANGE_MAX 1704
#define ER_ERROR_LAST 1704
 End of changes. 1 change blocks. 
0 lines changed or deleted 0 lines changed or added


 plugin.h   plugin.h 
skipping to change at line 74 skipping to change at line 74
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 0x0101 #define MYSQL_PLUGIN_INTERFACE_VERSION 0x0102
/* /*
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_MAX_PLUGIN_TYPE_NUM 7 /* The number of plugin types */ #define MYSQL_AUTHENTICATION_PLUGIN 7 /* The authentication plugin type *
/
#define MYSQL_MAX_PLUGIN_TYPE_NUM 8 /* 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 519 skipping to change at line 520
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {
#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);
int thd_tx_isolation(const MYSQL_THD thd); int thd_tx_isolation(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
 End of changes. 3 change blocks. 
2 lines changed or deleted 5 lines changed or added


 psi.h   psi.h 
/* Copyright (C) 2008-2010 Sun Microsystems, Inc /* Copyright (c) 2008, 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.
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,
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 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 #ifndef _global_h
/* /*
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
skipping to change at line 425 skipping to change at line 425
The name of the file instrument to register. The name of the file instrument to register.
*/ */
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.
This structure provide temporary storage to a mutex 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_mutex_locker_v1_t
*/
struct PSI_mutex_locker_state_v1
{
/** Internal state. */
uint m_flags;
/** Current mutex. */
struct PSI_mutex *m_mutex;
/** Current thread. */
struct PSI_thread *m_thread;
/** Timer start. */
ulonglong m_timer_start;
/** Timer function. */
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. */
void *m_wait;
};
/**
State data storage for @c get_thread_rwlock_locker_v1_t.
This structure provide temporary storage to a rwlock 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_rwlock_locker_v1_t
*/
struct PSI_rwlock_locker_state_v1
{
/** Internal state. */
uint m_flags;
/** Current rwlock. */
struct PSI_rwlock *m_rwlock;
/** Current thread. */
struct PSI_thread *m_thread;
/** Timer start. */
ulonglong m_timer_start;
/** Timer function. */
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. */
void *m_wait;
};
/**
State data storage for @c get_thread_cond_locker_v1_t.
This structure provide temporary storage to a condition 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_cond_locker_v1_t
*/
struct PSI_cond_locker_state_v1
{
/** Internal state. */
uint m_flags;
/** Current condition. */
struct PSI_cond *m_cond;
/** Current mutex. */
struct PSI_mutex *m_mutex;
/** Current thread. */
struct PSI_thread *m_thread;
/** Timer start. */
ulonglong m_timer_start;
/** Timer function. */
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. */
void *m_wait;
};
/**
State data storage for @c get_thread_file_name_locker_v1_t.
This structure provide temporary storage to a file 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_file_name_locker_v1_t
@sa get_thread_file_stream_locker_v1_t
@sa get_thread_file_descriptor_locker_v1_t
*/
struct PSI_file_locker_state_v1
{
/** Internal state. */
uint m_flags;
/** Current file. */
struct PSI_file *m_file;
/** 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_file_operation m_operation;
/** Source file. */
const char* m_src_file;
/** Source line number. */
int m_src_line;
/** Internal data. */
void *m_wait;
};
/**
State data storage for @c get_thread_table_locker_v1_t.
This structure provide temporary storage to a table 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_table_locker_v1_t
*/
struct PSI_table_locker_state_v1
{
/** Internal state. */
uint m_flags;
/** Current table handle. */
struct PSI_table *m_table;
/** Current table share. */
struct PSI_table_share *m_table_share;
/** Instrumentation class. */
void *m_class;
/** Current thread. */
struct PSI_thread *m_thread;
/** Timer start. */
ulonglong m_timer_start;
/** Timer function. */
ulonglong (*m_timer)(void);
/* Current operation (waiting for WL#4895). */
/* enum PSI_table_operation m_operation; */
/** Current table io index. */
uint m_index;
/** Current table lock index. */
uint m_lock_index;
/** Source file. */
const char* m_src_file;
/** Source line number. */
int m_src_line;
/** Internal data. */
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. */
/** /**
Mutex registration API. Mutex 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 mutex info to register @param info an array of mutex info to register
@param count the size of the info array @param count the size of the info array
*/ */
typedef void (*register_mutex_v1_t) typedef void (*register_mutex_v1_t)
(const char *category, struct PSI_mutex_info_v1 *info, int count); (const char *category, struct PSI_mutex_info_v1 *info, int count);
skipping to change at line 622 skipping to change at line 791
typedef void (*set_thread_v1_t)(struct PSI_thread *thread); typedef void (*set_thread_v1_t)(struct PSI_thread *thread);
/** Delete the current thread instrumentation. */ /** Delete the current thread instrumentation. */
typedef void (*delete_current_thread_v1_t)(void); typedef void (*delete_current_thread_v1_t)(void);
/** Delete a thread instrumentation. */ /** Delete a thread instrumentation. */
typedef void (*delete_thread_v1_t)(struct PSI_thread *thread); typedef void (*delete_thread_v1_t)(struct PSI_thread *thread);
/** /**
Get a mutex instrumentation locker. Get a mutex instrumentation locker.
@param state data storage for the locker
@param mutex the instrumented mutex to lock @param mutex the instrumented mutex to lock
@return a mutex locker, or NULL @return a mutex locker, or NULL
*/ */
typedef struct PSI_mutex_locker* (*get_thread_mutex_locker_v1_t) typedef struct PSI_mutex_locker* (*get_thread_mutex_locker_v1_t)
(struct PSI_mutex *mutex, enum PSI_mutex_operation op); (struct PSI_mutex_locker_state_v1 *state,
struct PSI_mutex *mutex,
enum PSI_mutex_operation op);
/** /**
Get a rwlock instrumentation locker. Get a rwlock instrumentation locker.
@param state data storage for the locker
@param rwlock the instrumented rwlock to lock @param rwlock the instrumented rwlock to lock
@return a rwlock locker, or NULL @return a rwlock locker, or NULL
*/ */
typedef struct PSI_rwlock_locker* (*get_thread_rwlock_locker_v1_t) typedef struct PSI_rwlock_locker* (*get_thread_rwlock_locker_v1_t)
(struct PSI_rwlock *rwlock, enum PSI_rwlock_operation op); (struct PSI_rwlock_locker_state_v1 *state,
struct PSI_rwlock *rwlock,
enum PSI_rwlock_operation op);
/** /**
Get a cond instrumentation locker. Get a cond instrumentation locker.
@param state data storage for the locker
@param cond the instrumented condition to wait on @param cond the instrumented condition to wait on
@param mutex the instrumented mutex associated with the condition @param mutex the instrumented mutex associated with the condition
@return a condition locker, or NULL @return a condition locker, or NULL
*/ */
typedef struct PSI_cond_locker* (*get_thread_cond_locker_v1_t) typedef struct PSI_cond_locker* (*get_thread_cond_locker_v1_t)
(struct PSI_cond *cond, struct PSI_mutex *mutex, (struct PSI_cond_locker_state_v1 *state,
struct PSI_cond *cond, struct PSI_mutex *mutex,
enum PSI_cond_operation op); enum PSI_cond_operation op);
/** /**
Get a table instrumentation locker. Get a table instrumentation locker.
@param state data storage for the locker
@param table the instrumented table to lock @param table the instrumented table to lock
@return a table locker, or NULL @return a table locker, or NULL
*/ */
typedef struct PSI_table_locker* (*get_thread_table_locker_v1_t) typedef struct PSI_table_locker* (*get_thread_table_locker_v1_t)
(struct PSI_table *table); (struct PSI_table_locker_state_v1 *state,
struct PSI_table *table);
/** /**
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 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
*/ */
typedef struct PSI_file_locker* (*get_thread_file_name_locker_v1_t) typedef struct PSI_file_locker* (*get_thread_file_name_locker_v1_t)
(PSI_file_key key, enum PSI_file_operation op, const char *name, (struct PSI_file_locker_state_v1 *state,
PSI_file_key key, enum PSI_file_operation op, const char *name,
const void *identity); const void *identity);
/** /**
Get a file stream instrumentation locker. Get a file stream instrumentation locker.
@param state data storage for the locker
@param file the file stream to access @param file the file stream to access
@param op the operation to perform @param op the operation to perform
@return a file locker, or NULL @return a file locker, or NULL
*/ */
typedef struct PSI_file_locker* (*get_thread_file_stream_locker_v1_t) typedef struct PSI_file_locker* (*get_thread_file_stream_locker_v1_t)
(struct PSI_file *file, enum PSI_file_operation op); (struct PSI_file_locker_state_v1 *state,
struct PSI_file *file, enum PSI_file_operation op);
/** /**
Get a file instrumentation locker. Get a file instrumentation locker.
@param state data storage for the locker
@param file the file descriptor to access @param file the file descriptor to access
@param op the operation to perform @param op the operation to perform
@return a file locker, or NULL @return a file locker, or NULL
*/ */
typedef struct PSI_file_locker* (*get_thread_file_descriptor_locker_v1_t) typedef struct PSI_file_locker* (*get_thread_file_descriptor_locker_v1_t)
(File file, enum PSI_file_operation op); (struct PSI_file_locker_state_v1 *state,
File file, enum PSI_file_operation op);
/** /**
Record a mutex instrumentation unlock event. Record a mutex instrumentation unlock event.
@param thread the running thread instrumentation
@param mutex the mutex instrumentation @param mutex the mutex instrumentation
*/ */
typedef void (*unlock_mutex_v1_t) typedef void (*unlock_mutex_v1_t)
(struct PSI_thread *thread, struct PSI_mutex *mutex); (struct PSI_mutex *mutex);
/** /**
Record a rwlock instrumentation unlock event. Record a rwlock instrumentation unlock event.
@param thread the running thread instrumentation
@param rwlock the rwlock instrumentation @param rwlock the rwlock instrumentation
*/ */
typedef void (*unlock_rwlock_v1_t) typedef void (*unlock_rwlock_v1_t)
(struct PSI_thread *thread, struct PSI_rwlock *rwlock); (struct PSI_rwlock *rwlock);
/** /**
Record a condition instrumentation signal event. Record a condition instrumentation signal event.
@param thread the running thread instrumentation
@param cond the cond instrumentation @param cond the cond instrumentation
*/ */
typedef void (*signal_cond_v1_t) typedef void (*signal_cond_v1_t)
(struct PSI_thread *thread, struct PSI_cond *cond); (struct PSI_cond *cond);
/** /**
Record a condition instrumentation broadcast event. Record a condition instrumentation broadcast event.
@param thread the running thread instrumentation
@param cond the cond instrumentation @param cond the cond instrumentation
*/ */
typedef void (*broadcast_cond_v1_t) typedef void (*broadcast_cond_v1_t)
(struct PSI_thread *thread, struct PSI_cond *cond); (struct PSI_cond *cond);
/** /**
Record a mutex instrumentation wait start event. Record a mutex instrumentation wait start event.
@param locker a thread locker for the running thread @param locker a thread locker for the running thread
*/ */
typedef void (*start_mutex_wait_v1_t) typedef void (*start_mutex_wait_v1_t)
(struct PSI_mutex_locker *locker, const char *src_file, uint src_line); (struct PSI_mutex_locker *locker, const char *src_file, uint src_line);
/** /**
Record a mutex instrumentation wait end event. Record a mutex instrumentation wait end event.
skipping to change at line 1016 skipping to change at line 1197
int placeholder; int placeholder;
}; };
/** Placeholder */ /** Placeholder */
struct PSI_file_info_v2 struct PSI_file_info_v2
{ {
/** Placeholder */ /** Placeholder */
int placeholder; int placeholder;
}; };
struct PSI_mutex_locker_state_v2
{
/** Placeholder */
int placeholder;
};
struct PSI_rwlock_locker_state_v2
{
/** Placeholder */
int placeholder;
};
struct PSI_cond_locker_state_v2
{
/** Placeholder */
int placeholder;
};
struct PSI_file_locker_state_v2
{
/** Placeholder */
int placeholder;
};
struct PSI_table_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 1059 skipping to change at line 1270
*/ */
/* 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_mutex_locker_state_v1 PSI_mutex_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_file_locker_state_v1 PSI_file_locker_state;
typedef struct PSI_table_locker_state_v1 PSI_table_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_mutex_locker_state_v2 PSI_mutex_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_file_locker_state_v2 PSI_file_locker_state;
typedef struct PSI_table_locker_state_v2 PSI_table_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
 End of changes. 28 change blocks. 
19 lines changed or deleted 239 lines changed or added


 psi_abi_v1.h   psi_abi_v1.h 
/* Copyright (C) 2008-2009 Sun Microsystems, Inc /* Copyright (c) 2008, 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.
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,
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 51 Franklin Street, Suite 500, Boston, MA 02110-1335 USA */
*/
/** /**
@file mysql/psi/psi_abi_v1.h @file mysql/psi/psi_abi_v1.h
ABI check for mysql/psi/psi.h, when using PSI_VERSION_1. ABI check for mysql/psi/psi.h, when using PSI_VERSION_1.
This file is only used to automate detection of changes between versions. This file is only used to automate detection of changes between versions.
Do not include this file, include mysql/psi/psi.h instead. Do not include this file, include mysql/psi/psi.h instead.
*/ */
#define USE_PSI_1 #define USE_PSI_1
#define HAVE_PSI_INTERFACE #define HAVE_PSI_INTERFACE
#define _global_h #define _global_h
 End of changes. 2 change blocks. 
4 lines changed or deleted 3 lines changed or added


 psi_abi_v2.h   psi_abi_v2.h 
/* Copyright (C) 2008-2009 Sun Microsystems, Inc /* Copyright (c) 2008, 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.
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,
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 51 Franklin Street, Suite 500, Boston, MA 02110-1335 USA */
*/
/** /**
@file mysql/psi/psi_abi_v1.h @file mysql/psi/psi_abi_v1.h
ABI check for mysql/psi/psi.h, when using PSI_VERSION_2. ABI check for mysql/psi/psi.h, when using PSI_VERSION_2.
This file is only used to automate detection of changes between versions. This file is only used to automate detection of changes between versions.
Do not include this file, include mysql/psi/psi.h instead. Do not include this file, include mysql/psi/psi.h instead.
*/ */
#define USE_PSI_2 #define USE_PSI_2
#define HAVE_PSI_INTERFACE #define HAVE_PSI_INTERFACE
#define _global_h #define _global_h
 End of changes. 2 change blocks. 
4 lines changed or deleted 3 lines changed or added


 service_my_snprintf.h   service_my_snprintf.h 
skipping to change at line 56 skipping to change at line 56
'0' has the standard zero-padding semantics; '0' has the standard zero-padding semantics;
'-' is parsed, but silently ignored; '-' is parsed, but silently ignored;
'`' (backtick) is only supported for strings (%s) and means that the '`' (backtick) is only supported for strings (%s) and means that the
string will be quoted according to MySQL identifier quoting rules. string will be quoted according to MySQL identifier quoting rules.
Both <width> and <precision> can be specified as numbers or '*'. Both <width> and <precision> can be specified as numbers or '*'.
<length modifier> can be 'l', 'll', or 'z'. <length modifier> can be 'l', 'll', or 'z'.
Supported formats are 's' (null pointer is accepted, printed as Supported formats are 's' (null pointer is accepted, printed as
"(null)"), 'b' (extension, see below), 'c', 'd', 'u', 'x', 'o', "(null)"), 'b' (extension, see below), 'c', 'd', 'i', 'u', 'x', 'o',
'X', 'p' (works as 0x%x). 'X', 'p' (works as 0x%x).
Standard syntax for positional arguments $n is supported. Standard syntax for positional arguments $n is supported.
Extensions: Extensions:
Flag '`' (backtick): see above. Flag '`' (backtick): see above.
Format 'b': binary buffer, prints exactly <precision> bytes from the Format 'b': binary buffer, prints exactly <precision> bytes from the
argument, without stopping at '\0'. argument, without stopping at '\0'.
*/ */
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {
#endif #endif
#ifndef MYSQL_ABI_CHECK
#include <stdarg.h> #include <stdarg.h>
#include <stdlib.h> #include <stdlib.h>
#endif
extern struct my_snprintf_service_st { extern struct my_snprintf_service_st {
size_t (*my_snprintf_type)(char*, size_t, const char*, ...); size_t (*my_snprintf_type)(char*, size_t, const char*, ...);
size_t (*my_vsnprintf_type)(char *, size_t, const char*, va_list); size_t (*my_vsnprintf_type)(char *, size_t, const char*, va_list);
} *my_snprintf_service; } *my_snprintf_service;
#ifdef MYSQL_DYNAMIC_PLUGIN #ifdef MYSQL_DYNAMIC_PLUGIN
#define my_vsnprintf my_snprintf_service->my_vsnprintf_type #define my_vsnprintf my_snprintf_service->my_vsnprintf_type
#define my_snprintf my_snprintf_service->my_snprintf_type #define my_snprintf my_snprintf_service->my_snprintf_type
 End of changes. 3 change blocks. 
1 lines changed or deleted 4 lines changed or added


 service_thd_alloc.h   service_thd_alloc.h 
skipping to change at line 30 skipping to change at line 30
memory pool. The memory allocated there will be automatically freed at th e memory pool. The memory allocated there will be automatically freed at th e
end of the statement, don't use it for allocations that should live longe r end of the statement, don't use it for allocations that should live longe r
than that. For short living allocations this is more efficient than than that. For short living allocations this is more efficient than
using my_malloc and friends, and automatic "garbage collection" allows no t using my_malloc and friends, and automatic "garbage collection" allows no t
to think about memory leaks. to think about memory leaks.
The pool is best for small to medium objects, don't use it for large The pool is best for small to medium objects, don't use it for large
allocations - they are better served with my_malloc. allocations - they are better served with my_malloc.
*/ */
#ifndef MYSQL_ABI_CHECK
#include <stdlib.h> #include <stdlib.h>
#endif
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {
#endif #endif
struct st_mysql_lex_string struct st_mysql_lex_string
{ {
char *str; char *str;
size_t length; size_t length;
}; };
 End of changes. 2 change blocks. 
0 lines changed or deleted 2 lines changed or added


 services.h   services.h 
skipping to change at line 23 skipping to change at line 23
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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 US A */ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 US A */
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {
#endif #endif
#include <mysql/service_my_snprintf.h> #include <mysql/service_my_snprintf.h>
#include <mysql/service_thd_alloc.h> #include <mysql/service_thd_alloc.h>
#include <mysql/service_thd_wait.h>
#include <mysql/service_thread_scheduler.h>
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif #endif
#define MYSQL_SERVICES_INCLUDED #define MYSQL_SERVICES_INCLUDED
#endif #endif
 End of changes. 1 change blocks. 
0 lines changed or deleted 2 lines changed or added


 sql_common.h   sql_common.h 
skipping to change at line 19 skipping to change at line 19
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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 US A */ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 US A */
#define SQL_COMMON_INCLUDED
#ifdef __cplusplus
extern "C" {
#endif
#include <mysql.h>
extern const char *unknown_sqlstate; extern const char *unknown_sqlstate;
extern const char *cant_connect_sqlstate; extern const char *cant_connect_sqlstate;
extern const char *not_error_sqlstate; extern const char *not_error_sqlstate;
#ifdef __cplusplus struct st_mysql_options_extention {
extern "C" { char *plugin_dir;
char *default_auth;
};
typedef struct st_mysql_methods
{
my_bool (*read_query_result)(MYSQL *mysql);
my_bool (*advanced_command)(MYSQL *mysql,
enum enum_server_command command,
const unsigned char *header,
unsigned long header_length,
const unsigned char *arg,
unsigned long arg_length,
my_bool skip_check,
MYSQL_STMT *stmt);
MYSQL_DATA *(*read_rows)(MYSQL *mysql,MYSQL_FIELD *mysql_fields,
unsigned int fields);
MYSQL_RES * (*use_result)(MYSQL *mysql);
void (*fetch_lengths)(unsigned long *to,
MYSQL_ROW column, unsigned int field_count);
void (*flush_use_result)(MYSQL *mysql, my_bool flush_all_results);
int (*read_change_user_result)(MYSQL *mysql);
#if !defined(MYSQL_SERVER) || defined(EMBEDDED_LIBRARY)
MYSQL_FIELD * (*list_fields)(MYSQL *mysql);
my_bool (*read_prepare_result)(MYSQL *mysql, MYSQL_STMT *stmt);
int (*stmt_execute)(MYSQL_STMT *stmt);
int (*read_binary_rows)(MYSQL_STMT *stmt);
int (*unbuffered_fetch)(MYSQL *mysql, char **row);
void (*free_embedded_thd)(MYSQL *mysql);
const char *(*read_statistics)(MYSQL *mysql);
my_bool (*next_result)(MYSQL *mysql);
int (*read_rows_from_cursor)(MYSQL_STMT *stmt);
#endif #endif
} MYSQL_METHODS;
#define simple_command(mysql, command, arg, length, skip_check) \
(*(mysql)->methods->advanced_command)(mysql, command, 0, \
0, arg, length, skip_check, NULL)
#define stmt_command(mysql, command, arg, length, stmt) \
(*(mysql)->methods->advanced_command)(mysql, command, 0, \
0, arg, length, 1, stmt)
extern CHARSET_INFO *default_client_charset_info; extern CHARSET_INFO *default_client_charset_info;
MYSQL_FIELD *unpack_fields(MYSQL_DATA *data,MEM_ROOT *alloc,uint fields, MYSQL_FIELD *unpack_fields(MYSQL_DATA *data,MEM_ROOT *alloc,uint fields,
my_bool default_value, uint server_capabilities); my_bool default_value, uint server_capabilities);
void free_rows(MYSQL_DATA *cur); void free_rows(MYSQL_DATA *cur);
void free_old_query(MYSQL *mysql); void free_old_query(MYSQL *mysql);
void end_server(MYSQL *mysql); void end_server(MYSQL *mysql);
my_bool mysql_reconnect(MYSQL *mysql); my_bool mysql_reconnect(MYSQL *mysql);
void mysql_read_default_options(struct st_mysql_options *options, void mysql_read_default_options(struct st_mysql_options *options,
const char *filename,const char *group); const char *filename,const char *group);
skipping to change at line 47 skipping to change at line 94
cli_advanced_command(MYSQL *mysql, enum enum_server_command command, cli_advanced_command(MYSQL *mysql, enum enum_server_command command,
const unsigned char *header, ulong header_length, const unsigned char *header, ulong header_length,
const unsigned char *arg, ulong arg_length, const unsigned char *arg, ulong arg_length,
my_bool skip_check, MYSQL_STMT *stmt); my_bool skip_check, MYSQL_STMT *stmt);
unsigned long cli_safe_read(MYSQL *mysql); unsigned long cli_safe_read(MYSQL *mysql);
void net_clear_error(NET *net); void net_clear_error(NET *net);
void set_stmt_errmsg(MYSQL_STMT *stmt, NET *net); void set_stmt_errmsg(MYSQL_STMT *stmt, NET *net);
void set_stmt_error(MYSQL_STMT *stmt, int errcode, const char *sqlstate, void set_stmt_error(MYSQL_STMT *stmt, int errcode, const char *sqlstate,
const char *err); const char *err);
void set_mysql_error(MYSQL *mysql, int errcode, const char *sqlstate); void set_mysql_error(MYSQL *mysql, int errcode, const char *sqlstate);
void set_mysql_extended_error(MYSQL *mysql, int errcode, const char *sqlsta
te,
const char *format, ...);
/* client side of the pluggable authentication */
struct st_plugin_vio_info;
void mpvio_info(Vio *vio, struct st_plugin_vio_info *info);
int run_plugin_auth(MYSQL *mysql, char *data, uint data_len,
const char *data_plugin, const char *db);
int mysql_client_plugin_init();
void mysql_client_plugin_deinit();
struct st_mysql_client_plugin;
extern struct st_mysql_client_plugin *mysql_client_builtins[];
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif #endif
#define protocol_41(A) ((A)->server_capabilities & CLIENT_PROTOCOL_41) #define protocol_41(A) ((A)->server_capabilities & CLIENT_PROTOCOL_41)
#endif /* SQL_COMMON_INCLUDED */ #endif /* SQL_COMMON_INCLUDED */
 End of changes. 4 change blocks. 
2 lines changed or deleted 63 lines changed or added


 sql_state.h   sql_state.h 
skipping to change at line 219 skipping to change at line 219
{ ER_XA_RBTIMEOUT ,"XA106", "" }, { ER_XA_RBTIMEOUT ,"XA106", "" },
{ ER_XA_RBDEADLOCK ,"XA102", "" }, { ER_XA_RBDEADLOCK ,"XA102", "" },
{ ER_FUNC_INEXISTENT_NAME_COLLISION ,"42000", "" }, { ER_FUNC_INEXISTENT_NAME_COLLISION ,"42000", "" },
{ ER_DUP_SIGNAL_SET ,"42000", "" }, { ER_DUP_SIGNAL_SET ,"42000", "" },
{ ER_SIGNAL_WARN ,"01000", "" }, { ER_SIGNAL_WARN ,"01000", "" },
{ ER_SIGNAL_NOT_FOUND ,"02000", "" }, { ER_SIGNAL_NOT_FOUND ,"02000", "" },
{ ER_SIGNAL_EXCEPTION ,"HY000", "" }, { ER_SIGNAL_EXCEPTION ,"HY000", "" },
{ ER_RESIGNAL_WITHOUT_ACTIVE_HANDLER ,"0K000", "" }, { ER_RESIGNAL_WITHOUT_ACTIVE_HANDLER ,"0K000", "" },
{ ER_SPATIAL_MUST_HAVE_GEOM_COL ,"42000", "" }, { ER_SPATIAL_MUST_HAVE_GEOM_COL ,"42000", "" },
{ ER_DATA_OUT_OF_RANGE ,"22003", "" }, { ER_DATA_OUT_OF_RANGE ,"22003", "" },
{ ER_ACCESS_DENIED_NO_PASSWORD_ERROR ,"28000", "" },
{ ER_TRUNCATE_ILLEGAL_FK ,"42000", "" },
 End of changes. 1 change blocks. 
0 lines changed or deleted 0 lines changed or added


 typelib.h   typelib.h 
skipping to change at line 38 skipping to change at line 38
extern my_ulonglong find_typeset(char *x, TYPELIB *typelib,int *error_posit ion); extern my_ulonglong find_typeset(char *x, TYPELIB *typelib,int *error_posit ion);
extern int find_type_or_exit(const char *x, TYPELIB *typelib, extern int find_type_or_exit(const char *x, TYPELIB *typelib,
const char *option); const char *option);
extern int find_type(char *x, const TYPELIB *typelib, unsigned int full_nam e); extern int find_type(char *x, const TYPELIB *typelib, unsigned int full_nam e);
extern void make_type(char *to,unsigned int nr,TYPELIB *typelib); extern void make_type(char *to,unsigned int nr,TYPELIB *typelib);
extern const char *get_type(TYPELIB *typelib,unsigned int nr); extern const char *get_type(TYPELIB *typelib,unsigned int nr);
extern TYPELIB *copy_typelib(MEM_ROOT *root, TYPELIB *from); extern TYPELIB *copy_typelib(MEM_ROOT *root, TYPELIB *from);
extern TYPELIB sql_protocol_typelib; extern TYPELIB sql_protocol_typelib;
my_ulonglong find_set_from_flags(const TYPELIB *lib, uint default_name, my_ulonglong find_set_from_flags(const TYPELIB *lib, unsigned int default_n ame,
my_ulonglong cur_set, my_ulonglong default_se t, my_ulonglong cur_set, my_ulonglong default_se t,
const char *str, uint length, const char *str, unsigned int length,
char **err_pos, uint *err_len); char **err_pos, unsigned int *err_len);
#endif /* _typelib_h */ #endif /* _typelib_h */
 End of changes. 2 change blocks. 
3 lines changed or deleted 3 lines changed or added

This html diff was produced by rfcdiff 1.41. The latest version is available from http://tools.ietf.org/tools/rfcdiff/