Merge of mysql-trunk-bugfixing into mysql-trunk-merge.

This commit is contained in:
Davi Arnaut 2010-07-15 10:47:50 -03:00
commit 711c318c07
488 changed files with 12062 additions and 12285 deletions

View file

@ -33,10 +33,10 @@ pkginclude_HEADERS = $(HEADERS_ABI) my_dbug.h m_string.h my_sys.h \
m_ctype.h my_attribute.h $(HEADERS_GEN_CONFIGURE) \
$(HEADERS_GEN_MAKE) probes_mysql.h probes_mysql_nodtrace.h
noinst_HEADERS = config-win.h config-netware.h lf.h my_bit.h \
noinst_HEADERS = config-win.h lf.h my_bit.h \
heap.h my_bitmap.h my_uctype.h password.h \
myisam.h myisampack.h myisammrg.h ft_global.h\
mysys_err.h my_base.h help_start.h help_end.h \
mysys_err.h my_base.h \
my_nosys.h my_alarm.h queues.h rijndael.h sha1.h sha2.h \
my_aes.h my_tree.h my_trie.h hash.h thr_alarm.h \
thr_lock.h t_ctype.h violite.h my_md5.h base64.h \

View file

@ -1,161 +0,0 @@
/* Copyright (C) 2000 MySQL AB
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
the Free Software Foundation; version 2 of the License.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
/* Header for NetWare compatible with MySQL */
#ifndef _config_netware_h
#define _config_netware_h
#define __event_h__
#define _EVENT_H_
/*
These two #define(s) are needed as both libc of NetWare and MySQL have
files named event.h which causes compilation errors.
*/
/* required headers */
#include <unistd.h>
#include <stdio.h>
#include <errno.h>
#include <screen.h>
#include <limits.h>
#include <signal.h>
#include <errno.h>
#include <stdbool.h>
#include <stdlib.h>
#include <sys/types.h>
#include <time.h>
#include <sys/time.h>
#include <pthread.h>
#include <termios.h>
#undef _EVENT_H_
/*
This #undef exists here because both libc of NetWare and MySQL have
files named event.h which causes compilation errors.
*/
#ifdef __cplusplus
extern "C" {
#endif
/* required adjustments */
#undef HAVE_READDIR_R
#undef HAVE_RWLOCK_INIT
#undef HAVE_SCHED_H
#undef HAVE_SYS_MMAN_H
#undef HAVE_SYNCH_H
#undef HAVE_MMAP
#undef HAVE_RINT
#define HAVE_PTHREAD_ATTR_SETSTACKSIZE 1
#define HAVE_PTHREAD_SIGMASK 1
#define HAVE_PTHREAD_YIELD_ZERO_ARG 1
#define HAVE_BROKEN_REALPATH 1
/* changes made to make use of LibC-June-2004 for building purpose */
#undef HAVE_POSIX_SIGNALS
#undef HAVE_PTHREAD_ATTR_SETSCOPE
#undef HAVE_ALLOC_A
#undef HAVE_FINITE
#undef HAVE_GETPWNAM
#undef HAVE_GETPWUID
#undef HAVE_READLINK
#undef HAVE_STPCPY
/* changes end */
/* Changes made to make use of LibC-June-2005 for building purpose */
#undef HAVE_GETPASS
#undef HAVE_GETRLIMIT
#undef HAVE_GETRUSAGE
#undef HAVE_INITGROUPS
/* Changes end - LibC-June-2005 */
/* no libc crypt() function */
#ifdef HAVE_OPENSSL
#define HAVE_CRYPT 1
#else
#undef HAVE_CRYPT
#endif /* HAVE_OPENSSL */
/* Netware has an ancient zlib */
#undef HAVE_COMPRESS
#define HAVE_COMPRESS
#undef HAVE_ARCHIVE_DB
/* include the old function apis */
#define USE_OLD_FUNCTIONS 1
/* no case sensitivity */
#define FN_NO_CASE_SENSE 1
/* the thread alarm is not used */
#define DONT_USE_THR_ALARM 1
/* signals do not interrupt sockets */
#define SIGNALS_DONT_BREAK_READ 1
/* signal by closing the sockets */
#define SIGNAL_WITH_VIO_CLOSE 1
/* On NetWare, stack grows towards lower address */
#define STACK_DIRECTION -1
/* On NetWare, we need to set stack size for threads, otherwise default 16K is used */
#define NW_THD_STACKSIZE 65536
/* On NetWare, to fix the problem with the deletion of open files */
#define CANT_DELETE_OPEN_FILES 1
#define FN_LIBCHAR '\\'
#define FN_ROOTDIR "\\"
#define FN_DEVCHAR ':'
/* default directory information */
#define DEFAULT_MYSQL_HOME "sys:/mysql"
#define PACKAGE "mysql"
#define DEFAULT_BASEDIR "sys:/"
#define SHAREDIR "share/"
#define DEFAULT_CHARSET_HOME "sys:/mysql/"
#define MYSQL_DATADIR "data/"
/* 64-bit file system calls */
#define SIZEOF_OFF_T 8
#define off_t off64_t
#define chsize chsize64
#define ftruncate ftruncate64
#define lseek lseek64
#define pread pread64
#define pwrite pwrite64
#define tell tell64
/* do not use the extended time in LibC sys\stat.h */
#define _POSIX_SOURCE
/* Some macros for portability */
#define set_timespec(ABSTIME,SEC) { (ABSTIME).tv_sec=time(NULL)+(SEC); (ABSTIME).tv_nsec=0; }
/* extra protection against CPU Hogs on NetWare */
#define NETWARE_YIELD pthread_yield()
/* Screen mode for help texts */
#define NETWARE_SET_SCREEN_MODE(A) setscreenmode(A)
#ifdef __cplusplus
}
#endif
#endif /* _config_netware_h */

View file

@ -185,7 +185,6 @@ typedef SSIZE_T ssize_t;
#define SOCKET_SIZE_TYPE int
#define my_socket_defined
#define byte_defined
#define HUGE_PTR
#define STDCALL __stdcall /* Used by libmysql.dll */
#define isnan(X) _isnan(X)
#define finite(X) _finite(X)

View file

@ -64,14 +64,14 @@ typedef struct st_hash {
typedef uint HASH_SEARCH_STATE;
#define my_hash_init(A,B,C,D,E,F,G,H) \
_my_hash_init(A,0,B,C,D,E,F,G,H CALLER_INFO)
_my_hash_init(A,0,B,C,D,E,F,G,H)
#define my_hash_init2(A,B,C,D,E,F,G,H,I) \
_my_hash_init(A,B,C,D,E,F,G,H,I CALLER_INFO)
_my_hash_init(A,B,C,D,E,F,G,H,I)
my_bool _my_hash_init(HASH *hash, uint growth_size, CHARSET_INFO *charset,
ulong default_array_elements, size_t key_offset,
size_t key_length, my_hash_get_key get_key,
void (*free_element)(void*),
uint flags CALLER_INFO_PROTO);
uint flags);
void my_hash_free(HASH *tree);
void my_hash_reset(HASH *hash);
uchar *my_hash_element(HASH *hash, ulong idx);
@ -100,7 +100,7 @@ my_bool my_hash_check(HASH *hash); /* Only in debug library */
#define my_hash_clear(H) bzero((char*) (H), sizeof(*(H)))
#define my_hash_inited(H) ((H)->blength != 0)
#define my_hash_init_opt(A,B,C,D,E,F,G,H) \
(!my_hash_inited(A) && _my_hash_init(A,0,B,C,D,E,F,G, H CALLER_INFO))
(!my_hash_inited(A) && _my_hash_init(A,0,B,C,D,E,F,G,H))
#ifdef __cplusplus
}

View file

@ -1,26 +0,0 @@
#ifndef HELP_END_INCLUDED
#define HELP_END_INCLUDED
/* Copyright (C) 2004-2005 MySQL AB
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
the Free Software Foundation; version 2 of the License.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
#ifdef __NETWARE__
#undef printf
#undef puts
#undef fputs
#undef fputc
#undef putchar
#endif
#endif /* HELP_END_INCLUDED */

View file

@ -1,28 +0,0 @@
#ifndef HELP_START_INCLUDED
#define HELP_START_INCLUDED
/* Copyright (C) 2004-2005 MySQL AB
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
the Free Software Foundation; version 2 of the License.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
/* Divert all help information on NetWare to logger screen. */
#ifdef __NETWARE__
#define printf consoleprintf
#define puts(s) consoleprintf("%s\n",s)
#define fputs(s,f) puts(s)
#define fputc(s,f) consoleprintf("%c", s)
#define putchar(s) consoleprintf("%c", s)
#endif
#endif /* HELP_START_INCLUDED */

View file

@ -204,7 +204,7 @@ uint lf_alloc_pool_count(LF_ALLOCATOR *allocator);
#define lf_alloc_get_pins(A) lf_pinbox_get_pins(&(A)->pinbox)
#define _lf_alloc_put_pins(PINS) _lf_pinbox_put_pins(PINS)
#define lf_alloc_put_pins(PINS) lf_pinbox_put_pins(PINS)
#define lf_alloc_direct_free(ALLOC, ADDR) my_free((uchar*)(ADDR), MYF(0))
#define lf_alloc_direct_free(ALLOC, ADDR) my_free((ADDR))
lock_wrap(lf_alloc_new, void *,
(LF_PINS *pins),

View file

@ -84,8 +84,8 @@ extern char *stpcpy(char *, const char *); /* For AIX with gcc 2.95.3 */
#endif
/* Declared in int2str() */
extern char NEAR _dig_vec_upper[];
extern char NEAR _dig_vec_lower[];
extern char _dig_vec_upper[];
extern char _dig_vec_lower[];
#ifndef strmov
#define strmov_overlapp(A,B) strmov(A,B)
@ -135,15 +135,15 @@ extern char *strmov(char *dst,const char *src);
#else
extern char *strmov_overlapp(char *dst,const char *src);
#endif
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 *strxcat _VARARGS((char *dst,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, ...));
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 *strxcat(char *dst, const char *src, ...);
extern char *strxmov(char *dst, const char *src, ...);
extern char *strxcpy(char *dst, const char *src, ...);
extern char *strxncat(char *dst, size_t len, const char *src, ...);
extern char *strxnmov(char *dst, size_t len, const char *src, ...);
extern char *strxncpy(char *dst, size_t len, const char *src, ...);
/* Prototypes of normal stringfunctions (with may ours) */

View file

@ -45,7 +45,7 @@ extern void _db_enter_(const char *_func_, const char *_file_, 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_doprnt_ _VARARGS((const char *format,...))
extern void _db_doprnt_(const char *format,...)
ATTRIBUTE_FORMAT(printf, 1, 2);
extern void _db_dump_(uint _line_,const char *keyword,
const unsigned char *memory, size_t length);

View file

@ -46,15 +46,6 @@
#define HAVE_ERRNO_AS_DEFINE
#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 */
#ifdef USE_PRAGMA_IMPLEMENTATION
#define USE_PRAGMA_INTERFACE
@ -82,20 +73,7 @@
#define CPP_UNNAMED_NS_END }
#endif
#if defined(_WIN32)
#include <my_config.h>
#elif defined(__NETWARE__)
#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
#define HAVE_PSI_INTERFACE
@ -108,12 +86,6 @@
#define IF_WIN(A,B) B
#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
@ -143,12 +115,6 @@
#define HAVE_EXTERNAL_CLIENT
#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)
/*
off_t is 32 bit long. We do not use C runtime functions
@ -591,22 +557,6 @@ C_MODE_END
extern "C" int madvise(void *addr, size_t len, int behav);
#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 */
@ -711,16 +661,6 @@ int __cxa_pure_virtual () __attribute__ ((weak));
C_MODE_END
#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 */
#if defined(DBUG_ON) && defined(DBUG_OFF)
#undef DBUG_OFF
@ -736,7 +676,6 @@ C_MODE_END
#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 */
@ -896,11 +835,8 @@ typedef SOCKET_SIZE_TYPE size_socket;
How much overhead does malloc have. The code often allocates
something like 1024-MALLOC_OVERHEAD bytes
*/
#ifdef SAFEMALLOC
#define MALLOC_OVERHEAD (8+24+4)
#else
#define MALLOC_OVERHEAD 8
#endif
/* get memory in huncs */
#define ONCE_ALLOC_INIT (uint) (4096-MALLOC_OVERHEAD)
/* Typical record cash */
@ -1099,14 +1035,6 @@ typedef long long my_ptrdiff_t;
((size_t)((char *)&(((TYPE *)0x10)->MEMBER) - (char*)0x10))
#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
#undef STDCALL
@ -1662,25 +1590,12 @@ do { doubleget_union _tmp; \
#endif
#ifndef __NETWARE__
/*
* Include standard definitions of operator new and delete.
*/
#ifdef __cplusplus
#include <new>
#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. */
#define MY_INT32_NUM_DECIMAL_DIGITS 11
@ -1694,11 +1609,6 @@ inline void operator delete[](void*, void*) { /* Do nothing */ }
#define min(a, b) ((a) < (b) ? (a) : (b))
#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 sure a
file creation/deletion/renaming in(from,to) this directory durable.

View file

@ -37,7 +37,7 @@ extern int list_walk(LIST *,list_walk_action action,unsigned char * argument);
#define list_rest(a) ((a)->next)
#define list_push(a,b) (a)=list_cons((b),(a))
#define list_pop(A) {LIST *old=(A); (A)=list_delete(old,old) ; my_free((unsigned char *) old,MYF(MY_FAE)); }
#define list_pop(A) {LIST *old=(A); (A)=list_delete(old,old); my_free(old); }
#ifdef __cplusplus
}

View file

@ -46,7 +46,7 @@ C_MODE_START
#include <sys/ioctl.h>
#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.h>
#include <netinet/ip.h>

View file

@ -39,7 +39,7 @@ extern size_t my_quick_read(File Filedes,uchar *Buffer,size_t Count,
myf myFlags);
extern size_t my_quick_write(File Filedes,const uchar *Buffer,size_t Count);
#if !defined(SAFEMALLOC) && defined(USE_HALLOC)
#if defined(USE_HALLOC)
#define my_malloc(a,b) halloc(a,1)
#define my_no_flags_free(a) hfree(a)
#endif

View file

@ -195,11 +195,6 @@ int pthread_cancel(pthread_t thread);
#include <synch.h>
#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 my_pthread_getspecific_ptr(T,V) my_pthread_getspecific(T,(V))
#define my_pthread_setspecific_ptr(T,V) pthread_setspecific(T,(void*) (V))
@ -356,7 +351,7 @@ struct tm *gmtime_r(const time_t *clock, struct tm *res);
#define pthread_kill(A,B) pthread_dummy((A) ? 0 : ESRCH)
#undef pthread_detach_this_thread
#define pthread_detach_this_thread() { pthread_t tmp=pthread_self() ; pthread_detach(&tmp); }
#elif !defined(__NETWARE__) /* HAVE_PTHREAD_ATTR_CREATE && !HAVE_SIGWAIT */
#else /* HAVE_PTHREAD_ATTR_CREATE && !HAVE_SIGWAIT */
#define HAVE_PTHREAD_KILL
#endif
@ -461,10 +456,6 @@ int my_pthread_mutex_trylock(pthread_mutex_t *mutex);
/* 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
{
pthread_mutex_t global,mutex;

View file

@ -32,9 +32,7 @@
#define HAVE_STACKTRACE 1
#endif
#if !defined(__NETWARE__)
#define HAVE_WRITE_CORE
#endif
#if HAVE_BACKTRACE && HAVE_BACKTRACE_SYMBOLS && \
HAVE_CXXABI_H && HAVE_ABI_CXA_DEMANGLE && \

View file

@ -42,7 +42,7 @@ typedef struct my_aio_result {
#endif /* HAVE_VALGRIND */
#ifndef THREAD
extern int NEAR my_errno; /* Last error in mysys */
extern int my_errno; /* Last error in mysys */
#else
#include <my_pthread.h>
#endif
@ -158,46 +158,15 @@ extern int NEAR my_errno; /* Last error in mysys */
#define GETDATE_FIXEDLENGTH 16
/* 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);
#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_no_flags_free(void *ptr);
extern void my_free(void *ptr);
extern void *my_memdup(const void *from,size_t length,myf MyFlags);
extern char *my_strdup(const char *from,myf MyFlags);
extern char *my_strndup(const char *from, size_t length,
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)
#endif
#if defined(ENABLED_DEBUG_SYNC)
extern void (*debug_sync_C_callback_ptr)(const char *, size_t);
#define DEBUG_SYNC_C(_sync_point_name_) do { \
@ -211,11 +180,11 @@ extern void (*debug_sync_C_callback_ptr)(const char *, size_t);
#ifdef HAVE_LARGE_PAGES
extern uint my_get_large_page_size(void);
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
#define my_get_large_page_size() (0)
#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 */
#ifdef HAVE_ALLOCA
@ -233,7 +202,7 @@ extern void my_large_free(uchar * ptr, myf my_flags);
#define my_afree(PTR) {}
#else
#define my_alloca(SZ) my_malloc(SZ,MYF(0))
#define my_afree(PTR) my_free(PTR,MYF(MY_WME))
#define my_afree(PTR) my_free(PTR)
#endif /* HAVE_ALLOCA */
#ifndef errno /* did we already get it? */
@ -245,7 +214,7 @@ extern int errno; /* declare errno */
#endif /* #ifndef errno */
extern char *home_dir; /* Home directory for user */
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 (*fatal_error_handler_hook)(uint my_err, const char *str,
myf MyFlags);
@ -278,17 +247,17 @@ extern void (*my_sigtstp_cleanup)(void),
(*my_sigtstp_restart)(void),
(*my_abort_hook)(int);
/* Executed when comming from shell */
extern MYSQL_PLUGIN_IMPORT int NEAR my_umask; /* Default creation mask */
extern int NEAR my_umask_dir,
NEAR my_recived_signals, /* Signals we have got */
NEAR my_safe_to_handle_signal, /* Set when allowed to SIGTSTP */
NEAR my_dont_interrupt; /* call remember_intr when set */
extern my_bool NEAR my_use_symdir;
extern MYSQL_PLUGIN_IMPORT int my_umask; /* Default creation mask */
extern int my_umask_dir,
my_recived_signals, /* Signals we have got */
my_safe_to_handle_signal, /* Set when allowed to SIGTSTP */
my_dont_interrupt; /* call remember_intr when set */
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 my_bool NEAR my_disable_locking,NEAR my_disable_async_io,
NEAR my_disable_flush_key_blocks, NEAR my_disable_symlinks;
extern my_bool my_disable_locking, my_disable_async_io,
my_disable_flush_key_blocks, my_disable_symlinks;
extern char wild_many,wild_one,wild_prefix;
extern const char *charsets_dir;
/* from default.c */
@ -642,20 +611,6 @@ extern size_t my_fwrite(FILE *stream,const uchar *Buffer,size_t Count,
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 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 */
extern void *my_memmem(const void *haystack, size_t haystacklen,
@ -684,9 +639,6 @@ extern HANDLE my_get_osfhandle(File fd);
extern void my_osmaperr(unsigned long last_error);
#endif
#ifndef TERMINATE
extern void TERMINATE(FILE *file, uint flag);
#endif
extern void init_glob_errs(void);
extern const char** get_global_errmsgs();
extern void wait_for_free_space(const char *filename, int errors);
@ -698,10 +650,10 @@ 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_dir(const char *dir_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_printf_error _VARARGS((uint my_err, const char *format,
myf MyFlags, ...))
ATTRIBUTE_FORMAT(printf, 2, 4);
extern void my_error(int nr,myf MyFlags, ...);
extern void my_printf_error(uint my_err, const char *format,
myf MyFlags, ...)
ATTRIBUTE_FORMAT(printf, 2, 4);
extern void my_printv_error(uint error, const char *format, myf MyFlags,
va_list ap);
extern int my_error_register(const char** (*get_errmsgs) (),
@ -835,18 +787,16 @@ extern my_bool real_open_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,
int mode, myf MyFlags);
#define my_init_dynamic_array(A,B,C,D) init_dynamic_array2(A,B,NULL,C,D CALLER_INFO)
#define my_init_dynamic_array_ci(A,B,C,D) init_dynamic_array2(A,B,NULL,C,D ORIG_CALLER_INFO)
#define my_init_dynamic_array2(A,B,C,D,E) init_dynamic_array2(A,B,C,D,E CALLER_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,
uint alloc_increment
CALLER_INFO_PROTO);
#define my_init_dynamic_array(A,B,C,D) init_dynamic_array2(A,B,NULL,C,D)
#define my_init_dynamic_array_ci(A,B,C,D) init_dynamic_array2(A,B,NULL,C,D)
#define my_init_dynamic_array2(A,B,C,D,E) init_dynamic_array2(A,B,C,D,E)
#define my_init_dynamic_array2_ci(A,B,C,D,E) init_dynamic_array2(A,B,C,D,E)
extern my_bool init_dynamic_array2(DYNAMIC_ARRAY *array, uint element_size,
void *init_buffer, uint init_alloc,
uint alloc_increment);
/* init_dynamic_array() function is deprecated */
extern my_bool init_dynamic_array(DYNAMIC_ARRAY *array,uint element_size,
uint init_alloc,uint alloc_increment
CALLER_INFO_PROTO);
extern my_bool init_dynamic_array(DYNAMIC_ARRAY *array, uint element_size,
uint init_alloc, uint alloc_increment);
extern my_bool insert_dynamic(DYNAMIC_ARRAY *array,uchar * element);
extern uchar *alloc_dynamic(DYNAMIC_ARRAY *array);
extern uchar *pop_dynamic(DYNAMIC_ARRAY*);
@ -876,10 +826,10 @@ extern my_bool dynstr_trunc(DYNAMIC_STRING *str, size_t n);
extern void dynstr_free(DYNAMIC_STRING *str);
#ifdef HAVE_MLOCK
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
#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
#define alloc_root_inited(A) ((A)->min_malloc != 0)
#define ALLOC_ROOT_MIN_BLOCK_SIZE (MALLOC_OVERHEAD + sizeof(USED_MEM) + 8)
@ -963,10 +913,7 @@ extern int my_getncpus();
#define MAP_FAILED ((void *)-1)
#define MS_SYNC 0x0000
#ifndef __NETWARE__
#define HAVE_MMAP
#endif
void *my_mmap(void *, size_t, int, int, int, my_off_t);
int my_munmap(void *, size_t);
#endif
@ -1031,10 +978,6 @@ void my_security_attr_free(SECURITY_ATTRIBUTES *sa);
char* my_cgets(char *string, size_t clen, size_t* plen);
#endif
#ifdef __NETWARE__
void netware_reg_user(const char *ip, const char *user,
const char *application);
#endif
#include <mysql/psi/psi.h>

View file

@ -35,8 +35,6 @@ extern uchar days_in_month[];
Using the system built in time_t is not an option as
we rely on the above requirements in the time functions
For example QNX has an unsigned time_t type
*/
typedef long my_time_t;

View file

@ -79,10 +79,6 @@ extern char *mysql_unix_port;
#define CLIENT_NET_READ_TIMEOUT 365*24*3600 /* Timeout on read */
#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_NOT_NULL(n) ((n) & NOT_NULL_FLAG)
#define IS_BLOB(n) ((n) & BLOB_FLAG)
@ -746,10 +742,6 @@ int STDCALL mysql_drop_db(MYSQL *mysql, const char *DB);
(*(mysql)->methods->advanced_command)(mysql, command, 0, \
0, arg, length, 1, stmt)
#ifdef __NETWARE__
#pragma pack(pop) /* restore alignment */
#endif
#ifdef __cplusplus
}
#endif

View file

@ -233,10 +233,10 @@ extern void make_type(char *to,unsigned int nr,TYPELIB *typelib);
extern const char *get_type(TYPELIB *typelib,unsigned int nr);
extern TYPELIB *copy_typelib(MEM_ROOT *root, TYPELIB *from);
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_name,
my_ulonglong cur_set, my_ulonglong default_set,
const char *str, uint length,
char **err_pos, uint *err_len);
const char *str, unsigned int length,
char **err_pos, unsigned int *err_len);
typedef struct st_mysql_rows {
struct st_mysql_rows *next;
MYSQL_ROW data;

View file

@ -1,4 +1,4 @@
/* Copyright (C) 2008-2009 Sun Microsystems, Inc
/* Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved.
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
@ -10,8 +10,8 @@
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
along with this program; if not, write to the Free Software Foundation,
51 Franklin Street, Suite 500, Boston, MA 02110-1335 USA */
#ifndef MYSQL_FILE_H
#define MYSQL_FILE_H
@ -506,9 +506,10 @@ inline_mysql_file_fgets(
char *result;
#ifdef HAVE_PSI_INTERFACE
struct PSI_file_locker *locker= NULL;
PSI_file_locker_state state;
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);
if (likely(locker != NULL))
PSI_server->start_file_wait(locker, (size_t) size, src_file, src_line);
@ -532,9 +533,10 @@ inline_mysql_file_fgetc(
int result;
#ifdef HAVE_PSI_INTERFACE
struct PSI_file_locker *locker= NULL;
PSI_file_locker_state state;
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);
if (likely(locker != NULL))
PSI_server->start_file_wait(locker, (size_t) 1, src_file, src_line);
@ -558,10 +560,11 @@ inline_mysql_file_fputs(
int result;
#ifdef HAVE_PSI_INTERFACE
struct PSI_file_locker *locker= NULL;
PSI_file_locker_state state;
size_t bytes= 0;
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);
if (likely(locker != NULL))
{
@ -588,9 +591,10 @@ inline_mysql_file_fputc(
int result;
#ifdef HAVE_PSI_INTERFACE
struct PSI_file_locker *locker= NULL;
PSI_file_locker_state state;
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);
if (likely(locker != NULL))
PSI_server->start_file_wait(locker, (size_t) 1, src_file, src_line);
@ -614,9 +618,10 @@ inline_mysql_file_fprintf(MYSQL_FILE *file, const char *format, ...)
va_list args;
#ifdef HAVE_PSI_INTERFACE
struct PSI_file_locker *locker= NULL;
PSI_file_locker_state state;
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);
if (likely(locker != NULL))
PSI_server->start_file_wait(locker, (size_t) 0, __FILE__, __LINE__);
@ -642,9 +647,10 @@ inline_mysql_file_vfprintf(
int result;
#ifdef HAVE_PSI_INTERFACE
struct PSI_file_locker *locker= NULL;
PSI_file_locker_state state;
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);
if (likely(locker != NULL))
PSI_server->start_file_wait(locker, (size_t) 0, src_file, src_line);
@ -668,9 +674,10 @@ inline_mysql_file_fflush(
int result;
#ifdef HAVE_PSI_INTERFACE
struct PSI_file_locker *locker= NULL;
PSI_file_locker_state state;
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);
if (likely(locker != NULL))
PSI_server->start_file_wait(locker, (size_t) 0, src_file, src_line);
@ -700,9 +707,10 @@ inline_mysql_file_fstat(
int result;
#ifdef HAVE_PSI_INTERFACE
struct PSI_file_locker *locker= NULL;
PSI_file_locker_state state;
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);
if (likely(locker != NULL))
PSI_server->start_file_wait(locker, (size_t) 0, src_file, src_line);
@ -726,9 +734,11 @@ inline_mysql_file_stat(
MY_STAT *result;
#ifdef HAVE_PSI_INTERFACE
struct PSI_file_locker *locker= NULL;
PSI_file_locker_state state;
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);
if (likely(locker != NULL))
PSI_server->start_file_open_wait(locker, src_file, src_line);
@ -752,9 +762,10 @@ inline_mysql_file_chsize(
int result;
#ifdef HAVE_PSI_INTERFACE
struct PSI_file_locker *locker= NULL;
PSI_file_locker_state state;
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);
if (likely(locker != NULL))
PSI_server->start_file_wait(locker, (size_t) newlength, src_file,
@ -784,10 +795,11 @@ inline_mysql_file_fopen(
{
#ifdef HAVE_PSI_INTERFACE
struct PSI_file_locker *locker= NULL;
PSI_file_locker_state state;
if (likely(PSI_server != NULL))
{
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))
that->m_psi= PSI_server->start_file_open_wait(locker, src_file,
src_line);
@ -800,7 +812,7 @@ inline_mysql_file_fopen(
#endif
if (unlikely(that->m_file == NULL))
{
my_free(that, MYF(0));
my_free(that);
return NULL;
}
}
@ -820,10 +832,11 @@ inline_mysql_file_fclose(
{
#ifdef HAVE_PSI_INTERFACE
struct PSI_file_locker *locker= NULL;
PSI_file_locker_state state;
DBUG_ASSERT(file != NULL);
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_CLOSE);
if (likely(locker != NULL))
PSI_server->start_file_wait(locker, (size_t) 0, src_file, src_line);
@ -834,7 +847,7 @@ inline_mysql_file_fclose(
if (likely(locker != NULL))
PSI_server->end_file_wait(locker, (size_t) 0);
#endif
my_free(file, MYF(0));
my_free(file);
}
return result;
}
@ -849,9 +862,10 @@ inline_mysql_file_fread(
size_t result= 0;
#ifdef HAVE_PSI_INTERFACE
struct PSI_file_locker *locker= NULL;
PSI_file_locker_state state;
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);
if (likely(locker != NULL))
PSI_server->start_file_wait(locker, count, src_file, src_line);
@ -882,9 +896,10 @@ inline_mysql_file_fwrite(
size_t result= 0;
#ifdef HAVE_PSI_INTERFACE
struct PSI_file_locker *locker= NULL;
PSI_file_locker_state state;
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);
if (likely(locker != NULL))
PSI_server->start_file_wait(locker, count, src_file, src_line);
@ -915,9 +930,10 @@ inline_mysql_file_fseek(
my_off_t result;
#ifdef HAVE_PSI_INTERFACE
struct PSI_file_locker *locker= NULL;
PSI_file_locker_state state;
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);
if (likely(locker != NULL))
PSI_server->start_file_wait(locker, (size_t) 0, src_file, src_line);
@ -941,9 +957,10 @@ inline_mysql_file_ftell(
my_off_t result;
#ifdef HAVE_PSI_INTERFACE
struct PSI_file_locker *locker= NULL;
PSI_file_locker_state state;
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);
if (likely(locker != NULL))
PSI_server->start_file_wait(locker, (size_t) 0, src_file, src_line);
@ -967,9 +984,10 @@ inline_mysql_file_create(
File file;
#ifdef HAVE_PSI_INTERFACE
struct PSI_file_locker *locker= NULL;
PSI_file_locker_state state;
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_CREATE,
filename, &locker);
if (likely(locker != NULL))
PSI_server->start_file_open_wait(locker, src_file, src_line);
@ -1014,9 +1032,10 @@ inline_mysql_file_open(
File file;
#ifdef HAVE_PSI_INTERFACE
struct PSI_file_locker *locker= NULL;
PSI_file_locker_state state;
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_OPEN,
filename, &locker);
if (likely(locker != NULL))
PSI_server->start_file_open_wait(locker, src_file, src_line);
@ -1040,9 +1059,10 @@ inline_mysql_file_close(
int result;
#ifdef HAVE_PSI_INTERFACE
struct PSI_file_locker *locker= NULL;
PSI_file_locker_state state;
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);
if (likely(locker != NULL))
PSI_server->start_file_wait(locker, (size_t) 0, src_file, src_line);
@ -1066,9 +1086,10 @@ inline_mysql_file_read(
size_t result= 0;
#ifdef HAVE_PSI_INTERFACE
struct PSI_file_locker *locker= NULL;
PSI_file_locker_state state;
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);
if (likely(locker != NULL))
PSI_server->start_file_wait(locker, count, src_file, src_line);
@ -1099,9 +1120,10 @@ inline_mysql_file_write(
size_t result;
#ifdef HAVE_PSI_INTERFACE
struct PSI_file_locker *locker= NULL;
PSI_file_locker_state state;
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);
if (likely(locker != NULL))
PSI_server->start_file_wait(locker, count, src_file, src_line);
@ -1132,9 +1154,10 @@ inline_mysql_file_pread(
size_t result;
#ifdef HAVE_PSI_INTERFACE
struct PSI_file_locker *locker= NULL;
PSI_file_locker_state state;
if (likely(PSI_server != NULL))
{
locker= PSI_server->get_thread_file_descriptor_locker(file, PSI_FILE_READ);
locker= PSI_server->get_thread_file_descriptor_locker(&state, file, PSI_FILE_READ);
if (likely(locker != NULL))
PSI_server->start_file_wait(locker, count, src_file, src_line);
}
@ -1164,9 +1187,10 @@ inline_mysql_file_pwrite(
size_t result;
#ifdef HAVE_PSI_INTERFACE
struct PSI_file_locker *locker= NULL;
PSI_file_locker_state state;
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);
if (likely(locker != NULL))
PSI_server->start_file_wait(locker, count, src_file, src_line);
@ -1197,9 +1221,10 @@ inline_mysql_file_seek(
my_off_t result;
#ifdef HAVE_PSI_INTERFACE
struct PSI_file_locker *locker= NULL;
PSI_file_locker_state state;
if (likely(PSI_server != NULL))
{
locker= PSI_server->get_thread_file_descriptor_locker(file, PSI_FILE_SEEK);
locker= PSI_server->get_thread_file_descriptor_locker(&state, file, PSI_FILE_SEEK);
if (likely(locker != NULL))
PSI_server->start_file_wait(locker, (size_t) 0, src_file, src_line);
}
@ -1222,9 +1247,10 @@ inline_mysql_file_tell(
my_off_t result;
#ifdef HAVE_PSI_INTERFACE
struct PSI_file_locker *locker= NULL;
PSI_file_locker_state state;
if (likely(PSI_server != NULL))
{
locker= PSI_server->get_thread_file_descriptor_locker(file, PSI_FILE_TELL);
locker= PSI_server->get_thread_file_descriptor_locker(&state, file, PSI_FILE_TELL);
if (likely(locker != NULL))
PSI_server->start_file_wait(locker, (size_t) 0, src_file, src_line);
}
@ -1247,9 +1273,10 @@ inline_mysql_file_delete(
int result;
#ifdef HAVE_PSI_INTERFACE
struct PSI_file_locker *locker= NULL;
PSI_file_locker_state state;
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_DELETE,
name, &locker);
if (likely(locker != NULL))
PSI_server->start_file_wait(locker, (size_t) 0, src_file, src_line);
@ -1273,9 +1300,10 @@ inline_mysql_file_rename(
int result;
#ifdef HAVE_PSI_INTERFACE
struct PSI_file_locker *locker= NULL;
PSI_file_locker_state state;
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_RENAME,
to, &locker);
if (likely(locker != NULL))
PSI_server->start_file_wait(locker, (size_t) 0, src_file, src_line);
@ -1300,9 +1328,10 @@ inline_mysql_file_create_with_symlink(
File file;
#ifdef HAVE_PSI_INTERFACE
struct PSI_file_locker *locker= NULL;
PSI_file_locker_state state;
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_CREATE,
filename, &locker);
if (likely(locker != NULL))
PSI_server->start_file_open_wait(locker, src_file, src_line);
@ -1327,9 +1356,10 @@ inline_mysql_file_delete_with_symlink(
int result;
#ifdef HAVE_PSI_INTERFACE
struct PSI_file_locker *locker= NULL;
PSI_file_locker_state state;
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_DELETE,
name, &locker);
if (likely(locker != NULL))
PSI_server->start_file_wait(locker, (size_t) 0, src_file, src_line);
@ -1353,9 +1383,10 @@ inline_mysql_file_rename_with_symlink(
int result;
#ifdef HAVE_PSI_INTERFACE
struct PSI_file_locker *locker= NULL;
PSI_file_locker_state state;
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_RENAME,
to, &locker);
if (likely(locker != NULL))
PSI_server->start_file_wait(locker, (size_t) 0, src_file, src_line);
@ -1379,9 +1410,10 @@ inline_mysql_file_sync(
int result= 0;
#ifdef HAVE_PSI_INTERFACE
struct PSI_file_locker *locker= NULL;
PSI_file_locker_state state;
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_FILE_SYNC);
if (likely(locker != NULL))
PSI_server->start_file_wait(locker, (size_t) 0, src_file, src_line);
}

View file

@ -1,4 +1,4 @@
/* Copyright (C) 2008-2009 Sun Microsystems, Inc
/* Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved.
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
@ -10,8 +10,8 @@
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
along with this program; if not, write to the Free Software Foundation,
51 Franklin Street, Suite 500, Boston, MA 02110-1335 USA */
#ifndef MYSQL_THREAD_H
#define MYSQL_THREAD_H
@ -625,9 +625,10 @@ static inline int inline_mysql_mutex_lock(
int result;
#ifdef HAVE_PSI_INTERFACE
struct PSI_mutex_locker *locker= NULL;
PSI_mutex_locker_state state;
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_MUTEX_LOCK);
if (likely(locker != NULL))
PSI_server->start_mutex_wait(locker, src_file, src_line);
}
@ -654,9 +655,10 @@ static inline int inline_mysql_mutex_trylock(
int result;
#ifdef HAVE_PSI_INTERFACE
struct PSI_mutex_locker *locker= NULL;
PSI_mutex_locker_state state;
if (likely(PSI_server && that->m_psi))
{
locker= PSI_server->get_thread_mutex_locker(that->m_psi, PSI_MUTEX_TRYLOCK);
locker= PSI_server->get_thread_mutex_locker(&state, that->m_psi, PSI_MUTEX_TRYLOCK);
if (likely(locker != NULL))
PSI_server->start_mutex_wait(locker, src_file, src_line);
}
@ -682,13 +684,8 @@ static inline int inline_mysql_mutex_unlock(
{
int result;
#ifdef HAVE_PSI_INTERFACE
struct PSI_thread *thread;
if (likely(PSI_server && that->m_psi))
{
thread= PSI_server->get_thread();
if (likely(thread != NULL))
PSI_server->unlock_mutex(thread, that->m_psi);
}
PSI_server->unlock_mutex(that->m_psi);
#endif
#ifdef SAFE_MUTEX
result= safe_mutex_unlock(&that->m_mutex, src_file, src_line);
@ -771,9 +768,10 @@ static inline int inline_mysql_rwlock_rdlock(
int result;
#ifdef HAVE_PSI_INTERFACE
struct PSI_rwlock_locker *locker= NULL;
PSI_rwlock_locker_state state;
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);
if (likely(locker != NULL))
PSI_server->start_rwlock_rdwait(locker, src_file, src_line);
@ -798,9 +796,10 @@ static inline int inline_mysql_prlock_rdlock(
int result;
#ifdef HAVE_PSI_INTERFACE
struct PSI_rwlock_locker *locker= NULL;
PSI_rwlock_locker_state state;
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);
if (likely(locker != NULL))
PSI_server->start_rwlock_rdwait(locker, src_file, src_line);
@ -825,9 +824,10 @@ static inline int inline_mysql_rwlock_wrlock(
int result;
#ifdef HAVE_PSI_INTERFACE
struct PSI_rwlock_locker *locker= NULL;
PSI_rwlock_locker_state state;
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);
if (likely(locker != NULL))
PSI_server->start_rwlock_wrwait(locker, src_file, src_line);
@ -852,9 +852,10 @@ static inline int inline_mysql_prlock_wrlock(
int result;
#ifdef HAVE_PSI_INTERFACE
struct PSI_rwlock_locker *locker= NULL;
PSI_rwlock_locker_state state;
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);
if (likely(locker != NULL))
PSI_server->start_rwlock_wrwait(locker, src_file, src_line);
@ -879,9 +880,10 @@ static inline int inline_mysql_rwlock_tryrdlock(
int result;
#ifdef HAVE_PSI_INTERFACE
struct PSI_rwlock_locker *locker= NULL;
PSI_rwlock_locker_state state;
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);
if (likely(locker != NULL))
PSI_server->start_rwlock_rdwait(locker, src_file, src_line);
@ -906,9 +908,10 @@ static inline int inline_mysql_prlock_tryrdlock(
int result;
#ifdef HAVE_PSI_INTERFACE
struct PSI_rwlock_locker *locker= NULL;
PSI_rwlock_locker_state state;
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);
if (likely(locker != NULL))
PSI_server->start_rwlock_rdwait(locker, src_file, src_line);
@ -933,9 +936,10 @@ static inline int inline_mysql_rwlock_trywrlock(
int result;
#ifdef HAVE_PSI_INTERFACE
struct PSI_rwlock_locker *locker= NULL;
PSI_rwlock_locker_state state;
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);
if (likely(locker != NULL))
PSI_server->start_rwlock_wrwait(locker, src_file, src_line);
@ -960,9 +964,10 @@ static inline int inline_mysql_prlock_trywrlock(
int result;
#ifdef HAVE_PSI_INTERFACE
struct PSI_rwlock_locker *locker= NULL;
PSI_rwlock_locker_state state;
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);
if (likely(locker != NULL))
PSI_server->start_rwlock_wrwait(locker, src_file, src_line);
@ -982,13 +987,8 @@ static inline int inline_mysql_rwlock_unlock(
{
int result;
#ifdef HAVE_PSI_INTERFACE
struct PSI_thread *thread;
if (likely(PSI_server && that->m_psi))
{
thread= PSI_server->get_thread();
if (likely(thread != NULL))
PSI_server->unlock_rwlock(thread, that->m_psi);
}
PSI_server->unlock_rwlock(that->m_psi);
#endif
result= rw_unlock(&that->m_rwlock);
return result;
@ -1000,13 +1000,8 @@ static inline int inline_mysql_prlock_unlock(
{
int result;
#ifdef HAVE_PSI_INTERFACE
struct PSI_thread *thread;
if (likely(PSI_server && that->m_psi))
{
thread= PSI_server->get_thread();
if (likely(thread != NULL))
PSI_server->unlock_rwlock(thread, that->m_psi);
}
PSI_server->unlock_rwlock(that->m_psi);
#endif
result= rw_pr_unlock(&that->m_prlock);
return result;
@ -1053,9 +1048,10 @@ static inline int inline_mysql_cond_wait(
int result;
#ifdef HAVE_PSI_INTERFACE
struct PSI_cond_locker *locker= NULL;
PSI_cond_locker_state state;
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);
if (likely(locker != NULL))
PSI_server->start_cond_wait(locker, src_file, src_line);
@ -1081,9 +1077,10 @@ static inline int inline_mysql_cond_timedwait(
int result;
#ifdef HAVE_PSI_INTERFACE
struct PSI_cond_locker *locker= NULL;
PSI_cond_locker_state state;
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);
if (likely(locker != NULL))
PSI_server->start_cond_wait(locker, src_file, src_line);
@ -1102,13 +1099,8 @@ static inline int inline_mysql_cond_signal(
{
int result;
#ifdef HAVE_PSI_INTERFACE
struct PSI_thread *thread;
if (likely(PSI_server && that->m_psi))
{
thread= PSI_server->get_thread();
if (likely(thread != NULL))
PSI_server->signal_cond(thread, that->m_psi);
}
PSI_server->signal_cond(that->m_psi);
#endif
result= pthread_cond_signal(&that->m_cond);
return result;
@ -1119,13 +1111,8 @@ static inline int inline_mysql_cond_broadcast(
{
int result;
#ifdef HAVE_PSI_INTERFACE
struct PSI_thread *thread;
if (likely(PSI_server && that->m_psi))
{
thread= PSI_server->get_thread();
if (likely(thread != NULL))
PSI_server->broadcast_cond(thread, that->m_psi);
}
PSI_server->broadcast_cond(that->m_psi);
#endif
result= pthread_cond_broadcast(&that->m_cond);
return result;

View file

@ -1,4 +1,4 @@
/* Copyright (C) 2008-2010 Sun Microsystems, Inc
/* Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved.
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
@ -10,8 +10,8 @@
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
along with this program; if not, write to the Free Software Foundation,
51 Franklin Street, Suite 500, Boston, MA 02110-1335 USA */
#ifndef MYSQL_PERFORMANCE_SCHEMA_INTERFACE_H
#define MYSQL_PERFORMANCE_SCHEMA_INTERFACE_H
@ -422,6 +422,175 @@ struct PSI_file_info_v1
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. */
/**
@ -619,40 +788,51 @@ typedef void (*delete_thread_v1_t)(struct PSI_thread *thread);
/**
Get a mutex instrumentation locker.
@param state data storage for the locker
@param mutex the instrumented mutex to lock
@return a mutex locker, or NULL
*/
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.
@param state data storage for the locker
@param rwlock the instrumented rwlock to lock
@return a rwlock locker, or NULL
*/
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.
@param state data storage for the locker
@param cond the instrumented condition to wait on
@param mutex the instrumented mutex associated with the condition
@return a condition locker, or NULL
*/
typedef struct PSI_cond_locker* (*get_thread_cond_locker_v1_t)
(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);
/**
Get a table instrumentation locker.
@param state data storage for the locker
@param table the instrumented table to lock
@return a table locker, or NULL
*/
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.
@param state data storage for the locker
@param key the file instrumentation key
@param op the operation to perform
@param name the file name
@ -660,58 +840,59 @@ typedef struct PSI_table_locker* (*get_thread_table_locker_v1_t)
@return a file locker, or NULL
*/
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);
/**
Get a file stream instrumentation locker.
@param state data storage for the locker
@param file the file stream to access
@param op the operation to perform
@return a file locker, or NULL
*/
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.
@param state data storage for the locker
@param file the file descriptor to access
@param op the operation to perform
@return a file locker, or NULL
*/
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.
@param thread the running thread instrumentation
@param mutex the mutex instrumentation
*/
typedef void (*unlock_mutex_v1_t)
(struct PSI_thread *thread, struct PSI_mutex *mutex);
(struct PSI_mutex *mutex);
/**
Record a rwlock instrumentation unlock event.
@param thread the running thread instrumentation
@param rwlock the rwlock instrumentation
*/
typedef void (*unlock_rwlock_v1_t)
(struct PSI_thread *thread, struct PSI_rwlock *rwlock);
(struct PSI_rwlock *rwlock);
/**
Record a condition instrumentation signal event.
@param thread the running thread instrumentation
@param cond the cond instrumentation
*/
typedef void (*signal_cond_v1_t)
(struct PSI_thread *thread, struct PSI_cond *cond);
(struct PSI_cond *cond);
/**
Record a condition instrumentation broadcast event.
@param thread the running thread instrumentation
@param cond the cond instrumentation
*/
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.
@ -1013,6 +1194,36 @@ struct PSI_file_info_v2
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) */
#endif /* HAVE_PSI_2 */
@ -1056,6 +1267,11 @@ typedef struct PSI_rwlock_info_v1 PSI_rwlock_info;
typedef struct PSI_cond_info_v1 PSI_cond_info;
typedef struct PSI_thread_info_v1 PSI_thread_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
#ifdef USE_PSI_2
@ -1065,6 +1281,11 @@ typedef struct PSI_rwlock_info_v2 PSI_rwlock_info;
typedef struct PSI_cond_info_v2 PSI_cond_info;
typedef struct PSI_thread_info_v2 PSI_thread_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
#else /* HAVE_PSI_INTERFACE */

View file

@ -1,4 +1,4 @@
/* Copyright (C) 2008-2009 Sun Microsystems, Inc
/* Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved.
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
@ -10,8 +10,8 @@
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
along with this program; if not, write to the Free Software Foundation,
51 Franklin Street, Suite 500, Boston, MA 02110-1335 USA */
/**
@file mysql/psi/psi_abi_v1.h

View file

@ -88,6 +88,71 @@ struct PSI_file_info_v1
const char *m_name;
int m_flags;
};
struct PSI_mutex_locker_state_v1
{
uint m_flags;
struct PSI_mutex *m_mutex;
struct PSI_thread *m_thread;
ulonglong m_timer_start;
ulonglong (*m_timer)(void);
enum PSI_mutex_operation m_operation;
const char* m_src_file;
int m_src_line;
void *m_wait;
};
struct PSI_rwlock_locker_state_v1
{
uint m_flags;
struct PSI_rwlock *m_rwlock;
struct PSI_thread *m_thread;
ulonglong m_timer_start;
ulonglong (*m_timer)(void);
enum PSI_rwlock_operation m_operation;
const char* m_src_file;
int m_src_line;
void *m_wait;
};
struct PSI_cond_locker_state_v1
{
uint m_flags;
struct PSI_cond *m_cond;
struct PSI_mutex *m_mutex;
struct PSI_thread *m_thread;
ulonglong m_timer_start;
ulonglong (*m_timer)(void);
enum PSI_cond_operation m_operation;
const char* m_src_file;
int m_src_line;
void *m_wait;
};
struct PSI_file_locker_state_v1
{
uint m_flags;
struct PSI_file *m_file;
struct PSI_thread *m_thread;
size_t m_number_of_bytes;
ulonglong m_timer_start;
ulonglong (*m_timer)(void);
enum PSI_file_operation m_operation;
const char* m_src_file;
int m_src_line;
void *m_wait;
};
struct PSI_table_locker_state_v1
{
uint m_flags;
struct PSI_table *m_table;
struct PSI_table_share *m_table_share;
void *m_class;
struct PSI_thread *m_thread;
ulonglong m_timer_start;
ulonglong (*m_timer)(void);
uint m_index;
uint m_lock_index;
const char* m_src_file;
int m_src_line;
void *m_wait;
};
typedef void (*register_mutex_v1_t)
(const char *category, struct PSI_mutex_info_v1 *info, int count);
typedef void (*register_rwlock_v1_t)
@ -129,29 +194,38 @@ typedef void (*set_thread_v1_t)(struct PSI_thread *thread);
typedef void (*delete_current_thread_v1_t)(void);
typedef void (*delete_thread_v1_t)(struct PSI_thread *thread);
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);
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);
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);
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);
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);
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);
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);
typedef void (*unlock_mutex_v1_t)
(struct PSI_thread *thread, struct PSI_mutex *mutex);
(struct PSI_mutex *mutex);
typedef void (*unlock_rwlock_v1_t)
(struct PSI_thread *thread, struct PSI_rwlock *rwlock);
(struct PSI_rwlock *rwlock);
typedef void (*signal_cond_v1_t)
(struct PSI_thread *thread, struct PSI_cond *cond);
(struct PSI_cond *cond);
typedef void (*broadcast_cond_v1_t)
(struct PSI_thread *thread, struct PSI_cond *cond);
(struct PSI_cond *cond);
typedef void (*start_mutex_wait_v1_t)
(struct PSI_mutex_locker *locker, const char *src_file, uint src_line);
typedef void (*end_mutex_wait_v1_t)
@ -240,5 +314,10 @@ typedef struct PSI_rwlock_info_v1 PSI_rwlock_info;
typedef struct PSI_cond_info_v1 PSI_cond_info;
typedef struct PSI_thread_info_v1 PSI_thread_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;
extern MYSQL_PLUGIN_IMPORT PSI *PSI_server;
C_MODE_END

View file

@ -1,4 +1,4 @@
/* Copyright (C) 2008-2009 Sun Microsystems, Inc
/* Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved.
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
@ -10,8 +10,8 @@
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
along with this program; if not, write to the Free Software Foundation,
51 Franklin Street, Suite 500, Boston, MA 02110-1335 USA */
/**
@file mysql/psi/psi_abi_v1.h

View file

@ -82,11 +82,36 @@ struct PSI_file_info_v2
{
int placeholder;
};
struct PSI_mutex_locker_state_v2
{
int placeholder;
};
struct PSI_rwlock_locker_state_v2
{
int placeholder;
};
struct PSI_cond_locker_state_v2
{
int placeholder;
};
struct PSI_file_locker_state_v2
{
int placeholder;
};
struct PSI_table_locker_state_v2
{
int placeholder;
};
typedef struct PSI_v2 PSI;
typedef struct PSI_mutex_info_v2 PSI_mutex_info;
typedef struct PSI_rwlock_info_v2 PSI_rwlock_info;
typedef struct PSI_cond_info_v2 PSI_cond_info;
typedef struct PSI_thread_info_v2 PSI_thread_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;
extern MYSQL_PLUGIN_IMPORT PSI *PSI_server;
C_MODE_END

View file

@ -15,17 +15,15 @@
#ifndef _mysys_err_h
#define _mysys_err_h
#ifdef __cplusplus
#include "my_global.h" /* NEAR */
extern "C" {
#endif
#define GLOBERRS (EE_ERROR_LAST - EE_ERROR_FIRST + 1) /* Nr of global errors */
#define EE(X) (globerrs[(X) - EE_ERROR_FIRST])
extern const char * NEAR globerrs[]; /* my_error_messages is here */
extern const char *globerrs[]; /* my_error_messages is here */
/* Error message numbers in global map */
/*

View file

@ -36,9 +36,9 @@ extern TYPELIB *copy_typelib(MEM_ROOT *root, TYPELIB *from);
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_name,
my_ulonglong cur_set, my_ulonglong default_set,
const char *str, uint length,
char **err_pos, uint *err_len);
const char *str, unsigned int length,
char **err_pos, unsigned int *err_len);
#endif /* _typelib_h */