diff options
Diffstat (limited to 'dep/mysqllite/include')
86 files changed, 0 insertions, 21563 deletions
diff --git a/dep/mysqllite/include/decimal.h b/dep/mysqllite/include/decimal.h deleted file mode 100644 index 530ed9e1757..00000000000 --- a/dep/mysqllite/include/decimal.h +++ /dev/null @@ -1,107 +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 */ - -#ifndef _decimal_h -#define _decimal_h - -typedef enum -{TRUNCATE=0, HALF_EVEN, HALF_UP, CEILING, FLOOR} - decimal_round_mode; -typedef int32 decimal_digit_t; - -typedef struct st_decimal_t { - int intg, frac, len; - my_bool sign; - decimal_digit_t *buf; -} decimal_t; - -int internal_str2dec(const char *from, decimal_t *to, char **end, - my_bool fixed); -int decimal2string(decimal_t *from, char *to, int *to_len, - int fixed_precision, int fixed_decimals, - char filler); -int decimal2ulonglong(decimal_t *from, ulonglong *to); -int ulonglong2decimal(ulonglong from, decimal_t *to); -int decimal2longlong(decimal_t *from, longlong *to); -int longlong2decimal(longlong from, decimal_t *to); -int decimal2double(decimal_t *from, double *to); -int double2decimal(double from, decimal_t *to); -int decimal_actual_fraction(decimal_t *from); -int decimal2bin(decimal_t *from, uchar *to, int precision, int scale); -int bin2decimal(const uchar *from, decimal_t *to, int precision, int scale); - -int decimal_size(int precision, int scale); -int decimal_bin_size(int precision, int scale); -int decimal_result_size(decimal_t *from1, decimal_t *from2, char op, - int param); - -int decimal_intg(decimal_t *from); -int decimal_add(decimal_t *from1, decimal_t *from2, decimal_t *to); -int decimal_sub(decimal_t *from1, decimal_t *from2, decimal_t *to); -int decimal_cmp(decimal_t *from1, decimal_t *from2); -int decimal_mul(decimal_t *from1, decimal_t *from2, decimal_t *to); -int decimal_div(decimal_t *from1, decimal_t *from2, decimal_t *to, - int scale_incr); -int decimal_mod(decimal_t *from1, decimal_t *from2, decimal_t *to); -int decimal_round(decimal_t *from, decimal_t *to, int new_scale, - decimal_round_mode mode); -int decimal_is_zero(decimal_t *from); -void max_decimal(int precision, int frac, decimal_t *to); - -#define string2decimal(A,B,C) internal_str2dec((A), (B), (C), 0) -#define string2decimal_fixed(A,B,C) internal_str2dec((A), (B), (C), 1) - -/* set a decimal_t to zero */ - -#define decimal_make_zero(dec) do { \ - (dec)->buf[0]=0; \ - (dec)->intg=1; \ - (dec)->frac=0; \ - (dec)->sign=0; \ - } while(0) - -/* - returns the length of the buffer to hold string representation - of the decimal (including decimal dot, possible sign and \0) -*/ - -#define decimal_string_size(dec) (((dec)->intg ? (dec)->intg : 1) + \ - (dec)->frac + ((dec)->frac > 0) + 2) - -/* negate a decimal */ -#define decimal_neg(dec) do { (dec)->sign^=1; } while(0) - -/* - conventions: - - decimal_smth() == 0 -- everything's ok - decimal_smth() <= 1 -- result is usable, but precision loss is possible - decimal_smth() <= 2 -- result can be unusable, most significant digits - could've been lost - decimal_smth() > 2 -- no result was generated -*/ - -#define E_DEC_OK 0 -#define E_DEC_TRUNCATED 1 -#define E_DEC_OVERFLOW 2 -#define E_DEC_DIV_ZERO 4 -#define E_DEC_BAD_NUM 8 -#define E_DEC_OOM 16 - -#define E_DEC_ERROR 31 -#define E_DEC_FATAL_ERROR 30 - -#endif - diff --git a/dep/mysqllite/include/errmsg.h b/dep/mysqllite/include/errmsg.h deleted file mode 100644 index f1d7dd65f97..00000000000 --- a/dep/mysqllite/include/errmsg.h +++ /dev/null @@ -1,108 +0,0 @@ -#ifndef ERRMSG_INCLUDED -#define ERRMSG_INCLUDED - -/* 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 */ - -/* Error messages for MySQL clients */ -/* (Error messages for the daemon are in sql/share/errmsg.txt) */ - -#ifdef __cplusplus -extern "C" { -#endif -void init_client_errs(void); -void finish_client_errs(void); -extern const char *client_errors[]; /* Error messages */ -#ifdef __cplusplus -} -#endif - -#define CR_MIN_ERROR 2000 /* For easier client code */ -#define CR_MAX_ERROR 2999 -#if !defined(ER) -#define ER(X) client_errors[(X)-CR_MIN_ERROR] -#endif -#define CLIENT_ERRMAP 2 /* Errormap used by my_error() */ - -/* Do not add error numbers before CR_ERROR_FIRST. */ -/* If necessary to add lower numbers, change CR_ERROR_FIRST accordingly. */ -#define CR_ERROR_FIRST 2000 /*Copy first error nr.*/ -#define CR_UNKNOWN_ERROR 2000 -#define CR_SOCKET_CREATE_ERROR 2001 -#define CR_CONNECTION_ERROR 2002 -#define CR_CONN_HOST_ERROR 2003 -#define CR_IPSOCK_ERROR 2004 -#define CR_UNKNOWN_HOST 2005 -#define CR_SERVER_GONE_ERROR 2006 -#define CR_VERSION_ERROR 2007 -#define CR_OUT_OF_MEMORY 2008 -#define CR_WRONG_HOST_INFO 2009 -#define CR_LOCALHOST_CONNECTION 2010 -#define CR_TCP_CONNECTION 2011 -#define CR_SERVER_HANDSHAKE_ERR 2012 -#define CR_SERVER_LOST 2013 -#define CR_COMMANDS_OUT_OF_SYNC 2014 -#define CR_NAMEDPIPE_CONNECTION 2015 -#define CR_NAMEDPIPEWAIT_ERROR 2016 -#define CR_NAMEDPIPEOPEN_ERROR 2017 -#define CR_NAMEDPIPESETSTATE_ERROR 2018 -#define CR_CANT_READ_CHARSET 2019 -#define CR_NET_PACKET_TOO_LARGE 2020 -#define CR_EMBEDDED_CONNECTION 2021 -#define CR_PROBE_SLAVE_STATUS 2022 -#define CR_PROBE_SLAVE_HOSTS 2023 -#define CR_PROBE_SLAVE_CONNECT 2024 -#define CR_PROBE_MASTER_CONNECT 2025 -#define CR_SSL_CONNECTION_ERROR 2026 -#define CR_MALFORMED_PACKET 2027 -#define CR_WRONG_LICENSE 2028 - -/* new 4.1 error codes */ -#define CR_NULL_POINTER 2029 -#define CR_NO_PREPARE_STMT 2030 -#define CR_PARAMS_NOT_BOUND 2031 -#define CR_DATA_TRUNCATED 2032 -#define CR_NO_PARAMETERS_EXISTS 2033 -#define CR_INVALID_PARAMETER_NO 2034 -#define CR_INVALID_BUFFER_USE 2035 -#define CR_UNSUPPORTED_PARAM_TYPE 2036 - -#define CR_SHARED_MEMORY_CONNECTION 2037 -#define CR_SHARED_MEMORY_CONNECT_REQUEST_ERROR 2038 -#define CR_SHARED_MEMORY_CONNECT_ANSWER_ERROR 2039 -#define CR_SHARED_MEMORY_CONNECT_FILE_MAP_ERROR 2040 -#define CR_SHARED_MEMORY_CONNECT_MAP_ERROR 2041 -#define CR_SHARED_MEMORY_FILE_MAP_ERROR 2042 -#define CR_SHARED_MEMORY_MAP_ERROR 2043 -#define CR_SHARED_MEMORY_EVENT_ERROR 2044 -#define CR_SHARED_MEMORY_CONNECT_ABANDONED_ERROR 2045 -#define CR_SHARED_MEMORY_CONNECT_SET_ERROR 2046 -#define CR_CONN_UNKNOW_PROTOCOL 2047 -#define CR_INVALID_CONN_HANDLE 2048 -#define CR_SECURE_AUTH 2049 -#define CR_FETCH_CANCELED 2050 -#define CR_NO_DATA 2051 -#define CR_NO_STMT_METADATA 2052 -#define CR_NO_RESULT_SET 2053 -#define CR_NOT_IMPLEMENTED 2054 -#define CR_SERVER_LOST_EXTENDED 2055 -#define CR_STMT_CLOSED 2056 -#define CR_NEW_STMT_METADATA 2057 -#define CR_ALREADY_CONNECTED 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. */ - -#endif /* ERRMSG_INCLUDED */ diff --git a/dep/mysqllite/include/internal/atomic/gcc_builtins.h b/dep/mysqllite/include/internal/atomic/gcc_builtins.h deleted file mode 100644 index d03d28f572e..00000000000 --- a/dep/mysqllite/include/internal/atomic/gcc_builtins.h +++ /dev/null @@ -1,42 +0,0 @@ -#ifndef ATOMIC_GCC_BUILTINS_INCLUDED -#define ATOMIC_GCC_BUILTINS_INCLUDED - -/* Copyright (C) 2008 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 */ - -#define make_atomic_add_body(S) \ - v= __sync_fetch_and_add(a, v); -#define make_atomic_fas_body(S) \ - v= __sync_lock_test_and_set(a, v); -#define make_atomic_cas_body(S) \ - int ## S sav; \ - int ## S cmp_val= *cmp; \ - sav= __sync_val_compare_and_swap(a, cmp_val, set);\ - if (!(ret= (sav == cmp_val))) *cmp= sav - -#ifdef MY_ATOMIC_MODE_DUMMY -#define make_atomic_load_body(S) ret= *a -#define make_atomic_store_body(S) *a= v -#define MY_ATOMIC_MODE "gcc-builtins-up" - -#else -#define MY_ATOMIC_MODE "gcc-builtins-smp" -#define make_atomic_load_body(S) \ - ret= __sync_fetch_and_or(a, 0); -#define make_atomic_store_body(S) \ - (void) __sync_lock_test_and_set(a, v); -#endif - -#endif /* ATOMIC_GCC_BUILTINS_INCLUDED */ diff --git a/dep/mysqllite/include/internal/atomic/generic-msvc.h b/dep/mysqllite/include/internal/atomic/generic-msvc.h deleted file mode 100644 index a84cde6b2c3..00000000000 --- a/dep/mysqllite/include/internal/atomic/generic-msvc.h +++ /dev/null @@ -1,134 +0,0 @@ -/* Copyright (C) 2006-2008 MySQL AB, 2008-2009 Sun Microsystems, Inc. - - 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 */ - -#ifndef _atomic_h_cleanup_ -#define _atomic_h_cleanup_ "atomic/generic-msvc.h" - -/* - We don't implement anything specific for MY_ATOMIC_MODE_DUMMY, always use - intrinsics. - 8 and 16-bit atomics are not implemented, but it can be done if necessary. -*/ -#undef MY_ATOMIC_HAS_8_16 - -#include <windows.h> -/* - x86 compilers (both VS2003 or VS2005) never use instrinsics, but generate - function calls to kernel32 instead, even in the optimized build. - We force intrinsics as described in MSDN documentation for - _InterlockedCompareExchange. -*/ -#ifdef _M_IX86 - -#if (_MSC_VER >= 1500) -#include <intrin.h> -#else -C_MODE_START -/*Visual Studio 2003 and earlier do not have prototypes for atomic intrinsics*/ -LONG _InterlockedCompareExchange (LONG volatile *Target, LONG Value, LONG Comp); -LONGLONG _InterlockedCompareExchange64 (LONGLONG volatile *Target, - LONGLONG Value, LONGLONG Comp); -C_MODE_END - -#pragma intrinsic(_InterlockedCompareExchange) -#pragma intrinsic(_InterlockedCompareExchange64) -#endif - -#define InterlockedCompareExchange _InterlockedCompareExchange -#define InterlockedCompareExchange64 _InterlockedCompareExchange64 -/* - No need to do something special for InterlockedCompareExchangePointer - as it is a #define to InterlockedCompareExchange. The same applies to - InterlockedExchangePointer. -*/ -#endif /*_M_IX86*/ - -#define MY_ATOMIC_MODE "msvc-intrinsics" -/* Implement using CAS on WIN32 */ -#define IL_COMP_EXCHG32(X,Y,Z) \ - InterlockedCompareExchange((volatile LONG *)(X),(Y),(Z)) -#define IL_COMP_EXCHG64(X,Y,Z) \ - InterlockedCompareExchange64((volatile LONGLONG *)(X), \ - (LONGLONG)(Y),(LONGLONG)(Z)) -#define IL_COMP_EXCHGptr InterlockedCompareExchangePointer - -#define make_atomic_cas_body(S) \ - int ## S initial_cmp= *cmp; \ - int ## S initial_a= IL_COMP_EXCHG ## S (a, set, initial_cmp); \ - if (!(ret= (initial_a == initial_cmp))) *cmp= initial_a; - -#ifndef _M_IX86 -/* Use full set of optimised functions on WIN64 */ -#define IL_EXCHG_ADD32(X,Y) \ - InterlockedExchangeAdd((volatile LONG *)(X),(Y)) -#define IL_EXCHG_ADD64(X,Y) \ - InterlockedExchangeAdd64((volatile LONGLONG *)(X),(LONGLONG)(Y)) -#define IL_EXCHG32(X,Y) \ - InterlockedExchange((volatile LONG *)(X),(Y)) -#define IL_EXCHG64(X,Y) \ - InterlockedExchange64((volatile LONGLONG *)(X),(LONGLONG)(Y)) -#define IL_EXCHGptr InterlockedExchangePointer - -#define make_atomic_add_body(S) \ - v= IL_EXCHG_ADD ## S (a, v) -#define make_atomic_swap_body(S) \ - v= IL_EXCHG ## S (a, v) -#define make_atomic_load_body(S) \ - ret= 0; /* avoid compiler warning */ \ - ret= IL_COMP_EXCHG ## S (a, ret, ret); -#endif -/* - my_yield_processor (equivalent of x86 PAUSE instruction) should be used - to improve performance on hyperthreaded CPUs. Intel recommends to use it in - spin loops also on non-HT machines to reduce power consumption (see e.g - http://softwarecommunity.intel.com/articles/eng/2004.htm) - - Running benchmarks for spinlocks implemented with InterlockedCompareExchange - and YieldProcessor shows that much better performance is achieved by calling - YieldProcessor in a loop - that is, yielding longer. On Intel boxes setting - loop count in the range 200-300 brought best results. - */ -#ifndef YIELD_LOOPS -#define YIELD_LOOPS 200 -#endif - -static __inline int my_yield_processor() -{ - int i; - for(i=0; i<YIELD_LOOPS; i++) - { -#if (_MSC_VER <= 1310) - /* On older compilers YieldProcessor is not available, use inline assembly*/ - __asm { rep nop } -#else - YieldProcessor(); -#endif - } - return 1; -} - -#define LF_BACKOFF my_yield_processor() -#else /* cleanup */ - -#undef IL_EXCHG_ADD32 -#undef IL_EXCHG_ADD64 -#undef IL_COMP_EXCHG32 -#undef IL_COMP_EXCHG64 -#undef IL_COMP_EXCHGptr -#undef IL_EXCHG32 -#undef IL_EXCHG64 -#undef IL_EXCHGptr - -#endif diff --git a/dep/mysqllite/include/internal/atomic/nolock.h b/dep/mysqllite/include/internal/atomic/nolock.h deleted file mode 100644 index 4c871473b60..00000000000 --- a/dep/mysqllite/include/internal/atomic/nolock.h +++ /dev/null @@ -1,69 +0,0 @@ -#ifndef ATOMIC_NOLOCK_INCLUDED -#define ATOMIC_NOLOCK_INCLUDED - -/* Copyright (C) 2006 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 */ - -#if defined(__i386__) || defined(_MSC_VER) || defined(__x86_64__) \ - || defined(HAVE_GCC_ATOMIC_BUILTINS) \ - || defined(HAVE_SOLARIS_ATOMIC) - -# ifdef MY_ATOMIC_MODE_DUMMY -# define LOCK_prefix "" -# else -# define LOCK_prefix "lock" -# endif -/* - We choose implementation as follows: - ------------------------------------ - On Windows using Visual C++ the native implementation should be - preferrable. When using gcc we prefer the Solaris implementation - before the gcc because of stability preference, we choose gcc - builtins if available, otherwise we choose the somewhat broken - native x86 implementation. If neither Visual C++ or gcc we still - choose the Solaris implementation on Solaris (mainly for SunStudio - compilers). -*/ -# if defined(_MSV_VER) -# include "generic-msvc.h" -# elif __GNUC__ -# if defined(HAVE_SOLARIS_ATOMIC) -# include "solaris.h" -# elif defined(HAVE_GCC_ATOMIC_BUILTINS) -# include "gcc_builtins.h" -# elif defined(__i386__) || defined(__x86_64__) -# include "x86-gcc.h" -# endif -# elif defined(HAVE_SOLARIS_ATOMIC) -# include "solaris.h" -# endif -#endif - -#if defined(make_atomic_cas_body) -/* - Type not used so minimal size (emptry struct has different size between C - and C++, zero-length array is gcc-specific). -*/ -typedef char my_atomic_rwlock_t __attribute__ ((unused)); -#define my_atomic_rwlock_destroy(name) -#define my_atomic_rwlock_init(name) -#define my_atomic_rwlock_rdlock(name) -#define my_atomic_rwlock_wrlock(name) -#define my_atomic_rwlock_rdunlock(name) -#define my_atomic_rwlock_wrunlock(name) - -#endif - -#endif /* ATOMIC_NOLOCK_INCLUDED */ diff --git a/dep/mysqllite/include/internal/atomic/rwlock.h b/dep/mysqllite/include/internal/atomic/rwlock.h deleted file mode 100644 index a31f8ed6ca1..00000000000 --- a/dep/mysqllite/include/internal/atomic/rwlock.h +++ /dev/null @@ -1,100 +0,0 @@ -#ifndef ATOMIC_RWLOCK_INCLUDED -#define ATOMIC_RWLOCK_INCLUDED - -/* Copyright (C) 2006 MySQL AB, 2009 Sun Microsystems, Inc. - - 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 */ - -#define MY_ATOMIC_MODE_RWLOCKS 1 - -#ifdef MY_ATOMIC_MODE_DUMMY -/* - the following can never be enabled by ./configure, one need to put #define in - a source to trigger the following warning. The resulting code will be broken, - it only makes sense to do it to see now test_atomic detects broken - implementations (another way is to run a UP build on an SMP box). -*/ -#warning MY_ATOMIC_MODE_DUMMY and MY_ATOMIC_MODE_RWLOCKS are incompatible - -typedef char my_atomic_rwlock_t; - -#define my_atomic_rwlock_destroy(name) -#define my_atomic_rwlock_init(name) -#define my_atomic_rwlock_rdlock(name) -#define my_atomic_rwlock_wrlock(name) -#define my_atomic_rwlock_rdunlock(name) -#define my_atomic_rwlock_wrunlock(name) -#define MY_ATOMIC_MODE "dummy (non-atomic)" -#else /* not MY_ATOMIC_MODE_DUMMY */ - -typedef struct {pthread_mutex_t rw;} my_atomic_rwlock_t; - -#ifndef SAFE_MUTEX - -/* - we're using read-write lock macros but map them to mutex locks, and they're - faster. Still, having semantically rich API we can change the - underlying implementation, if necessary. -*/ -#define my_atomic_rwlock_destroy(name) pthread_mutex_destroy(& (name)->rw) -#define my_atomic_rwlock_init(name) pthread_mutex_init(& (name)->rw, 0) -#define my_atomic_rwlock_rdlock(name) pthread_mutex_lock(& (name)->rw) -#define my_atomic_rwlock_wrlock(name) pthread_mutex_lock(& (name)->rw) -#define my_atomic_rwlock_rdunlock(name) pthread_mutex_unlock(& (name)->rw) -#define my_atomic_rwlock_wrunlock(name) pthread_mutex_unlock(& (name)->rw) - -#else /* SAFE_MUTEX */ - -/* - SAFE_MUTEX pollutes the compiling name space with macros - that alter pthread_mutex_t, pthread_mutex_init, etc. - Atomic operations should never use the safe mutex wrappers. - Unfortunately, there is no way to have both: - - safe mutex macros expanding pthread_mutex_lock to safe_mutex_lock - - my_atomic macros expanding to unmodified pthread_mutex_lock - inlined in the same compilation unit. - So, in case of SAFE_MUTEX, a function call is required. - Given that SAFE_MUTEX is a debugging facility, - this extra function call is not a performance concern for - production builds. -*/ -C_MODE_START -extern void plain_pthread_mutex_init(safe_mutex_t *); -extern void plain_pthread_mutex_destroy(safe_mutex_t *); -extern void plain_pthread_mutex_lock(safe_mutex_t *); -extern void plain_pthread_mutex_unlock(safe_mutex_t *); -C_MODE_END - -#define my_atomic_rwlock_destroy(name) plain_pthread_mutex_destroy(&(name)->rw) -#define my_atomic_rwlock_init(name) plain_pthread_mutex_init(&(name)->rw) -#define my_atomic_rwlock_rdlock(name) plain_pthread_mutex_lock(&(name)->rw) -#define my_atomic_rwlock_wrlock(name) plain_pthread_mutex_lock(&(name)->rw) -#define my_atomic_rwlock_rdunlock(name) plain_pthread_mutex_unlock(&(name)->rw) -#define my_atomic_rwlock_wrunlock(name) plain_pthread_mutex_unlock(&(name)->rw) - -#endif /* SAFE_MUTEX */ - -#define MY_ATOMIC_MODE "mutex" -#ifndef MY_ATOMIC_MODE_RWLOCKS -#define MY_ATOMIC_MODE_RWLOCKS 1 -#endif -#endif - -#define make_atomic_add_body(S) int ## S sav; sav= *a; *a+= v; v=sav; -#define make_atomic_fas_body(S) int ## S sav; sav= *a; *a= v; v=sav; -#define make_atomic_cas_body(S) if ((ret= (*a == *cmp))) *a= set; else *cmp=*a; -#define make_atomic_load_body(S) ret= *a; -#define make_atomic_store_body(S) *a= v; - -#endif /* ATOMIC_RWLOCK_INCLUDED */ diff --git a/dep/mysqllite/include/internal/atomic/solaris.h b/dep/mysqllite/include/internal/atomic/solaris.h deleted file mode 100644 index 5643f878cd2..00000000000 --- a/dep/mysqllite/include/internal/atomic/solaris.h +++ /dev/null @@ -1,72 +0,0 @@ -/* Copyright (C) 2008 MySQL AB, 2009 Sun Microsystems, Inc - - 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 */ - -#ifndef _atomic_h_cleanup_ -#define _atomic_h_cleanup_ "atomic/solaris.h" - -#include <atomic.h> - -#define MY_ATOMIC_MODE "solaris-atomic" - -#if defined(__GNUC__) -#define atomic_typeof(T,V) __typeof__(V) -#else -#define atomic_typeof(T,V) T -#endif - -#define uintptr_t void * -#define atomic_or_ptr_nv(X,Y) (void *)atomic_or_ulong_nv((volatile ulong_t *)X, Y) - -#define make_atomic_cas_body(S) \ - atomic_typeof(uint ## S ## _t, *cmp) sav; \ - sav = atomic_cas_ ## S( \ - (volatile uint ## S ## _t *)a, \ - (uint ## S ## _t)*cmp, \ - (uint ## S ## _t)set); \ - if (! (ret= (sav == *cmp))) \ - *cmp= sav; - -#define make_atomic_add_body(S) \ - int ## S nv; /* new value */ \ - nv= atomic_add_ ## S ## _nv((volatile uint ## S ## _t *)a, v); \ - v= nv - v - -/* ------------------------------------------------------------------------ */ - -#ifdef MY_ATOMIC_MODE_DUMMY - -#define make_atomic_load_body(S) ret= *a -#define make_atomic_store_body(S) *a= v - -#else /* MY_ATOMIC_MODE_DUMMY */ - -#define make_atomic_load_body(S) \ - ret= atomic_or_ ## S ## _nv((volatile uint ## S ## _t *)a, 0) - -#define make_atomic_store_body(S) \ - (void) atomic_swap_ ## S((volatile uint ## S ## _t *)a, (uint ## S ## _t)v) - -#endif - -#define make_atomic_fas_body(S) \ - v= atomic_swap_ ## S((volatile uint ## S ## _t *)a, (uint ## S ## _t)v) - -#else /* cleanup */ - -#undef uintptr_t -#undef atomic_or_ptr_nv - -#endif - diff --git a/dep/mysqllite/include/internal/atomic/x86-gcc.h b/dep/mysqllite/include/internal/atomic/x86-gcc.h deleted file mode 100644 index ea3202aa9c9..00000000000 --- a/dep/mysqllite/include/internal/atomic/x86-gcc.h +++ /dev/null @@ -1,145 +0,0 @@ -#ifndef ATOMIC_X86_GCC_INCLUDED -#define ATOMIC_X86_GCC_INCLUDED - -/* Copyright (C) 2006 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 */ - -/* - XXX 64-bit atomic operations can be implemented using - cmpxchg8b, if necessary. Though I've heard that not all 64-bit - architectures support double-word (128-bit) cas. -*/ - -/* - No special support of 8 and 16 bit operations are implemented here - currently. -*/ -#undef MY_ATOMIC_HAS_8_AND_16 - -#ifdef __x86_64__ -# ifdef MY_ATOMIC_NO_XADD -# define MY_ATOMIC_MODE "gcc-amd64" LOCK_prefix "-no-xadd" -# else -# define MY_ATOMIC_MODE "gcc-amd64" LOCK_prefix -# endif -#else -# ifdef MY_ATOMIC_NO_XADD -# define MY_ATOMIC_MODE "gcc-x86" LOCK_prefix "-no-xadd" -# else -# define MY_ATOMIC_MODE "gcc-x86" LOCK_prefix -# endif -#endif - -/* fix -ansi errors while maintaining readability */ -#ifndef asm -#define asm __asm__ -#endif - -#ifndef MY_ATOMIC_NO_XADD -#define make_atomic_add_body(S) make_atomic_add_body ## S -#define make_atomic_cas_body(S) make_atomic_cas_body ## S -#endif - -#define make_atomic_add_body32 \ - asm volatile (LOCK_prefix "; xadd %0, %1;" \ - : "+r" (v), "=m" (*a) \ - : "m" (*a) \ - : "memory") - -#define make_atomic_cas_body32 \ - __typeof__(*cmp) sav; \ - asm volatile (LOCK_prefix "; cmpxchg %3, %0; setz %2;" \ - : "=m" (*a), "=a" (sav), "=q" (ret) \ - : "r" (set), "m" (*a), "a" (*cmp) \ - : "memory"); \ - if (!ret) \ - *cmp= sav - -#ifdef __x86_64__ -#define make_atomic_add_body64 make_atomic_add_body32 -#define make_atomic_cas_body64 make_atomic_cas_body32 - -#define make_atomic_fas_body(S) \ - asm volatile ("xchg %0, %1;" \ - : "+r" (v), "=m" (*a) \ - : "m" (*a) \ - : "memory") - -/* - Actually 32/64-bit reads/writes are always atomic on x86_64, - nonetheless issue memory barriers as appropriate. -*/ -#define make_atomic_load_body(S) \ - /* Serialize prior load and store operations. */ \ - asm volatile ("mfence" ::: "memory"); \ - ret= *a; \ - /* Prevent compiler from reordering instructions. */ \ - asm volatile ("" ::: "memory") -#define make_atomic_store_body(S) \ - asm volatile ("; xchg %0, %1;" \ - : "=m" (*a), "+r" (v) \ - : "m" (*a) \ - : "memory") - -#else -/* - Use default implementations of 64-bit operations since we solved - the 64-bit problem on 32-bit platforms for CAS, no need to solve it - once more for ADD, LOAD, STORE and FAS as well. - Since we already added add32 support, we need to define add64 - here, but we haven't defined fas, load and store at all, so - we can fallback on default implementations. -*/ -#define make_atomic_add_body64 \ - int64 tmp=*a; \ - while (!my_atomic_cas64(a, &tmp, tmp+v)) ; \ - v=tmp; - -/* - On some platforms (e.g. Mac OS X and Solaris) the ebx register - is held as a pointer to the global offset table. Thus we're not - allowed to use the b-register on those platforms when compiling - PIC code, to avoid this we push ebx and pop ebx. The new value - is copied directly from memory to avoid problems with a implicit - manipulation of the stack pointer by the push. - - cmpxchg8b works on both 32-bit platforms and 64-bit platforms but - the code here is only used on 32-bit platforms, on 64-bit - platforms the much simpler make_atomic_cas_body32 will work - fine. -*/ -#define make_atomic_cas_body64 \ - asm volatile ("push %%ebx;" \ - "movl (%%ecx), %%ebx;" \ - "movl 4(%%ecx), %%ecx;" \ - LOCK_prefix "; cmpxchg8b %0;" \ - "setz %2; pop %%ebx" \ - : "=m" (*a), "+A" (*cmp), "=c" (ret) \ - : "c" (&set), "m" (*a) \ - : "memory", "esp") -#endif - -/* - The implementation of make_atomic_cas_body32 is adaptable to - the OS word size, so on 64-bit platforms it will automatically - adapt to 64-bits and so it will work also on 64-bit platforms -*/ -#define make_atomic_cas_bodyptr make_atomic_cas_body32 - -#ifdef MY_ATOMIC_MODE_DUMMY -#define make_atomic_load_body(S) ret=*a -#define make_atomic_store_body(S) *a=v -#endif -#endif /* ATOMIC_X86_GCC_INCLUDED */ diff --git a/dep/mysqllite/include/internal/base64.h b/dep/mysqllite/include/internal/base64.h deleted file mode 100644 index 4ac0aa72ad8..00000000000 --- a/dep/mysqllite/include/internal/base64.h +++ /dev/null @@ -1,48 +0,0 @@ -/* Copyright (C) 2003 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 */ - -#ifndef __BASE64_H_INCLUDED__ -#define __BASE64_H_INCLUDED__ - -#ifdef __cplusplus -extern "C" { -#endif - -/* - Calculate how much memory needed for dst of base64_encode() -*/ -int base64_needed_encoded_length(int length_of_data); - -/* - Calculate how much memory needed for dst of base64_decode() -*/ -int base64_needed_decoded_length(int length_of_encoded_data); - -/* - Encode data as a base64 string -*/ -int base64_encode(const void *src, size_t src_len, char *dst); - -/* - Decode a base64 string into data -*/ -int base64_decode(const char *src, size_t src_len, - void *dst, const char **end_ptr); - - -#ifdef __cplusplus -} -#endif -#endif /* !__BASE64_H_INCLUDED__ */ diff --git a/dep/mysqllite/include/internal/hash.h b/dep/mysqllite/include/internal/hash.h deleted file mode 100644 index d390cb7d4e6..00000000000 --- a/dep/mysqllite/include/internal/hash.h +++ /dev/null @@ -1,108 +0,0 @@ -/* Copyright 2000-2008 MySQL AB, 2008 Sun Microsystems, Inc. - - 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 */ - -/* Dynamic hashing of record with different key-length */ - -#ifndef _hash_h -#define _hash_h - -#include "my_global.h" /* uchar */ -#include "my_sys.h" /* DYNAMIC_ARRAY */ - -/* - This forward declaration is used from C files where the real - definition is included before. Since C does not allow repeated - typedef declarations, even when identical, the definition may not be - repeated. -*/ -#ifndef CHARSET_INFO_DEFINED -#define CHARSET_INFO_DEFINED -typedef struct charset_info_st CHARSET_INFO; -#endif /* CHARSET_INFO_DEFINED */ - -#ifdef __cplusplus -extern "C" { -#endif - -/* - Overhead to store an element in hash - Can be used to approximate memory consumption for a hash - */ -#define HASH_OVERHEAD (sizeof(char*)*2) - -/* flags for hash_init */ -#define HASH_UNIQUE 1 /* hash_insert fails on duplicate key */ - -typedef uint my_hash_value_type; -typedef uchar *(*my_hash_get_key)(const uchar *,size_t*,my_bool); -typedef void (*my_hash_free_key)(void *); - -typedef struct st_hash { - size_t key_offset,key_length; /* Length of key if const length */ - size_t blength; - ulong records; - uint flags; - DYNAMIC_ARRAY array; /* Place for hash_keys */ - my_hash_get_key get_key; - void (*free)(void *); - CHARSET_INFO *charset; -} HASH; - -/* A search iterator state */ -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) -#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) -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); -void my_hash_free(HASH *tree); -void my_hash_reset(HASH *hash); -uchar *my_hash_element(HASH *hash, ulong idx); -uchar *my_hash_search(const HASH *info, const uchar *key, size_t length); -uchar *my_hash_search_using_hash_value(const HASH *info, - my_hash_value_type hash_value, - const uchar *key, size_t length); -my_hash_value_type my_calc_hash(const HASH *info, - const uchar *key, size_t length); -uchar *my_hash_first(const HASH *info, const uchar *key, size_t length, - HASH_SEARCH_STATE *state); -uchar *my_hash_first_from_hash_value(const HASH *info, - my_hash_value_type hash_value, - const uchar *key, - size_t length, - HASH_SEARCH_STATE *state); -uchar *my_hash_next(const HASH *info, const uchar *key, size_t length, - HASH_SEARCH_STATE *state); -my_bool my_hash_insert(HASH *info, const uchar *data); -my_bool my_hash_delete(HASH *hash, uchar *record); -my_bool my_hash_update(HASH *hash, uchar *record, uchar *old_key, - size_t old_key_length); -void my_hash_replace(HASH *hash, HASH_SEARCH_STATE *state, uchar *new_row); -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)) - -#ifdef __cplusplus -} -#endif -#endif diff --git a/dep/mysqllite/include/internal/lf.h b/dep/mysqllite/include/internal/lf.h deleted file mode 100644 index e9fb094493f..00000000000 --- a/dep/mysqllite/include/internal/lf.h +++ /dev/null @@ -1,265 +0,0 @@ -/* Copyright (C) 2007-2008 MySQL AB, 2008-2009 Sun Microsystems, Inc. - - 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 */ - -#ifndef _lf_h -#define _lf_h - -#include <my_atomic.h> - -C_MODE_START - -/* - Helpers to define both func() and _func(), where - func() is a _func() protected by my_atomic_rwlock_wrlock() -*/ - -#define lock_wrap(f, t, proto_args, args, lock) \ -t _ ## f proto_args; \ -static inline t f proto_args \ -{ \ - t ret; \ - my_atomic_rwlock_wrlock(lock); \ - ret= _ ## f args; \ - my_atomic_rwlock_wrunlock(lock); \ - return ret; \ -} - -#define lock_wrap_void(f, proto_args, args, lock) \ -void _ ## f proto_args; \ -static inline void f proto_args \ -{ \ - my_atomic_rwlock_wrlock(lock); \ - _ ## f args; \ - my_atomic_rwlock_wrunlock(lock); \ -} - -#define nolock_wrap(f, t, proto_args, args) \ -t _ ## f proto_args; \ -static inline t f proto_args \ -{ \ - return _ ## f args; \ -} - -#define nolock_wrap_void(f, proto_args, args) \ -void _ ## f proto_args; \ -static inline void f proto_args \ -{ \ - _ ## f args; \ -} - -/* - wait-free dynamic array, see lf_dynarray.c - - 4 levels of 256 elements each mean 4311810304 elements in an array - it - should be enough for a while -*/ -#define LF_DYNARRAY_LEVEL_LENGTH 256 -#define LF_DYNARRAY_LEVELS 4 - -typedef struct { - void * volatile level[LF_DYNARRAY_LEVELS]; - uint size_of_element; - my_atomic_rwlock_t lock; -} LF_DYNARRAY; - -typedef int (*lf_dynarray_func)(void *, void *); - -void lf_dynarray_init(LF_DYNARRAY *array, uint element_size); -void lf_dynarray_destroy(LF_DYNARRAY *array); - -nolock_wrap(lf_dynarray_value, void *, - (LF_DYNARRAY *array, uint idx), - (array, idx)) -lock_wrap(lf_dynarray_lvalue, void *, - (LF_DYNARRAY *array, uint idx), - (array, idx), - &array->lock) -nolock_wrap(lf_dynarray_iterate, int, - (LF_DYNARRAY *array, lf_dynarray_func func, void *arg), - (array, func, arg)) - -/* - pin manager for memory allocator, lf_alloc-pin.c -*/ - -#define LF_PINBOX_PINS 4 -#define LF_PURGATORY_SIZE 10 - -typedef void lf_pinbox_free_func(void *, void *, void*); - -typedef struct { - LF_DYNARRAY pinarray; - lf_pinbox_free_func *free_func; - void *free_func_arg; - uint free_ptr_offset; - uint32 volatile pinstack_top_ver; /* this is a versioned pointer */ - uint32 volatile pins_in_array; /* number of elements in array */ -} LF_PINBOX; - -typedef struct { - void * volatile pin[LF_PINBOX_PINS]; - LF_PINBOX *pinbox; - void **stack_ends_here; - void *purgatory; - uint32 purgatory_count; - uint32 volatile link; -/* we want sizeof(LF_PINS) to be 64 to avoid false sharing */ -#if SIZEOF_INT*2+SIZEOF_CHARP*(LF_PINBOX_PINS+3) != 64 - char pad[64-sizeof(uint32)*2-sizeof(void*)*(LF_PINBOX_PINS+3)]; -#endif -} LF_PINS; - -/* - shortcut macros to do an atomic_wrlock on a structure that uses pins - (e.g. lf_hash). -*/ -#define lf_rwlock_by_pins(PINS) \ - my_atomic_rwlock_wrlock(&(PINS)->pinbox->pinarray.lock) -#define lf_rwunlock_by_pins(PINS) \ - my_atomic_rwlock_wrunlock(&(PINS)->pinbox->pinarray.lock) - -/* - compile-time assert, to require "no less than N" pins - it's enough if it'll fail on at least one compiler, so - we'll enable it on GCC only, which supports zero-length arrays. -*/ -#if defined(__GNUC__) && defined(MY_LF_EXTRA_DEBUG) -#define LF_REQUIRE_PINS(N) \ - static const char require_pins[LF_PINBOX_PINS-N] \ - __attribute__ ((unused)); \ - static const int LF_NUM_PINS_IN_THIS_FILE= N; -#define _lf_pin(PINS, PIN, ADDR) \ - ( \ - assert(PIN < LF_NUM_PINS_IN_THIS_FILE), \ - my_atomic_storeptr(&(PINS)->pin[PIN], (ADDR)) \ - ) -#else -#define LF_REQUIRE_PINS(N) -#define _lf_pin(PINS, PIN, ADDR) my_atomic_storeptr(&(PINS)->pin[PIN], (ADDR)) -#endif - -#define _lf_unpin(PINS, PIN) _lf_pin(PINS, PIN, NULL) -#define lf_pin(PINS, PIN, ADDR) \ - do { \ - lf_rwlock_by_pins(PINS); \ - _lf_pin(PINS, PIN, ADDR); \ - lf_rwunlock_by_pins(PINS); \ - } while (0) -#define lf_unpin(PINS, PIN) lf_pin(PINS, PIN, NULL) -#define _lf_assert_pin(PINS, PIN) assert((PINS)->pin[PIN] != 0) -#define _lf_assert_unpin(PINS, PIN) assert((PINS)->pin[PIN] == 0) - -void lf_pinbox_init(LF_PINBOX *pinbox, uint free_ptr_offset, - lf_pinbox_free_func *free_func, void * free_func_arg); -void lf_pinbox_destroy(LF_PINBOX *pinbox); - -lock_wrap(lf_pinbox_get_pins, LF_PINS *, - (LF_PINBOX *pinbox), - (pinbox), - &pinbox->pinarray.lock) -lock_wrap_void(lf_pinbox_put_pins, - (LF_PINS *pins), - (pins), - &pins->pinbox->pinarray.lock) -lock_wrap_void(lf_pinbox_free, - (LF_PINS *pins, void *addr), - (pins, addr), - &pins->pinbox->pinarray.lock) - -/* - memory allocator, lf_alloc-pin.c -*/ - -typedef struct st_lf_allocator { - LF_PINBOX pinbox; - uchar * volatile top; - uint element_size; - uint32 volatile mallocs; -} LF_ALLOCATOR; - -void lf_alloc_init(LF_ALLOCATOR *allocator, uint size, uint free_ptr_offset); -void lf_alloc_destroy(LF_ALLOCATOR *allocator); -uint lf_alloc_pool_count(LF_ALLOCATOR *allocator); -/* - shortcut macros to access underlying pinbox functions from an LF_ALLOCATOR - see _lf_pinbox_get_pins() and _lf_pinbox_put_pins() -*/ -#define _lf_alloc_free(PINS, PTR) _lf_pinbox_free((PINS), (PTR)) -#define lf_alloc_free(PINS, PTR) lf_pinbox_free((PINS), (PTR)) -#define _lf_alloc_get_pins(A) _lf_pinbox_get_pins(&(A)->pinbox) -#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((ADDR)) - -lock_wrap(lf_alloc_new, void *, - (LF_PINS *pins), - (pins), - &pins->pinbox->pinarray.lock) - -C_MODE_END - -/* - extendible hash, lf_hash.c -*/ -#include <hash.h> - -C_MODE_START - -#define LF_HASH_UNIQUE 1 - -/* lf_hash overhead per element is sizeof(LF_SLIST). */ - -typedef struct { - LF_DYNARRAY array; /* hash itself */ - LF_ALLOCATOR alloc; /* allocator for elements */ - my_hash_get_key get_key; /* see HASH */ - CHARSET_INFO *charset; /* see HASH */ - uint key_offset, key_length; /* see HASH */ - uint element_size; /* size of memcpy'ed area on insert */ - uint flags; /* LF_HASH_UNIQUE, etc */ - int32 volatile size; /* size of array */ - int32 volatile count; /* number of elements in the hash */ -} LF_HASH; - -void lf_hash_init(LF_HASH *hash, uint element_size, uint flags, - uint key_offset, uint key_length, my_hash_get_key get_key, - CHARSET_INFO *charset); -void lf_hash_destroy(LF_HASH *hash); -int lf_hash_insert(LF_HASH *hash, LF_PINS *pins, const void *data); -void *lf_hash_search(LF_HASH *hash, LF_PINS *pins, const void *key, uint keylen); -int lf_hash_delete(LF_HASH *hash, LF_PINS *pins, const void *key, uint keylen); -/* - shortcut macros to access underlying pinbox functions from an LF_HASH - see _lf_pinbox_get_pins() and _lf_pinbox_put_pins() -*/ -#define _lf_hash_get_pins(HASH) _lf_alloc_get_pins(&(HASH)->alloc) -#define lf_hash_get_pins(HASH) lf_alloc_get_pins(&(HASH)->alloc) -#define _lf_hash_put_pins(PINS) _lf_pinbox_put_pins(PINS) -#define lf_hash_put_pins(PINS) lf_pinbox_put_pins(PINS) -#define lf_hash_search_unpin(PINS) lf_unpin((PINS), 2) -/* - cleanup -*/ - -#undef lock_wrap_void -#undef lock_wrap -#undef nolock_wrap_void -#undef nolock_wrap - -C_MODE_END - -#endif - diff --git a/dep/mysqllite/include/internal/my_aes.h b/dep/mysqllite/include/internal/my_aes.h deleted file mode 100644 index 2e2a66b4968..00000000000 --- a/dep/mysqllite/include/internal/my_aes.h +++ /dev/null @@ -1,70 +0,0 @@ -#ifndef MY_AES_INCLUDED -#define MY_AES_INCLUDED - -/* Copyright (C) 2002 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 file for my_aes.c */ -/* Wrapper to give simple interface for MySQL to AES standard encryption */ - -#include "rijndael.h" - -C_MODE_START - -#define AES_KEY_LENGTH 128 /* Must be 128 192 or 256 */ - -/* - my_aes_encrypt - Crypt buffer with AES encryption algorithm. - source - Pointer to data for encryption - source_length - size of encryption data - dest - buffer to place encrypted data (must be large enough) - key - Key to be used for encryption - kel_length - Length of the key. Will handle keys of any length - - returns - size of encrypted data, or negative in case of error. -*/ - -int my_aes_encrypt(const char *source, int source_length, char *dest, - const char *key, int key_length); - -/* - my_aes_decrypt - DeCrypt buffer with AES encryption algorithm. - source - Pointer to data for decryption - source_length - size of encrypted data - dest - buffer to place decrypted data (must be large enough) - key - Key to be used for decryption - kel_length - Length of the key. Will handle keys of any length - - returns - size of original data, or negative in case of error. -*/ - - -int my_aes_decrypt(const char *source, int source_length, char *dest, - const char *key, int key_length); - -/* - my_aes_get_size - get size of buffer which will be large enough for encrypted - data - source_length - length of data to be encrypted - - returns - size of buffer required to store encrypted data -*/ - -int my_aes_get_size(int source_length); - -C_MODE_END - -#endif /* MY_AES_INCLUDED */ diff --git a/dep/mysqllite/include/internal/my_alarm.h b/dep/mysqllite/include/internal/my_alarm.h deleted file mode 100644 index fa396cf02f9..00000000000 --- a/dep/mysqllite/include/internal/my_alarm.h +++ /dev/null @@ -1,58 +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 */ - -/* - File to include when we want to use alarm or a loop_counter to display - some information when a program is running -*/ -#ifndef _my_alarm_h -#define _my_alarm_h -#ifdef __cplusplus -extern "C" { -#endif - -extern int volatile my_have_got_alarm; -extern ulong my_time_to_wait_for_lock; - -#if defined(HAVE_ALARM) && !defined(NO_ALARM_LOOP) -#include <signal.h> -#define ALARM_VARIABLES uint alarm_old=0; \ - sig_return alarm_signal=0 -#define ALARM_INIT my_have_got_alarm=0 ; \ - alarm_old=(uint) alarm(MY_HOW_OFTEN_TO_ALARM); \ - alarm_signal=signal(SIGALRM,my_set_alarm_variable); -#define ALARM_END (void) signal(SIGALRM,alarm_signal); \ - (void) alarm(alarm_old); -#define ALARM_TEST my_have_got_alarm -#ifdef SIGNAL_HANDLER_RESET_ON_DELIVERY -#define ALARM_REINIT (void) alarm(MY_HOW_OFTEN_TO_ALARM); \ - (void) signal(SIGALRM,my_set_alarm_variable);\ - my_have_got_alarm=0; -#else -#define ALARM_REINIT (void) alarm((uint) MY_HOW_OFTEN_TO_ALARM); \ - my_have_got_alarm=0; -#endif /* SIGNAL_HANDLER_RESET_ON_DELIVERY */ -#else -#define ALARM_VARIABLES long alarm_pos=0,alarm_end_pos=MY_HOW_OFTEN_TO_WRITE-1 -#define ALARM_INIT -#define ALARM_END -#define ALARM_TEST (alarm_pos++ >= alarm_end_pos) -#define ALARM_REINIT alarm_end_pos+=MY_HOW_OFTEN_TO_WRITE -#endif /* HAVE_ALARM */ - -#ifdef __cplusplus -} -#endif -#endif diff --git a/dep/mysqllite/include/internal/my_atomic.h b/dep/mysqllite/include/internal/my_atomic.h deleted file mode 100644 index c2d514012d9..00000000000 --- a/dep/mysqllite/include/internal/my_atomic.h +++ /dev/null @@ -1,287 +0,0 @@ -#ifndef MY_ATOMIC_INCLUDED -#define MY_ATOMIC_INCLUDED - -/* Copyright (C) 2006 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 */ - -/* - This header defines five atomic operations: - - my_atomic_add#(&var, what) - 'Fetch and Add' - add 'what' to *var, and return the old value of *var - - my_atomic_fas#(&var, what) - 'Fetch And Store' - store 'what' in *var, and return the old value of *var - - my_atomic_cas#(&var, &old, new) - An odd variation of 'Compare And Set/Swap' - if *var is equal to *old, then store 'new' in *var, and return TRUE - otherwise store *var in *old, and return FALSE - Usually, &old should not be accessed if the operation is successful. - - my_atomic_load#(&var) - return *var - - my_atomic_store#(&var, what) - store 'what' in *var - - '#' is substituted by a size suffix - 8, 16, 32, 64, or ptr - (e.g. my_atomic_add8, my_atomic_fas32, my_atomic_casptr). - - NOTE This operations are not always atomic, so they always must be - enclosed in my_atomic_rwlock_rdlock(lock)/my_atomic_rwlock_rdunlock(lock) - or my_atomic_rwlock_wrlock(lock)/my_atomic_rwlock_wrunlock(lock). - Hint: if a code block makes intensive use of atomic ops, it make sense - to take/release rwlock once for the whole block, not for every statement. - - On architectures where these operations are really atomic, rwlocks will - be optimized away. - 8- and 16-bit atomics aren't implemented for windows (see generic-msvc.h), - but can be added, if necessary. -*/ - -#ifndef my_atomic_rwlock_init - -#define intptr void * -/** - Currently we don't support 8-bit and 16-bit operations. - It can be added later if needed. -*/ -#undef MY_ATOMIC_HAS_8_16 - -#ifndef MY_ATOMIC_MODE_RWLOCKS -/* - * Attempt to do atomic ops without locks - */ -#include "atomic/nolock.h" -#endif - -#ifndef make_atomic_cas_body -/* nolock.h was not able to generate even a CAS function, fall back */ -#include "atomic/rwlock.h" -#endif - -/* define missing functions by using the already generated ones */ -#ifndef make_atomic_add_body -#define make_atomic_add_body(S) \ - int ## S tmp=*a; \ - while (!my_atomic_cas ## S(a, &tmp, tmp+v)) ; \ - v=tmp; -#endif -#ifndef make_atomic_fas_body -#define make_atomic_fas_body(S) \ - int ## S tmp=*a; \ - while (!my_atomic_cas ## S(a, &tmp, v)) ; \ - v=tmp; -#endif -#ifndef make_atomic_load_body -#define make_atomic_load_body(S) \ - ret= 0; /* avoid compiler warning */ \ - (void)(my_atomic_cas ## S(a, &ret, ret)); -#endif -#ifndef make_atomic_store_body -#define make_atomic_store_body(S) \ - (void)(my_atomic_fas ## S (a, v)); -#endif - -/* - transparent_union doesn't work in g++ - Bug ? - - Darwin's gcc doesn't want to put pointers in a transparent_union - when built with -arch ppc64. Complains: - warning: 'transparent_union' attribute ignored -*/ -#if defined(__GNUC__) && !defined(__cplusplus) && \ - ! (defined(__APPLE__) && (defined(_ARCH_PPC64) ||defined (_ARCH_PPC))) -/* - we want to be able to use my_atomic_xxx functions with - both signed and unsigned integers. But gcc will issue a warning - "passing arg N of `my_atomic_XXX' as [un]signed due to prototype" - if the signedness of the argument doesn't match the prototype, or - "pointer targets in passing argument N of my_atomic_XXX differ in signedness" - if int* is used where uint* is expected (or vice versa). - Let's shut these warnings up -*/ -#define make_transparent_unions(S) \ - typedef union { \ - int ## S i; \ - uint ## S u; \ - } U_ ## S __attribute__ ((transparent_union)); \ - typedef union { \ - int ## S volatile *i; \ - uint ## S volatile *u; \ - } Uv_ ## S __attribute__ ((transparent_union)); -#define uintptr intptr -make_transparent_unions(8) -make_transparent_unions(16) -make_transparent_unions(32) -make_transparent_unions(64) -make_transparent_unions(ptr) -#undef uintptr -#undef make_transparent_unions -#define a U_a.i -#define cmp U_cmp.i -#define v U_v.i -#define set U_set.i -#else -#define U_8 int8 -#define U_16 int16 -#define U_32 int32 -#define U_64 int64 -#define U_ptr intptr -#define Uv_8 int8 -#define Uv_16 int16 -#define Uv_32 int32 -#define Uv_64 int64 -#define Uv_ptr intptr -#define U_a volatile *a -#define U_cmp *cmp -#define U_v v -#define U_set set -#endif /* __GCC__ transparent_union magic */ - -#define make_atomic_cas(S) \ -static inline int my_atomic_cas ## S(Uv_ ## S U_a, \ - Uv_ ## S U_cmp, U_ ## S U_set) \ -{ \ - int8 ret; \ - make_atomic_cas_body(S); \ - return ret; \ -} - -#define make_atomic_add(S) \ -static inline int ## S my_atomic_add ## S( \ - Uv_ ## S U_a, U_ ## S U_v) \ -{ \ - make_atomic_add_body(S); \ - return v; \ -} - -#define make_atomic_fas(S) \ -static inline int ## S my_atomic_fas ## S( \ - Uv_ ## S U_a, U_ ## S U_v) \ -{ \ - make_atomic_fas_body(S); \ - return v; \ -} - -#define make_atomic_load(S) \ -static inline int ## S my_atomic_load ## S(Uv_ ## S U_a) \ -{ \ - int ## S ret; \ - make_atomic_load_body(S); \ - return ret; \ -} - -#define make_atomic_store(S) \ -static inline void my_atomic_store ## S( \ - Uv_ ## S U_a, U_ ## S U_v) \ -{ \ - make_atomic_store_body(S); \ -} - -#ifdef MY_ATOMIC_HAS_8_16 -make_atomic_cas(8) -make_atomic_cas(16) -#endif -make_atomic_cas(32) -make_atomic_cas(64) -make_atomic_cas(ptr) - -#ifdef MY_ATOMIC_HAS_8_16 -make_atomic_add(8) -make_atomic_add(16) -#endif -make_atomic_add(32) -make_atomic_add(64) - -#ifdef MY_ATOMIC_HAS_8_16 -make_atomic_load(8) -make_atomic_load(16) -#endif -make_atomic_load(32) -make_atomic_load(64) -make_atomic_load(ptr) - -#ifdef MY_ATOMIC_HAS_8_16 -make_atomic_fas(8) -make_atomic_fas(16) -#endif -make_atomic_fas(32) -make_atomic_fas(64) -make_atomic_fas(ptr) - -#ifdef MY_ATOMIC_HAS_8_16 -make_atomic_store(8) -make_atomic_store(16) -#endif -make_atomic_store(32) -make_atomic_store(64) -make_atomic_store(ptr) - -#ifdef _atomic_h_cleanup_ -#include _atomic_h_cleanup_ -#undef _atomic_h_cleanup_ -#endif - -#undef U_8 -#undef U_16 -#undef U_32 -#undef U_64 -#undef U_ptr -#undef Uv_8 -#undef Uv_16 -#undef Uv_32 -#undef Uv_64 -#undef Uv_ptr -#undef a -#undef cmp -#undef v -#undef set -#undef U_a -#undef U_cmp -#undef U_v -#undef U_set -#undef make_atomic_add -#undef make_atomic_cas -#undef make_atomic_load -#undef make_atomic_store -#undef make_atomic_fas -#undef make_atomic_add_body -#undef make_atomic_cas_body -#undef make_atomic_load_body -#undef make_atomic_store_body -#undef make_atomic_fas_body -#undef intptr - -/* - the macro below defines (as an expression) the code that - will be run in spin-loops. Intel manuals recummend to have PAUSE there. - It is expected to be defined in include/atomic/ *.h files -*/ -#ifndef LF_BACKOFF -#define LF_BACKOFF (1) -#endif - -#define MY_ATOMIC_OK 0 -#define MY_ATOMIC_NOT_1CPU 1 -extern int my_atomic_initialize(); - -#endif - -#endif /* MY_ATOMIC_INCLUDED */ diff --git a/dep/mysqllite/include/internal/my_base.h b/dep/mysqllite/include/internal/my_base.h deleted file mode 100644 index 347bda01bef..00000000000 --- a/dep/mysqllite/include/internal/my_base.h +++ /dev/null @@ -1,572 +0,0 @@ -/* Copyright (C) 2000, 2011, 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 - 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 */ - -/* This file includes constants used with all databases */ - -#ifndef _my_base_h -#define _my_base_h - -#ifndef stdin /* Included first in handler */ -#define CHSIZE_USED -#include <my_global.h> -#include <my_dir.h> /* This includes types */ -#include <my_sys.h> -#include <m_string.h> -#include <errno.h> - -#ifndef EOVERFLOW -#define EOVERFLOW 84 -#endif - -#endif /* stdin */ -#include <my_list.h> - -/* The following is bits in the flag parameter to ha_open() */ - -#define HA_OPEN_ABORT_IF_LOCKED 0 /* default */ -#define HA_OPEN_WAIT_IF_LOCKED 1 -#define HA_OPEN_IGNORE_IF_LOCKED 2 -#define HA_OPEN_TMP_TABLE 4 /* Table is a temp table */ -#define HA_OPEN_DELAY_KEY_WRITE 8 /* Don't update index */ -#define HA_OPEN_ABORT_IF_CRASHED 16 -#define HA_OPEN_FOR_REPAIR 32 /* open even if crashed */ -#define HA_OPEN_FROM_SQL_LAYER 64 -#define HA_OPEN_MMAP 128 /* open memory mapped */ -#define HA_OPEN_COPY 256 /* Open copy (for repair) */ -/* Internal temp table, used for temporary results */ -#define HA_OPEN_INTERNAL_TABLE 512 - -/* The following is parameter to ha_rkey() how to use key */ - -/* - We define a complete-field prefix of a key value as a prefix where - the last included field in the prefix contains the full field, not - just some bytes from the start of the field. A partial-field prefix - is allowed to contain only a few first bytes from the last included - field. - - Below HA_READ_KEY_EXACT, ..., HA_READ_BEFORE_KEY can take a - complete-field prefix of a key value as the search - key. HA_READ_PREFIX and HA_READ_PREFIX_LAST could also take a - partial-field prefix, but currently (4.0.10) they are only used with - complete-field prefixes. MySQL uses a padding trick to implement - LIKE 'abc%' queries. - - NOTE that in InnoDB HA_READ_PREFIX_LAST will NOT work with a - partial-field prefix because InnoDB currently strips spaces from the - end of varchar fields! -*/ - -enum ha_rkey_function { - HA_READ_KEY_EXACT, /* Find first record else error */ - HA_READ_KEY_OR_NEXT, /* Record or next record */ - HA_READ_KEY_OR_PREV, /* Record or previous */ - HA_READ_AFTER_KEY, /* Find next rec. after key-record */ - HA_READ_BEFORE_KEY, /* Find next rec. before key-record */ - HA_READ_PREFIX, /* Key which as same prefix */ - HA_READ_PREFIX_LAST, /* Last key with the same prefix */ - HA_READ_PREFIX_LAST_OR_PREV, /* Last or prev key with the same prefix */ - HA_READ_MBR_CONTAIN, - HA_READ_MBR_INTERSECT, - HA_READ_MBR_WITHIN, - HA_READ_MBR_DISJOINT, - HA_READ_MBR_EQUAL -}; - - /* Key algorithm types */ - -enum ha_key_alg { - HA_KEY_ALG_UNDEF= 0, /* Not specified (old file) */ - HA_KEY_ALG_BTREE= 1, /* B-tree, default one */ - HA_KEY_ALG_RTREE= 2, /* R-tree, for spatial searches */ - HA_KEY_ALG_HASH= 3, /* HASH keys (HEAP tables) */ - HA_KEY_ALG_FULLTEXT= 4 /* FULLTEXT (MyISAM tables) */ -}; - - /* Storage media types */ - -enum ha_storage_media { - HA_SM_DEFAULT= 0, /* Not specified (engine default) */ - HA_SM_DISK= 1, /* DISK storage */ - HA_SM_MEMORY= 2 /* MAIN MEMORY storage */ -}; - - /* The following is parameter to ha_extra() */ - -enum ha_extra_function { - HA_EXTRA_NORMAL=0, /* Optimize for space (def) */ - HA_EXTRA_QUICK=1, /* Optimize for speed */ - HA_EXTRA_NOT_USED=2, - HA_EXTRA_CACHE=3, /* Cache record in HA_rrnd() */ - HA_EXTRA_NO_CACHE=4, /* End caching of records (def) */ - HA_EXTRA_NO_READCHECK=5, /* No readcheck on update */ - HA_EXTRA_READCHECK=6, /* Use readcheck (def) */ - HA_EXTRA_KEYREAD=7, /* Read only key to database */ - HA_EXTRA_NO_KEYREAD=8, /* Normal read of records (def) */ - HA_EXTRA_NO_USER_CHANGE=9, /* No user is allowed to write */ - HA_EXTRA_KEY_CACHE=10, - HA_EXTRA_NO_KEY_CACHE=11, - HA_EXTRA_WAIT_LOCK=12, /* Wait until file is avalably (def) */ - HA_EXTRA_NO_WAIT_LOCK=13, /* If file is locked, return quickly */ - HA_EXTRA_WRITE_CACHE=14, /* Use write cache in ha_write() */ - HA_EXTRA_FLUSH_CACHE=15, /* flush write_record_cache */ - HA_EXTRA_NO_KEYS=16, /* Remove all update of keys */ - HA_EXTRA_KEYREAD_CHANGE_POS=17, /* Keyread, but change pos */ - /* xxxxchk -r must be used */ - HA_EXTRA_REMEMBER_POS=18, /* Remember pos for next/prev */ - HA_EXTRA_RESTORE_POS=19, - HA_EXTRA_REINIT_CACHE=20, /* init cache from current record */ - HA_EXTRA_FORCE_REOPEN=21, /* Datafile have changed on disk */ - HA_EXTRA_FLUSH, /* Flush tables to disk */ - HA_EXTRA_NO_ROWS, /* Don't write rows */ - HA_EXTRA_RESET_STATE, /* Reset positions */ - HA_EXTRA_IGNORE_DUP_KEY, /* Dup keys don't rollback everything*/ - HA_EXTRA_NO_IGNORE_DUP_KEY, - HA_EXTRA_PREPARE_FOR_DROP, - HA_EXTRA_PREPARE_FOR_UPDATE, /* Remove read cache if problems */ - HA_EXTRA_PRELOAD_BUFFER_SIZE, /* Set buffer size for preloading */ - /* - On-the-fly switching between unique and non-unique key inserting. - */ - HA_EXTRA_CHANGE_KEY_TO_UNIQUE, - HA_EXTRA_CHANGE_KEY_TO_DUP, - /* - When using HA_EXTRA_KEYREAD, overwrite only key member fields and keep - other fields intact. When this is off (by default) InnoDB will use memcpy - to overwrite entire row. - */ - HA_EXTRA_KEYREAD_PRESERVE_FIELDS, - HA_EXTRA_MMAP, - /* - Ignore if the a tuple is not found, continue processing the - transaction and ignore that 'row'. Needed for idempotency - handling on the slave - - Currently only used by NDB storage engine. Partition handler ignores flag. - */ - HA_EXTRA_IGNORE_NO_KEY, - HA_EXTRA_NO_IGNORE_NO_KEY, - /* - Mark the table as a log table. For some handlers (e.g. CSV) this results - in a special locking for the table. - */ - HA_EXTRA_MARK_AS_LOG_TABLE, - /* - Informs handler that write_row() which tries to insert new row into the - table and encounters some already existing row with same primary/unique - key can replace old row with new row instead of reporting error (basically - it informs handler that we do REPLACE instead of simple INSERT). - Off by default. - */ - HA_EXTRA_WRITE_CAN_REPLACE, - HA_EXTRA_WRITE_CANNOT_REPLACE, - /* - Inform handler that delete_row()/update_row() cannot batch deletes/updates - and should perform them immediately. This may be needed when table has - AFTER DELETE/UPDATE triggers which access to subject table. - These flags are reset by the handler::extra(HA_EXTRA_RESET) call. - */ - HA_EXTRA_DELETE_CANNOT_BATCH, - HA_EXTRA_UPDATE_CANNOT_BATCH, - /* - Inform handler that an "INSERT...ON DUPLICATE KEY UPDATE" will be - executed. This condition is unset by HA_EXTRA_NO_IGNORE_DUP_KEY. - */ - HA_EXTRA_INSERT_WITH_UPDATE, - /* Inform handler that we will do a rename */ - HA_EXTRA_PREPARE_FOR_RENAME, - /* - Special actions for MERGE tables. - */ - HA_EXTRA_ADD_CHILDREN_LIST, - HA_EXTRA_ATTACH_CHILDREN, - HA_EXTRA_IS_ATTACHED_CHILDREN, - HA_EXTRA_DETACH_CHILDREN -}; - -/* Compatible option, to be deleted in 6.0 */ -#define HA_EXTRA_PREPARE_FOR_DELETE HA_EXTRA_PREPARE_FOR_DROP - - /* The following is parameter to ha_panic() */ - -enum ha_panic_function { - HA_PANIC_CLOSE, /* Close all databases */ - HA_PANIC_WRITE, /* Unlock and write status */ - HA_PANIC_READ /* Lock and read keyinfo */ -}; - - /* The following is parameter to ha_create(); keytypes */ - -enum ha_base_keytype { - HA_KEYTYPE_END=0, - HA_KEYTYPE_TEXT=1, /* Key is sorted as letters */ - HA_KEYTYPE_BINARY=2, /* Key is sorted as unsigned chars */ - HA_KEYTYPE_SHORT_INT=3, - HA_KEYTYPE_LONG_INT=4, - HA_KEYTYPE_FLOAT=5, - HA_KEYTYPE_DOUBLE=6, - HA_KEYTYPE_NUM=7, /* Not packed num with pre-space */ - HA_KEYTYPE_USHORT_INT=8, - HA_KEYTYPE_ULONG_INT=9, - HA_KEYTYPE_LONGLONG=10, - HA_KEYTYPE_ULONGLONG=11, - HA_KEYTYPE_INT24=12, - HA_KEYTYPE_UINT24=13, - HA_KEYTYPE_INT8=14, - /* Varchar (0-255 bytes) with length packed with 1 byte */ - HA_KEYTYPE_VARTEXT1=15, /* Key is sorted as letters */ - HA_KEYTYPE_VARBINARY1=16, /* Key is sorted as unsigned chars */ - /* Varchar (0-65535 bytes) with length packed with 2 bytes */ - HA_KEYTYPE_VARTEXT2=17, /* Key is sorted as letters */ - HA_KEYTYPE_VARBINARY2=18, /* Key is sorted as unsigned chars */ - HA_KEYTYPE_BIT=19 -}; - -#define HA_MAX_KEYTYPE 31 /* Must be log2-1 */ - - /* These flags kan be OR:ed to key-flag */ - -#define HA_NOSAME 1 /* Set if not dupplicated records */ -#define HA_PACK_KEY 2 /* Pack string key to previous key */ -#define HA_AUTO_KEY 16 -#define HA_BINARY_PACK_KEY 32 /* Packing of all keys to prev key */ -#define HA_FULLTEXT 128 /* For full-text search */ -#define HA_UNIQUE_CHECK 256 /* Check the key for uniqueness */ -#define HA_SPATIAL 1024 /* For spatial search */ -#define HA_NULL_ARE_EQUAL 2048 /* NULL in key are cmp as equal */ -#define HA_GENERATED_KEY 8192 /* Automaticly generated key */ - - /* The combination of the above can be used for key type comparison. */ -#define HA_KEYFLAG_MASK (HA_NOSAME | HA_PACK_KEY | HA_AUTO_KEY | \ - HA_BINARY_PACK_KEY | HA_FULLTEXT | HA_UNIQUE_CHECK | \ - HA_SPATIAL | HA_NULL_ARE_EQUAL | HA_GENERATED_KEY) - -/* - Key contains partial segments. - - This flag is internal to the MySQL server by design. It is not supposed - neither to be saved in FRM-files, nor to be passed to storage engines. - It is intended to pass information into internal static sort_keys(KEY *, - KEY *) function. - - This flag can be calculated -- it's based on key lengths comparison. -*/ -#define HA_KEY_HAS_PART_KEY_SEG 65536 - - /* Automatic bits in key-flag */ - -#define HA_SPACE_PACK_USED 4 /* Test for if SPACE_PACK used */ -#define HA_VAR_LENGTH_KEY 8 -#define HA_NULL_PART_KEY 64 -#define HA_USES_COMMENT 4096 -#define HA_USES_PARSER 16384 /* Fulltext index uses [pre]parser */ -#define HA_USES_BLOCK_SIZE ((uint) 32768) -#define HA_SORT_ALLOWS_SAME 512 /* Intern bit when sorting records */ - - /* These flags can be added to key-seg-flag */ - -#define HA_SPACE_PACK 1 /* Pack space in key-seg */ -#define HA_PART_KEY_SEG 4 /* Used by MySQL for part-key-cols */ -#define HA_VAR_LENGTH_PART 8 -#define HA_NULL_PART 16 -#define HA_BLOB_PART 32 -#define HA_SWAP_KEY 64 -#define HA_REVERSE_SORT 128 /* Sort key in reverse order */ -#define HA_NO_SORT 256 /* do not bother sorting on this keyseg */ -/* - End space in unique/varchar are considered equal. (Like 'a' and 'a ') - Only needed for internal temporary tables. -*/ -#define HA_END_SPACE_ARE_EQUAL 512 -#define HA_BIT_PART 1024 - - /* optionbits for database */ -#define HA_OPTION_PACK_RECORD 1 -#define HA_OPTION_PACK_KEYS 2 -#define HA_OPTION_COMPRESS_RECORD 4 -#define HA_OPTION_LONG_BLOB_PTR 8 /* new ISAM format */ -#define HA_OPTION_TMP_TABLE 16 -#define HA_OPTION_CHECKSUM 32 -#define HA_OPTION_DELAY_KEY_WRITE 64 -#define HA_OPTION_NO_PACK_KEYS 128 /* Reserved for MySQL */ -#define HA_OPTION_CREATE_FROM_ENGINE 256 -#define HA_OPTION_RELIES_ON_SQL_LAYER 512 -#define HA_OPTION_NULL_FIELDS 1024 -#define HA_OPTION_PAGE_CHECKSUM 2048 -#define HA_OPTION_TEMP_COMPRESS_RECORD ((uint) 16384) /* set by isamchk */ -#define HA_OPTION_READ_ONLY_DATA ((uint) 32768) /* Set by isamchk */ - - /* Bits in flag to create() */ - -#define HA_DONT_TOUCH_DATA 1 /* Don't empty datafile (isamchk) */ -#define HA_PACK_RECORD 2 /* Request packed record format */ -#define HA_CREATE_TMP_TABLE 4 -#define HA_CREATE_CHECKSUM 8 -#define HA_CREATE_KEEP_FILES 16 /* don't overwrite .MYD and MYI */ -#define HA_CREATE_PAGE_CHECKSUM 32 -#define HA_CREATE_DELAY_KEY_WRITE 64 -#define HA_CREATE_RELIES_ON_SQL_LAYER 128 - -/* - The following flags (OR-ed) are passed to handler::info() method. - The method copies misc handler information out of the storage engine - to data structures accessible from MySQL - - Same flags are also passed down to mi_status, myrg_status, etc. -*/ - -/* this one is not used */ -#define HA_STATUS_POS 1 -/* - assuming the table keeps shared actual copy of the 'info' and - local, possibly outdated copy, the following flag means that - it should not try to get the actual data (locking the shared structure) - slightly outdated version will suffice -*/ -#define HA_STATUS_NO_LOCK 2 -/* update the time of the last modification (in handler::update_time) */ -#define HA_STATUS_TIME 4 -/* - update the 'constant' part of the info: - handler::max_data_file_length, max_index_file_length, create_time - sortkey, ref_length, block_size, data_file_name, index_file_name. - handler::table->s->keys_in_use, keys_for_keyread, rec_per_key -*/ -#define HA_STATUS_CONST 8 -/* - update the 'variable' part of the info: - handler::records, deleted, data_file_length, index_file_length, - check_time, mean_rec_length -*/ -#define HA_STATUS_VARIABLE 16 -/* - get the information about the key that caused last duplicate value error - update handler::errkey and handler::dupp_ref - see handler::get_dup_key() -*/ -#define HA_STATUS_ERRKEY 32 -/* - update handler::auto_increment_value -*/ -#define HA_STATUS_AUTO 64 -/* - Get also delete_length when HA_STATUS_VARIABLE is called. It's ok to set it also - when only HA_STATUS_VARIABLE but it won't be used. -*/ -#define HA_STATUS_VARIABLE_EXTRA 128 - -/* - Errorcodes given by handler functions - - opt_sum_query() assumes these codes are > 1 - Do not add error numbers before HA_ERR_FIRST. - If necessary to add lower numbers, change HA_ERR_FIRST accordingly. -*/ -#define HA_ERR_FIRST 120 /* Copy of first error nr.*/ - -#define HA_ERR_KEY_NOT_FOUND 120 /* Didn't find key on read or update */ -#define HA_ERR_FOUND_DUPP_KEY 121 /* Dupplicate key on write */ -#define HA_ERR_INTERNAL_ERROR 122 /* Internal error */ -#define HA_ERR_RECORD_CHANGED 123 /* Uppdate with is recoverable */ -#define HA_ERR_WRONG_INDEX 124 /* Wrong index given to function */ -#define HA_ERR_CRASHED 126 /* Indexfile is crashed */ -#define HA_ERR_WRONG_IN_RECORD 127 /* Record-file is crashed */ -#define HA_ERR_OUT_OF_MEM 128 /* Record-file is crashed */ -#define HA_ERR_NOT_A_TABLE 130 /* not a MYI file - no signature */ -#define HA_ERR_WRONG_COMMAND 131 /* Command not supported */ -#define HA_ERR_OLD_FILE 132 /* old databasfile */ -#define HA_ERR_NO_ACTIVE_RECORD 133 /* No record read in update() */ -#define HA_ERR_RECORD_DELETED 134 /* A record is not there */ -#define HA_ERR_RECORD_FILE_FULL 135 /* No more room in file */ -#define HA_ERR_INDEX_FILE_FULL 136 /* No more room in file */ -#define HA_ERR_END_OF_FILE 137 /* end in next/prev/first/last */ -#define HA_ERR_UNSUPPORTED 138 /* unsupported extension used */ -#define HA_ERR_TO_BIG_ROW 139 /* Too big row */ -#define HA_WRONG_CREATE_OPTION 140 /* Wrong create option */ -#define HA_ERR_FOUND_DUPP_UNIQUE 141 /* Dupplicate unique on write */ -#define HA_ERR_UNKNOWN_CHARSET 142 /* Can't open charset */ -#define HA_ERR_WRONG_MRG_TABLE_DEF 143 /* conflicting tables in MERGE */ -#define HA_ERR_CRASHED_ON_REPAIR 144 /* Last (automatic?) repair failed */ -#define HA_ERR_CRASHED_ON_USAGE 145 /* Table must be repaired */ -#define HA_ERR_LOCK_WAIT_TIMEOUT 146 -#define HA_ERR_LOCK_TABLE_FULL 147 -#define HA_ERR_READ_ONLY_TRANSACTION 148 /* Updates not allowed */ -#define HA_ERR_LOCK_DEADLOCK 149 -#define HA_ERR_CANNOT_ADD_FOREIGN 150 /* Cannot add a foreign key constr. */ -#define HA_ERR_NO_REFERENCED_ROW 151 /* Cannot add a child row */ -#define HA_ERR_ROW_IS_REFERENCED 152 /* Cannot delete a parent row */ -#define HA_ERR_NO_SAVEPOINT 153 /* No savepoint with that name */ -#define HA_ERR_NON_UNIQUE_BLOCK_SIZE 154 /* Non unique key block size */ -#define HA_ERR_NO_SUCH_TABLE 155 /* The table does not exist in engine */ -#define HA_ERR_TABLE_EXIST 156 /* The table existed in storage engine */ -#define HA_ERR_NO_CONNECTION 157 /* Could not connect to storage engine */ -/* NULLs are not supported in spatial index */ -#define HA_ERR_NULL_IN_SPATIAL 158 -#define HA_ERR_TABLE_DEF_CHANGED 159 /* The table changed in storage engine */ -/* There's no partition in table for given value */ -#define HA_ERR_NO_PARTITION_FOUND 160 -#define HA_ERR_RBR_LOGGING_FAILED 161 /* Row-based binlogging of row failed */ -#define HA_ERR_DROP_INDEX_FK 162 /* Index needed in foreign key constr */ -/* - Upholding foreign key constraints would lead to a duplicate key error - in some other table. -*/ -#define HA_ERR_FOREIGN_DUPLICATE_KEY 163 -/* The table changed in storage engine */ -#define HA_ERR_TABLE_NEEDS_UPGRADE 164 -#define HA_ERR_TABLE_READONLY 165 /* The table is not writable */ - -#define HA_ERR_AUTOINC_READ_FAILED 166 /* Failed to get next autoinc value */ -#define HA_ERR_AUTOINC_ERANGE 167 /* Failed to set row autoinc value */ -#define HA_ERR_GENERIC 168 /* Generic error */ -/* row not actually updated: new values same as the old values */ -#define HA_ERR_RECORD_IS_THE_SAME 169 -/* It is not possible to log this statement */ -#define HA_ERR_LOGGING_IMPOSSIBLE 170 /* It is not possible to log this - statement */ -#define HA_ERR_CORRUPT_EVENT 171 /* The event was corrupt, leading to - illegal data being read */ -#define HA_ERR_NEW_FILE 172 /* New file format */ -#define HA_ERR_ROWS_EVENT_APPLY 173 /* The event could not be processed - no other hanlder error happened */ -#define HA_ERR_INITIALIZATION 174 /* Error during initialization */ -#define HA_ERR_FILE_TOO_SHORT 175 /* File too short */ -#define HA_ERR_WRONG_CRC 176 /* Wrong CRC on page */ -#define HA_ERR_TOO_MANY_CONCURRENT_TRXS 177 /*Too many active concurrent transactions */ -#define HA_ERR_LAST 177 /* Copy of last error nr */ - -/* Number of different errors */ -#define HA_ERR_ERRORS (HA_ERR_LAST - HA_ERR_FIRST + 1) - - /* Other constants */ - -#define HA_NAMELEN 64 /* Max length of saved filename */ -#define NO_SUCH_KEY (~(uint)0) /* used as a key no. */ - -typedef ulong key_part_map; -#define HA_WHOLE_KEY (~(key_part_map)0) - - /* Intern constants in databases */ - - /* bits in _search */ -#define SEARCH_FIND 1 -#define SEARCH_NO_FIND 2 -#define SEARCH_SAME 4 -#define SEARCH_BIGGER 8 -#define SEARCH_SMALLER 16 -#define SEARCH_SAVE_BUFF 32 -#define SEARCH_UPDATE 64 -#define SEARCH_PREFIX 128 -#define SEARCH_LAST 256 -#define MBR_CONTAIN 512 -#define MBR_INTERSECT 1024 -#define MBR_WITHIN 2048 -#define MBR_DISJOINT 4096 -#define MBR_EQUAL 8192 -#define MBR_DATA 16384 -#define SEARCH_NULL_ARE_EQUAL 32768 /* NULL in keys are equal */ -#define SEARCH_NULL_ARE_NOT_EQUAL 65536 /* NULL in keys are not equal */ - - /* bits in opt_flag */ -#define QUICK_USED 1 -#define READ_CACHE_USED 2 -#define READ_CHECK_USED 4 -#define KEY_READ_USED 8 -#define WRITE_CACHE_USED 16 -#define OPT_NO_ROWS 32 - - /* bits in update */ -#define HA_STATE_CHANGED 1 /* Database has changed */ -#define HA_STATE_AKTIV 2 /* Has a current record */ -#define HA_STATE_WRITTEN 4 /* Record is written */ -#define HA_STATE_DELETED 8 -#define HA_STATE_NEXT_FOUND 16 /* Next found record (record before) */ -#define HA_STATE_PREV_FOUND 32 /* Prev found record (record after) */ -#define HA_STATE_NO_KEY 64 /* Last read didn't find record */ -#define HA_STATE_KEY_CHANGED 128 -#define HA_STATE_WRITE_AT_END 256 /* set in _ps_find_writepos */ -#define HA_STATE_BUFF_SAVED 512 /* If current keybuff is info->buff */ -#define HA_STATE_ROW_CHANGED 1024 /* To invalide ROW cache */ -#define HA_STATE_EXTEND_BLOCK 2048 -#define HA_STATE_RNEXT_SAME 4096 /* rnext_same occupied lastkey2 */ - -/* myisampack expects no more than 32 field types. */ -enum en_fieldtype { - FIELD_LAST=-1,FIELD_NORMAL,FIELD_SKIP_ENDSPACE,FIELD_SKIP_PRESPACE, - FIELD_SKIP_ZERO,FIELD_BLOB,FIELD_CONSTANT,FIELD_INTERVALL,FIELD_ZERO, - FIELD_VARCHAR,FIELD_CHECK, - FIELD_enum_val_count -}; - -enum data_file_type { - STATIC_RECORD, DYNAMIC_RECORD, COMPRESSED_RECORD, BLOCK_RECORD -}; - -/* For key ranges */ - -#define NO_MIN_RANGE 1 -#define NO_MAX_RANGE 2 -#define NEAR_MIN 4 -#define NEAR_MAX 8 -#define UNIQUE_RANGE 16 -#define EQ_RANGE 32 -#define NULL_RANGE 64 -#define GEOM_FLAG 128 -#define SKIP_RANGE 256 - -typedef struct st_key_range -{ - const uchar *key; - uint length; - key_part_map keypart_map; - enum ha_rkey_function flag; -} key_range; - -typedef struct st_key_multi_range -{ - key_range start_key; - key_range end_key; - char *ptr; /* Free to use by caller (ptr to row etc) */ - uint range_flag; /* key range flags see above */ -} KEY_MULTI_RANGE; - - -/* For number of records */ -#ifdef BIG_TABLES -#define rows2double(A) ulonglong2double(A) -typedef my_off_t ha_rows; -#else -#define rows2double(A) (double) (A) -typedef ulong ha_rows; -#endif - -#define HA_POS_ERROR (~ (ha_rows) 0) -#define HA_OFFSET_ERROR (~ (my_off_t) 0) - -#if SYSTEM_SIZEOF_OFF_T == 4 -#define MAX_FILE_SIZE INT_MAX32 -#else -#define MAX_FILE_SIZE LONGLONG_MAX -#endif - -#define HA_VARCHAR_PACKLENGTH(field_length) ((field_length) < 256 ? 1 :2) - -/* invalidator function reference for Query Cache */ -C_MODE_START -typedef void (* invalidator_by_filename)(const char * filename); -C_MODE_END - -#endif /* _my_base_h */ diff --git a/dep/mysqllite/include/internal/my_bit.h b/dep/mysqllite/include/internal/my_bit.h deleted file mode 100644 index b396b84b0d8..00000000000 --- a/dep/mysqllite/include/internal/my_bit.h +++ /dev/null @@ -1,105 +0,0 @@ -#ifndef MY_BIT_INCLUDED -#define MY_BIT_INCLUDED - -/* - Some useful bit functions -*/ - -C_MODE_START - -extern const char _my_bits_nbits[256]; -extern const uchar _my_bits_reverse_table[256]; - -/* - Find smallest X in 2^X >= value - This can be used to divide a number with value by doing a shift instead -*/ - -static inline uint my_bit_log2(ulong value) -{ - uint bit; - for (bit=0 ; value > 1 ; value>>=1, bit++) ; - return bit; -} - -static inline uint my_count_bits(ulonglong v) -{ -#if SIZEOF_LONG_LONG > 4 - /* The following code is a bit faster on 16 bit machines than if we would - only shift v */ - ulong v2=(ulong) (v >> 32); - return (uint) (uchar) (_my_bits_nbits[(uchar) v] + - _my_bits_nbits[(uchar) (v >> 8)] + - _my_bits_nbits[(uchar) (v >> 16)] + - _my_bits_nbits[(uchar) (v >> 24)] + - _my_bits_nbits[(uchar) (v2)] + - _my_bits_nbits[(uchar) (v2 >> 8)] + - _my_bits_nbits[(uchar) (v2 >> 16)] + - _my_bits_nbits[(uchar) (v2 >> 24)]); -#else - return (uint) (uchar) (_my_bits_nbits[(uchar) v] + - _my_bits_nbits[(uchar) (v >> 8)] + - _my_bits_nbits[(uchar) (v >> 16)] + - _my_bits_nbits[(uchar) (v >> 24)]); -#endif -} - -static inline uint my_count_bits_ushort(ushort v) -{ - return _my_bits_nbits[v]; -} - - -/* - Next highest power of two - - SYNOPSIS - my_round_up_to_next_power() - v Value to check - - RETURN - Next or equal power of 2 - Note: 0 will return 0 - - NOTES - Algorithm by Sean Anderson, according to: - http://graphics.stanford.edu/~seander/bithacks.html - (Orignal code public domain) - - Comments shows how this works with 01100000000000000000000000001011 -*/ - -static inline uint32 my_round_up_to_next_power(uint32 v) -{ - v--; /* 01100000000000000000000000001010 */ - v|= v >> 1; /* 01110000000000000000000000001111 */ - v|= v >> 2; /* 01111100000000000000000000001111 */ - v|= v >> 4; /* 01111111110000000000000000001111 */ - v|= v >> 8; /* 01111111111111111100000000001111 */ - v|= v >> 16; /* 01111111111111111111111111111111 */ - return v+1; /* 10000000000000000000000000000000 */ -} - -static inline uint32 my_clear_highest_bit(uint32 v) -{ - uint32 w=v >> 1; - w|= w >> 1; - w|= w >> 2; - w|= w >> 4; - w|= w >> 8; - w|= w >> 16; - return v & w; -} - -static inline uint32 my_reverse_bits(uint32 key) -{ - return - (_my_bits_reverse_table[ key & 255] << 24) | - (_my_bits_reverse_table[(key>> 8) & 255] << 16) | - (_my_bits_reverse_table[(key>>16) & 255] << 8) | - _my_bits_reverse_table[(key>>24) ]; -} - -C_MODE_END - -#endif /* MY_BIT_INCLUDED */ diff --git a/dep/mysqllite/include/internal/my_bitmap.h b/dep/mysqllite/include/internal/my_bitmap.h deleted file mode 100644 index 78b33b09a51..00000000000 --- a/dep/mysqllite/include/internal/my_bitmap.h +++ /dev/null @@ -1,142 +0,0 @@ -/* Copyright (C) 2000 MySQL AB, 2009 Sun Microsystems, Inc - - 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 */ - -#ifndef _my_bitmap_h_ -#define _my_bitmap_h_ - -#define MY_BIT_NONE (~(uint) 0) - -#include <m_string.h> - -typedef uint32 my_bitmap_map; - -typedef struct st_bitmap -{ - my_bitmap_map *bitmap; - uint n_bits; /* number of bits occupied by the above */ - my_bitmap_map last_word_mask; - my_bitmap_map *last_word_ptr; - /* - mutex will be acquired for the duration of each bitmap operation if - thread_safe flag in bitmap_init was set. Otherwise, we optimize by not - acquiring the mutex - */ - mysql_mutex_t *mutex; -} MY_BITMAP; - -#ifdef __cplusplus -extern "C" { -#endif -extern void create_last_word_mask(MY_BITMAP *map); -extern my_bool bitmap_init(MY_BITMAP *map, my_bitmap_map *buf, uint n_bits, - my_bool thread_safe); -extern my_bool bitmap_is_clear_all(const MY_BITMAP *map); -extern my_bool bitmap_is_prefix(const MY_BITMAP *map, uint prefix_size); -extern my_bool bitmap_is_set_all(const MY_BITMAP *map); -extern my_bool bitmap_is_subset(const MY_BITMAP *map1, const MY_BITMAP *map2); -extern my_bool bitmap_is_overlapping(const MY_BITMAP *map1, - const MY_BITMAP *map2); -extern my_bool bitmap_test_and_set(MY_BITMAP *map, uint bitmap_bit); -extern my_bool bitmap_test_and_clear(MY_BITMAP *map, uint bitmap_bit); -extern my_bool bitmap_fast_test_and_set(MY_BITMAP *map, uint bitmap_bit); -extern uint bitmap_set_next(MY_BITMAP *map); -extern uint bitmap_get_first(const MY_BITMAP *map); -extern uint bitmap_get_first_set(const MY_BITMAP *map); -extern uint bitmap_bits_set(const MY_BITMAP *map); -extern void bitmap_free(MY_BITMAP *map); -extern void bitmap_set_above(MY_BITMAP *map, uint from_byte, uint use_bit); -extern void bitmap_set_prefix(MY_BITMAP *map, uint prefix_size); -extern void bitmap_intersect(MY_BITMAP *map, const MY_BITMAP *map2); -extern void bitmap_subtract(MY_BITMAP *map, const MY_BITMAP *map2); -extern void bitmap_union(MY_BITMAP *map, const MY_BITMAP *map2); -extern void bitmap_xor(MY_BITMAP *map, const MY_BITMAP *map2); -extern void bitmap_invert(MY_BITMAP *map); -extern void bitmap_copy(MY_BITMAP *map, const MY_BITMAP *map2); - -extern uint bitmap_lock_set_next(MY_BITMAP *map); -extern void bitmap_lock_clear_bit(MY_BITMAP *map, uint bitmap_bit); -/* Fast, not thread safe, bitmap functions */ -#define bitmap_buffer_size(bits) (((bits)+31)/32)*4 -#define no_bytes_in_map(map) (((map)->n_bits + 7)/8) -#define no_words_in_map(map) (((map)->n_bits + 31)/32) -#define bytes_word_aligned(bytes) (4*((bytes + 3)/4)) -#define _bitmap_set_bit(MAP, BIT) (((uchar*)(MAP)->bitmap)[(BIT) / 8] \ - |= (1 << ((BIT) & 7))) -#define _bitmap_flip_bit(MAP, BIT) (((uchar*)(MAP)->bitmap)[(BIT) / 8] \ - ^= (1 << ((BIT) & 7))) -#define _bitmap_clear_bit(MAP, BIT) (((uchar*)(MAP)->bitmap)[(BIT) / 8] \ - &= ~ (1 << ((BIT) & 7))) -#define _bitmap_is_set(MAP, BIT) (uint) (((uchar*)(MAP)->bitmap)[(BIT) / 8] \ - & (1 << ((BIT) & 7))) -/* - WARNING! - - The below symbols are inline functions in DEBUG builds and macros in - non-DEBUG builds. The latter evaluate their 'bit' argument twice. - - NEVER use an increment/decrement operator with the 'bit' argument. - It would work with DEBUG builds, but fails later in production builds! - - FORBIDDEN: bitmap_set_bit($my_bitmap, (field++)->field_index); -*/ -#ifndef DBUG_OFF -static inline void -bitmap_set_bit(MY_BITMAP *map,uint bit) -{ - DBUG_ASSERT(bit < (map)->n_bits); - _bitmap_set_bit(map,bit); -} -static inline void -bitmap_flip_bit(MY_BITMAP *map,uint bit) -{ - DBUG_ASSERT(bit < (map)->n_bits); - _bitmap_flip_bit(map,bit); -} -static inline void -bitmap_clear_bit(MY_BITMAP *map,uint bit) -{ - DBUG_ASSERT(bit < (map)->n_bits); - _bitmap_clear_bit(map,bit); -} -static inline uint -bitmap_is_set(const MY_BITMAP *map,uint bit) -{ - DBUG_ASSERT(bit < (map)->n_bits); - return _bitmap_is_set(map,bit); -} -#else -#define bitmap_set_bit(MAP, BIT) _bitmap_set_bit(MAP, BIT) -#define bitmap_flip_bit(MAP, BIT) _bitmap_flip_bit(MAP, BIT) -#define bitmap_clear_bit(MAP, BIT) _bitmap_clear_bit(MAP, BIT) -#define bitmap_is_set(MAP, BIT) _bitmap_is_set(MAP, BIT) -#endif - -static inline my_bool bitmap_cmp(const MY_BITMAP *map1, const MY_BITMAP *map2) -{ - *(map1)->last_word_ptr|= (map1)->last_word_mask; - *(map2)->last_word_ptr|= (map2)->last_word_mask; - return memcmp((map1)->bitmap, (map2)->bitmap, 4*no_words_in_map((map1)))==0; -} - -#define bitmap_clear_all(MAP) \ - { memset((MAP)->bitmap, 0, 4*no_words_in_map((MAP))); } -#define bitmap_set_all(MAP) \ - (memset((MAP)->bitmap, 0xFF, 4*no_words_in_map((MAP)))) - -#ifdef __cplusplus -} -#endif - -#endif /* _my_bitmap_h_ */ diff --git a/dep/mysqllite/include/internal/my_handler.h b/dep/mysqllite/include/internal/my_handler.h deleted file mode 100644 index ba0d3fc313f..00000000000 --- a/dep/mysqllite/include/internal/my_handler.h +++ /dev/null @@ -1,130 +0,0 @@ -/* Copyright (C) 2002-2006 MySQL AB - - This program is free software; you can redistribute it and/or - modify it under the terms of the GNU Library 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 - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public - License along with this library; if not, write to the Free - Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, - MA 02111-1307, USA */ - -#ifndef _my_handler_h -#define _my_handler_h - -#include "myisampack.h" -#ifdef __cplusplus -extern "C" { -#endif - -#include "m_ctype.h" /* CHARSET_INFO */ - -/* - There is a hard limit for the maximum number of keys as there are only - 8 bits in the index file header for the number of keys in a table. - This means that 0..255 keys can exist for a table. The idea of - HA_MAX_POSSIBLE_KEY is to ensure that one can use myisamchk & tools on - a MyISAM table for which one has more keys than MyISAM is normally - compiled for. If you don't have this, you will get a core dump when - running myisamchk compiled for 128 keys on a table with 255 keys. -*/ - -#define HA_MAX_POSSIBLE_KEY 255 /* For myisamchk */ -/* - The following defines can be increased if necessary. - But beware the dependency of MI_MAX_POSSIBLE_KEY_BUFF and HA_MAX_KEY_LENGTH. -*/ - -#define HA_MAX_KEY_LENGTH 1000 /* Max length in bytes */ -#define HA_MAX_KEY_SEG 16 /* Max segments for key */ - -#define HA_MAX_POSSIBLE_KEY_BUFF (HA_MAX_KEY_LENGTH + 24+ 6+6) -#define HA_MAX_KEY_BUFF (HA_MAX_KEY_LENGTH+HA_MAX_KEY_SEG*6+8+8) - -typedef struct st_HA_KEYSEG /* Key-portion */ -{ - CHARSET_INFO *charset; - uint32 start; /* Start of key in record */ - uint32 null_pos; /* position to NULL indicator */ - uint16 bit_pos; /* Position to bit part */ - uint16 flag; - uint16 length; /* Keylength */ - uint16 language; - uint8 type; /* Type of key (for sort) */ - uint8 null_bit; /* bitmask to test for NULL */ - uint8 bit_start,bit_end; /* if bit field */ - uint8 bit_length; /* Length of bit part */ -} HA_KEYSEG; - -#define get_key_length(length,key) \ -{ if (*(uchar*) (key) != 255) \ - length= (uint) *(uchar*) ((key)++); \ - else \ - { length= mi_uint2korr((key)+1); (key)+=3; } \ -} - -#define get_key_length_rdonly(length,key) \ -{ if (*(uchar*) (key) != 255) \ - length= ((uint) *(uchar*) ((key))); \ - else \ - { length= mi_uint2korr((key)+1); } \ -} - -#define get_key_pack_length(length,length_pack,key) \ -{ if (*(uchar*) (key) != 255) \ - { length= (uint) *(uchar*) ((key)++); length_pack= 1; }\ - else \ - { length=mi_uint2korr((key)+1); (key)+= 3; length_pack= 3; } \ -} - -#define store_key_length_inc(key,length) \ -{ if ((length) < 255) \ - { *(key)++= (length); } \ - else \ - { *(key)=255; mi_int2store((key)+1,(length)); (key)+=3; } \ -} - -#define size_to_store_key_length(length) ((length) < 255 ? 1 : 3) - -#define get_rec_bits(bit_ptr, bit_ofs, bit_len) \ - (((((uint16) (bit_ptr)[1] << 8) | (uint16) (bit_ptr)[0]) >> (bit_ofs)) & \ - ((1 << (bit_len)) - 1)) - -#define set_rec_bits(bits, bit_ptr, bit_ofs, bit_len) \ -{ \ - (bit_ptr)[0]= ((bit_ptr)[0] & ~(((1 << (bit_len)) - 1) << (bit_ofs))) | \ - ((bits) << (bit_ofs)); \ - if ((bit_ofs) + (bit_len) > 8) \ - (bit_ptr)[1]= ((bit_ptr)[1] & ~((1 << ((bit_len) - 8 + (bit_ofs))) - 1)) | \ - ((bits) >> (8 - (bit_ofs))); \ -} - -#define clr_rec_bits(bit_ptr, bit_ofs, bit_len) \ - set_rec_bits(0, bit_ptr, bit_ofs, bit_len) - -extern int ha_compare_text(CHARSET_INFO *, uchar *, uint, uchar *, uint , - my_bool, my_bool); -extern int ha_key_cmp(register HA_KEYSEG *keyseg, register uchar *a, - register uchar *b, uint key_length, uint nextflag, - uint *diff_pos); - -extern HA_KEYSEG *ha_find_null(HA_KEYSEG *keyseg, uchar *a); -extern void my_handler_error_register(void); -extern void my_handler_error_unregister(void); -/* - Inside an in-memory data record, memory pointers to pieces of the - record (like BLOBs) are stored in their native byte order and in - this amount of bytes. -*/ -#define portable_sizeof_char_ptr 8 -#ifdef __cplusplus -} -#endif - -#endif /* _my_handler_h */ diff --git a/dep/mysqllite/include/internal/my_libwrap.h b/dep/mysqllite/include/internal/my_libwrap.h deleted file mode 100644 index 8235c00d8f3..00000000000 --- a/dep/mysqllite/include/internal/my_libwrap.h +++ /dev/null @@ -1,31 +0,0 @@ -#ifndef MY_LIBWRAP_INCLUDED -#define MY_LIBWRAP_INCLUDED - -/* 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 */ - -#ifdef HAVE_LIBWRAP -#include <tcpd.h> -#include <syslog.h> -#ifdef NEED_SYS_SYSLOG_H -#include <sys/syslog.h> -#endif /* NEED_SYS_SYSLOG_H */ - -extern void my_fromhost(struct request_info *req); -extern int my_hosts_access(struct request_info *req); -extern char *my_eval_client(struct request_info *req); - -#endif /* HAVE_LIBWRAP */ -#endif /* MY_LIBWRAP_INCLUDED */ diff --git a/dep/mysqllite/include/internal/my_md5.h b/dep/mysqllite/include/internal/my_md5.h deleted file mode 100644 index 782bef8a27a..00000000000 --- a/dep/mysqllite/include/internal/my_md5.h +++ /dev/null @@ -1,59 +0,0 @@ -#ifndef MY_MD5_INCLUDED -#define MY_MD5_INCLUDED - -/* 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 */ - -/* See md5.c for explanation and copyright information. */ - -/* - * $FreeBSD: src/contrib/cvs/lib/md5.h,v 1.2 1999/12/11 15:10:02 peter Exp $ - */ - -/* Unlike previous versions of this code, uint32 need not be exactly - 32 bits, merely 32 bits or more. Choosing a data type which is 32 - bits instead of 64 is not important; speed is considerably more - important. ANSI guarantees that "unsigned long" will be big enough, - and always using it seems to have few disadvantages. */ -typedef uint32 cvs_uint32; - -typedef struct { - cvs_uint32 buf[4]; - cvs_uint32 bits[2]; - unsigned char in[64]; -} my_MD5Context; - -#ifdef __cplusplus -extern "C" { -#endif -void my_MD5Init (my_MD5Context *context); -void my_MD5Update (my_MD5Context *context, - unsigned char const *buf, unsigned len); -void my_MD5Final (unsigned char digest[16], - my_MD5Context *context); - -#ifdef __cplusplus -} -#endif - -#define MY_MD5_HASH(digest,buf,len) \ -do { \ - my_MD5Context ctx; \ - my_MD5Init (&ctx); \ - my_MD5Update (&ctx, buf, len); \ - my_MD5Final (digest, &ctx); \ -} while (0) - -#endif /* MY_MD__INCLUDED */ diff --git a/dep/mysqllite/include/internal/my_nosys.h b/dep/mysqllite/include/internal/my_nosys.h deleted file mode 100644 index 96ba6d4c464..00000000000 --- a/dep/mysqllite/include/internal/my_nosys.h +++ /dev/null @@ -1,52 +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 to remove use of my_functions in functions where we need speed and - where calls to posix functions should work -*/ -#ifndef _my_nosys_h -#define _my_nosys_h -#ifdef __cplusplus -extern "C" { -#endif - -#ifndef __MY_NOSYS__ -#define __MY_NOSYS__ - -#ifndef HAVE_STDLIB_H -#include <malloc.h> -#endif - -#undef my_read -#undef my_write -#undef my_seek -#define my_read(a,b,c,d) my_quick_read(a,b,c,d) -#define my_write(a,b,c,d) my_quick_write(a,b,c) -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(USE_HALLOC) -#define my_malloc(a,b) halloc(a,1) -#define my_no_flags_free(a) hfree(a) -#endif - -#endif /* __MY_NOSYS__ */ - -#ifdef __cplusplus -} -#endif -#endif diff --git a/dep/mysqllite/include/internal/my_rdtsc.h b/dep/mysqllite/include/internal/my_rdtsc.h deleted file mode 100644 index 81bc1aafb58..00000000000 --- a/dep/mysqllite/include/internal/my_rdtsc.h +++ /dev/null @@ -1,129 +0,0 @@ -/* Copyright (C) 2008, 2009 Sun Microsystems, Inc - - 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 */ - -/* - rdtsc3 -- multi-platform timer code - pgulutzan@mysql.com, 2005-08-29 - modified 2008-11-02 -*/ - -#ifndef MY_RDTSC_H -#define MY_RDTSC_H - -/** - Characteristics of a timer. -*/ -struct my_timer_unit_info -{ - /** Routine used for the timer. */ - ulonglong routine; - /** Overhead of the timer. */ - ulonglong overhead; - /** Frequency of the timer. */ - ulonglong frequency; - /** Resolution of the timer. */ - ulonglong resolution; -}; - -/** - Characteristics of all the supported timers. - @sa my_timer_init(). -*/ -struct my_timer_info -{ - /** Characteristics of the cycle timer. */ - struct my_timer_unit_info cycles; - /** Characteristics of the nanosecond timer. */ - struct my_timer_unit_info nanoseconds; - /** Characteristics of the microsecond timer. */ - struct my_timer_unit_info microseconds; - /** Characteristics of the millisecond timer. */ - struct my_timer_unit_info milliseconds; - /** Characteristics of the tick timer. */ - struct my_timer_unit_info ticks; -}; - -typedef struct my_timer_info MY_TIMER_INFO; - -C_MODE_START - -/** - A cycle timer. - @return the current timer value, in cycles. -*/ -ulonglong my_timer_cycles(void); - -/** - A namoseconds timer. - @return the current timer value, in nanoseconds. -*/ -ulonglong my_timer_nanoseconds(void); - -/** - A microseconds timer. - @return the current timer value, in microseconds. -*/ -ulonglong my_timer_microseconds(void); - -/** - A millisecond timer. - @return the current timer value, in milliseconds. -*/ -ulonglong my_timer_milliseconds(void); - -/** - A ticks timer. - @return the current timer value, in ticks. -*/ -ulonglong my_timer_ticks(void); - -/** - Timer initialization function. - @param [out] mti the timer characteristics. -*/ -void my_timer_init(MY_TIMER_INFO *mti); - -C_MODE_END - -#define MY_TIMER_ROUTINE_ASM_X86 1 -#define MY_TIMER_ROUTINE_ASM_X86_64 2 -#define MY_TIMER_ROUTINE_RDTSCLL 3 -#define MY_TIMER_ROUTINE_ASM_X86_WIN 4 -#define MY_TIMER_ROUTINE_RDTSC 5 -#define MY_TIMER_ROUTINE_ASM_IA64 6 -#define MY_TIMER_ROUTINE_ASM_PPC 7 -#define MY_TIMER_ROUTINE_SGI_CYCLE 8 -#define MY_TIMER_ROUTINE_GETHRTIME 9 -#define MY_TIMER_ROUTINE_READ_REAL_TIME 10 -#define MY_TIMER_ROUTINE_CLOCK_GETTIME 11 -#define MY_TIMER_ROUTINE_NXGETTIME 12 -#define MY_TIMER_ROUTINE_GETTIMEOFDAY 13 -#define MY_TIMER_ROUTINE_QUERYPERFORMANCECOUNTER 14 -#define MY_TIMER_ROUTINE_GETTICKCOUNT 15 -#define MY_TIMER_ROUTINE_TIME 16 -#define MY_TIMER_ROUTINE_TIMES 17 -#define MY_TIMER_ROUTINE_FTIME 18 -#define MY_TIMER_ROUTINE_ASM_PPC64 19 -#define MY_TIMER_ROUTINE_ASM_SUNPRO_SPARC64 20 -#define MY_TIMER_ROUTINE_ASM_SUNPRO_SPARC32 21 -#define MY_TIMER_ROUTINE_ASM_SUNPRO_I386 22 -#define MY_TIMER_ROUTINE_ASM_GCC_SPARC64 23 -#define MY_TIMER_ROUTINE_ASM_GCC_SPARC32 24 -#define MY_TIMER_ROUTINE_MACH_ABSOLUTE_TIME 25 -#define MY_TIMER_ROUTINE_GETSYSTEMTIMEASFILETIME 26 -#define MY_TIMER_ROUTINE_ASM_SUNPRO_X86_64 27 - -#endif - diff --git a/dep/mysqllite/include/internal/my_stacktrace.h b/dep/mysqllite/include/internal/my_stacktrace.h deleted file mode 100644 index 8c2c97c68e5..00000000000 --- a/dep/mysqllite/include/internal/my_stacktrace.h +++ /dev/null @@ -1,64 +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 */ - -#ifndef _my_stacktrace_h_ -#define _my_stacktrace_h_ - -#include <my_global.h> - -#ifdef TARGET_OS_LINUX -#if defined (__x86_64__) || defined (__i386__) || \ - (defined(__alpha__) && defined(__GNUC__)) -#define HAVE_STACKTRACE 1 -#endif -#elif defined(__WIN__) || defined(HAVE_PRINTSTACK) -#define HAVE_STACKTRACE 1 -#endif - -#if HAVE_BACKTRACE && (HAVE_BACKTRACE_SYMBOLS || HAVE_BACKTRACE_SYMBOLS_FD) -#undef HAVE_STACKTRACE -#define HAVE_STACKTRACE 1 -#endif - -#define HAVE_WRITE_CORE - -#if HAVE_BACKTRACE && HAVE_BACKTRACE_SYMBOLS && \ - HAVE_CXXABI_H && HAVE_ABI_CXA_DEMANGLE && \ - HAVE_WEAK_SYMBOL -#define BACKTRACE_DEMANGLE 1 -#endif - -C_MODE_START - -#if defined(HAVE_STACKTRACE) || defined(HAVE_BACKTRACE) -void my_init_stacktrace(); -void my_print_stacktrace(uchar* stack_bottom, ulong thread_stack); -void my_safe_print_str(const char* val, int max_len); -void my_write_core(int sig); -#if BACKTRACE_DEMANGLE -char *my_demangle(const char *mangled_name, int *status); -#endif -#ifdef __WIN__ -void my_set_exception_pointers(EXCEPTION_POINTERS *ep); -#endif -#endif - -#ifdef HAVE_WRITE_CORE -void my_write_core(int sig); -#endif - -C_MODE_END - -#endif /* _my_stacktrace_h_ */ diff --git a/dep/mysqllite/include/internal/my_time.h b/dep/mysqllite/include/internal/my_time.h deleted file mode 100644 index fdfe130c45f..00000000000 --- a/dep/mysqllite/include/internal/my_time.h +++ /dev/null @@ -1,170 +0,0 @@ -/* 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ - -/* - This is a private header of sql-common library, containing - declarations for my_time.c -*/ - -#ifndef _my_time_h_ -#define _my_time_h_ -#include "my_global.h" -#include "mysql_time.h" - -C_MODE_START - -extern ulonglong log_10_int[20]; -extern uchar days_in_month[]; - -/* - Portable time_t replacement. - Should be signed and hold seconds for 1902 -- 2038-01-19 range - i.e at least a 32bit variable - - Using the system built in time_t is not an option as - we rely on the above requirements in the time functions -*/ -typedef long my_time_t; - -#define MY_TIME_T_MAX LONG_MAX -#define MY_TIME_T_MIN LONG_MIN - -/* Time handling defaults */ -#define TIMESTAMP_MAX_YEAR 2038 -#define TIMESTAMP_MIN_YEAR (1900 + YY_PART_YEAR - 1) -#define TIMESTAMP_MAX_VALUE INT_MAX32 -#define TIMESTAMP_MIN_VALUE 1 - -/* two-digit years < this are 20..; >= this are 19.. */ -#define YY_PART_YEAR 70 - -/* Flags to str_to_datetime */ -#define TIME_FUZZY_DATE 1 -#define TIME_DATETIME_ONLY 2 -/* Must be same as MODE_NO_ZERO_IN_DATE */ -#define TIME_NO_ZERO_IN_DATE (65536L*2*2*2*2*2*2*2) -/* Must be same as MODE_NO_ZERO_DATE */ -#define TIME_NO_ZERO_DATE (TIME_NO_ZERO_IN_DATE*2) -#define TIME_INVALID_DATES (TIME_NO_ZERO_DATE*2) - -#define MYSQL_TIME_WARN_TRUNCATED 1 -#define MYSQL_TIME_WARN_OUT_OF_RANGE 2 - -/* Limits for the TIME data type */ -#define TIME_MAX_HOUR 838 -#define TIME_MAX_MINUTE 59 -#define TIME_MAX_SECOND 59 -#define TIME_MAX_VALUE (TIME_MAX_HOUR*10000 + TIME_MAX_MINUTE*100 + \ - TIME_MAX_SECOND) -#define TIME_MAX_VALUE_SECONDS (TIME_MAX_HOUR * 3600L + \ - TIME_MAX_MINUTE * 60L + TIME_MAX_SECOND) - -my_bool check_date(const MYSQL_TIME *ltime, my_bool not_zero_date, - ulonglong flags, int *was_cut); -enum enum_mysql_timestamp_type -str_to_datetime(const char *str, uint length, MYSQL_TIME *l_time, - ulonglong flags, int *was_cut); -longlong number_to_datetime(longlong nr, MYSQL_TIME *time_res, - ulonglong flags, int *was_cut); -ulonglong TIME_to_ulonglong_datetime(const MYSQL_TIME *); -ulonglong TIME_to_ulonglong_date(const MYSQL_TIME *); -ulonglong TIME_to_ulonglong_time(const MYSQL_TIME *); -ulonglong TIME_to_ulonglong(const MYSQL_TIME *); - - -my_bool str_to_time(const char *str,uint length, MYSQL_TIME *l_time, - int *warning); - -int check_time_range(struct st_mysql_time *, int *warning); - -long calc_daynr(uint year,uint month,uint day); -uint calc_days_in_year(uint year); -uint year_2000_handling(uint year); - -void my_init_time(void); - - -/* - Function to check sanity of a TIMESTAMP value - - DESCRIPTION - Check if a given MYSQL_TIME value fits in TIMESTAMP range. - This function doesn't make precise check, but rather a rough - estimate. - - RETURN VALUES - FALSE The value seems sane - TRUE The MYSQL_TIME value is definitely out of range -*/ - -static inline my_bool validate_timestamp_range(const MYSQL_TIME *t) -{ - if ((t->year > TIMESTAMP_MAX_YEAR || t->year < TIMESTAMP_MIN_YEAR) || - (t->year == TIMESTAMP_MAX_YEAR && (t->month > 1 || t->day > 19)) || - (t->year == TIMESTAMP_MIN_YEAR && (t->month < 12 || t->day < 31))) - return FALSE; - - return TRUE; -} - -my_time_t -my_system_gmt_sec(const MYSQL_TIME *t, long *my_timezone, - my_bool *in_dst_time_gap); - -void set_zero_time(MYSQL_TIME *tm, enum enum_mysql_timestamp_type time_type); - -/* - Required buffer length for my_time_to_str, my_date_to_str, - my_datetime_to_str and TIME_to_string functions. Note, that the - caller is still responsible to check that given TIME structure - has values in valid ranges, otherwise size of the buffer could - be not enough. We also rely on the fact that even wrong values - sent using binary protocol fit in this buffer. -*/ -#define MAX_DATE_STRING_REP_LENGTH 30 - -int my_time_to_str(const MYSQL_TIME *l_time, char *to); -int my_date_to_str(const MYSQL_TIME *l_time, char *to); -int my_datetime_to_str(const MYSQL_TIME *l_time, char *to); -int my_TIME_to_str(const MYSQL_TIME *l_time, char *to); - -/* - Available interval types used in any statement. - - 'interval_type' must be sorted so that simple intervals comes first, - ie year, quarter, month, week, day, hour, etc. The order based on - interval size is also important and the intervals should be kept in a - large to smaller order. (get_interval_value() depends on this) - - Note: If you change the order of elements in this enum you should fix - order of elements in 'interval_type_to_name' and 'interval_names' - arrays - - See also interval_type_to_name, get_interval_value, interval_names -*/ - -enum interval_type -{ - INTERVAL_YEAR, INTERVAL_QUARTER, INTERVAL_MONTH, INTERVAL_WEEK, INTERVAL_DAY, - INTERVAL_HOUR, INTERVAL_MINUTE, INTERVAL_SECOND, INTERVAL_MICROSECOND, - INTERVAL_YEAR_MONTH, INTERVAL_DAY_HOUR, INTERVAL_DAY_MINUTE, - INTERVAL_DAY_SECOND, INTERVAL_HOUR_MINUTE, INTERVAL_HOUR_SECOND, - INTERVAL_MINUTE_SECOND, INTERVAL_DAY_MICROSECOND, INTERVAL_HOUR_MICROSECOND, - INTERVAL_MINUTE_MICROSECOND, INTERVAL_SECOND_MICROSECOND, INTERVAL_LAST -}; - -C_MODE_END - -#endif /* _my_time_h_ */ diff --git a/dep/mysqllite/include/internal/my_tree.h b/dep/mysqllite/include/internal/my_tree.h deleted file mode 100644 index 0958a37fb4c..00000000000 --- a/dep/mysqllite/include/internal/my_tree.h +++ /dev/null @@ -1,96 +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 */ - -#ifndef _tree_h -#define _tree_h -#ifdef __cplusplus -extern "C" { -#endif - -#include "my_base.h" /* get 'enum ha_rkey_function' */ -#include "my_alloc.h" /* MEM_ROOT */ - -/* Worst case tree is half full. This gives use 2^(MAX_TREE_HEIGHT/2) leafs */ -#define MAX_TREE_HEIGHT 64 - -#define ELEMENT_KEY(tree,element)\ -(tree->offset_to_key ? (void*)((uchar*) element+tree->offset_to_key) :\ - *((void**) (element+1))) - -#define tree_set_pointer(element,ptr) *((uchar **) (element+1))=((uchar*) (ptr)) - -#define TREE_NO_DUPS 1 - -typedef enum { left_root_right, right_root_left } TREE_WALK; -typedef uint32 element_count; -typedef int (*tree_walk_action)(void *,element_count,void *); - -typedef enum { free_init, free_free, free_end } TREE_FREE; -typedef void (*tree_element_free)(void*, TREE_FREE, void *); - -typedef struct st_tree_element { - struct st_tree_element *left,*right; - uint32 count:31, - colour:1; /* black is marked as 1 */ -} TREE_ELEMENT; - -#define ELEMENT_CHILD(element, offs) (*(TREE_ELEMENT**)((char*)element + offs)) - -typedef struct st_tree { - TREE_ELEMENT *root,null_element; - TREE_ELEMENT **parents[MAX_TREE_HEIGHT]; - uint offset_to_key,elements_in_tree,size_of_element; - ulong memory_limit, allocated; - qsort_cmp2 compare; - void *custom_arg; - MEM_ROOT mem_root; - my_bool with_delete; - tree_element_free free; - uint flag; -} TREE; - - /* Functions on whole tree */ -void init_tree(TREE *tree, ulong default_alloc_size, ulong memory_limit, - int size, qsort_cmp2 compare, my_bool with_delete, - tree_element_free free_element, void *custom_arg); -void delete_tree(TREE*); -void reset_tree(TREE*); - /* similar to delete tree, except we do not my_free() blocks in mem_root - */ -#define is_tree_inited(tree) ((tree)->root != 0) - - /* Functions on leafs */ -TREE_ELEMENT *tree_insert(TREE *tree,void *key, uint key_size, - void *custom_arg); -void *tree_search(TREE *tree, void *key, void *custom_arg); -int tree_walk(TREE *tree,tree_walk_action action, - void *argument, TREE_WALK visit); -int tree_delete(TREE *tree, void *key, uint key_size, void *custom_arg); -void *tree_search_key(TREE *tree, const void *key, - TREE_ELEMENT **parents, TREE_ELEMENT ***last_pos, - enum ha_rkey_function flag, void *custom_arg); -void *tree_search_edge(TREE *tree, TREE_ELEMENT **parents, - TREE_ELEMENT ***last_pos, int child_offs); -void *tree_search_next(TREE *tree, TREE_ELEMENT ***last_pos, int l_offs, - int r_offs); -ha_rows tree_record_pos(TREE *tree, const void *key, - enum ha_rkey_function search_flag, void *custom_arg); - -#define TREE_ELEMENT_EXTRA_SIZE (sizeof(TREE_ELEMENT) + sizeof(void*)) - -#ifdef __cplusplus -} -#endif -#endif diff --git a/dep/mysqllite/include/internal/my_uctype.h b/dep/mysqllite/include/internal/my_uctype.h deleted file mode 100644 index 580eb646e11..00000000000 --- a/dep/mysqllite/include/internal/my_uctype.h +++ /dev/null @@ -1,1483 +0,0 @@ -#ifndef MY_UCTYPE_INCLUDED -#define MY_UCTYPE_INCLUDED - -/* Copyright (C) 2006 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 */ - -/* - Unicode ctype data - Generated from UnicodeData-5.0.0d9.txt -*/ -static unsigned char uctype_page00[256]= -{ - 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, - 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, - 8, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, - 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 16, 16, 16, 16, 16, 16, - 16, 129, 129, 129, 129, 129, 129, 129, 129, 129, 129, 129, 129, 129, 129, 129, - 129, 129, 129, 129, 129, 129, 129, 129, 129, 129, 129, 16, 16, 16, 16, 16, - 16, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, - 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 16, 16, 16, 16, 32, - 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, - 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, - 8, 16, 16, 16, 16, 16, 16, 16, 16, 16, 2, 16, 16, 32, 16, 16, - 16, 16, 20, 20, 16, 2, 16, 16, 16, 20, 2, 16, 20, 20, 20, 16, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 16, 1, 1, 1, 1, 1, 1, 1, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 16, 2, 2, 2, 2, 2, 2, 2, 2 -}; - -static unsigned char uctype_page01[256]= -{ - 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, - 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, - 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, - 1, 2, 1, 2, 1, 2, 1, 2, 2, 1, 2, 1, 2, 1, 2, 1, - 2, 1, 2, 1, 2, 1, 2, 1, 2, 2, 1, 2, 1, 2, 1, 2, - 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, - 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, - 1, 2, 1, 2, 1, 2, 1, 2, 1, 1, 2, 1, 2, 1, 2, 2, - 2, 1, 1, 2, 1, 2, 1, 1, 2, 1, 1, 1, 2, 2, 1, 1, - 1, 1, 2, 1, 1, 2, 1, 1, 1, 2, 2, 2, 1, 1, 2, 1, - 1, 2, 1, 2, 1, 2, 1, 1, 2, 1, 2, 2, 1, 2, 1, 1, - 2, 1, 1, 1, 2, 1, 2, 1, 1, 2, 2, 2, 1, 2, 2, 2, - 2, 2, 2, 2, 1, 1, 2, 1, 1, 2, 1, 1, 2, 1, 2, 1, - 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 2, 1, 2, - 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, - 2, 1, 1, 2, 1, 2, 1, 1, 1, 2, 1, 2, 1, 2, 1, 2 -}; - -static unsigned char uctype_page02[256]= -{ - 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, - 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, - 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, - 1, 2, 1, 2, 2, 2, 2, 2, 2, 2, 1, 1, 2, 1, 1, 2, - 2, 1, 2, 1, 1, 1, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 16, 16, 16, 16, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, - 2, 2, 2, 2, 2, 16, 16, 16, 16, 16, 16, 16, 16, 16, 2, 16, - 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16 -}; - -static unsigned char uctype_page03[256]= -{ - 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, - 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, - 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, - 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, - 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, - 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, - 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, - 0, 0, 0, 0, 16, 16, 0, 0, 0, 0, 2, 2, 2, 2, 16, 0, - 0, 0, 0, 0, 16, 16, 1, 16, 1, 1, 1, 0, 1, 0, 1, 1, - 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, - 2, 2, 1, 1, 1, 2, 2, 2, 1, 2, 1, 2, 1, 2, 1, 2, - 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, - 2, 2, 2, 2, 1, 2, 16, 1, 2, 1, 1, 2, 2, 1, 1, 1 -}; - -static unsigned char uctype_page04[256]= -{ - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, - 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, - 1, 2, 16, 18, 18, 18, 18, 0, 18, 18, 1, 2, 1, 2, 1, 2, - 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, - 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, - 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, - 1, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 2, - 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, - 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, - 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2 -}; - -static unsigned char uctype_page05[256]= -{ - 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, - 1, 2, 1, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 0, 0, 2, 16, 16, 16, 16, 16, 16, - 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 0, 16, 16, 0, 0, 0, 0, 0, - 0, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, - 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, - 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 16, 18, - 16, 18, 18, 16, 18, 18, 16, 18, 0, 0, 0, 0, 0, 0, 0, 0, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 0, 0, 0, 0, - 2, 2, 2, 16, 16, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 -}; - -static unsigned char uctype_page06[256]= -{ - 32, 32, 32, 32, 0, 0, 0, 0, 0, 0, 0, 16, 16, 16, 16, 16, - 18, 18, 18, 18, 18, 18, 0, 0, 0, 0, 0, 16, 0, 0, 16, 16, - 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 0, 0, 0, 0, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 18, 18, 18, 18, 18, - 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 0, - 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 16, 16, 16, 16, 2, 2, - 18, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 16, 2, 18, 18, 18, 18, 18, 18, 18, 32, 18, 18, - 18, 18, 18, 18, 18, 2, 2, 18, 18, 16, 18, 18, 18, 18, 2, 2, - 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 2, 2, 2, 16, 16, 2 -}; - -static unsigned char uctype_page07[256]= -{ - 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 0, 32, - 2, 18, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, - 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 0, 0, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, - 18, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 18, 18, 18, 18, 18, - 18, 18, 18, 18, 2, 2, 16, 16, 16, 16, 2, 0, 0, 0, 0, 0 -}; - -static unsigned char uctype_page09[256]= -{ - 0, 18, 18, 18, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 0, 18, 2, 18, 18, - 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 0, 0, - 2, 18, 18, 18, 18, 0, 0, 0, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 18, 18, 16, 16, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, - 16, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 2, 2, 2, 2, - 0, 18, 18, 18, 0, 2, 2, 2, 2, 2, 2, 2, 2, 0, 0, 2, - 2, 0, 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 2, 2, 2, 2, 2, 2, - 2, 0, 2, 0, 0, 0, 2, 2, 2, 2, 0, 0, 18, 2, 18, 18, - 18, 18, 18, 18, 18, 0, 0, 18, 18, 0, 0, 18, 18, 18, 2, 0, - 0, 0, 0, 0, 0, 0, 0, 18, 0, 0, 0, 0, 2, 2, 0, 2, - 2, 2, 18, 18, 0, 0, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, - 2, 2, 16, 16, 20, 20, 20, 20, 20, 20, 16, 0, 0, 0, 0, 0 -}; - -static unsigned char uctype_page0A[256]= -{ - 0, 18, 18, 18, 0, 2, 2, 2, 2, 2, 2, 0, 0, 0, 0, 2, - 2, 0, 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 2, 2, 2, 2, 2, 2, - 2, 0, 2, 2, 0, 2, 2, 0, 2, 2, 0, 0, 18, 0, 18, 18, - 18, 18, 18, 0, 0, 0, 0, 18, 18, 0, 0, 18, 18, 18, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 2, 2, 2, 0, 2, 0, - 0, 0, 0, 0, 0, 0, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, - 18, 18, 2, 2, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 18, 18, 18, 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 2, - 2, 2, 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 2, 2, 2, 2, 2, 2, - 2, 0, 2, 2, 0, 2, 2, 2, 2, 2, 0, 0, 18, 2, 18, 18, - 18, 18, 18, 18, 18, 18, 0, 18, 18, 18, 0, 18, 18, 18, 0, 0, - 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 2, 2, 18, 18, 0, 0, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, - 0, 16, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 -}; - -static unsigned char uctype_page0B[256]= -{ - 0, 18, 18, 18, 0, 2, 2, 2, 2, 2, 2, 2, 2, 0, 0, 2, - 2, 0, 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 2, 2, 2, 2, 2, 2, - 2, 0, 2, 2, 0, 2, 2, 2, 2, 2, 0, 0, 18, 2, 18, 18, - 18, 18, 18, 18, 0, 0, 0, 18, 18, 0, 0, 18, 18, 18, 0, 0, - 0, 0, 0, 0, 0, 0, 18, 18, 0, 0, 0, 0, 2, 2, 0, 2, - 2, 2, 0, 0, 0, 0, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, - 16, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 18, 2, 0, 2, 2, 2, 2, 2, 2, 0, 0, 0, 2, 2, - 2, 0, 2, 2, 2, 2, 0, 0, 0, 2, 2, 0, 2, 0, 2, 2, - 0, 0, 0, 2, 2, 0, 0, 0, 2, 2, 2, 0, 0, 0, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 0, 0, 0, 18, 18, - 18, 18, 18, 0, 0, 0, 18, 18, 18, 0, 18, 18, 18, 18, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 18, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, - 20, 20, 20, 16, 16, 16, 16, 16, 16, 16, 16, 0, 0, 0, 0, 0 -}; - -static unsigned char uctype_page0C[256]= -{ - 0, 18, 18, 18, 0, 2, 2, 2, 2, 2, 2, 2, 2, 0, 2, 2, - 2, 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 0, 2, 2, 2, 2, 2, 0, 0, 0, 0, 18, 18, - 18, 18, 18, 18, 18, 0, 18, 18, 18, 0, 18, 18, 18, 18, 0, 0, - 0, 0, 0, 0, 0, 18, 18, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 2, 2, 0, 0, 0, 0, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 18, 18, 0, 2, 2, 2, 2, 2, 2, 2, 2, 0, 2, 2, - 2, 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 0, 2, 2, 2, 2, 2, 0, 0, 18, 2, 18, 18, - 18, 18, 18, 18, 18, 0, 18, 18, 18, 0, 18, 18, 18, 18, 0, 0, - 0, 0, 0, 0, 0, 18, 18, 0, 0, 0, 0, 0, 0, 0, 2, 0, - 2, 2, 18, 18, 0, 0, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, - 0, 16, 16, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 -}; - -static unsigned char uctype_page0D[256]= -{ - 0, 0, 18, 18, 0, 2, 2, 2, 2, 2, 2, 2, 2, 0, 2, 2, - 2, 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 0, 0, 0, 18, 18, - 18, 18, 18, 18, 0, 0, 18, 18, 18, 0, 18, 18, 18, 18, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 18, 0, 0, 0, 0, 0, 0, 0, 0, - 2, 2, 0, 0, 0, 0, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 18, 18, 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 0, 0, 0, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 2, 0, 0, - 2, 2, 2, 2, 2, 2, 2, 0, 0, 0, 18, 0, 0, 0, 0, 18, - 18, 18, 18, 18, 18, 0, 18, 0, 18, 18, 18, 18, 18, 18, 18, 18, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 18, 18, 16, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 -}; - -static unsigned char uctype_page0E[256]= -{ - 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 18, 2, 2, 18, 18, 18, 18, 18, 18, 18, 0, 0, 0, 0, 16, - 2, 2, 2, 2, 2, 2, 2, 18, 18, 18, 18, 18, 18, 18, 18, 16, - 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 16, 16, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 2, 2, 0, 2, 0, 0, 2, 2, 0, 2, 0, 0, 2, 0, 0, - 0, 0, 0, 0, 2, 2, 2, 2, 0, 2, 2, 2, 2, 2, 2, 2, - 0, 2, 2, 2, 0, 2, 0, 2, 0, 0, 2, 2, 0, 2, 2, 2, - 2, 18, 2, 2, 18, 18, 18, 18, 18, 18, 0, 18, 18, 2, 0, 0, - 2, 2, 2, 2, 2, 0, 2, 0, 18, 18, 18, 18, 18, 18, 0, 0, - 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 0, 0, 2, 2, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 -}; - -static unsigned char uctype_page0F[256]= -{ - 2, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, - 16, 16, 16, 16, 16, 16, 16, 16, 18, 18, 16, 16, 16, 16, 16, 16, - 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 20, 20, 20, 20, 20, 20, - 20, 20, 20, 20, 16, 18, 16, 18, 16, 18, 16, 16, 16, 16, 18, 18, - 2, 2, 2, 2, 2, 2, 2, 2, 0, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 0, 0, 0, 0, - 0, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, - 18, 18, 18, 18, 18, 16, 18, 18, 2, 2, 2, 2, 0, 0, 0, 0, - 18, 18, 18, 18, 18, 18, 18, 18, 0, 18, 18, 18, 18, 18, 18, 18, - 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, - 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 0, 16, 16, - 16, 16, 16, 16, 16, 16, 18, 16, 16, 16, 16, 16, 16, 0, 0, 16, - 16, 16, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 -}; - -static unsigned char uctype_page10[256]= -{ - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 0, 2, 2, 2, 2, 2, 0, 2, 2, 0, 18, 18, 18, 18, - 18, 18, 18, 0, 0, 0, 18, 18, 18, 18, 0, 0, 0, 0, 0, 0, - 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 16, 16, 16, 16, 16, 16, - 2, 2, 2, 2, 2, 2, 18, 18, 18, 18, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 16, 2, 0, 0, 0 -}; - -static unsigned char uctype_page11[256]= -{ - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 0, 0, 0, 0, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 0, 0, 0, 0, 0, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 0, 0, 0, 0, 0 -}; - -static unsigned char uctype_page12[256]= -{ - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 2, 2, 2, 2, 0, 0, - 2, 2, 2, 2, 2, 2, 2, 0, 2, 0, 2, 2, 2, 2, 0, 0, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 2, 2, 2, 2, 0, 0, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 0, 2, 2, 2, 2, 0, 0, 2, 2, 2, 2, 2, 2, 2, 0, - 2, 0, 2, 2, 2, 2, 0, 0, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 0, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2 -}; - -static unsigned char uctype_page13[256]= -{ - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 0, 2, 2, 2, 2, 0, 0, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 0, 0, 0, 18, - 16, 16, 16, 16, 16, 16, 16, 16, 16, 20, 20, 20, 20, 20, 20, 20, - 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 0, 0, 0, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 0, 0, 0, 0, 0, 0, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 -}; - -static unsigned char uctype_page14[256]= -{ - 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2 -}; - -static unsigned char uctype_page16[256]= -{ - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 16, 16, 2, - 2, 2, 2, 2, 2, 2, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 8, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 16, 16, 0, 0, 0, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 16, 16, 16, 7, 7, - 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 -}; - -static unsigned char uctype_page17[256]= -{ - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 2, 2, - 2, 2, 18, 18, 18, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 18, 18, 18, 16, 16, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 18, 18, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 2, 2, - 2, 0, 18, 18, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 32, 32, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, - 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, - 18, 18, 18, 18, 16, 16, 16, 2, 16, 16, 16, 16, 2, 18, 0, 0, - 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 0, 0, 0, 0, 0, 0, - 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 0, 0, 0, 0, 0, 0 -}; - -static unsigned char uctype_page18[256]= -{ - 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 18, 18, 18, 8, 0, - 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 0, 0, 0, 0, 0, 0, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 0, 0, 0, 0, 0, 0, 0, 0, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 18, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 -}; - -static unsigned char uctype_page19[256]= -{ - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 0, 0, - 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 0, 0, 0, 0, - 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 0, 0, 0, 0, - 16, 0, 0, 0, 16, 16, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 0, - 2, 2, 2, 2, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 0, 0, 0, 0, 0, - 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, - 18, 2, 2, 2, 2, 2, 2, 2, 18, 18, 0, 0, 0, 0, 0, 0, - 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 0, 0, 0, 0, 16, 16, - 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, - 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16 -}; - -static unsigned char uctype_page1A[256]= -{ - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 18, 18, 18, 18, 18, 0, 0, 16, 16, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 -}; - -static unsigned char uctype_page1B[256]= -{ - 18, 18, 18, 18, 18, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, - 18, 18, 18, 18, 18, 2, 2, 2, 2, 2, 2, 2, 0, 0, 0, 0, - 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 16, 16, 16, 16, 16, 16, - 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 18, 18, 18, 18, 18, - 18, 18, 18, 18, 16, 16, 16, 16, 16, 16, 16, 16, 16, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 -}; - -static unsigned char uctype_page1D[256]= -{ - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 18, 18 -}; - -static unsigned char uctype_page1E[256]= -{ - 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, - 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, - 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, - 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, - 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, - 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, - 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, - 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, - 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, - 1, 2, 1, 2, 1, 2, 2, 2, 2, 2, 2, 2, 0, 0, 0, 0, - 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, - 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, - 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, - 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, - 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, - 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 0, 0, 0, 0, 0, 0 -}; - -static unsigned char uctype_page1F[256]= -{ - 2, 2, 2, 2, 2, 2, 2, 2, 1, 1, 1, 1, 1, 1, 1, 1, - 2, 2, 2, 2, 2, 2, 0, 0, 1, 1, 1, 1, 1, 1, 0, 0, - 2, 2, 2, 2, 2, 2, 2, 2, 1, 1, 1, 1, 1, 1, 1, 1, - 2, 2, 2, 2, 2, 2, 2, 2, 1, 1, 1, 1, 1, 1, 1, 1, - 2, 2, 2, 2, 2, 2, 0, 0, 1, 1, 1, 1, 1, 1, 0, 0, - 2, 2, 2, 2, 2, 2, 2, 2, 0, 1, 0, 1, 0, 1, 0, 1, - 2, 2, 2, 2, 2, 2, 2, 2, 1, 1, 1, 1, 1, 1, 1, 1, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 0, - 2, 2, 2, 2, 2, 2, 2, 2, 1, 1, 1, 1, 1, 1, 1, 1, - 2, 2, 2, 2, 2, 2, 2, 2, 1, 1, 1, 1, 1, 1, 1, 1, - 2, 2, 2, 2, 2, 2, 2, 2, 1, 1, 1, 1, 1, 1, 1, 1, - 2, 2, 2, 2, 2, 0, 2, 2, 1, 1, 1, 1, 1, 16, 2, 16, - 16, 16, 2, 2, 2, 0, 2, 2, 1, 1, 1, 1, 1, 16, 16, 16, - 2, 2, 2, 2, 0, 0, 2, 2, 1, 1, 1, 1, 0, 16, 16, 16, - 2, 2, 2, 2, 2, 2, 2, 2, 1, 1, 1, 1, 1, 16, 16, 16, - 0, 0, 2, 2, 2, 0, 2, 2, 1, 1, 1, 1, 1, 16, 16, 0 -}; - -static unsigned char uctype_page20[256]= -{ - 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 32, 32, 32, 32, 32, - 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, - 16, 16, 16, 16, 16, 16, 16, 16, 8, 8, 32, 32, 32, 32, 32, 8, - 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, - 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, - 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 8, - 32, 32, 32, 32, 0, 0, 0, 0, 0, 0, 32, 32, 32, 32, 32, 32, - 20, 2, 0, 0, 20, 20, 20, 20, 20, 20, 16, 16, 16, 16, 16, 2, - 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 16, 16, 16, 16, 16, 0, - 2, 2, 2, 2, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, - 16, 16, 16, 16, 16, 16, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, - 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 -}; - -static unsigned char uctype_page21[256]= -{ - 16, 16, 1, 16, 16, 16, 16, 1, 16, 16, 2, 1, 1, 1, 2, 2, - 1, 1, 1, 2, 16, 1, 16, 16, 16, 1, 1, 1, 1, 1, 16, 16, - 16, 16, 16, 16, 1, 16, 1, 16, 1, 16, 1, 1, 1, 1, 16, 2, - 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 16, 16, 2, 2, 1, 1, - 16, 16, 16, 16, 16, 1, 2, 2, 2, 2, 16, 16, 16, 16, 2, 0, - 0, 0, 0, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, - 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, - 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, - 7, 7, 7, 1, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, - 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, - 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, - 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, - 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, - 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, - 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16 -}; - -static unsigned char uctype_page23[256]= -{ - 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, - 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, - 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, - 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, - 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, - 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, - 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, - 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, - 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, - 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, - 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, - 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, - 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, - 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, - 16, 16, 16, 16, 16, 16, 16, 16, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 -}; - -static unsigned char uctype_page24[256]= -{ - 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, - 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, - 16, 16, 16, 16, 16, 16, 16, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, - 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, - 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, - 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 16, 16, 16, 16, - 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, - 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, - 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, - 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, - 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 20, 20, 20, 20, 20, 20, - 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20 -}; - -static unsigned char uctype_page26[256]= -{ - 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, - 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, - 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, - 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, - 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, - 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, - 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, - 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, - 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, - 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 0, 0, 0, - 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, - 16, 16, 16, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 -}; - -static unsigned char uctype_page27[256]= -{ - 0, 16, 16, 16, 16, 0, 16, 16, 16, 16, 0, 0, 16, 16, 16, 16, - 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, - 16, 16, 16, 16, 16, 16, 16, 16, 0, 16, 16, 16, 16, 16, 16, 16, - 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, - 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 0, 16, 0, 16, - 16, 16, 16, 0, 0, 0, 16, 0, 16, 16, 16, 16, 16, 16, 16, 0, - 0, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, - 16, 16, 16, 16, 16, 16, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, - 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, - 20, 20, 20, 20, 16, 0, 0, 0, 16, 16, 16, 16, 16, 16, 16, 16, - 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, - 0, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 0, - 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 0, 0, 0, 0, 0, - 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, - 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 0, 0, 0, 0, - 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16 -}; - -static unsigned char uctype_page2B[256]= -{ - 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, - 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 0, 0, 0, 0, 0, - 16, 16, 16, 16, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 -}; - -static unsigned char uctype_page2C[256]= -{ - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, - 1, 2, 1, 1, 1, 2, 2, 1, 2, 1, 2, 1, 2, 0, 0, 0, - 0, 0, 0, 0, 2, 1, 2, 2, 0, 0, 0, 0, 0, 0, 0, 0, - 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, - 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, - 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, - 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, - 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, - 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, - 1, 2, 1, 2, 2, 16, 16, 16, 16, 16, 16, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 16, 16, 16, 20, 16, 16 -}; - -static unsigned char uctype_page2D[256]= -{ - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 2, 2, 2, 2, 2, 2, 2, 0, 2, 2, 2, 2, 2, 2, 2, 0, - 2, 2, 2, 2, 2, 2, 2, 0, 2, 2, 2, 2, 2, 2, 2, 0, - 2, 2, 2, 2, 2, 2, 2, 0, 2, 2, 2, 2, 2, 2, 2, 0, - 2, 2, 2, 2, 2, 2, 2, 0, 2, 2, 2, 2, 2, 2, 2, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 -}; - -static unsigned char uctype_page2E[256]= -{ - 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, - 16, 16, 16, 16, 16, 16, 16, 16, 0, 0, 0, 0, 16, 16, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, - 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 0, 16, 16, 16, 16, 16, - 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, - 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, - 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, - 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, - 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, - 16, 16, 16, 16, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 -}; - -static unsigned char uctype_page2F[256]= -{ - 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, - 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, - 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, - 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, - 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, - 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, - 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, - 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, - 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, - 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, - 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, - 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, - 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, - 16, 16, 16, 16, 16, 16, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 0, 0, 0, 0 -}; - -static unsigned char uctype_page30[256]= -{ - 8, 16, 16, 16, 16, 2, 2, 7, 16, 16, 16, 16, 16, 16, 16, 16, - 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, - 16, 7, 7, 7, 7, 7, 7, 7, 7, 7, 18, 18, 18, 18, 18, 18, - 16, 2, 2, 2, 2, 2, 16, 16, 7, 7, 7, 2, 2, 16, 16, 16, - 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 0, 0, 18, 18, 16, 16, 2, 2, 2, - 16, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 16, 2, 2, 2, 2 -}; - -static unsigned char uctype_page31[256]= -{ - 0, 0, 0, 0, 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 0, 0, - 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, - 16, 16, 20, 20, 20, 20, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 0, 0, 0, 0, 0, 0, 0, 0, - 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2 -}; - -static unsigned char uctype_page32[256]= -{ - 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, - 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 0, - 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 16, 16, 16, 16, 16, 16, - 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, - 16, 16, 16, 16, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 16, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, - 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, - 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, - 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 16, 16, 16, 16, 16, 16, - 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, - 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, - 16, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, - 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, - 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, - 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, - 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 0 -}; - -static unsigned char uctype_page4D[256]= -{ - 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, - 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, - 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, - 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, - 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, - 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, - 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, - 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, - 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, - 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, - 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, - 3, 3, 3, 3, 3, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, - 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, - 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, - 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16 -}; - -static unsigned char uctype_page9F[256]= -{ - 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, - 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, - 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, - 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, - 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, - 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, - 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, - 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, - 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, - 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, - 3, 3, 3, 3, 3, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 -}; - -static unsigned char uctype_pageA4[256]= -{ - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 0, 0, - 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, - 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, - 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, - 16, 16, 16, 16, 16, 16, 16, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 -}; - -static unsigned char uctype_pageA7[256]= -{ - 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, - 16, 16, 16, 16, 16, 16, 16, 2, 2, 2, 2, 0, 0, 0, 0, 0, - 16, 16, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 -}; - -static unsigned char uctype_pageA8[256]= -{ - 2, 2, 18, 2, 2, 2, 18, 2, 2, 2, 2, 18, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 18, 18, 18, 18, 18, 16, 16, 16, 16, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 16, 16, 16, 16, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 -}; - -static unsigned char uctype_pageD7[256]= -{ - 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, - 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, - 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, - 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, - 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, - 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, - 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, - 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, - 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, - 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, - 3, 3, 3, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 -}; - -static unsigned char uctype_pageD8[256]= -{ - 32, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 -}; - -static unsigned char uctype_pageDB[256]= -{ - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 32, - 32, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 32 -}; - -static unsigned char uctype_pageDC[256]= -{ - 32, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 -}; - -static unsigned char uctype_pageDF[256]= -{ - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 32 -}; - -static unsigned char uctype_pageE0[256]= -{ - 32, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 -}; - -static unsigned char uctype_pageF8[256]= -{ - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 32 -}; - -static unsigned char uctype_pageFA[256]= -{ - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 0, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 0, 0, 0, 0, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 -}; - -static unsigned char uctype_pageFB[256]= -{ - 2, 2, 2, 2, 2, 2, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 2, 2, 2, 2, 2, 0, 0, 0, 0, 0, 2, 18, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 16, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 0, 2, 2, 2, 2, 2, 0, 2, 0, - 2, 2, 0, 2, 2, 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2 -}; - -static unsigned char uctype_pageFD[256]= -{ - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 16, 16, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 0, 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 16, 16, 0, 0 -}; - -static unsigned char uctype_pageFE[256]= -{ - 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, - 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 0, 0, 0, 0, 0, 0, - 18, 18, 18, 18, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, - 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, - 16, 16, 16, 0, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, - 16, 16, 16, 16, 16, 16, 16, 0, 16, 16, 16, 16, 0, 0, 0, 0, - 2, 2, 2, 2, 2, 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 0, 32 -}; - -static unsigned char uctype_pageFF[256]= -{ - 0, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, - 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 16, 16, 16, 16, 16, 16, - 16, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 16, 16, 16, 16, 16, - 16, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 16, 16, 16, 16, 16, - 16, 16, 16, 16, 16, 16, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, - 0, 0, 2, 2, 2, 2, 2, 2, 0, 0, 2, 2, 2, 2, 2, 2, - 0, 0, 2, 2, 2, 2, 2, 2, 0, 0, 2, 2, 2, 0, 0, 0, - 16, 16, 16, 16, 16, 16, 16, 0, 16, 16, 16, 16, 16, 16, 16, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 32, 32, 32, 16, 16, 0, 0 -}; - -MY_UNI_CTYPE my_uni_ctype[256]={ - {0,uctype_page00}, - {0,uctype_page01}, - {0,uctype_page02}, - {0,uctype_page03}, - {0,uctype_page04}, - {0,uctype_page05}, - {0,uctype_page06}, - {0,uctype_page07}, - {0,NULL}, - {0,uctype_page09}, - {0,uctype_page0A}, - {0,uctype_page0B}, - {0,uctype_page0C}, - {0,uctype_page0D}, - {0,uctype_page0E}, - {0,uctype_page0F}, - {0,uctype_page10}, - {0,uctype_page11}, - {0,uctype_page12}, - {0,uctype_page13}, - {0,uctype_page14}, - {2,NULL}, - {0,uctype_page16}, - {0,uctype_page17}, - {0,uctype_page18}, - {0,uctype_page19}, - {0,uctype_page1A}, - {0,uctype_page1B}, - {0,NULL}, - {0,uctype_page1D}, - {0,uctype_page1E}, - {0,uctype_page1F}, - {0,uctype_page20}, - {0,uctype_page21}, - {16,NULL}, - {0,uctype_page23}, - {0,uctype_page24}, - {16,NULL}, - {0,uctype_page26}, - {0,uctype_page27}, - {16,NULL}, - {16,NULL}, - {16,NULL}, - {0,uctype_page2B}, - {0,uctype_page2C}, - {0,uctype_page2D}, - {0,uctype_page2E}, - {0,uctype_page2F}, - {0,uctype_page30}, - {0,uctype_page31}, - {0,uctype_page32}, - {16,NULL}, - {3,NULL}, - {3,NULL}, - {3,NULL}, - {3,NULL}, - {3,NULL}, - {3,NULL}, - {3,NULL}, - {3,NULL}, - {3,NULL}, - {3,NULL}, - {3,NULL}, - {3,NULL}, - {3,NULL}, - {3,NULL}, - {3,NULL}, - {3,NULL}, - {3,NULL}, - {3,NULL}, - {3,NULL}, - {3,NULL}, - {3,NULL}, - {3,NULL}, - {3,NULL}, - {3,NULL}, - {3,NULL}, - {0,uctype_page4D}, - {3,NULL}, - {3,NULL}, - {3,NULL}, - {3,NULL}, - {3,NULL}, - {3,NULL}, - {3,NULL}, - {3,NULL}, - {3,NULL}, - {3,NULL}, - {3,NULL}, - {3,NULL}, - {3,NULL}, - {3,NULL}, - {3,NULL}, - {3,NULL}, - {3,NULL}, - {3,NULL}, - {3,NULL}, - {3,NULL}, - {3,NULL}, - {3,NULL}, - {3,NULL}, - {3,NULL}, - {3,NULL}, - {3,NULL}, - {3,NULL}, - {3,NULL}, - {3,NULL}, - {3,NULL}, - {3,NULL}, - {3,NULL}, - {3,NULL}, - {3,NULL}, - {3,NULL}, - {3,NULL}, - {3,NULL}, - {3,NULL}, - {3,NULL}, - {3,NULL}, - {3,NULL}, - {3,NULL}, - {3,NULL}, - {3,NULL}, - {3,NULL}, - {3,NULL}, - {3,NULL}, - {3,NULL}, - {3,NULL}, - {3,NULL}, - {3,NULL}, - {3,NULL}, - {3,NULL}, - {3,NULL}, - {3,NULL}, - {3,NULL}, - {3,NULL}, - {3,NULL}, - {3,NULL}, - {3,NULL}, - {3,NULL}, - {3,NULL}, - {3,NULL}, - {3,NULL}, - {3,NULL}, - {3,NULL}, - {3,NULL}, - {3,NULL}, - {3,NULL}, - {3,NULL}, - {3,NULL}, - {3,NULL}, - {3,NULL}, - {3,NULL}, - {3,NULL}, - {3,NULL}, - {3,NULL}, - {3,NULL}, - {3,NULL}, - {3,NULL}, - {3,NULL}, - {0,uctype_page9F}, - {2,NULL}, - {2,NULL}, - {2,NULL}, - {2,NULL}, - {0,uctype_pageA4}, - {0,NULL}, - {0,NULL}, - {0,uctype_pageA7}, - {0,uctype_pageA8}, - {0,NULL}, - {0,NULL}, - {0,NULL}, - {3,NULL}, - {3,NULL}, - {3,NULL}, - {3,NULL}, - {3,NULL}, - {3,NULL}, - {3,NULL}, - {3,NULL}, - {3,NULL}, - {3,NULL}, - {3,NULL}, - {3,NULL}, - {3,NULL}, - {3,NULL}, - {3,NULL}, - {3,NULL}, - {3,NULL}, - {3,NULL}, - {3,NULL}, - {3,NULL}, - {3,NULL}, - {3,NULL}, - {3,NULL}, - {3,NULL}, - {3,NULL}, - {3,NULL}, - {3,NULL}, - {3,NULL}, - {3,NULL}, - {3,NULL}, - {3,NULL}, - {3,NULL}, - {3,NULL}, - {3,NULL}, - {3,NULL}, - {3,NULL}, - {3,NULL}, - {3,NULL}, - {3,NULL}, - {3,NULL}, - {3,NULL}, - {3,NULL}, - {3,NULL}, - {0,uctype_pageD7}, - {0,uctype_pageD8}, - {0,NULL}, - {0,NULL}, - {0,uctype_pageDB}, - {0,uctype_pageDC}, - {0,NULL}, - {0,NULL}, - {0,uctype_pageDF}, - {0,uctype_pageE0}, - {0,NULL}, - {0,NULL}, - {0,NULL}, - {0,NULL}, - {0,NULL}, - {0,NULL}, - {0,NULL}, - {0,NULL}, - {0,NULL}, - {0,NULL}, - {0,NULL}, - {0,NULL}, - {0,NULL}, - {0,NULL}, - {0,NULL}, - {0,NULL}, - {0,NULL}, - {0,NULL}, - {0,NULL}, - {0,NULL}, - {0,NULL}, - {0,NULL}, - {0,NULL}, - {0,uctype_pageF8}, - {2,NULL}, - {0,uctype_pageFA}, - {0,uctype_pageFB}, - {2,NULL}, - {0,uctype_pageFD}, - {0,uctype_pageFE}, - {0,uctype_pageFF} -}; - - -#endif /* MY_UCTYPE_INCLUDED */ diff --git a/dep/mysqllite/include/internal/myisampack.h b/dep/mysqllite/include/internal/myisampack.h deleted file mode 100644 index ecf35520a88..00000000000 --- a/dep/mysqllite/include/internal/myisampack.h +++ /dev/null @@ -1,242 +0,0 @@ -#ifndef MYISAMPACK_INCLUDED -#define MYISAMPACK_INCLUDED - -/* 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 */ - -/* - Storing of values in high byte first order. - - integer keys and file pointers are stored with high byte first to get - better compression -*/ - -/* these two are for uniformity */ -#define mi_sint1korr(A) ((int8)(*A)) -#define mi_uint1korr(A) ((uint8)(*A)) - -#define mi_sint2korr(A) ((int16) (((int16) (((uchar*) (A))[1])) +\ - ((int16) ((int16) ((char*) (A))[0]) << 8))) -#define mi_sint3korr(A) ((int32) (((((uchar*) (A))[0]) & 128) ? \ - (((uint32) 255L << 24) | \ - (((uint32) ((uchar*) (A))[0]) << 16) |\ - (((uint32) ((uchar*) (A))[1]) << 8) | \ - ((uint32) ((uchar*) (A))[2])) : \ - (((uint32) ((uchar*) (A))[0]) << 16) |\ - (((uint32) ((uchar*) (A))[1]) << 8) | \ - ((uint32) ((uchar*) (A))[2]))) -#define mi_sint4korr(A) ((int32) (((int32) (((uchar*) (A))[3])) +\ - ((int32) (((uchar*) (A))[2]) << 8) +\ - ((int32) (((uchar*) (A))[1]) << 16) +\ - ((int32) ((int16) ((char*) (A))[0]) << 24))) -#define mi_sint8korr(A) ((longlong) mi_uint8korr(A)) -#define mi_uint2korr(A) ((uint16) (((uint16) (((uchar*) (A))[1])) +\ - ((uint16) (((uchar*) (A))[0]) << 8))) -#define mi_uint3korr(A) ((uint32) (((uint32) (((uchar*) (A))[2])) +\ - (((uint32) (((uchar*) (A))[1])) << 8) +\ - (((uint32) (((uchar*) (A))[0])) << 16))) -#define mi_uint4korr(A) ((uint32) (((uint32) (((uchar*) (A))[3])) +\ - (((uint32) (((uchar*) (A))[2])) << 8) +\ - (((uint32) (((uchar*) (A))[1])) << 16) +\ - (((uint32) (((uchar*) (A))[0])) << 24))) -#define mi_uint5korr(A) ((ulonglong)(((uint32) (((uchar*) (A))[4])) +\ - (((uint32) (((uchar*) (A))[3])) << 8) +\ - (((uint32) (((uchar*) (A))[2])) << 16) +\ - (((uint32) (((uchar*) (A))[1])) << 24)) +\ - (((ulonglong) (((uchar*) (A))[0])) << 32)) -#define mi_uint6korr(A) ((ulonglong)(((uint32) (((uchar*) (A))[5])) +\ - (((uint32) (((uchar*) (A))[4])) << 8) +\ - (((uint32) (((uchar*) (A))[3])) << 16) +\ - (((uint32) (((uchar*) (A))[2])) << 24)) +\ - (((ulonglong) (((uint32) (((uchar*) (A))[1])) +\ - (((uint32) (((uchar*) (A))[0]) << 8)))) <<\ - 32)) -#define mi_uint7korr(A) ((ulonglong)(((uint32) (((uchar*) (A))[6])) +\ - (((uint32) (((uchar*) (A))[5])) << 8) +\ - (((uint32) (((uchar*) (A))[4])) << 16) +\ - (((uint32) (((uchar*) (A))[3])) << 24)) +\ - (((ulonglong) (((uint32) (((uchar*) (A))[2])) +\ - (((uint32) (((uchar*) (A))[1])) << 8) +\ - (((uint32) (((uchar*) (A))[0])) << 16))) <<\ - 32)) -#define mi_uint8korr(A) ((ulonglong)(((uint32) (((uchar*) (A))[7])) +\ - (((uint32) (((uchar*) (A))[6])) << 8) +\ - (((uint32) (((uchar*) (A))[5])) << 16) +\ - (((uint32) (((uchar*) (A))[4])) << 24)) +\ - (((ulonglong) (((uint32) (((uchar*) (A))[3])) +\ - (((uint32) (((uchar*) (A))[2])) << 8) +\ - (((uint32) (((uchar*) (A))[1])) << 16) +\ - (((uint32) (((uchar*) (A))[0])) << 24))) <<\ - 32)) - -/* This one is for uniformity */ -#define mi_int1store(T,A) *((uchar*)(T))= (uchar) (A) - -#define mi_int2store(T,A) { uint def_temp= (uint) (A) ;\ - ((uchar*) (T))[1]= (uchar) (def_temp);\ - ((uchar*) (T))[0]= (uchar) (def_temp >> 8); } -#define mi_int3store(T,A) { /*lint -save -e734 */\ - ulong def_temp= (ulong) (A);\ - ((uchar*) (T))[2]= (uchar) (def_temp);\ - ((uchar*) (T))[1]= (uchar) (def_temp >> 8);\ - ((uchar*) (T))[0]= (uchar) (def_temp >> 16);\ - /*lint -restore */} -#define mi_int4store(T,A) { ulong def_temp= (ulong) (A);\ - ((uchar*) (T))[3]= (uchar) (def_temp);\ - ((uchar*) (T))[2]= (uchar) (def_temp >> 8);\ - ((uchar*) (T))[1]= (uchar) (def_temp >> 16);\ - ((uchar*) (T))[0]= (uchar) (def_temp >> 24); } -#define mi_int5store(T,A) { ulong def_temp= (ulong) (A),\ - def_temp2= (ulong) ((A) >> 32);\ - ((uchar*) (T))[4]= (uchar) (def_temp);\ - ((uchar*) (T))[3]= (uchar) (def_temp >> 8);\ - ((uchar*) (T))[2]= (uchar) (def_temp >> 16);\ - ((uchar*) (T))[1]= (uchar) (def_temp >> 24);\ - ((uchar*) (T))[0]= (uchar) (def_temp2); } -#define mi_int6store(T,A) { ulong def_temp= (ulong) (A),\ - def_temp2= (ulong) ((A) >> 32);\ - ((uchar*) (T))[5]= (uchar) (def_temp);\ - ((uchar*) (T))[4]= (uchar) (def_temp >> 8);\ - ((uchar*) (T))[3]= (uchar) (def_temp >> 16);\ - ((uchar*) (T))[2]= (uchar) (def_temp >> 24);\ - ((uchar*) (T))[1]= (uchar) (def_temp2);\ - ((uchar*) (T))[0]= (uchar) (def_temp2 >> 8); } -#define mi_int7store(T,A) { ulong def_temp= (ulong) (A),\ - def_temp2= (ulong) ((A) >> 32);\ - ((uchar*) (T))[6]= (uchar) (def_temp);\ - ((uchar*) (T))[5]= (uchar) (def_temp >> 8);\ - ((uchar*) (T))[4]= (uchar) (def_temp >> 16);\ - ((uchar*) (T))[3]= (uchar) (def_temp >> 24);\ - ((uchar*) (T))[2]= (uchar) (def_temp2);\ - ((uchar*) (T))[1]= (uchar) (def_temp2 >> 8);\ - ((uchar*) (T))[0]= (uchar) (def_temp2 >> 16); } -#define mi_int8store(T,A) { ulong def_temp3= (ulong) (A),\ - def_temp4= (ulong) ((A) >> 32);\ - mi_int4store((uchar*) (T) + 0, def_temp4);\ - mi_int4store((uchar*) (T) + 4, def_temp3); } - -#ifdef WORDS_BIGENDIAN - -#define mi_float4store(T,A) { ((uchar*) (T))[0]= ((uchar*) &A)[0];\ - ((uchar*) (T))[1]= ((uchar*) &A)[1];\ - ((uchar*) (T))[2]= ((uchar*) &A)[2];\ - ((uchar*) (T))[3]= ((uchar*) &A)[3]; } - -#define mi_float4get(V,M) { float def_temp;\ - ((uchar*) &def_temp)[0]= ((uchar*) (M))[0];\ - ((uchar*) &def_temp)[1]= ((uchar*) (M))[1];\ - ((uchar*) &def_temp)[2]= ((uchar*) (M))[2];\ - ((uchar*) &def_temp)[3]= ((uchar*) (M))[3];\ - (V)= def_temp; } - -#define mi_float8store(T,V) { ((uchar*) (T))[0]= ((uchar*) &V)[0];\ - ((uchar*) (T))[1]= ((uchar*) &V)[1];\ - ((uchar*) (T))[2]= ((uchar*) &V)[2];\ - ((uchar*) (T))[3]= ((uchar*) &V)[3];\ - ((uchar*) (T))[4]= ((uchar*) &V)[4];\ - ((uchar*) (T))[5]= ((uchar*) &V)[5];\ - ((uchar*) (T))[6]= ((uchar*) &V)[6];\ - ((uchar*) (T))[7]= ((uchar*) &V)[7]; } - -#define mi_float8get(V,M) { double def_temp;\ - ((uchar*) &def_temp)[0]= ((uchar*) (M))[0];\ - ((uchar*) &def_temp)[1]= ((uchar*) (M))[1];\ - ((uchar*) &def_temp)[2]= ((uchar*) (M))[2];\ - ((uchar*) &def_temp)[3]= ((uchar*) (M))[3];\ - ((uchar*) &def_temp)[4]= ((uchar*) (M))[4];\ - ((uchar*) &def_temp)[5]= ((uchar*) (M))[5];\ - ((uchar*) &def_temp)[6]= ((uchar*) (M))[6];\ - ((uchar*) &def_temp)[7]= ((uchar*) (M))[7]; \ - (V)= def_temp; } -#else - -#define mi_float4store(T,A) { ((uchar*) (T))[0]= ((uchar*) &A)[3];\ - ((uchar*) (T))[1]= ((uchar*) &A)[2];\ - ((uchar*) (T))[2]= ((uchar*) &A)[1];\ - ((uchar*) (T))[3]= ((uchar*) &A)[0]; } - -#define mi_float4get(V,M) { float def_temp;\ - ((uchar*) &def_temp)[0]= ((uchar*) (M))[3];\ - ((uchar*) &def_temp)[1]= ((uchar*) (M))[2];\ - ((uchar*) &def_temp)[2]= ((uchar*) (M))[1];\ - ((uchar*) &def_temp)[3]= ((uchar*) (M))[0];\ - (V)= def_temp; } - -#if defined(__FLOAT_WORD_ORDER) && (__FLOAT_WORD_ORDER == __BIG_ENDIAN) -#define mi_float8store(T,V) { ((uchar*) (T))[0]= ((uchar*) &V)[3];\ - ((uchar*) (T))[1]= ((uchar*) &V)[2];\ - ((uchar*) (T))[2]= ((uchar*) &V)[1];\ - ((uchar*) (T))[3]= ((uchar*) &V)[0];\ - ((uchar*) (T))[4]= ((uchar*) &V)[7];\ - ((uchar*) (T))[5]= ((uchar*) &V)[6];\ - ((uchar*) (T))[6]= ((uchar*) &V)[5];\ - ((uchar*) (T))[7]= ((uchar*) &V)[4];} - -#define mi_float8get(V,M) { double def_temp;\ - ((uchar*) &def_temp)[0]= ((uchar*) (M))[3];\ - ((uchar*) &def_temp)[1]= ((uchar*) (M))[2];\ - ((uchar*) &def_temp)[2]= ((uchar*) (M))[1];\ - ((uchar*) &def_temp)[3]= ((uchar*) (M))[0];\ - ((uchar*) &def_temp)[4]= ((uchar*) (M))[7];\ - ((uchar*) &def_temp)[5]= ((uchar*) (M))[6];\ - ((uchar*) &def_temp)[6]= ((uchar*) (M))[5];\ - ((uchar*) &def_temp)[7]= ((uchar*) (M))[4];\ - (V)= def_temp; } - -#else -#define mi_float8store(T,V) { ((uchar*) (T))[0]= ((uchar*) &V)[7];\ - ((uchar*) (T))[1]= ((uchar*) &V)[6];\ - ((uchar*) (T))[2]= ((uchar*) &V)[5];\ - ((uchar*) (T))[3]= ((uchar*) &V)[4];\ - ((uchar*) (T))[4]= ((uchar*) &V)[3];\ - ((uchar*) (T))[5]= ((uchar*) &V)[2];\ - ((uchar*) (T))[6]= ((uchar*) &V)[1];\ - ((uchar*) (T))[7]= ((uchar*) &V)[0];} - -#define mi_float8get(V,M) { double def_temp;\ - ((uchar*) &def_temp)[0]= ((uchar*) (M))[7];\ - ((uchar*) &def_temp)[1]= ((uchar*) (M))[6];\ - ((uchar*) &def_temp)[2]= ((uchar*) (M))[5];\ - ((uchar*) &def_temp)[3]= ((uchar*) (M))[4];\ - ((uchar*) &def_temp)[4]= ((uchar*) (M))[3];\ - ((uchar*) &def_temp)[5]= ((uchar*) (M))[2];\ - ((uchar*) &def_temp)[6]= ((uchar*) (M))[1];\ - ((uchar*) &def_temp)[7]= ((uchar*) (M))[0];\ - (V)= def_temp; } -#endif /* __FLOAT_WORD_ORDER */ -#endif /* WORDS_BIGENDIAN */ - -/* Fix to avoid warnings when sizeof(ha_rows) == sizeof(long) */ - -#ifdef BIG_TABLES -#define mi_rowstore(T,A) mi_int8store(T, A) -#define mi_rowkorr(T) mi_uint8korr(T) -#else -#define mi_rowstore(T,A) { mi_int4store(T, 0);\ - mi_int4store(((uchar*) (T) + 4), A); } -#define mi_rowkorr(T) mi_uint4korr((uchar*) (T) + 4) -#endif - -#if SIZEOF_OFF_T > 4 -#define mi_sizestore(T,A) mi_int8store(T, A) -#define mi_sizekorr(T) mi_uint8korr(T) -#else -#define mi_sizestore(T,A) { if ((A) == HA_OFFSET_ERROR)\ - bfill((char*) (T), 8, 255);\ - else { mi_int4store((T), 0);\ - mi_int4store(((T) + 4), A); }} -#define mi_sizekorr(T) mi_uint4korr((uchar*) (T) + 4) -#endif -#endif /* MYISAMPACK_INCLUDED */ diff --git a/dep/mysqllite/include/internal/mysql_version.h.in b/dep/mysqllite/include/internal/mysql_version.h.in deleted file mode 100644 index 04a43f2c968..00000000000 --- a/dep/mysqllite/include/internal/mysql_version.h.in +++ /dev/null @@ -1,30 +0,0 @@ -/* Copyright Abandoned 1996, 1999, 2001 MySQL AB - This file is public domain and comes with NO WARRANTY of any kind */ - -/* Version numbers for protocol & mysqld */ - -#ifndef _mysql_version_h -#define _mysql_version_h -#ifdef _CUSTOMCONFIG_ -#include <custom_conf.h> -#else -#define PROTOCOL_VERSION @PROTOCOL_VERSION@ -#define MYSQL_SERVER_VERSION "@VERSION@" -#define MYSQL_BASE_VERSION "mysqld-@MYSQL_BASE_VERSION@" -#define MYSQL_SERVER_SUFFIX_DEF "@MYSQL_SERVER_SUFFIX@" -#define FRM_VER @DOT_FRM_VERSION@ -#define MYSQL_VERSION_ID @MYSQL_VERSION_ID@ -#define MYSQL_PORT @MYSQL_TCP_PORT@ -#define MYSQL_PORT_DEFAULT @MYSQL_TCP_PORT_DEFAULT@ -#define MYSQL_UNIX_ADDR "@MYSQL_UNIX_ADDR@" -#define MYSQL_CONFIG_NAME "my" -#define MYSQL_COMPILATION_COMMENT "@COMPILATION_COMMENT@" - -/* mysqld compile time options */ -#endif /* _CUSTOMCONFIG_ */ - -#ifndef LICENSE -#define LICENSE GPL -#endif /* LICENSE */ - -#endif /* _mysql_version_h */ diff --git a/dep/mysqllite/include/internal/mysys_err.h b/dep/mysqllite/include/internal/mysys_err.h deleted file mode 100644 index 22ac74302a2..00000000000 --- a/dep/mysqllite/include/internal/mysys_err.h +++ /dev/null @@ -1,93 +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 */ - -#ifndef _mysys_err_h -#define _mysys_err_h - -#ifdef __cplusplus -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 *globerrs[]; /* my_error_messages is here */ - -/* Error message numbers in global map */ -/* - Do not add error numbers before EE_ERROR_FIRST. - If necessary to add lower numbers, change EE_ERROR_FIRST accordingly. - - We start with error 1 to not confuse peoples with 'error 0' -*/ - -#define EE_ERROR_FIRST 1 /*Copy first error nr.*/ -#define EE_CANTCREATEFILE 1 -#define EE_READ 2 -#define EE_WRITE 3 -#define EE_BADCLOSE 4 -#define EE_OUTOFMEMORY 5 -#define EE_DELETE 6 -#define EE_LINK 7 -#define EE_EOFERR 9 -#define EE_CANTLOCK 10 -#define EE_CANTUNLOCK 11 -#define EE_DIR 12 -#define EE_STAT 13 -#define EE_CANT_CHSIZE 14 -#define EE_CANT_OPEN_STREAM 15 -#define EE_GETWD 16 -#define EE_SETWD 17 -#define EE_LINK_WARNING 18 -#define EE_OPEN_WARNING 19 -#define EE_DISK_FULL 20 -#define EE_CANT_MKDIR 21 -#define EE_UNKNOWN_CHARSET 22 -#define EE_OUT_OF_FILERESOURCES 23 -#define EE_CANT_READLINK 24 -#define EE_CANT_SYMLINK 25 -#define EE_REALPATH 26 -#define EE_SYNC 27 -#define EE_UNKNOWN_COLLATION 28 -#define EE_FILENOTFOUND 29 -#define EE_FILE_NOT_CLOSED 30 -#define EE_CHANGE_OWNERSHIP 31 -#define EE_CHANGE_PERMISSIONS 32 -#define EE_CANT_SEEK 33 -#define EE_ERROR_LAST 33 /* Copy last error nr */ -/* Add error numbers before EE_ERROR_LAST and change it accordingly. */ - - /* exit codes for all MySQL programs */ - -#define EXIT_UNSPECIFIED_ERROR 1 -#define EXIT_UNKNOWN_OPTION 2 -#define EXIT_AMBIGUOUS_OPTION 3 -#define EXIT_NO_ARGUMENT_ALLOWED 4 -#define EXIT_ARGUMENT_REQUIRED 5 -#define EXIT_VAR_PREFIX_NOT_UNIQUE 6 -#define EXIT_UNKNOWN_VARIABLE 7 -#define EXIT_OUT_OF_MEMORY 8 -#define EXIT_UNKNOWN_SUFFIX 9 -#define EXIT_NO_PTR_TO_VARIABLE 10 -#define EXIT_CANNOT_CONNECT_TO_SERVICE 11 -#define EXIT_OPTION_DISABLED 12 -#define EXIT_ARGUMENT_INVALID 13 - - -#ifdef __cplusplus -} -#endif -#endif - diff --git a/dep/mysqllite/include/internal/password.h b/dep/mysqllite/include/internal/password.h deleted file mode 100644 index e75b09297a3..00000000000 --- a/dep/mysqllite/include/internal/password.h +++ /dev/null @@ -1,32 +0,0 @@ -/* Copyright 2006-2008 MySQL AB, 2008-2009 Sun Microsystems, Inc. - - 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 */ - -#ifndef PASSWORD_INCLUDED -#define PASSWORD_INCLUDED - -#include "my_global.h" - -C_MODE_START - -void my_make_scrambled_password_323(char *to, const char *password, - size_t pass_len); -void my_make_scrambled_password(char *to, const char *password, - size_t pass_len); - -void hash_password(ulong *result, const char *password, uint password_len); - -C_MODE_END - -#endif /* PASSWORD_INCLUDED */ diff --git a/dep/mysqllite/include/internal/probes_mysql.h b/dep/mysqllite/include/internal/probes_mysql.h deleted file mode 100644 index 13491c661fd..00000000000 --- a/dep/mysqllite/include/internal/probes_mysql.h +++ /dev/null @@ -1,13 +0,0 @@ -#ifndef PROBES_MYSQL_H - -#define PROBES_MYSQL_H - -#include <my_global.h> - -#if defined(HAVE_DTRACE) && !defined(DISABLE_DTRACE) -#include "probes_mysql_dtrace.h" -#else -#include "probes_mysql_nodtrace.h" -#endif - -#endif /* PROBES_MYSQL_H */ diff --git a/dep/mysqllite/include/internal/probes_mysql_nodtrace.h b/dep/mysqllite/include/internal/probes_mysql_nodtrace.h deleted file mode 100644 index bc3b65a00e5..00000000000 --- a/dep/mysqllite/include/internal/probes_mysql_nodtrace.h +++ /dev/null @@ -1,129 +0,0 @@ -/* - * Generated by dheadgen(1). - */ - -#ifndef _PROBES_MYSQL_D -#define _PROBES_MYSQL_D - -#ifdef __cplusplus -extern "C" { -#endif - -#define MYSQL_CONNECTION_START(arg0, arg1, arg2) -#define MYSQL_CONNECTION_START_ENABLED() (0) -#define MYSQL_CONNECTION_DONE(arg0, arg1) -#define MYSQL_CONNECTION_DONE_ENABLED() (0) -#define MYSQL_COMMAND_START(arg0, arg1, arg2, arg3) -#define MYSQL_COMMAND_START_ENABLED() (0) -#define MYSQL_COMMAND_DONE(arg0) -#define MYSQL_COMMAND_DONE_ENABLED() (0) -#define MYSQL_QUERY_START(arg0, arg1, arg2, arg3, arg4) -#define MYSQL_QUERY_START_ENABLED() (0) -#define MYSQL_QUERY_DONE(arg0) -#define MYSQL_QUERY_DONE_ENABLED() (0) -#define MYSQL_QUERY_PARSE_START(arg0) -#define MYSQL_QUERY_PARSE_START_ENABLED() (0) -#define MYSQL_QUERY_PARSE_DONE(arg0) -#define MYSQL_QUERY_PARSE_DONE_ENABLED() (0) -#define MYSQL_QUERY_CACHE_HIT(arg0, arg1) -#define MYSQL_QUERY_CACHE_HIT_ENABLED() (0) -#define MYSQL_QUERY_CACHE_MISS(arg0) -#define MYSQL_QUERY_CACHE_MISS_ENABLED() (0) -#define MYSQL_QUERY_EXEC_START(arg0, arg1, arg2, arg3, arg4, arg5) -#define MYSQL_QUERY_EXEC_START_ENABLED() (0) -#define MYSQL_QUERY_EXEC_DONE(arg0) -#define MYSQL_QUERY_EXEC_DONE_ENABLED() (0) -#define MYSQL_INSERT_ROW_START(arg0, arg1) -#define MYSQL_INSERT_ROW_START_ENABLED() (0) -#define MYSQL_INSERT_ROW_DONE(arg0) -#define MYSQL_INSERT_ROW_DONE_ENABLED() (0) -#define MYSQL_UPDATE_ROW_START(arg0, arg1) -#define MYSQL_UPDATE_ROW_START_ENABLED() (0) -#define MYSQL_UPDATE_ROW_DONE(arg0) -#define MYSQL_UPDATE_ROW_DONE_ENABLED() (0) -#define MYSQL_DELETE_ROW_START(arg0, arg1) -#define MYSQL_DELETE_ROW_START_ENABLED() (0) -#define MYSQL_DELETE_ROW_DONE(arg0) -#define MYSQL_DELETE_ROW_DONE_ENABLED() (0) -#define MYSQL_READ_ROW_START(arg0, arg1, arg2) -#define MYSQL_READ_ROW_START_ENABLED() (0) -#define MYSQL_READ_ROW_DONE(arg0) -#define MYSQL_READ_ROW_DONE_ENABLED() (0) -#define MYSQL_INDEX_READ_ROW_START(arg0, arg1) -#define MYSQL_INDEX_READ_ROW_START_ENABLED() (0) -#define MYSQL_INDEX_READ_ROW_DONE(arg0) -#define MYSQL_INDEX_READ_ROW_DONE_ENABLED() (0) -#define MYSQL_HANDLER_RDLOCK_START(arg0, arg1) -#define MYSQL_HANDLER_RDLOCK_START_ENABLED() (0) -#define MYSQL_HANDLER_WRLOCK_START(arg0, arg1) -#define MYSQL_HANDLER_WRLOCK_START_ENABLED() (0) -#define MYSQL_HANDLER_UNLOCK_START(arg0, arg1) -#define MYSQL_HANDLER_UNLOCK_START_ENABLED() (0) -#define MYSQL_HANDLER_RDLOCK_DONE(arg0) -#define MYSQL_HANDLER_RDLOCK_DONE_ENABLED() (0) -#define MYSQL_HANDLER_WRLOCK_DONE(arg0) -#define MYSQL_HANDLER_WRLOCK_DONE_ENABLED() (0) -#define MYSQL_HANDLER_UNLOCK_DONE(arg0) -#define MYSQL_HANDLER_UNLOCK_DONE_ENABLED() (0) -#define MYSQL_FILESORT_START(arg0, arg1) -#define MYSQL_FILESORT_START_ENABLED() (0) -#define MYSQL_FILESORT_DONE(arg0, arg1) -#define MYSQL_FILESORT_DONE_ENABLED() (0) -#define MYSQL_SELECT_START(arg0) -#define MYSQL_SELECT_START_ENABLED() (0) -#define MYSQL_SELECT_DONE(arg0, arg1) -#define MYSQL_SELECT_DONE_ENABLED() (0) -#define MYSQL_INSERT_START(arg0) -#define MYSQL_INSERT_START_ENABLED() (0) -#define MYSQL_INSERT_DONE(arg0, arg1) -#define MYSQL_INSERT_DONE_ENABLED() (0) -#define MYSQL_INSERT_SELECT_START(arg0) -#define MYSQL_INSERT_SELECT_START_ENABLED() (0) -#define MYSQL_INSERT_SELECT_DONE(arg0, arg1) -#define MYSQL_INSERT_SELECT_DONE_ENABLED() (0) -#define MYSQL_UPDATE_START(arg0) -#define MYSQL_UPDATE_START_ENABLED() (0) -#define MYSQL_UPDATE_DONE(arg0, arg1, arg2) -#define MYSQL_UPDATE_DONE_ENABLED() (0) -#define MYSQL_MULTI_UPDATE_START(arg0) -#define MYSQL_MULTI_UPDATE_START_ENABLED() (0) -#define MYSQL_MULTI_UPDATE_DONE(arg0, arg1, arg2) -#define MYSQL_MULTI_UPDATE_DONE_ENABLED() (0) -#define MYSQL_DELETE_START(arg0) -#define MYSQL_DELETE_START_ENABLED() (0) -#define MYSQL_DELETE_DONE(arg0, arg1) -#define MYSQL_DELETE_DONE_ENABLED() (0) -#define MYSQL_MULTI_DELETE_START(arg0) -#define MYSQL_MULTI_DELETE_START_ENABLED() (0) -#define MYSQL_MULTI_DELETE_DONE(arg0, arg1) -#define MYSQL_MULTI_DELETE_DONE_ENABLED() (0) -#define MYSQL_NET_READ_START() -#define MYSQL_NET_READ_START_ENABLED() (0) -#define MYSQL_NET_READ_DONE(arg0, arg1) -#define MYSQL_NET_READ_DONE_ENABLED() (0) -#define MYSQL_NET_WRITE_START(arg0) -#define MYSQL_NET_WRITE_START_ENABLED() (0) -#define MYSQL_NET_WRITE_DONE(arg0) -#define MYSQL_NET_WRITE_DONE_ENABLED() (0) -#define MYSQL_KEYCACHE_READ_START(arg0, arg1, arg2, arg3) -#define MYSQL_KEYCACHE_READ_START_ENABLED() (0) -#define MYSQL_KEYCACHE_READ_BLOCK(arg0) -#define MYSQL_KEYCACHE_READ_BLOCK_ENABLED() (0) -#define MYSQL_KEYCACHE_READ_HIT() -#define MYSQL_KEYCACHE_READ_HIT_ENABLED() (0) -#define MYSQL_KEYCACHE_READ_MISS() -#define MYSQL_KEYCACHE_READ_MISS_ENABLED() (0) -#define MYSQL_KEYCACHE_READ_DONE(arg0, arg1) -#define MYSQL_KEYCACHE_READ_DONE_ENABLED() (0) -#define MYSQL_KEYCACHE_WRITE_START(arg0, arg1, arg2, arg3) -#define MYSQL_KEYCACHE_WRITE_START_ENABLED() (0) -#define MYSQL_KEYCACHE_WRITE_BLOCK(arg0) -#define MYSQL_KEYCACHE_WRITE_BLOCK_ENABLED() (0) -#define MYSQL_KEYCACHE_WRITE_DONE(arg0, arg1) -#define MYSQL_KEYCACHE_WRITE_DONE_ENABLED() (0) - -#ifdef __cplusplus -} -#endif - -#endif /* _PROBES_MYSQL_D */ diff --git a/dep/mysqllite/include/internal/queues.h b/dep/mysqllite/include/internal/queues.h deleted file mode 100644 index 07962f09201..00000000000 --- a/dep/mysqllite/include/internal/queues.h +++ /dev/null @@ -1,75 +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 */ - -/* - Code for generell handling of priority Queues. - Implemention of queues from "Algoritms in C" by Robert Sedgewick. - Copyright Monty Program KB. - By monty. -*/ - -#ifndef _queues_h -#define _queues_h - -#include "my_global.h" /* uchar */ - -#ifdef __cplusplus -extern "C" { -#endif - -typedef struct st_queue { - uchar **root; - void *first_cmp_arg; - uint elements; - uint max_elements; - uint offset_to_key; /* compare is done on element+offset */ - int max_at_top; /* Normally 1, set to -1 if queue_top gives max */ - int (*compare)(void *, uchar *,uchar *); - uint auto_extent; -} QUEUE; - -#define queue_top(queue) ((queue)->root[1]) -#define queue_element(queue,index) ((queue)->root[index+1]) -#define queue_end(queue) ((queue)->root[(queue)->elements]) -#define queue_replaced(queue) _downheap(queue,1) -#define queue_set_cmp_arg(queue, set_arg) (queue)->first_cmp_arg= set_arg -#define queue_set_max_at_top(queue, set_arg) \ - (queue)->max_at_top= set_arg ? -1 : 1 -typedef int (*queue_compare)(void *,uchar *, uchar *); - -int init_queue(QUEUE *queue,uint max_elements,uint offset_to_key, - pbool max_at_top, queue_compare compare, - void *first_cmp_arg); -int init_queue_ex(QUEUE *queue,uint max_elements,uint offset_to_key, - pbool max_at_top, queue_compare compare, - void *first_cmp_arg, uint auto_extent); -int reinit_queue(QUEUE *queue,uint max_elements,uint offset_to_key, - pbool max_at_top, queue_compare compare, - void *first_cmp_arg); -int resize_queue(QUEUE *queue, uint max_elements); -void delete_queue(QUEUE *queue); -void queue_insert(QUEUE *queue,uchar *element); -int queue_insert_safe(QUEUE *queue, uchar *element); -uchar *queue_remove(QUEUE *queue,uint idx); -#define queue_remove_all(queue) { (queue)->elements= 0; } -#define queue_is_full(queue) (queue->elements == queue->max_elements) -void _downheap(QUEUE *queue,uint idx); -void queue_fix(QUEUE *queue); -#define is_queue_inited(queue) ((queue)->root != 0) - -#ifdef __cplusplus -} -#endif -#endif diff --git a/dep/mysqllite/include/internal/rijndael.h b/dep/mysqllite/include/internal/rijndael.h deleted file mode 100644 index 71df1c48dbf..00000000000 --- a/dep/mysqllite/include/internal/rijndael.h +++ /dev/null @@ -1,46 +0,0 @@ -#ifndef RIJNDAEL_INCLUDED -#define RIJNDAEL_INCLUDED - -/* Copyright (C) 2002 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 */ - - -/* - rijndael-alg-fst.h - - @version 3.0 (December 2000) - Optimised ANSI C code for the Rijndael cipher (now AES) - @author Vincent Rijmen <vincent.rijmen@esat.kuleuven.ac.be> - @author Antoon Bosselaers <antoon.bosselaers@esat.kuleuven.ac.be> - @author Paulo Barreto <paulo.barreto@terra.com.br> - - This code is hereby placed in the public domain. - Modified by Peter Zaitsev to fit MySQL coding style. - */ - -#define AES_MAXKC (256/32) -#define AES_MAXKB (256/8) -#define AES_MAXNR 14 - -int rijndaelKeySetupEnc(uint32 rk[/*4*(Nr + 1)*/], const uint8 cipherKey[], - int keyBits); -int rijndaelKeySetupDec(uint32 rk[/*4*(Nr + 1)*/], const uint8 cipherKey[], - int keyBits); -void rijndaelEncrypt(const uint32 rk[/*4*(Nr + 1)*/], int Nr, - const uint8 pt[16], uint8 ct[16]); -void rijndaelDecrypt(const uint32 rk[/*4*(Nr + 1)*/], int Nr, - const uint8 ct[16], uint8 pt[16]); - -#endif /* RIJNDAEL_INCLUDED */ diff --git a/dep/mysqllite/include/internal/sha1.h b/dep/mysqllite/include/internal/sha1.h deleted file mode 100644 index d60d5e17c60..00000000000 --- a/dep/mysqllite/include/internal/sha1.h +++ /dev/null @@ -1,104 +0,0 @@ -#ifndef SHA1_INCLUDED -#define SHA1_INCLUDED - -/* Copyright (C) 2002, 2006 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 Street, Fifth Floor, Boston, MA 02110-1301 USA -*/ - -/* - This is the header file for code which implements the Secure - Hashing Algorithm 1 as defined in FIPS PUB 180-1 published - April 17, 1995. - - Many of the variable names in this code, especially the - single character names, were used because those were the names - used in the publication. - - Please read the file sha1.c for more information. - - Modified 2002 by Peter Zaitsev to better follow MySQL standards - - Original Source from: http://www.faqs.org/rfcs/rfc3174.html - - Copyright (C) The Internet Society (2001). All Rights Reserved. - - This document and translations of it may be copied and furnished to - others, and derivative works that comment on or otherwise explain it - or assist in its implementation may be prepared, copied, published - and distributed, in whole or in part, without restriction of any - kind, provided that the above copyright notice and this paragraph are - included on all such copies and derivative works. However, this - document itself may not be modified in any way, such as by removing - the copyright notice or references to the Internet Society or other - Internet organizations, except as needed for the purpose of - developing Internet standards in which case the procedures for - copyrights defined in the Internet Standards process must be - followed, or as required to translate it into languages other than - English. - - The limited permissions granted above are perpetual and will not be - revoked by the Internet Society or its successors or assigns. - - This document and the information contained herein is provided on an - "AS IS" basis and THE INTERNET SOCIETY AND THE INTERNET ENGINEERING - TASK FORCE DISCLAIMS ALL WARRANTIES, EXPRESS OR IMPLIED, INCLUDING - BUT NOT LIMITED TO ANY WARRANTY THAT THE USE OF THE INFORMATION - HEREIN WILL NOT INFRINGE ANY RIGHTS OR ANY IMPLIED WARRANTIES OF - MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. - - Acknowledgement - Funding for the RFC Editor function is currently provided by the - Internet Society. -*/ - - -enum sha_result_codes -{ - SHA_SUCCESS = 0, - SHA_NULL, /* Null pointer parameter */ - SHA_INPUT_TOO_LONG, /* input data too long */ - SHA_STATE_ERROR /* called Input after Result */ -}; - -#define SHA1_HASH_SIZE 20 /* Hash size in bytes */ - -/* - This structure will hold context information for the SHA-1 - hashing operation -*/ - -typedef struct SHA1_CONTEXT -{ - ulonglong Length; /* Message length in bits */ - uint32 Intermediate_Hash[SHA1_HASH_SIZE/4]; /* Message Digest */ - int Computed; /* Is the digest computed? */ - int Corrupted; /* Is the message digest corrupted? */ - int16 Message_Block_Index; /* Index into message block array */ - uint8 Message_Block[64]; /* 512-bit message blocks */ -} SHA1_CONTEXT; - -/* - Function Prototypes -*/ - -C_MODE_START - -int mysql_sha1_reset(SHA1_CONTEXT*); -int mysql_sha1_input(SHA1_CONTEXT*, const uint8 *, unsigned int); -int mysql_sha1_result(SHA1_CONTEXT* , uint8 Message_Digest[SHA1_HASH_SIZE]); - -C_MODE_END - -#endif /* SHA__INCLUDED */ diff --git a/dep/mysqllite/include/internal/t_ctype.h b/dep/mysqllite/include/internal/t_ctype.h deleted file mode 100644 index 15600019cd6..00000000000 --- a/dep/mysqllite/include/internal/t_ctype.h +++ /dev/null @@ -1,254 +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 */ - -/* - Copyright (C) 1998, 1999 by Pruet Boonma, all rights reserved. - Copyright (C) 1998 by Theppitak Karoonboonyanan, all rights reserved. - Permission to use, copy, modify, distribute and sell this software - and its documentation for any purpose is hereby granted without fee, - provided that the above copyright notice appear in all copies. - Smaphan Raruenrom and Pruet Boonma makes no representations about - the suitability of this software for any purpose. It is provided - "as is" without express or implied warranty. -*/ - -/* LC_COLLATE category + Level information */ - -#ifndef _t_ctype_h -#define _t_ctype_h - -#define TOT_LEVELS 5 -#define LAST_LEVEL 4 /* TOT_LEVELS - 1 */ - -#define IGNORE 0 - - -/* level 1 symbols & order */ -enum l1_symbols { - L1_08 = TOT_LEVELS, - L1_18, - L1_28, - L1_38, - L1_48, - L1_58, - L1_68, - L1_78, - L1_88, - L1_98, - L1_A8, - L1_B8, - L1_C8, - L1_D8, - L1_E8, - L1_F8, - L1_G8, - L1_H8, - L1_I8, - L1_J8, - L1_K8, - L1_L8, - L1_M8, - L1_N8, - L1_O8, - L1_P8, - L1_Q8, - L1_R8, - L1_S8, - L1_T8, - L1_U8, - L1_V8, - L1_W8, - L1_X8, - L1_Y8, - L1_Z8, - L1_KO_KAI, - L1_KHO_KHAI, - L1_KHO_KHUAT, - L1_KHO_KHWAI, - L1_KHO_KHON, - L1_KHO_RAKHANG, - L1_NGO_NGU, - L1_CHO_CHAN, - L1_CHO_CHING, - L1_CHO_CHANG, - L1_SO_SO, - L1_CHO_CHOE, - L1_YO_YING, - L1_DO_CHADA, - L1_TO_PATAK, - L1_THO_THAN, - L1_THO_NANGMONTHO, - L1_THO_PHUTHAO, - L1_NO_NEN, - L1_DO_DEK, - L1_TO_TAO, - L1_THO_THUNG, - L1_THO_THAHAN, - L1_THO_THONG, - L1_NO_NU, - L1_BO_BAIMAI, - L1_PO_PLA, - L1_PHO_PHUNG, - L1_FO_FA, - L1_PHO_PHAN, - L1_FO_FAN, - L1_PHO_SAMPHAO, - L1_MO_MA, - L1_YO_YAK, - L1_RO_RUA, - L1_RU, - L1_LO_LING, - L1_LU, - L1_WO_WAEN, - L1_SO_SALA, - L1_SO_RUSI, - L1_SO_SUA, - L1_HO_HIP, - L1_LO_CHULA, - L1_O_ANG, - L1_HO_NOKHUK, - L1_NKHIT, - L1_SARA_A, - L1_MAI_HAN_AKAT, - L1_SARA_AA, - L1_SARA_AM, - L1_SARA_I, - L1_SARA_II, - L1_SARA_UE, - L1_SARA_UEE, - L1_SARA_U, - L1_SARA_UU, - L1_SARA_E, - L1_SARA_AE, - L1_SARA_O, - L1_SARA_AI_MAIMUAN, - L1_SARA_AI_MAIMALAI -}; - -/* level 2 symbols & order */ -enum l2_symbols { - L2_BLANK = TOT_LEVELS, - L2_THAII, - L2_YAMAK, - L2_PINTHU, - L2_GARAN, - L2_TYKHU, - L2_TONE1, - L2_TONE2, - L2_TONE3, - L2_TONE4 -}; - -/* level 3 symbols & order */ -enum l3_symbols { - L3_BLANK = TOT_LEVELS, - L3_SPACE, - L3_NB_SACE, - L3_LOW_LINE, - L3_HYPHEN, - L3_COMMA, - L3_SEMICOLON, - L3_COLON, - L3_EXCLAMATION, - L3_QUESTION, - L3_SOLIDUS, - L3_FULL_STOP, - L3_PAIYAN_NOI, - L3_MAI_YAMOK, - L3_GRAVE, - L3_CIRCUMFLEX, - L3_TILDE, - L3_APOSTROPHE, - L3_QUOTATION, - L3_L_PARANTHESIS, - L3_L_BRACKET, - L3_L_BRACE, - L3_R_BRACE, - L3_R_BRACKET, - L3_R_PARENTHESIS, - L3_AT, - L3_BAHT, - L3_DOLLAR, - L3_FONGMAN, - L3_ANGKHANKHU, - L3_KHOMUT, - L3_ASTERISK, - L3_BK_SOLIDUS, - L3_AMPERSAND, - L3_NUMBER, - L3_PERCENT, - L3_PLUS, - L3_LESS_THAN, - L3_EQUAL, - L3_GREATER_THAN, - L3_V_LINE -}; - -/* level 4 symbols & order */ -enum l4_symbols { - L4_BLANK = TOT_LEVELS, - L4_MIN, - L4_CAP, - L4_EXT -}; - -enum level_symbols { - L_UPRUPR = TOT_LEVELS, - L_UPPER, - L_MIDDLE, - L_LOWER -}; - -#define _is(c) (t_ctype[(c)][LAST_LEVEL]) -#define _level 8 -#define _consnt 16 -#define _ldvowel 32 -#define _fllwvowel 64 -#define _uprvowel 128 -#define _lwrvowel 256 -#define _tone 512 -#define _diacrt1 1024 -#define _diacrt2 2048 -#define _combine 4096 -#define _stone 8192 -#define _tdig 16384 -#define _rearvowel (_fllwvowel | _uprvowel | _lwrvowel) -#define _diacrt (_diacrt1 | _diacrt2) -#define levelof(c) ( _is(c) & _level ) -#define isthai(c) ( (c) >= 128 ) -#define istalpha(c) ( _is(c) & (_consnt|_ldvowel|_rearvowel|\ - _tone|_diacrt1|_diacrt2) ) -#define isconsnt(c) ( _is(c) & _consnt ) -#define isldvowel(c) ( _is(c) & _ldvowel ) -#define isfllwvowel(c) ( _is(c) & _fllwvowel ) -#define ismidvowel(c) ( _is(c) & (_ldvowel|_fllwvowel) ) -#define isuprvowel(c) ( _is(c) & _uprvowel ) -#define islwrvowel(c) ( _is(c) & _lwrvowel ) -#define isuprlwrvowel(c) ( _is(c) & (_lwrvowel | _uprvowel)) -#define isrearvowel(c) ( _is(c) & _rearvowel ) -#define isvowel(c) ( _is(c) & (_ldvowel|_rearvowel) ) -#define istone(c) ( _is(c) & _tone ) -#define isunldable(c) ( _is(c) & (_rearvowel|_tone|_diacrt1|_diacrt2) ) -#define iscombinable(c) ( _is(c) & _combine ) -#define istdigit(c) ( _is(c) & _tdig ) -#define isstone(c) ( _is(c) & _stone ) -#define isdiacrt1(c) ( _is(c) & _diacrt1) -#define isdiacrt2(c) ( _is(c) & _diacrt2) -#define isdiacrt(c) ( _is(c) & _diacrt) - -/* Function prototype called by sql/field.cc */ -void ThNormalize(uchar* ptr, uint field_length, const uchar* from, uint length); - -#endif diff --git a/dep/mysqllite/include/internal/thr_alarm.h b/dep/mysqllite/include/internal/thr_alarm.h deleted file mode 100644 index 8c91fc0b899..00000000000 --- a/dep/mysqllite/include/internal/thr_alarm.h +++ /dev/null @@ -1,110 +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 */ - -/* Prototypes when using thr_alarm library functions */ - -#ifndef _thr_alarm_h -#define _thr_alarm_h -#ifdef __cplusplus -extern "C" { -#endif - -#ifndef USE_ALARM_THREAD -#define USE_ONE_SIGNAL_HAND /* One must call process_alarm */ -#endif -#ifdef HAVE_rts_threads -#undef USE_ONE_SIGNAL_HAND -#define USE_ALARM_THREAD -#define THR_SERVER_ALARM SIGUSR1 -#else -#define THR_SERVER_ALARM SIGALRM -#endif - -typedef struct st_alarm_info -{ - ulong next_alarm_time; - uint active_alarms; - uint max_used_alarms; -} ALARM_INFO; - -void thr_alarm_info(ALARM_INFO *info); - -#if defined(DONT_USE_THR_ALARM) - -#define USE_ALARM_THREAD -#undef USE_ONE_SIGNAL_HAND - -typedef my_bool thr_alarm_t; -typedef my_bool ALARM; - -#define thr_alarm_init(A) (*(A))=0 -#define thr_alarm_in_use(A) (*(A) != 0) -#define thr_end_alarm(A) -#define thr_alarm(A,B,C) ((*(A)=1)-1) -/* The following should maybe be (*(A)) */ -#define thr_got_alarm(A) 0 -#define init_thr_alarm(A) -#define thr_alarm_kill(A) -#define resize_thr_alarm(N) -#define end_thr_alarm(A) - -#else -#if defined(__WIN__) -typedef struct st_thr_alarm_entry -{ - UINT_PTR crono; -} thr_alarm_entry; - -#else /* System with posix threads */ - -typedef int thr_alarm_entry; - -#define thr_got_alarm(thr_alarm) (**(thr_alarm)) - -#endif /* __WIN__ */ - -typedef thr_alarm_entry* thr_alarm_t; - -typedef struct st_alarm { - ulong expire_time; - thr_alarm_entry alarmed; /* set when alarm is due */ - pthread_t thread; - my_thread_id thread_id; - my_bool malloced; -} ALARM; - -extern uint thr_client_alarm; -extern pthread_t alarm_thread; - -#define thr_alarm_init(A) (*(A))=0 -#define thr_alarm_in_use(A) (*(A)!= 0) -void init_thr_alarm(uint max_alarm); -void resize_thr_alarm(uint max_alarms); -my_bool thr_alarm(thr_alarm_t *alarmed, uint sec, ALARM *buff); -void thr_alarm_kill(my_thread_id thread_id); -void thr_end_alarm(thr_alarm_t *alarmed); -void end_thr_alarm(my_bool free_structures); -sig_handler process_alarm(int); -#ifndef thr_got_alarm -my_bool thr_got_alarm(thr_alarm_t *alrm); -#endif - - -#endif /* DONT_USE_THR_ALARM */ - -#ifdef __cplusplus -} -#endif /* __cplusplus */ -#endif /* _thr_alarm_h */ diff --git a/dep/mysqllite/include/internal/thr_lock.h b/dep/mysqllite/include/internal/thr_lock.h deleted file mode 100644 index 91473737be3..00000000000 --- a/dep/mysqllite/include/internal/thr_lock.h +++ /dev/null @@ -1,163 +0,0 @@ -/* Copyright 2000-2008 MySQL AB, 2008-2009 Sun Microsystems, Inc. - - 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 */ - -/* For use with thr_lock:s */ - -#ifndef _thr_lock_h -#define _thr_lock_h -#ifdef __cplusplus -extern "C" { -#endif - -#include <my_pthread.h> -#include <my_list.h> - -struct st_thr_lock; -extern ulong locks_immediate,locks_waited ; - -/* - Important: if a new lock type is added, a matching lock description - must be added to sql_test.cc's lock_descriptions array. -*/ -enum thr_lock_type { TL_IGNORE=-1, - TL_UNLOCK, /* UNLOCK ANY LOCK */ - /* - Parser only! At open_tables() becomes TL_READ or - TL_READ_NO_INSERT depending on the binary log format - (SBR/RBR) and on the table category (log table). - Used for tables that are read by statements which - modify tables. - */ - TL_READ_DEFAULT, - TL_READ, /* Read lock */ - TL_READ_WITH_SHARED_LOCKS, - /* High prior. than TL_WRITE. Allow concurrent insert */ - TL_READ_HIGH_PRIORITY, - /* READ, Don't allow concurrent insert */ - TL_READ_NO_INSERT, - /* - Write lock, but allow other threads to read / write. - Used by BDB tables in MySQL to mark that someone is - reading/writing to the table. - */ - TL_WRITE_ALLOW_WRITE, - /* - WRITE lock used by concurrent insert. Will allow - READ, if one could use concurrent insert on table. - */ - TL_WRITE_CONCURRENT_INSERT, - /* Write used by INSERT DELAYED. Allows READ locks */ - TL_WRITE_DELAYED, - /* - parser only! Late bound low_priority flag. - At open_tables() becomes thd->update_lock_default. - */ - TL_WRITE_DEFAULT, - /* WRITE lock that has lower priority than TL_READ */ - TL_WRITE_LOW_PRIORITY, - /* Normal WRITE lock */ - TL_WRITE, - /* Abort new lock request with an error */ - TL_WRITE_ONLY}; - -enum enum_thr_lock_result { THR_LOCK_SUCCESS= 0, THR_LOCK_ABORTED= 1, - THR_LOCK_WAIT_TIMEOUT= 2, THR_LOCK_DEADLOCK= 3 }; - - -extern ulong max_write_lock_count; -extern my_bool thr_lock_inited; -extern enum thr_lock_type thr_upgraded_concurrent_insert_lock; - -/* - A description of the thread which owns the lock. The address - of an instance of this structure is used to uniquely identify the thread. -*/ - -typedef struct st_thr_lock_info -{ - pthread_t thread; - my_thread_id thread_id; -} THR_LOCK_INFO; - - -typedef struct st_thr_lock_data { - THR_LOCK_INFO *owner; - struct st_thr_lock_data *next,**prev; - struct st_thr_lock *lock; - mysql_cond_t *cond; - enum thr_lock_type type; - void *status_param; /* Param to status functions */ - void *debug_print_param; - struct PSI_table *m_psi; -} THR_LOCK_DATA; - -struct st_lock_list { - THR_LOCK_DATA *data,**last; -}; - -typedef struct st_thr_lock { - LIST list; - mysql_mutex_t mutex; - struct st_lock_list read_wait; - struct st_lock_list read; - struct st_lock_list write_wait; - struct st_lock_list write; - /* write_lock_count is incremented for write locks and reset on read locks */ - ulong write_lock_count; - uint read_no_write_count; - void (*get_status)(void*, int); /* When one gets a lock */ - void (*copy_status)(void*,void*); - void (*update_status)(void*); /* Before release of write */ - void (*restore_status)(void*); /* Before release of read */ - my_bool (*check_status)(void *); -} THR_LOCK; - - -extern LIST *thr_lock_thread_list; -extern mysql_mutex_t THR_LOCK_lock; - -my_bool init_thr_lock(void); /* Must be called once/thread */ -void thr_lock_info_init(THR_LOCK_INFO *info); -void thr_lock_init(THR_LOCK *lock); -void thr_lock_delete(THR_LOCK *lock); -void thr_lock_data_init(THR_LOCK *lock,THR_LOCK_DATA *data, - void *status_param); -enum enum_thr_lock_result thr_lock(THR_LOCK_DATA *data, - THR_LOCK_INFO *owner, - enum thr_lock_type lock_type, - ulong lock_wait_timeout); -void thr_unlock(THR_LOCK_DATA *data); -enum enum_thr_lock_result thr_multi_lock(THR_LOCK_DATA **data, - uint count, THR_LOCK_INFO *owner, - ulong lock_wait_timeout); -void thr_multi_unlock(THR_LOCK_DATA **data,uint count); -void -thr_lock_merge_status(THR_LOCK_DATA **data, uint count); -void thr_abort_locks(THR_LOCK *lock, my_bool upgrade_lock); -my_bool thr_abort_locks_for_thread(THR_LOCK *lock, my_thread_id thread); -void thr_print_locks(void); /* For debugging */ -my_bool thr_upgrade_write_delay_lock(THR_LOCK_DATA *data, - enum thr_lock_type new_lock_type, - ulong lock_wait_timeout); -void thr_downgrade_write_lock(THR_LOCK_DATA *data, - enum thr_lock_type new_lock_type); -my_bool thr_reschedule_write_lock(THR_LOCK_DATA *data, - ulong lock_wait_timeout); -void thr_set_lock_wait_callback(void (*before_wait)(void), - void (*after_wait)(void)); -#ifdef __cplusplus -} -#endif -#endif /* _thr_lock_h */ diff --git a/dep/mysqllite/include/internal/violite.h b/dep/mysqllite/include/internal/violite.h deleted file mode 100644 index f4083216894..00000000000 --- a/dep/mysqllite/include/internal/violite.h +++ /dev/null @@ -1,241 +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 */ - -/* - * Vio Lite. - * Purpose: include file for Vio that will work with C and C++ - */ - -#ifndef vio_violite_h_ -#define vio_violite_h_ - -#include "my_net.h" /* needed because of struct in_addr */ - - -/* Simple vio interface in C; The functions are implemented in violite.c */ - -#ifdef __cplusplus -extern "C" { -#endif /* __cplusplus */ - -#ifdef __cplusplus -typedef struct st_vio Vio; -#endif /* __cplusplus */ - -enum enum_vio_type -{ - VIO_CLOSED, VIO_TYPE_TCPIP, VIO_TYPE_SOCKET, VIO_TYPE_NAMEDPIPE, - VIO_TYPE_SSL, VIO_TYPE_SHARED_MEMORY -}; - - -#define VIO_LOCALHOST 1 /* a localhost connection */ -#define VIO_BUFFERED_READ 2 /* use buffered read */ -#define VIO_READ_BUFFER_SIZE 16384 /* size of read buffer */ - -Vio* vio_new(my_socket sd, enum enum_vio_type type, uint flags); -#ifdef __WIN__ -Vio* vio_new_win32pipe(HANDLE hPipe); -Vio* vio_new_win32shared_memory(HANDLE handle_file_map, - HANDLE handle_map, - HANDLE event_server_wrote, - HANDLE event_server_read, - HANDLE event_client_wrote, - HANDLE event_client_read, - HANDLE event_conn_closed); -#else -#define HANDLE void * -#endif /* __WIN__ */ - -void vio_delete(Vio* vio); -int vio_close(Vio* vio); -void vio_reset(Vio* vio, enum enum_vio_type type, - my_socket sd, HANDLE hPipe, uint flags); -size_t vio_read(Vio *vio, uchar * buf, size_t size); -size_t vio_read_buff(Vio *vio, uchar * buf, size_t size); -size_t vio_write(Vio *vio, const uchar * buf, size_t size); -int vio_blocking(Vio *vio, my_bool onoff, my_bool *old_mode); -my_bool vio_is_blocking(Vio *vio); -/* setsockopt TCP_NODELAY at IPPROTO_TCP level, when possible */ -int vio_fastsend(Vio *vio); -/* setsockopt SO_KEEPALIVE at SOL_SOCKET level, when possible */ -int vio_keepalive(Vio *vio, my_bool onoff); -/* Whenever we should retry the last read/write operation. */ -my_bool vio_should_retry(Vio *vio); -/* Check that operation was timed out */ -my_bool vio_was_interrupted(Vio *vio); -/* Short text description of the socket for those, who are curious.. */ -const char* vio_description(Vio *vio); -/* Return the type of the connection */ -enum enum_vio_type vio_type(Vio* vio); -/* Return last error number */ -int vio_errno(Vio*vio); -/* Get socket number */ -my_socket vio_fd(Vio*vio); -/* Remote peer's address and name in text form */ -my_bool vio_peer_addr(Vio *vio, char *buf, uint16 *port, size_t buflen); -my_bool vio_poll_read(Vio *vio, uint timeout); -my_bool vio_is_connected(Vio *vio); -ssize_t vio_pending(Vio *vio); - -my_bool vio_get_normalized_ip_string(const struct sockaddr *addr, int addr_length, - char *ip_string, size_t ip_string_size); - -int vio_getnameinfo(const struct sockaddr *sa, - char *hostname, size_t hostname_size, - char *port, size_t port_size, - int flags); - -#ifdef HAVE_OPENSSL -#include <openssl/opensslv.h> -#if OPENSSL_VERSION_NUMBER < 0x0090700f -#define DES_cblock des_cblock -#define DES_key_schedule des_key_schedule -#define DES_set_key_unchecked(k,ks) des_set_key_unchecked((k),*(ks)) -#define DES_ede3_cbc_encrypt(i,o,l,k1,k2,k3,iv,e) des_ede3_cbc_encrypt((i),(o),(l),*(k1),*(k2),*(k3),(iv),(e)) -#endif - -#define HEADER_DES_LOCL_H dummy_something -#define YASSL_MYSQL_COMPATIBLE -#ifndef YASSL_PREFIX -#define YASSL_PREFIX -#endif -/* Set yaSSL to use same type as MySQL do for socket handles */ -typedef my_socket YASSL_SOCKET_T; -#define YASSL_SOCKET_T_DEFINED -#include <openssl/ssl.h> -#include <openssl/err.h> - -#ifndef EMBEDDED_LIBRARY -enum enum_ssl_init_error -{ - SSL_INITERR_NOERROR= 0, SSL_INITERR_CERT, SSL_INITERR_KEY, - SSL_INITERR_NOMATCH, SSL_INITERR_BAD_PATHS, SSL_INITERR_CIPHERS, - SSL_INITERR_MEMFAIL, SSL_INITERR_LASTERR -}; -const char* sslGetErrString(enum enum_ssl_init_error err); - -struct st_VioSSLFd -{ - SSL_CTX *ssl_context; -}; - -int sslaccept(struct st_VioSSLFd*, Vio *, long timeout); -int sslconnect(struct st_VioSSLFd*, Vio *, long timeout); - -struct st_VioSSLFd -*new_VioSSLConnectorFd(const char *key_file, const char *cert_file, - const char *ca_file, const char *ca_path, - const char *cipher); -struct st_VioSSLFd -*new_VioSSLAcceptorFd(const char *key_file, const char *cert_file, - const char *ca_file,const char *ca_path, - const char *cipher, enum enum_ssl_init_error* error); -void free_vio_ssl_acceptor_fd(struct st_VioSSLFd *fd); -#endif /* ! EMBEDDED_LIBRARY */ -#endif /* HAVE_OPENSSL */ - -void vio_end(void); - -#ifdef __cplusplus -} -#endif - -#if !defined(DONT_MAP_VIO) -#define vio_delete(vio) (vio)->viodelete(vio) -#define vio_errno(vio) (vio)->vioerrno(vio) -#define vio_read(vio, buf, size) ((vio)->read)(vio,buf,size) -#define vio_write(vio, buf, size) ((vio)->write)(vio, buf, size) -#define vio_blocking(vio, set_blocking_mode, old_mode)\ - (vio)->vioblocking(vio, set_blocking_mode, old_mode) -#define vio_is_blocking(vio) (vio)->is_blocking(vio) -#define vio_fastsend(vio) (vio)->fastsend(vio) -#define vio_keepalive(vio, set_keep_alive) (vio)->viokeepalive(vio, set_keep_alive) -#define vio_should_retry(vio) (vio)->should_retry(vio) -#define vio_was_interrupted(vio) (vio)->was_interrupted(vio) -#define vio_close(vio) ((vio)->vioclose)(vio) -#define vio_peer_addr(vio, buf, prt, buflen) (vio)->peer_addr(vio, buf, prt, buflen) -#define vio_timeout(vio, which, seconds) (vio)->timeout(vio, which, seconds) -#define vio_poll_read(vio, timeout) (vio)->poll_read(vio, timeout) -#define vio_is_connected(vio) (vio)->is_connected(vio) -#endif /* !defined(DONT_MAP_VIO) */ - -/* This enumerator is used in parser - should be always visible */ -enum SSL_type -{ - SSL_TYPE_NOT_SPECIFIED= -1, - SSL_TYPE_NONE, - SSL_TYPE_ANY, - SSL_TYPE_X509, - SSL_TYPE_SPECIFIED -}; - - -/* HFTODO - hide this if we don't want client in embedded server */ -/* This structure is for every connection on both sides */ -struct st_vio -{ - my_socket sd; /* my_socket - real or imaginary */ - HANDLE hPipe; - my_bool localhost; /* Are we from localhost? */ - int fcntl_mode; /* Buffered fcntl(sd,F_GETFL) */ - struct sockaddr_storage local; /* Local internet address */ - struct sockaddr_storage remote; /* Remote internet address */ - int addrLen; /* Length of remote address */ - enum enum_vio_type type; /* Type of connection */ - char desc[30]; /* String description */ - char *read_buffer; /* buffer for vio_read_buff */ - char *read_pos; /* start of unfetched data in the - read buffer */ - char *read_end; /* end of unfetched data */ - /* function pointers. They are similar for socket/SSL/whatever */ - void (*viodelete)(Vio*); - int (*vioerrno)(Vio*); - size_t (*read)(Vio*, uchar *, size_t); - size_t (*write)(Vio*, const uchar *, size_t); - int (*vioblocking)(Vio*, my_bool, my_bool *); - my_bool (*is_blocking)(Vio*); - int (*viokeepalive)(Vio*, my_bool); - int (*fastsend)(Vio*); - my_bool (*peer_addr)(Vio*, char *, uint16*, size_t); - void (*in_addr)(Vio*, struct sockaddr_storage*); - my_bool (*should_retry)(Vio*); - my_bool (*was_interrupted)(Vio*); - int (*vioclose)(Vio*); - void (*timeout)(Vio*, unsigned int which, unsigned int timeout); - my_bool (*poll_read)(Vio *vio, uint timeout); - my_bool (*is_connected)(Vio*); - my_bool (*has_data) (Vio*); -#ifdef HAVE_OPENSSL - void *ssl_arg; -#endif -#ifdef HAVE_SMEM - HANDLE handle_file_map; - char *handle_map; - HANDLE event_server_wrote; - HANDLE event_server_read; - HANDLE event_client_wrote; - HANDLE event_client_read; - HANDLE event_conn_closed; - size_t shared_memory_remain; - char *shared_memory_pos; -#endif /* HAVE_SMEM */ -#ifdef _WIN32 - OVERLAPPED pipe_overlapped; - DWORD read_timeout_ms; - DWORD write_timeout_ms; -#endif -}; -#endif /* vio_violite_h_ */ diff --git a/dep/mysqllite/include/keycache.h b/dep/mysqllite/include/keycache.h deleted file mode 100644 index fefa31afd87..00000000000 --- a/dep/mysqllite/include/keycache.h +++ /dev/null @@ -1,146 +0,0 @@ -/* Copyright (C) 2003 MySQL AB, 2009 Sun Microsystems, Inc - - 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 */ - -/* Key cache variable structures */ - -#ifndef _keycache_h -#define _keycache_h - -#include "my_sys.h" /* flush_type */ - -C_MODE_START - -/* declare structures that is used by st_key_cache */ - -struct st_block_link; -typedef struct st_block_link BLOCK_LINK; -struct st_keycache_page; -typedef struct st_keycache_page KEYCACHE_PAGE; -struct st_hash_link; -typedef struct st_hash_link HASH_LINK; - -/* info about requests in a waiting queue */ -typedef struct st_keycache_wqueue -{ - struct st_my_thread_var *last_thread; /* circular list of waiting threads */ -} KEYCACHE_WQUEUE; - -#define CHANGED_BLOCKS_HASH 128 /* must be power of 2 */ - -/* - The key cache structure - It also contains read-only statistics parameters. -*/ - -typedef struct st_key_cache -{ - my_bool key_cache_inited; - my_bool in_resize; /* true during resize operation */ - my_bool resize_in_flush; /* true during flush of resize operation */ - my_bool can_be_used; /* usage of cache for read/write is allowed */ - size_t key_cache_mem_size; /* specified size of the cache memory */ - uint key_cache_block_size; /* size of the page buffer of a cache block */ - ulong min_warm_blocks; /* min number of warm blocks; */ - ulong age_threshold; /* age threshold for hot blocks */ - ulonglong keycache_time; /* total number of block link operations */ - uint hash_entries; /* max number of entries in the hash table */ - int hash_links; /* max number of hash links */ - int hash_links_used; /* number of hash links currently used */ - int disk_blocks; /* max number of blocks in the cache */ - ulong blocks_used; /* maximum number of concurrently used blocks */ - ulong blocks_unused; /* number of currently unused blocks */ - ulong blocks_changed; /* number of currently dirty blocks */ - ulong warm_blocks; /* number of blocks in warm sub-chain */ - ulong cnt_for_resize_op; /* counter to block resize operation */ - long blocks_available; /* number of blocks available in the LRU chain */ - HASH_LINK **hash_root; /* arr. of entries into hash table buckets */ - HASH_LINK *hash_link_root; /* memory for hash table links */ - HASH_LINK *free_hash_list; /* list of free hash links */ - BLOCK_LINK *free_block_list; /* list of free blocks */ - BLOCK_LINK *block_root; /* memory for block links */ - uchar *block_mem; /* memory for block buffers */ - BLOCK_LINK *used_last; /* ptr to the last block of the LRU chain */ - BLOCK_LINK *used_ins; /* ptr to the insertion block in LRU chain */ - mysql_mutex_t cache_lock; /* to lock access to the cache structure */ - KEYCACHE_WQUEUE resize_queue; /* threads waiting during resize operation */ - /* - Waiting for a zero resize count. Using a queue for symmetry though - only one thread can wait here. - */ - KEYCACHE_WQUEUE waiting_for_resize_cnt; - KEYCACHE_WQUEUE waiting_for_hash_link; /* waiting for a free hash link */ - KEYCACHE_WQUEUE waiting_for_block; /* requests waiting for a free block */ - BLOCK_LINK *changed_blocks[CHANGED_BLOCKS_HASH]; /* hash for dirty file bl.*/ - BLOCK_LINK *file_blocks[CHANGED_BLOCKS_HASH]; /* hash for other file bl.*/ - - /* - The following variables are and variables used to hold parameters for - initializing the key cache. - */ - - ulonglong param_buff_size; /* size the memory allocated for the cache */ - ulonglong param_block_size; /* size of the blocks in the key cache */ - ulonglong param_division_limit; /* min. percentage of warm blocks */ - ulonglong param_age_threshold; /* determines when hot block is downgraded */ - - /* Statistics variables. These are reset in reset_key_cache_counters(). */ - ulong global_blocks_changed; /* number of currently dirty blocks */ - ulonglong global_cache_w_requests;/* number of write requests (write hits) */ - ulonglong global_cache_write; /* number of writes from cache to files */ - ulonglong global_cache_r_requests;/* number of read requests (read hits) */ - ulonglong global_cache_read; /* number of reads from files to cache */ - - int blocks; /* max number of blocks in the cache */ - my_bool in_init; /* Set to 1 in MySQL during init/resize */ -} KEY_CACHE; - -/* The default key cache */ -extern KEY_CACHE dflt_key_cache_var, *dflt_key_cache; - -extern int init_key_cache(KEY_CACHE *keycache, uint key_cache_block_size, - size_t use_mem, uint division_limit, - uint age_threshold); -extern int resize_key_cache(KEY_CACHE *keycache, uint key_cache_block_size, - size_t use_mem, uint division_limit, - uint age_threshold); -extern void change_key_cache_param(KEY_CACHE *keycache, uint division_limit, - uint age_threshold); -extern uchar *key_cache_read(KEY_CACHE *keycache, - File file, my_off_t filepos, int level, - uchar *buff, uint length, - uint block_length,int return_buffer); -extern int key_cache_insert(KEY_CACHE *keycache, - File file, my_off_t filepos, int level, - uchar *buff, uint length); -extern int key_cache_write(KEY_CACHE *keycache, - File file, my_off_t filepos, int level, - uchar *buff, uint length, - uint block_length,int force_write); -extern int flush_key_blocks(KEY_CACHE *keycache, - int file, enum flush_type type); -extern void end_key_cache(KEY_CACHE *keycache, my_bool cleanup); - -/* Functions to handle multiple key caches */ -extern my_bool multi_keycache_init(void); -extern void multi_keycache_free(void); -extern KEY_CACHE *multi_key_cache_search(uchar *key, uint length); -extern my_bool multi_key_cache_set(const uchar *key, uint length, - KEY_CACHE *key_cache); -extern void multi_key_cache_change(KEY_CACHE *old_data, - KEY_CACHE *new_data); -extern int reset_key_cache_counters(const char *name, - KEY_CACHE *key_cache); -C_MODE_END -#endif /* _keycache_h */ diff --git a/dep/mysqllite/include/m_ctype.h b/dep/mysqllite/include/m_ctype.h deleted file mode 100644 index bb7f5ddfb3d..00000000000 --- a/dep/mysqllite/include/m_ctype.h +++ /dev/null @@ -1,660 +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 */ - -/* - A better inplementation of the UNIX ctype(3) library. -*/ - -#ifndef _m_ctype_h -#define _m_ctype_h - -#include <my_attribute.h> -#include "my_global.h" /* uint16, uchar */ - -#ifdef __cplusplus -extern "C" { -#endif - -#define MY_CS_NAME_SIZE 32 -#define MY_CS_CTYPE_TABLE_SIZE 257 -#define MY_CS_TO_LOWER_TABLE_SIZE 256 -#define MY_CS_TO_UPPER_TABLE_SIZE 256 -#define MY_CS_SORT_ORDER_TABLE_SIZE 256 -#define MY_CS_TO_UNI_TABLE_SIZE 256 - -#define CHARSET_DIR "charsets/" - -#define my_wc_t ulong - -#define MY_CS_REPLACEMENT_CHARACTER 0xFFFD - -/* - On i386 we store Unicode->CS conversion tables for - some character sets using Big-endian order, - to copy two bytes at onces. - This gives some performance improvement. -*/ -#ifdef __i386__ -#define MB2(x) (((x) >> 8) + (((x) & 0xFF) << 8)) -#define MY_PUT_MB2(s, code) { *((uint16*)(s))= (code); } -#else -#define MB2(x) (x) -#define MY_PUT_MB2(s, code) { (s)[0]= code >> 8; (s)[1]= code & 0xFF; } -#endif - - - -typedef struct unicase_info_st -{ - uint32 toupper; - uint32 tolower; - uint32 sort; -} MY_UNICASE_INFO; - - -extern MY_UNICASE_INFO *my_unicase_default[256]; -extern MY_UNICASE_INFO *my_unicase_turkish[256]; - -typedef struct uni_ctype_st -{ - uchar pctype; - uchar *ctype; -} MY_UNI_CTYPE; - -extern MY_UNI_CTYPE my_uni_ctype[256]; - -/* wm_wc and wc_mb return codes */ -#define MY_CS_ILSEQ 0 /* Wrong by sequence: wb_wc */ -#define MY_CS_ILUNI 0 /* Cannot encode Unicode to charset: wc_mb */ -#define MY_CS_TOOSMALL -101 /* Need at least one byte: wc_mb and mb_wc */ -#define MY_CS_TOOSMALL2 -102 /* Need at least two bytes: wc_mb and mb_wc */ -#define MY_CS_TOOSMALL3 -103 /* Need at least three bytes: wc_mb and mb_wc */ -/* These following three are currently not really used */ -#define MY_CS_TOOSMALL4 -104 /* Need at least 4 bytes: wc_mb and mb_wc */ -#define MY_CS_TOOSMALL5 -105 /* Need at least 5 bytes: wc_mb and mb_wc */ -#define MY_CS_TOOSMALL6 -106 /* Need at least 6 bytes: wc_mb and mb_wc */ -/* A helper macros for "need at least n bytes" */ -#define MY_CS_TOOSMALLN(n) (-100-(n)) - -#define MY_SEQ_INTTAIL 1 -#define MY_SEQ_SPACES 2 - - /* My charsets_list flags */ -#define MY_CS_COMPILED 1 /* compiled-in sets */ -#define MY_CS_CONFIG 2 /* sets that have a *.conf file */ -#define MY_CS_INDEX 4 /* sets listed in the Index file */ -#define MY_CS_LOADED 8 /* sets that are currently loaded */ -#define MY_CS_BINSORT 16 /* if binary sort order */ -#define MY_CS_PRIMARY 32 /* if primary collation */ -#define MY_CS_STRNXFRM 64 /* if strnxfrm is used for sort */ -#define MY_CS_UNICODE 128 /* is a charset is BMP Unicode */ -#define MY_CS_READY 256 /* if a charset is initialized */ -#define MY_CS_AVAILABLE 512 /* If either compiled-in or loaded*/ -#define MY_CS_CSSORT 1024 /* if case sensitive sort order */ -#define MY_CS_HIDDEN 2048 /* don't display in SHOW */ -#define MY_CS_PUREASCII 4096 /* if a charset is pure ascii */ -#define MY_CS_NONASCII 8192 /* if not ASCII-compatible */ -#define MY_CS_UNICODE_SUPPLEMENT 16384 /* Non-BMP Unicode characters */ -#define MY_CHARSET_UNDEFINED 0 - -/* Character repertoire flags */ -#define MY_REPERTOIRE_ASCII 1 /* Pure ASCII U+0000..U+007F */ -#define MY_REPERTOIRE_EXTENDED 2 /* Extended characters: U+0080..U+FFFF */ -#define MY_REPERTOIRE_UNICODE30 3 /* ASCII | EXTENDED: U+0000..U+FFFF */ - -typedef struct my_uni_idx_st -{ - uint16 from; - uint16 to; - uchar *tab; -} MY_UNI_IDX; - -typedef struct -{ - uint beg; - uint end; - uint mb_len; -} my_match_t; - -enum my_lex_states -{ - MY_LEX_START, MY_LEX_CHAR, MY_LEX_IDENT, - MY_LEX_IDENT_SEP, MY_LEX_IDENT_START, - MY_LEX_REAL, MY_LEX_HEX_NUMBER, MY_LEX_BIN_NUMBER, - MY_LEX_CMP_OP, MY_LEX_LONG_CMP_OP, MY_LEX_STRING, MY_LEX_COMMENT, MY_LEX_END, - MY_LEX_OPERATOR_OR_IDENT, MY_LEX_NUMBER_IDENT, MY_LEX_INT_OR_REAL, - MY_LEX_REAL_OR_POINT, MY_LEX_BOOL, MY_LEX_EOL, MY_LEX_ESCAPE, - MY_LEX_LONG_COMMENT, MY_LEX_END_LONG_COMMENT, MY_LEX_SEMICOLON, - MY_LEX_SET_VAR, MY_LEX_USER_END, MY_LEX_HOSTNAME, MY_LEX_SKIP, - MY_LEX_USER_VARIABLE_DELIMITER, MY_LEX_SYSTEM_VAR, - MY_LEX_IDENT_OR_KEYWORD, - MY_LEX_IDENT_OR_HEX, MY_LEX_IDENT_OR_BIN, MY_LEX_IDENT_OR_NCHAR, - MY_LEX_STRING_OR_DELIMITER -}; - -struct charset_info_st; - - -/* See strings/CHARSET_INFO.txt for information about this structure */ -typedef struct my_collation_handler_st -{ - my_bool (*init)(struct charset_info_st *, void *(*alloc)(size_t)); - /* Collation routines */ - int (*strnncoll)(struct charset_info_st *, - const uchar *, size_t, const uchar *, size_t, my_bool); - int (*strnncollsp)(struct charset_info_st *, - const uchar *, size_t, const uchar *, size_t, - my_bool diff_if_only_endspace_difference); - size_t (*strnxfrm)(struct charset_info_st *, - uchar *, size_t, const uchar *, size_t); - size_t (*strnxfrmlen)(struct charset_info_st *, size_t); - my_bool (*like_range)(struct charset_info_st *, - const char *s, size_t s_length, - pchar w_prefix, pchar w_one, pchar w_many, - size_t res_length, - char *min_str, char *max_str, - size_t *min_len, size_t *max_len); - int (*wildcmp)(struct charset_info_st *, - const char *str,const char *str_end, - const char *wildstr,const char *wildend, - int escape,int w_one, int w_many); - - int (*strcasecmp)(struct charset_info_st *, const char *, const char *); - - uint (*instr)(struct charset_info_st *, - const char *b, size_t b_length, - const char *s, size_t s_length, - my_match_t *match, uint nmatch); - - /* Hash calculation */ - void (*hash_sort)(struct charset_info_st *cs, const uchar *key, size_t len, - ulong *nr1, ulong *nr2); - my_bool (*propagate)(struct charset_info_st *cs, const uchar *str, size_t len); -} MY_COLLATION_HANDLER; - -extern MY_COLLATION_HANDLER my_collation_mb_bin_handler; -extern MY_COLLATION_HANDLER my_collation_8bit_bin_handler; -extern MY_COLLATION_HANDLER my_collation_8bit_simple_ci_handler; -extern MY_COLLATION_HANDLER my_collation_ucs2_uca_handler; - -/* Some typedef to make it easy for C++ to make function pointers */ -typedef int (*my_charset_conv_mb_wc)(struct charset_info_st *, my_wc_t *, - const uchar *, const uchar *); -typedef int (*my_charset_conv_wc_mb)(struct charset_info_st *, my_wc_t, - uchar *, uchar *); -typedef size_t (*my_charset_conv_case)(struct charset_info_st *, - char *, size_t, char *, size_t); - - -/* See strings/CHARSET_INFO.txt about information on this structure */ -typedef struct my_charset_handler_st -{ - my_bool (*init)(struct charset_info_st *, void *(*alloc)(size_t)); - /* Multibyte routines */ - uint (*ismbchar)(struct charset_info_st *, const char *, const char *); - uint (*mbcharlen)(struct charset_info_st *, uint c); - size_t (*numchars)(struct charset_info_st *, const char *b, const char *e); - size_t (*charpos)(struct charset_info_st *, const char *b, const char *e, - size_t pos); - size_t (*well_formed_len)(struct charset_info_st *, - const char *b,const char *e, - size_t nchars, int *error); - size_t (*lengthsp)(struct charset_info_st *, const char *ptr, size_t length); - size_t (*numcells)(struct charset_info_st *, const char *b, const char *e); - - /* Unicode conversion */ - my_charset_conv_mb_wc mb_wc; - my_charset_conv_wc_mb wc_mb; - - /* CTYPE scanner */ - int (*ctype)(struct charset_info_st *cs, int *ctype, - const uchar *s, const uchar *e); - - /* Functions for case and sort conversion */ - size_t (*caseup_str)(struct charset_info_st *, char *); - size_t (*casedn_str)(struct charset_info_st *, char *); - - my_charset_conv_case caseup; - my_charset_conv_case casedn; - - /* Charset dependant snprintf() */ - size_t (*snprintf)(struct charset_info_st *, char *to, size_t n, - const char *fmt, - ...) ATTRIBUTE_FORMAT_FPTR(printf, 4, 5); - size_t (*long10_to_str)(struct charset_info_st *, char *to, size_t n, - int radix, long int val); - size_t (*longlong10_to_str)(struct charset_info_st *, char *to, size_t n, - int radix, longlong val); - - void (*fill)(struct charset_info_st *, char *to, size_t len, int fill); - - /* String-to-number conversion routines */ - long (*strntol)(struct charset_info_st *, const char *s, size_t l, - int base, char **e, int *err); - ulong (*strntoul)(struct charset_info_st *, const char *s, size_t l, - int base, char **e, int *err); - longlong (*strntoll)(struct charset_info_st *, const char *s, size_t l, - int base, char **e, int *err); - ulonglong (*strntoull)(struct charset_info_st *, const char *s, size_t l, - int base, char **e, int *err); - double (*strntod)(struct charset_info_st *, char *s, size_t l, char **e, - int *err); - longlong (*strtoll10)(struct charset_info_st *cs, - const char *nptr, char **endptr, int *error); - ulonglong (*strntoull10rnd)(struct charset_info_st *cs, - const char *str, size_t length, - int unsigned_fl, - char **endptr, int *error); - size_t (*scan)(struct charset_info_st *, const char *b, const char *e, - int sq); -} MY_CHARSET_HANDLER; - -extern MY_CHARSET_HANDLER my_charset_8bit_handler; -extern MY_CHARSET_HANDLER my_charset_ucs2_handler; - - -/* - We define this CHARSET_INFO_DEFINED here to prevent a repeat of the - typedef in hash.c, which will cause a compiler error. -*/ -#define CHARSET_INFO_DEFINED - -/* See strings/CHARSET_INFO.txt about information on this structure */ -typedef struct charset_info_st -{ - uint number; - uint primary_number; - uint binary_number; - uint state; - const char *csname; - const char *name; - const char *comment; - const char *tailoring; - uchar *ctype; - uchar *to_lower; - uchar *to_upper; - uchar *sort_order; - uint16 *contractions; - uint16 **sort_order_big; - uint16 *tab_to_uni; - MY_UNI_IDX *tab_from_uni; - MY_UNICASE_INFO **caseinfo; - uchar *state_map; - uchar *ident_map; - uint strxfrm_multiply; - uchar caseup_multiply; - uchar casedn_multiply; - uint mbminlen; - uint mbmaxlen; - uint16 min_sort_char; - uint16 max_sort_char; /* For LIKE optimization */ - uchar pad_char; - my_bool escape_with_backslash_is_dangerous; - - MY_CHARSET_HANDLER *cset; - MY_COLLATION_HANDLER *coll; - -} CHARSET_INFO; -#define ILLEGAL_CHARSET_INFO_NUMBER (~0U) - - -extern MYSQL_PLUGIN_IMPORT CHARSET_INFO my_charset_bin; -extern MYSQL_PLUGIN_IMPORT CHARSET_INFO my_charset_latin1; -extern MYSQL_PLUGIN_IMPORT CHARSET_INFO my_charset_filename; - -extern CHARSET_INFO my_charset_big5_chinese_ci; -extern CHARSET_INFO my_charset_big5_bin; -extern CHARSET_INFO my_charset_cp932_japanese_ci; -extern CHARSET_INFO my_charset_cp932_bin; -extern CHARSET_INFO my_charset_cp1250_czech_ci; -extern CHARSET_INFO my_charset_eucjpms_japanese_ci; -extern CHARSET_INFO my_charset_eucjpms_bin; -extern CHARSET_INFO my_charset_euckr_korean_ci; -extern CHARSET_INFO my_charset_euckr_bin; -extern CHARSET_INFO my_charset_gb2312_chinese_ci; -extern CHARSET_INFO my_charset_gb2312_bin; -extern CHARSET_INFO my_charset_gbk_chinese_ci; -extern CHARSET_INFO my_charset_gbk_bin; -extern CHARSET_INFO my_charset_latin1_german2_ci; -extern CHARSET_INFO my_charset_latin1_bin; -extern CHARSET_INFO my_charset_latin2_czech_ci; -extern CHARSET_INFO my_charset_sjis_japanese_ci; -extern CHARSET_INFO my_charset_sjis_bin; -extern CHARSET_INFO my_charset_tis620_thai_ci; -extern CHARSET_INFO my_charset_tis620_bin; -extern CHARSET_INFO my_charset_ucs2_general_ci; -extern CHARSET_INFO my_charset_ucs2_bin; -extern CHARSET_INFO my_charset_ucs2_unicode_ci; -extern CHARSET_INFO my_charset_ujis_japanese_ci; -extern CHARSET_INFO my_charset_ujis_bin; -extern CHARSET_INFO my_charset_utf16_bin; -extern CHARSET_INFO my_charset_utf16_general_ci; -extern CHARSET_INFO my_charset_utf16_unicode_ci; -extern CHARSET_INFO my_charset_utf32_bin; -extern CHARSET_INFO my_charset_utf32_general_ci; -extern CHARSET_INFO my_charset_utf32_unicode_ci; - -extern CHARSET_INFO my_charset_utf8_general_ci; -extern CHARSET_INFO my_charset_utf8_unicode_ci; -extern CHARSET_INFO my_charset_utf8_bin; -extern CHARSET_INFO my_charset_utf8mb4_bin; -extern CHARSET_INFO my_charset_utf8mb4_general_ci; -extern CHARSET_INFO my_charset_utf8mb4_unicode_ci; -#define MY_UTF8MB3 "utf8" -#define MY_UTF8MB4 "utf8mb4" - - -/* Helper functions to handle contraction */ -static inline my_bool -my_cs_have_contractions(CHARSET_INFO *cs) -{ - return cs->contractions != NULL; -} - -static inline my_bool -my_cs_can_be_contraction_head(CHARSET_INFO *cs, my_wc_t wc) -{ - return ((const char *)cs->contractions)[0x40*0x40 + (wc & 0xFF)]; -} - -static inline my_bool -my_cs_can_be_contraction_tail(CHARSET_INFO *cs, my_wc_t wc) -{ - return ((const char *)cs->contractions)[0x40*0x40 + (wc & 0xFF)]; -} - -static inline uint16* -my_cs_contraction2_weight(CHARSET_INFO *cs, my_wc_t wc1, my_wc_t wc2) -{ - return &cs->contractions[(wc1 - 0x40) * 0x40 + wc2 - 0x40]; -} - - -/* declarations for simple charsets */ -extern size_t my_strnxfrm_simple(CHARSET_INFO *, uchar *, size_t, - const uchar *, size_t); -size_t my_strnxfrmlen_simple(CHARSET_INFO *, size_t); -extern int my_strnncoll_simple(CHARSET_INFO *, const uchar *, size_t, - const uchar *, size_t, my_bool); - -extern int my_strnncollsp_simple(CHARSET_INFO *, const uchar *, size_t, - const uchar *, size_t, - my_bool diff_if_only_endspace_difference); - -extern void my_hash_sort_simple(CHARSET_INFO *cs, - const uchar *key, size_t len, - ulong *nr1, ulong *nr2); - -extern size_t my_lengthsp_8bit(CHARSET_INFO *cs, const char *ptr, size_t length); - -extern uint my_instr_simple(struct charset_info_st *, - const char *b, size_t b_length, - const char *s, size_t s_length, - my_match_t *match, uint nmatch); - - -/* Functions for 8bit */ -extern size_t my_caseup_str_8bit(CHARSET_INFO *, char *); -extern size_t my_casedn_str_8bit(CHARSET_INFO *, char *); -extern size_t my_caseup_8bit(CHARSET_INFO *, char *src, size_t srclen, - char *dst, size_t dstlen); -extern size_t my_casedn_8bit(CHARSET_INFO *, char *src, size_t srclen, - char *dst, size_t dstlen); - -extern int my_strcasecmp_8bit(CHARSET_INFO * cs, const char *, const char *); - -int my_mb_wc_8bit(CHARSET_INFO *cs,my_wc_t *wc, const uchar *s,const uchar *e); -int my_wc_mb_8bit(CHARSET_INFO *cs,my_wc_t wc, uchar *s, uchar *e); - -int my_mb_ctype_8bit(CHARSET_INFO *,int *, const uchar *,const uchar *); -int my_mb_ctype_mb(CHARSET_INFO *,int *, const uchar *,const uchar *); - -size_t my_scan_8bit(CHARSET_INFO *cs, const char *b, const char *e, int sq); - -size_t my_snprintf_8bit(struct charset_info_st *, char *to, size_t n, - const char *fmt, ...) - ATTRIBUTE_FORMAT(printf, 4, 5); - -long my_strntol_8bit(CHARSET_INFO *, const char *s, size_t l, int base, - char **e, int *err); -ulong my_strntoul_8bit(CHARSET_INFO *, const char *s, size_t l, int base, - char **e, int *err); -longlong my_strntoll_8bit(CHARSET_INFO *, const char *s, size_t l, int base, - char **e, int *err); -ulonglong my_strntoull_8bit(CHARSET_INFO *, const char *s, size_t l, int base, - char **e, int *err); -double my_strntod_8bit(CHARSET_INFO *, char *s, size_t l,char **e, - int *err); -size_t my_long10_to_str_8bit(CHARSET_INFO *, char *to, size_t l, int radix, - long int val); -size_t my_longlong10_to_str_8bit(CHARSET_INFO *, char *to, size_t l, int radix, - longlong val); - -longlong my_strtoll10_8bit(CHARSET_INFO *cs, - const char *nptr, char **endptr, int *error); -longlong my_strtoll10_ucs2(CHARSET_INFO *cs, - const char *nptr, char **endptr, int *error); - -ulonglong my_strntoull10rnd_8bit(CHARSET_INFO *cs, - const char *str, size_t length, int - unsigned_fl, char **endptr, int *error); -ulonglong my_strntoull10rnd_ucs2(CHARSET_INFO *cs, - const char *str, size_t length, - int unsigned_fl, char **endptr, int *error); - -void my_fill_8bit(CHARSET_INFO *cs, char* to, size_t l, int fill); - -/* For 8-bit character set */ -my_bool my_like_range_simple(CHARSET_INFO *cs, - const char *ptr, size_t ptr_length, - pbool escape, pbool w_one, pbool w_many, - size_t res_length, - char *min_str, char *max_str, - size_t *min_length, size_t *max_length); - -/* For ASCII-based multi-byte character sets with mbminlen=1 */ -my_bool my_like_range_mb(CHARSET_INFO *cs, - const char *ptr, size_t ptr_length, - pbool escape, pbool w_one, pbool w_many, - size_t res_length, - char *min_str, char *max_str, - size_t *min_length, size_t *max_length); - -/* For other character sets, with arbitrary mbminlen and mbmaxlen numbers */ -my_bool my_like_range_generic(CHARSET_INFO *cs, - const char *ptr, size_t ptr_length, - pbool escape, pbool w_one, pbool w_many, - size_t res_length, - char *min_str, char *max_str, - size_t *min_length, size_t *max_length); - -int my_wildcmp_8bit(CHARSET_INFO *, - const char *str,const char *str_end, - const char *wildstr,const char *wildend, - int escape, int w_one, int w_many); - -int my_wildcmp_bin(CHARSET_INFO *, - const char *str,const char *str_end, - const char *wildstr,const char *wildend, - int escape, int w_one, int w_many); - -size_t my_numchars_8bit(CHARSET_INFO *, const char *b, const char *e); -size_t my_numcells_8bit(CHARSET_INFO *, const char *b, const char *e); -size_t my_charpos_8bit(CHARSET_INFO *, const char *b, const char *e, size_t pos); -size_t my_well_formed_len_8bit(CHARSET_INFO *, const char *b, const char *e, - size_t pos, int *error); -uint my_mbcharlen_8bit(CHARSET_INFO *, uint c); - - -/* Functions for multibyte charsets */ -extern size_t my_caseup_str_mb(CHARSET_INFO *, char *); -extern size_t my_casedn_str_mb(CHARSET_INFO *, char *); -extern size_t my_caseup_mb(CHARSET_INFO *, char *src, size_t srclen, - char *dst, size_t dstlen); -extern size_t my_casedn_mb(CHARSET_INFO *, char *src, size_t srclen, - char *dst, size_t dstlen); -extern size_t my_caseup_mb_varlen(CHARSET_INFO *, char *src, size_t srclen, - char *dst, size_t dstlen); -extern size_t my_casedn_mb_varlen(CHARSET_INFO *, char *src, size_t srclen, - char *dst, size_t dstlen); -extern size_t my_caseup_ujis(CHARSET_INFO *, char *src, size_t srclen, - char *dst, size_t dstlen); -extern size_t my_casedn_ujis(CHARSET_INFO *, char *src, size_t srclen, - char *dst, size_t dstlen); -extern int my_strcasecmp_mb(CHARSET_INFO * cs,const char *, const char *); - -int my_wildcmp_mb(CHARSET_INFO *, - const char *str,const char *str_end, - const char *wildstr,const char *wildend, - int escape, int w_one, int w_many); -size_t my_numchars_mb(CHARSET_INFO *, const char *b, const char *e); -size_t my_numcells_mb(CHARSET_INFO *, const char *b, const char *e); -size_t my_charpos_mb(CHARSET_INFO *, const char *b, const char *e, size_t pos); -size_t my_well_formed_len_mb(CHARSET_INFO *, const char *b, const char *e, - size_t pos, int *error); -uint my_instr_mb(struct charset_info_st *, - const char *b, size_t b_length, - const char *s, size_t s_length, - my_match_t *match, uint nmatch); - -int my_strnncoll_mb_bin(CHARSET_INFO * cs, - const uchar *s, size_t slen, - const uchar *t, size_t tlen, - my_bool t_is_prefix); - -int my_strnncollsp_mb_bin(CHARSET_INFO *cs, - const uchar *a, size_t a_length, - const uchar *b, size_t b_length, - my_bool diff_if_only_endspace_difference); - -int my_wildcmp_mb_bin(CHARSET_INFO *cs, - const char *str,const char *str_end, - const char *wildstr,const char *wildend, - int escape, int w_one, int w_many); - -int my_strcasecmp_mb_bin(CHARSET_INFO * cs __attribute__((unused)), - const char *s, const char *t); - -void my_hash_sort_mb_bin(CHARSET_INFO *cs __attribute__((unused)), - const uchar *key, size_t len,ulong *nr1, ulong *nr2); - -size_t my_strnxfrm_unicode(CHARSET_INFO *, - uchar *dst, size_t dstlen, - 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, - const char *str, const char *str_end, - const char *wildstr, const char *wildend, - int escape, int w_one, int w_many, - MY_UNICASE_INFO **weights); - -extern my_bool my_parse_charset_xml(const char *bug, size_t len, - int (*add)(CHARSET_INFO *cs)); -extern char *my_strchr(CHARSET_INFO *cs, const char *str, const char *end, - pchar c); -extern size_t my_strcspn(CHARSET_INFO *cs, const char *str, const char *end, - const char *accept); - -my_bool my_propagate_simple(CHARSET_INFO *cs, const uchar *str, size_t len); -my_bool my_propagate_complex(CHARSET_INFO *cs, const uchar *str, size_t len); - - -uint my_string_repertoire(CHARSET_INFO *cs, const char *str, ulong len); -my_bool my_charset_is_ascii_based(CHARSET_INFO *cs); -my_bool my_charset_is_8bit_pure_ascii(CHARSET_INFO *cs); -uint my_charset_repertoire(CHARSET_INFO *cs); - -my_bool my_charset_is_ascii_compatible(CHARSET_INFO *cs); - -extern size_t my_vsnprintf_ex(CHARSET_INFO *cs, char *to, size_t n, - const char* fmt, va_list ap); - -#define _MY_U 01 /* Upper case */ -#define _MY_L 02 /* Lower case */ -#define _MY_NMR 04 /* Numeral (digit) */ -#define _MY_SPC 010 /* Spacing character */ -#define _MY_PNT 020 /* Punctuation */ -#define _MY_CTR 040 /* Control character */ -#define _MY_B 0100 /* Blank */ -#define _MY_X 0200 /* heXadecimal digit */ - - -#define my_isascii(c) (!((c) & ~0177)) -#define my_toascii(c) ((c) & 0177) -#define my_tocntrl(c) ((c) & 31) -#define my_toprint(c) ((c) | 64) -#define my_toupper(s,c) (char) ((s)->to_upper[(uchar) (c)]) -#define my_tolower(s,c) (char) ((s)->to_lower[(uchar) (c)]) -#define my_isalpha(s, c) (((s)->ctype+1)[(uchar) (c)] & (_MY_U | _MY_L)) -#define my_isupper(s, c) (((s)->ctype+1)[(uchar) (c)] & _MY_U) -#define my_islower(s, c) (((s)->ctype+1)[(uchar) (c)] & _MY_L) -#define my_isdigit(s, c) (((s)->ctype+1)[(uchar) (c)] & _MY_NMR) -#define my_isxdigit(s, c) (((s)->ctype+1)[(uchar) (c)] & _MY_X) -#define my_isalnum(s, c) (((s)->ctype+1)[(uchar) (c)] & (_MY_U | _MY_L | _MY_NMR)) -#define my_isspace(s, c) (((s)->ctype+1)[(uchar) (c)] & _MY_SPC) -#define my_ispunct(s, c) (((s)->ctype+1)[(uchar) (c)] & _MY_PNT) -#define my_isprint(s, c) (((s)->ctype+1)[(uchar) (c)] & (_MY_PNT | _MY_U | _MY_L | _MY_NMR | _MY_B)) -#define my_isgraph(s, c) (((s)->ctype+1)[(uchar) (c)] & (_MY_PNT | _MY_U | _MY_L | _MY_NMR)) -#define my_iscntrl(s, c) (((s)->ctype+1)[(uchar) (c)] & _MY_CTR) - -/* Some macros that should be cleaned up a little */ -#define my_isvar(s,c) (my_isalnum(s,c) || (c) == '_') -#define my_isvar_start(s,c) (my_isalpha(s,c) || (c) == '_') - -#define my_binary_compare(s) ((s)->state & MY_CS_BINSORT) -#define use_strnxfrm(s) ((s)->state & MY_CS_STRNXFRM) -#define my_strnxfrm(s, a, b, c, d) ((s)->coll->strnxfrm((s), (a), (b), (c), (d))) -#define my_strnncoll(s, a, b, c, d) ((s)->coll->strnncoll((s), (a), (b), (c), (d), 0)) -#define my_like_range(s, a, b, c, d, e, f, g, h, i, j) \ - ((s)->coll->like_range((s), (a), (b), (c), (d), (e), (f), (g), (h), (i), (j))) -#define my_wildcmp(cs,s,se,w,we,e,o,m) ((cs)->coll->wildcmp((cs),(s),(se),(w),(we),(e),(o),(m))) -#define my_strcasecmp(s, a, b) ((s)->coll->strcasecmp((s), (a), (b))) -#define my_charpos(cs, b, e, num) (cs)->cset->charpos((cs), (const char*) (b), (const char *)(e), (num)) - - -#define use_mb(s) ((s)->cset->ismbchar != NULL) -#define my_ismbchar(s, a, b) ((s)->cset->ismbchar((s), (a), (b))) -#ifdef USE_MB -#define my_mbcharlen(s, a) ((s)->cset->mbcharlen((s),(a))) -#else -#define my_mbcharlen(s, a) 1 -#endif - -#define my_caseup_str(s, a) ((s)->cset->caseup_str((s), (a))) -#define my_casedn_str(s, a) ((s)->cset->casedn_str((s), (a))) -#define my_strntol(s, a, b, c, d, e) ((s)->cset->strntol((s),(a),(b),(c),(d),(e))) -#define my_strntoul(s, a, b, c, d, e) ((s)->cset->strntoul((s),(a),(b),(c),(d),(e))) -#define my_strntoll(s, a, b, c, d, e) ((s)->cset->strntoll((s),(a),(b),(c),(d),(e))) -#define my_strntoull(s, a, b, c,d, e) ((s)->cset->strntoull((s),(a),(b),(c),(d),(e))) -#define my_strntod(s, a, b, c, d) ((s)->cset->strntod((s),(a),(b),(c),(d))) - - -/* XXX: still need to take care of this one */ -#ifdef MY_CHARSET_TIS620 -#error The TIS620 charset is broken at the moment. Tell tim to fix it. -#define USE_TIS620 -#include "t_ctype.h" -#endif - -#ifdef __cplusplus -} -#endif - -#endif /* _m_ctype_h */ diff --git a/dep/mysqllite/include/m_string.h b/dep/mysqllite/include/m_string.h deleted file mode 100644 index d2194858589..00000000000 --- a/dep/mysqllite/include/m_string.h +++ /dev/null @@ -1,295 +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 */ - -/* There may be prolems include all of theese. Try to test in - configure with ones are needed? */ - -/* This is needed for the definitions of strchr... on solaris */ - -#ifndef _m_string_h -#define _m_string_h - -#include "my_global.h" /* HAVE_* */ - -#ifndef __USE_GNU -#define __USE_GNU /* We want to use stpcpy */ -#endif -#if defined(HAVE_STRINGS_H) -#include <strings.h> -#endif -#if defined(HAVE_STRING_H) -#include <string.h> -#endif - -/* need by my_vsnprintf */ -#include <stdarg.h> - -/* This is needed for the definitions of bzero... on solaris */ -#if defined(HAVE_STRINGS_H) -#include <strings.h> -#endif - -/* This is needed for the definitions of memcpy... on solaris */ -#if defined(HAVE_MEMORY_H) && !defined(__cplusplus) -#include <memory.h> -#endif - -#if !defined(HAVE_MEMCPY) && !defined(HAVE_MEMMOVE) -# define memcpy(d, s, n) bcopy ((s), (d), (n)) -# define memset(A,C,B) bfill((A),(B),(C)) -# define memmove(d, s, n) bmove ((d), (s), (n)) -#elif defined(HAVE_MEMMOVE) -# define bmove(d, s, n) memmove((d), (s), (n)) -#endif - -/* Unixware 7 */ -#if !defined(HAVE_BFILL) -# define bfill(A,B,C) memset((A),(C),(B)) -#endif - -#if !defined(bzero) && !defined(HAVE_BZERO) -# define bzero(A,B) memset((A),0,(B)) -#endif - -#if defined(__cplusplus) -extern "C" { -#endif - -/* - my_str_malloc() and my_str_free() are assigned to implementations in - strings/alloc.c, but can be overridden in the calling program. - */ -extern void *(*my_str_malloc)(size_t); -extern void (*my_str_free)(void *); - -#if defined(HAVE_STPCPY) && MY_GNUC_PREREQ(3, 4) && !defined(__INTEL_COMPILER) -#define strmov(A,B) __builtin_stpcpy((A),(B)) -#elif defined(HAVE_STPCPY) -#define strmov(A,B) stpcpy((A),(B)) -#ifndef stpcpy -extern char *stpcpy(char *, const char *); /* For AIX with gcc 2.95.3 */ -#endif -#endif - -/* Declared in int2str() */ -extern char _dig_vec_upper[]; -extern char _dig_vec_lower[]; - -#ifndef strmov -#define strmov_overlapp(A,B) strmov(A,B) -#define strmake_overlapp(A,B,C) strmake(A,B,C) -#endif - - /* Prototypes for string functions */ - -extern void bmove_upp(uchar *dst,const uchar *src,size_t len); -extern void bchange(uchar *dst,size_t old_len,const uchar *src, - size_t new_len,size_t tot_len); -extern void strappend(char *s,size_t len,pchar fill); -extern char *strend(const char *s); -extern char *strcend(const char *, pchar); -extern char *strfill(char * s,size_t len,pchar fill); -extern char *strmake(char *dst,const char *src,size_t length); - -#ifndef strmov -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 *strcont(const char *src, const char *set); -extern char *strxmov(char *dst, const char *src, ...); -extern char *strxnmov(char *dst, size_t len, const char *src, ...); - -/* Prototypes of normal stringfunctions (with may ours) */ -#ifndef HAVE_STRNLEN -extern size_t strnlen(const char *s, size_t n); -#endif - -extern int is_prefix(const char *, const char *); - -/* Conversion routines */ -typedef enum { - MY_GCVT_ARG_FLOAT, - MY_GCVT_ARG_DOUBLE -} my_gcvt_arg_type; - -double my_strtod(const char *str, char **end, int *error); -double my_atof(const char *nptr); -size_t my_fcvt(double x, int precision, char *to, my_bool *error); -size_t my_gcvt(double x, my_gcvt_arg_type type, int width, char *to, - my_bool *error); - -#define NOT_FIXED_DEC 31 - -/* - The longest string my_fcvt can return is 311 + "precision" bytes. - Here we assume that we never cal my_fcvt() with precision >= NOT_FIXED_DEC - (+ 1 byte for the terminating '\0'). -*/ -#define FLOATING_POINT_BUFFER (311 + NOT_FIXED_DEC) - -/* - We want to use the 'e' format in some cases even if we have enough space - for the 'f' one just to mimic sprintf("%.15g") behavior for large integers, - and to improve it for numbers < 10^(-4). - That is, for |x| < 1 we require |x| >= 10^(-15), and for |x| > 1 we require - it to be integer and be <= 10^DBL_DIG for the 'f' format to be used. - We don't lose precision, but make cases like "1e200" or "0.00001" look nicer. -*/ -#define MAX_DECPT_FOR_F_FORMAT DBL_DIG - -/* - The maximum possible field width for my_gcvt() conversion. - (DBL_DIG + 2) significant digits + sign + "." + ("e-NNN" or - MAX_DECPT_FOR_F_FORMAT zeros for cases when |x|<1 and the 'f' format is used). -*/ -#define MY_GCVT_MAX_FIELD_WIDTH (DBL_DIG + 4 + max(5, MAX_DECPT_FOR_F_FORMAT)) \ - -extern char *llstr(longlong value,char *buff); -extern char *ullstr(longlong value,char *buff); -#ifndef HAVE_STRTOUL -extern long strtol(const char *str, char **ptr, int base); -extern ulong strtoul(const char *str, char **ptr, int base); -#endif - -extern char *int2str(long val, char *dst, int radix, int upcase); -extern char *int10_to_str(long val,char *dst,int radix); -extern char *str2int(const char *src,int radix,long lower,long upper, - long *val); -longlong my_strtoll10(const char *nptr, char **endptr, int *error); -#if SIZEOF_LONG == SIZEOF_LONG_LONG -#define ll2str(A,B,C,D) int2str((A),(B),(C),(D)) -#define longlong10_to_str(A,B,C) int10_to_str((A),(B),(C)) -#undef strtoll -#define strtoll(A,B,C) strtol((A),(B),(C)) -#define strtoull(A,B,C) strtoul((A),(B),(C)) -#ifndef HAVE_STRTOULL -#define HAVE_STRTOULL -#endif -#ifndef HAVE_STRTOLL -#define HAVE_STRTOLL -#endif -#else -#ifdef HAVE_LONG_LONG -extern char *ll2str(longlong val,char *dst,int radix, int upcase); -extern char *longlong10_to_str(longlong val,char *dst,int radix); -#if (!defined(HAVE_STRTOULL) || defined(NO_STRTOLL_PROTO)) -extern longlong strtoll(const char *str, char **ptr, int base); -extern ulonglong strtoull(const char *str, char **ptr, int base); -#endif -#endif -#endif -#define longlong2str(A,B,C) ll2str((A),(B),(C),1) - -#if defined(__cplusplus) -} -#endif - -/* - LEX_STRING -- a pair of a C-string and its length. - (it's part of the plugin API as a MYSQL_LEX_STRING) -*/ - -#include <mysql/plugin.h> -typedef struct st_mysql_lex_string LEX_STRING; - -#define STRING_WITH_LEN(X) (X), ((size_t) (sizeof(X) - 1)) -#define USTRING_WITH_LEN(X) ((uchar*) X), ((size_t) (sizeof(X) - 1)) -#define C_STRING_WITH_LEN(X) ((char *) (X)), ((size_t) (sizeof(X) - 1)) - -struct st_mysql_const_lex_string -{ - const char *str; - size_t length; -}; -typedef struct st_mysql_const_lex_string LEX_CSTRING; - -/* SPACE_INT is a word that contains only spaces */ -#if SIZEOF_INT == 4 -#define SPACE_INT 0x20202020 -#elif SIZEOF_INT == 8 -#define SPACE_INT 0x2020202020202020 -#else -#error define the appropriate constant for a word full of spaces -#endif - -/** - Skip trailing space. - - On most systems reading memory in larger chunks (ideally equal to the size of - the chinks that the machine physically reads from memory) causes fewer memory - access loops and hence increased performance. - This is why the 'int' type is used : it's closest to that (according to how - it's defined in C). - So when we determine the amount of whitespace at the end of a string we do - the following : - 1. We divide the string into 3 zones : - a) from the start of the string (__start) to the first multiple - of sizeof(int) (__start_words) - b) from the end of the string (__end) to the last multiple of sizeof(int) - (__end_words) - c) a zone that is aligned to sizeof(int) and can be safely accessed - through an int * - 2. We start comparing backwards from (c) char-by-char. If all we find is - space then we continue - 3. If there are elements in zone (b) we compare them as unsigned ints to a - int mask (SPACE_INT) consisting of all spaces - 4. Finally we compare the remaining part (a) of the string char by char. - This covers for the last non-space unsigned int from 3. (if any) - - This algorithm works well for relatively larger strings, but it will slow - the things down for smaller strings (because of the additional calculations - and checks compared to the naive method). Thus the barrier of length 20 - is added. - - @param ptr pointer to the input string - @param len the length of the string - @return the last non-space character -*/ - -static inline const uchar *skip_trailing_space(const uchar *ptr,size_t len) -{ - const uchar *end= ptr + len; - - if (len > 20) - { - const uchar *end_words= (const uchar *)(intptr) - (((ulonglong)(intptr)end) / SIZEOF_INT * SIZEOF_INT); - const uchar *start_words= (const uchar *)(intptr) - ((((ulonglong)(intptr)ptr) + SIZEOF_INT - 1) / SIZEOF_INT * SIZEOF_INT); - - DBUG_ASSERT(((ulonglong)(intptr)ptr) >= SIZEOF_INT); - if (end_words > ptr) - { - while (end > end_words && end[-1] == 0x20) - end--; - if (end[-1] == 0x20 && start_words < end_words) - while (end > start_words && ((unsigned *)end)[-1] == SPACE_INT) - end -= SIZEOF_INT; - } - } - while (end > ptr && end[-1] == 0x20) - end--; - return (end); -} - -static inline void lex_string_set(LEX_STRING *lex_str, const char *c_str) -{ - lex_str->str= (char *) c_str; - lex_str->length= strlen(c_str); -} - -#endif diff --git a/dep/mysqllite/include/my_alloc.h b/dep/mysqllite/include/my_alloc.h deleted file mode 100644 index 4b1ffd3d444..00000000000 --- a/dep/mysqllite/include/my_alloc.h +++ /dev/null @@ -1,60 +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 */ - -/* - Data structures for mysys/my_alloc.c (root memory allocator) -*/ - -#ifndef _my_alloc_h -#define _my_alloc_h - -#define ALLOC_MAX_BLOCK_TO_DROP 4096 -#define ALLOC_MAX_BLOCK_USAGE_BEFORE_DROP 10 - -#ifdef __cplusplus -extern "C" { -#endif - -typedef struct st_used_mem -{ /* struct for once_alloc (block) */ - struct st_used_mem *next; /* Next block in use */ - unsigned int left; /* memory left in block */ - unsigned int size; /* size of block */ -} USED_MEM; - - -typedef struct st_mem_root -{ - USED_MEM *free; /* blocks with free memory in it */ - USED_MEM *used; /* blocks almost without free memory */ - USED_MEM *pre_alloc; /* preallocated block */ - /* if block have less memory it will be put in 'used' list */ - size_t min_malloc; - size_t block_size; /* initial block size */ - unsigned int block_num; /* allocated blocks counter */ - /* - first free block in queue test counter (if it exceed - MAX_BLOCK_USAGE_BEFORE_DROP block will be dropped in 'used' list) - */ - unsigned int first_block_usage; - - void (*error_handler)(void); -} MEM_ROOT; - -#ifdef __cplusplus -} -#endif - -#endif diff --git a/dep/mysqllite/include/my_attribute.h b/dep/mysqllite/include/my_attribute.h deleted file mode 100644 index d35b3013bdd..00000000000 --- a/dep/mysqllite/include/my_attribute.h +++ /dev/null @@ -1,69 +0,0 @@ -/* Copyright (C) 2000-2003 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 */ - -/* - Helper macros used for setting different __attributes__ - on functions in a portable fashion -*/ - -#ifndef _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. - 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 - compilation warnings. -*/ -#ifndef __attribute__ -# if !defined(__GNUC__) -# define __attribute__(A) -# elif GCC_VERSION < 2008 -# define __attribute__(A) -# elif defined(__cplusplus) && GCC_VERSION < 3004 -# define __attribute__(A) -# endif -#endif - -/* - __attribute__((format(...))) is only supported in gcc >= 2.8 and g++ >= 3.4 - But that's already covered by the __attribute__ tests above, so this is - just a convenience macro. -*/ -#ifndef ATTRIBUTE_FORMAT -# define ATTRIBUTE_FORMAT(style, m, n) __attribute__((format(style, m, n))) -#endif - -/* - - __attribute__((format(...))) on a function pointer is not supported - until gcc 3.1 -*/ -#ifndef ATTRIBUTE_FORMAT_FPTR -# if (GCC_VERSION >= 3001) -# define ATTRIBUTE_FORMAT_FPTR(style, m, n) ATTRIBUTE_FORMAT(style, m, n) -# else -# define ATTRIBUTE_FORMAT_FPTR(style, m, n) -# endif /* GNUC >= 3.1 */ -#endif - - -#endif diff --git a/dep/mysqllite/include/my_compiler.h b/dep/mysqllite/include/my_compiler.h deleted file mode 100644 index 5f898621159..00000000000 --- a/dep/mysqllite/include/my_compiler.h +++ /dev/null @@ -1,145 +0,0 @@ -#ifndef MY_COMPILER_INCLUDED -#define MY_COMPILER_INCLUDED - -/* Copyright (c) 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 - 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 */ - -/** - Header for compiler-dependent features. - - Intended to contain a set of reusable wrappers for preprocessor - macros, attributes, pragmas, and any other features that are - specific to a target compiler. -*/ - -#include <my_global.h> /* stddef.h offsetof */ - -/** - Compiler-dependent internal convenience macros. -*/ - -/* GNU C/C++ */ -#if defined __GNUC__ -/* Convenience macro to test the minimum required GCC version. */ -# define MY_GNUC_PREREQ(maj, min) \ - ((__GNUC__ << 16) + __GNUC_MINOR__ >= ((maj) << 16) + (min)) -/* Any after 2.95... */ -# define MY_ALIGN_EXT -/* Comunicate to the compiler the unreachability of the code. */ -# if MY_GNUC_PREREQ(4,5) -# define MY_ASSERT_UNREACHABLE() __builtin_unreachable() -# endif - -/* Microsoft Visual C++ */ -#elif defined _MSC_VER -# define MY_ALIGNOF(type) __alignof(type) -# define MY_ALIGNED(n) __declspec(align(n)) - -/* Oracle Solaris Studio */ -#elif defined(__SUNPRO_C) || defined(__SUNPRO_CC) -# if __SUNPRO_C >= 0x590 -# define MY_ALIGN_EXT -# endif - -/* IBM XL C/C++ */ -#elif defined __xlC__ -# if __xlC__ >= 0x0600 -# define MY_ALIGN_EXT -# endif - -/* HP aCC */ -#elif defined(__HP_aCC) || defined(__HP_cc) -# if (__HP_aCC >= 60000) || (__HP_cc >= 60000) -# define MY_ALIGN_EXT -# endif -#endif - -#ifdef MY_ALIGN_EXT -/** Specifies the minimum alignment of a type. */ -# define MY_ALIGNOF(type) __alignof__(type) -/** Determine the alignment requirement of a type. */ -# define MY_ALIGNED(n) __attribute__((__aligned__((n)))) -#endif - -/** - Generic (compiler-independent) features. -*/ - -#ifndef MY_GNUC_PREREQ -# define MY_GNUC_PREREQ(maj, min) (0) -#endif - -#ifndef MY_ALIGNOF -# ifdef __cplusplus - template<typename type> struct my_alignof_helper { char m1; type m2; }; - /* Invalid for non-POD types, but most compilers give the right answer. */ -# define MY_ALIGNOF(type) offsetof(my_alignof_helper<type>, m2) -# else -# define MY_ALIGNOF(type) offsetof(struct { char m1; type m2; }, m2) -# endif -#endif - -#ifndef MY_ASSERT_UNREACHABLE -# define MY_ASSERT_UNREACHABLE() do { assert(0); } while (0) -#endif - -/** - C++ Type Traits -*/ - -#ifdef __cplusplus - -/** - Opaque storage with a particular alignment. -*/ -# if defined(MY_ALIGNED) -/* Partial specialization used due to MSVC++. */ -template<size_t alignment> struct my_alignment_imp; -template<> struct MY_ALIGNED(1) my_alignment_imp<1> {}; -template<> struct MY_ALIGNED(2) my_alignment_imp<2> {}; -template<> struct MY_ALIGNED(4) my_alignment_imp<4> {}; -template<> struct MY_ALIGNED(8) my_alignment_imp<8> {}; -template<> struct MY_ALIGNED(16) my_alignment_imp<16> {}; -/* ... expand as necessary. */ -# else -template<size_t alignment> -struct my_alignment_imp { double m1; }; -# endif - -/** - A POD type with a given size and alignment. - - @remark If the compiler does not support a alignment attribute - (MY_ALIGN macro), the default alignment of a double is - used instead. - - @tparam size The minimum size. - @tparam alignment The desired alignment: 1, 2, 4, 8 or 16. -*/ -template <size_t size, size_t alignment> -struct my_aligned_storage -{ - union - { - char data[size]; - my_alignment_imp<alignment> align; - }; -}; - -#endif /* __cplusplus */ - -#include <my_attribute.h> - -#endif /* MY_COMPILER_INCLUDED */ diff --git a/dep/mysqllite/include/my_dbug.h b/dep/mysqllite/include/my_dbug.h deleted file mode 100644 index 7f8f5a1578d..00000000000 --- a/dep/mysqllite/include/my_dbug.h +++ /dev/null @@ -1,194 +0,0 @@ -/* Copyright (c) 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 - 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 */ - -#ifndef MY_DBUG_INCLUDED -#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 -extern "C" { -#endif -#if !defined(DBUG_OFF) && !defined(_lint) - -struct _db_stack_frame_ { - const char *func; /* function name of the previous stack frame */ - const char *file; /* filename of the function of previous frame */ - uint level; /* this nesting level, highest bit enables tracing */ - struct _db_stack_frame_ *prev; /* pointer to the previous frame */ -}; - -struct _db_code_state_; -extern my_bool _dbug_on_; -extern my_bool _db_keyword_(struct _db_code_state_ *, const char *, int); -extern int _db_explain_(struct _db_code_state_ *cs, char *buf, size_t len); -extern int _db_explain_init_(char *buf, size_t len); -extern int _db_is_pushed_(void); -extern void _db_setjmp_(void); -extern void _db_longjmp_(void); -extern void _db_process_(const char *name); -extern void _db_push_(const char *control); -extern void _db_pop_(void); -extern void _db_set_(const char *control); -extern void _db_set_init_(const char *control); -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_(const char *format,...) - ATTRIBUTE_FORMAT(printf, 1, 2); -extern void _db_dump_(uint _line_,const char *keyword, - const unsigned char *memory, size_t length); -extern void _db_end_(void); -extern void _db_lock_file_(void); -extern void _db_unlock_file_(void); -extern FILE *_db_fp_(void); -extern void _db_flush_(); -extern const char* _db_get_func_(void); - -#define DBUG_ENTER(a) struct _db_stack_frame_ _db_stack_frame_; \ - _db_enter_ (a,__FILE__,__LINE__,&_db_stack_frame_) -#define DBUG_LEAVE _db_return_ (__LINE__, &_db_stack_frame_) -#define DBUG_RETURN(a1) do {DBUG_LEAVE; return(a1);} while(0) -#define DBUG_VOID_RETURN do {DBUG_LEAVE; return;} while(0) -#define DBUG_EXECUTE(keyword,a1) \ - do {if (_db_keyword_(0, (keyword), 0)) { a1 }} while(0) -#define DBUG_EXECUTE_IF(keyword,a1) \ - do {if (_db_keyword_(0, (keyword), 1)) { a1 }} while(0) -#define DBUG_EVALUATE(keyword,a1,a2) \ - (_db_keyword_(0,(keyword), 0) ? (a1) : (a2)) -#define DBUG_EVALUATE_IF(keyword,a1,a2) \ - (_db_keyword_(0,(keyword), 1) ? (a1) : (a2)) -#define DBUG_PRINT(keyword,arglist) \ - do {_db_pargs_(__LINE__,keyword); _db_doprnt_ arglist;} while(0) -#define DBUG_PUSH(a1) _db_push_ (a1) -#define DBUG_POP() _db_pop_ () -#define DBUG_SET(a1) _db_set_ (a1) -#define DBUG_SET_INITIAL(a1) _db_set_init_ (a1) -#define DBUG_PROCESS(a1) _db_process_(a1) -#define DBUG_FILE _db_fp_() -#define DBUG_SETJMP(a1) (_db_setjmp_ (), setjmp (a1)) -#define DBUG_LONGJMP(a1,a2) (_db_longjmp_ (), longjmp (a1, a2)) -#define DBUG_DUMP(keyword,a1,a2) _db_dump_(__LINE__,keyword,a1,a2) -#define DBUG_END() _db_end_ () -#define DBUG_LOCK_FILE _db_lock_file_() -#define DBUG_UNLOCK_FILE _db_unlock_file_() -#define DBUG_ASSERT(A) assert(A) -#define DBUG_EXPLAIN(buf,len) _db_explain_(0, (buf),(len)) -#define DBUG_EXPLAIN_INITIAL(buf,len) _db_explain_init_((buf),(len)) -#define DEBUGGER_OFF do { _dbug_on_= 0; } while(0) -#define DEBUGGER_ON do { _dbug_on_= 1; } while(0) -#ifndef __WIN__ -#define DBUG_ABORT() (_db_flush_(), abort()) -#else -/* - Avoid popup with abort/retry/ignore buttons. When BUG#31745 is fixed we can - call abort() instead of _exit(3) (now it would cause a "test signal" popup). -*/ -#include <crtdbg.h> -#define DBUG_ABORT() (_db_flush_(),\ - (void)_CrtSetReportMode(_CRT_ERROR, _CRTDBG_MODE_FILE),\ - (void)_CrtSetReportFile(_CRT_ERROR, _CRTDBG_FILE_STDERR),\ - _exit(3)) -#endif -#define DBUG_CHECK_CRASH(func, op) \ - do { char _dbuf_[255]; strxnmov(_dbuf_, sizeof(_dbuf_)-1, (func), (op)); \ - DBUG_EXECUTE_IF(_dbuf_, DBUG_ABORT()); } while(0) -#define DBUG_CRASH_ENTER(func) \ - DBUG_ENTER(func); DBUG_CHECK_CRASH(func, "_crash_enter") -#define DBUG_CRASH_RETURN(val) \ - DBUG_CHECK_CRASH(_db_get_func_(), "_crash_return") -#define DBUG_CRASH_VOID_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 -extern void _db_suicide_(); -#define DBUG_SUICIDE() (_db_flush_(), _db_suicide_()) -#endif - -#else /* No debugger */ - -#define DBUG_ENTER(a1) -#define DBUG_LEAVE -#define DBUG_RETURN(a1) do { return(a1); } while(0) -#define DBUG_VOID_RETURN do { return; } while(0) -#define DBUG_EXECUTE(keyword,a1) do { } while(0) -#define DBUG_EXECUTE_IF(keyword,a1) do { } while(0) -#define DBUG_EVALUATE(keyword,a1,a2) (a2) -#define DBUG_EVALUATE_IF(keyword,a1,a2) (a2) -#define DBUG_PRINT(keyword,arglist) do { } while(0) -#define DBUG_PUSH(a1) do { } while(0) -#define DBUG_SET(a1) do { } while(0) -#define DBUG_SET_INITIAL(a1) do { } while(0) -#define DBUG_POP() do { } while(0) -#define DBUG_PROCESS(a1) do { } while(0) -#define DBUG_SETJMP(a1) setjmp(a1) -#define DBUG_LONGJMP(a1) longjmp(a1) -#define DBUG_DUMP(keyword,a1,a2) do { } while(0) -#define DBUG_END() do { } while(0) -#define DBUG_ASSERT(A) do { } while(0) -#define DBUG_LOCK_FILE do { } while(0) -#define DBUG_FILE (stderr) -#define DBUG_UNLOCK_FILE do { } while(0) -#define DBUG_EXPLAIN(buf,len) -#define DBUG_EXPLAIN_INITIAL(buf,len) -#define DEBUGGER_OFF do { } while(0) -#define DEBUGGER_ON do { } while(0) -#define DBUG_ABORT() do { } while(0) -#define DBUG_CRASH_ENTER(func) -#define DBUG_CRASH_RETURN(val) do { return(val); } while(0) -#define DBUG_CRASH_VOID_RETURN do { return; } while(0) -#define DBUG_SUICIDE() do { } while(0) - -#endif - -#ifdef EXTRA_DEBUG -/** - 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. - The client tells the server to block with SELECT GET_LOCK() - and unblocks it with SELECT RELEASE_LOCK(). Used for debugging difficult - concurrency problems -*/ -#define DBUG_SYNC_POINT(lock_name,lock_timeout) \ - debug_sync_point(lock_name,lock_timeout) -void debug_sync_point(const char* lock_name, uint lock_timeout); -#else -#define DBUG_SYNC_POINT(lock_name,lock_timeout) -#endif /* EXTRA_DEBUG */ - -#ifdef __cplusplus -} -#endif - -#endif /* MY_DBUG_INCLUDED */ diff --git a/dep/mysqllite/include/my_dir.h b/dep/mysqllite/include/my_dir.h deleted file mode 100644 index de21bee7385..00000000000 --- a/dep/mysqllite/include/my_dir.h +++ /dev/null @@ -1,109 +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 */ - -#ifndef MY_DIR_H -#define MY_DIR_H - -#include "my_global.h" - -#include <sys/stat.h> - -#ifdef __cplusplus -extern "C" { -#endif - - /* Defines for my_dir and my_stat */ - -#define MY_S_IFMT S_IFMT /* type of file */ -#define MY_S_IFDIR S_IFDIR /* directory */ -#define MY_S_IFCHR S_IFCHR /* character special */ -#define MY_S_IFBLK S_IFBLK /* block special */ -#define MY_S_IFREG S_IFREG /* regular */ -#define MY_S_IFIFO S_IFIFO /* fifo */ -#define MY_S_ISUID S_ISUID /* set user id on execution */ -#define MY_S_ISGID S_ISGID /* set group id on execution */ -#define MY_S_ISVTX S_ISVTX /* save swapped text even after use */ -#define MY_S_IREAD S_IREAD /* read permission, owner */ -#define MY_S_IWRITE S_IWRITE /* write permission, owner */ -#define MY_S_IEXEC S_IEXEC /* execute/search permission, owner */ - -#define MY_S_ISDIR(m) (((m) & MY_S_IFMT) == MY_S_IFDIR) -#define MY_S_ISCHR(m) (((m) & MY_S_IFMT) == MY_S_IFCHR) -#define MY_S_ISBLK(m) (((m) & MY_S_IFMT) == MY_S_IFBLK) -#define MY_S_ISREG(m) (((m) & MY_S_IFMT) == MY_S_IFREG) -#define MY_S_ISFIFO(m) (((m) & MY_S_IFMT) == MY_S_IFIFO) - -#define MY_DONT_SORT 512 /* my_lib; Don't sort files */ -#define MY_WANT_STAT 1024 /* my_lib; stat files */ - - /* typedefs for my_dir & my_stat */ - -#ifdef USE_MY_STAT_STRUCT - -typedef struct my_stat -{ - dev_t st_dev; /* major & minor device numbers */ - ino_t st_ino; /* inode number */ - ushort st_mode; /* file permissons (& suid sgid .. bits) */ - short st_nlink; /* number of links to file */ - ushort st_uid; /* user id */ - ushort st_gid; /* group id */ - dev_t st_rdev; /* more major & minor device numbers (???) */ - off_t st_size; /* size of file */ - time_t st_atime; /* time for last read */ - time_t st_mtime; /* time for last contens modify */ - time_t st_ctime; /* time for last inode or contents modify */ -} MY_STAT; - -#else - -#if(_MSC_VER) -#define MY_STAT struct _stati64 /* 64 bit file size */ -#else -#define MY_STAT struct stat /* Orginal struct have what we need */ -#endif - -#endif /* USE_MY_STAT_STRUCT */ - -/* Struct describing one file returned from my_dir */ -typedef struct fileinfo -{ - char *name; - MY_STAT *mystat; -} FILEINFO; - -typedef struct st_my_dir /* Struct returned from my_dir */ -{ - /* - These members are just copies of parts of DYNAMIC_ARRAY structure, - which is allocated right after the end of MY_DIR structure (MEM_ROOT - for storing names is also resides there). We've left them here because - we don't want to change code that uses my_dir. - */ - struct fileinfo *dir_entry; - uint number_off_files; -} MY_DIR; - -extern MY_DIR *my_dir(const char *path,myf MyFlags); -extern void my_dirend(MY_DIR *buffer); -extern MY_STAT *my_stat(const char *path, MY_STAT *stat_area, myf my_flags); -extern int my_fstat(int filenr, MY_STAT *stat_area, myf MyFlags); - -#ifdef __cplusplus -} -#endif - -#endif /* MY_DIR_H */ - diff --git a/dep/mysqllite/include/my_getopt.h b/dep/mysqllite/include/my_getopt.h deleted file mode 100644 index 47feb21d85e..00000000000 --- a/dep/mysqllite/include/my_getopt.h +++ /dev/null @@ -1,123 +0,0 @@ -/* Copyright (C) 2002-2004 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 */ - -#ifndef _my_getopt_h -#define _my_getopt_h - -#include "my_sys.h" /* loglevel */ - -C_MODE_START - -#define GET_NO_ARG 1 -#define GET_BOOL 2 -#define GET_INT 3 -#define GET_UINT 4 -#define GET_LONG 5 -#define GET_ULONG 6 -#define GET_LL 7 -#define GET_ULL 8 -#define GET_STR 9 -#define GET_STR_ALLOC 10 -#define GET_DISABLED 11 -#define GET_ENUM 12 -#define GET_SET 13 -#define GET_DOUBLE 14 -#define GET_FLAGSET 15 - -#define GET_ASK_ADDR 128 -#define GET_TYPE_MASK 127 - -/** - Enumeration of the my_option::arg_type attributes. - It should be noted that for historical reasons variables with the combination - 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 }; - -struct st_typelib; - -struct my_option -{ - const char *name; /**< Name of the option. name=NULL - marks the end of the my_option[] - array. - */ - int id; /**< For 0<id<255 it's means one - character for a short option - (like -A), if >255 no short option - is created, but a long option still - can be identified uniquely in the - my_get_one_option() callback. - If an opton needs neither special - treatment in the my_get_one_option() - nor one-letter short equivalent - use id=0 - */ - const char *comment; /**< option comment, for autom. --help. - if it's NULL the option is not - visible in --help. - */ - void *value; /**< A pointer to the variable value */ - void *u_max_value; /**< The user def. max variable value */ - struct st_typelib *typelib; /**< Pointer to possible values */ - ulong var_type; /**< GET_BOOL, GET_ULL, etc */ - enum get_opt_arg_type arg_type; /**< e.g. REQUIRED_ARG or OPT_ARG */ - longlong def_value; /**< Default value */ - longlong min_value; /**< Min allowed value (for numbers) */ - longlong max_value; /**< Max allowed value (for numbers) */ - longlong sub_size; /**< Unused */ - long block_size; /**< Value should be a mult. of this (for numbers) */ - void *app_type; /**< To be used by an application */ -}; - - -typedef my_bool (*my_get_one_option)(int, const struct my_option *, char *); -typedef void (*my_error_reporter)(enum loglevel level, const char *format, ...); -/** - Used to retrieve a reference to the object (variable) that holds the value - for the given option. For example, if var_type is GET_UINT, the function - must return a pointer to a variable of type uint. A argument is stored in - the location pointed to by the returned pointer. -*/ -typedef void *(*my_getopt_value)(const char *, uint, const struct my_option *, - int *); - - -extern char *disabled_my_option; -extern my_bool my_getopt_print_errors; -extern my_bool my_getopt_skip_unknown; -extern my_error_reporter my_getopt_error_reporter; - -extern int handle_options (int *argc, char ***argv, - const struct my_option *longopts, my_get_one_option); -extern void my_cleanup_options(const struct my_option *options); -extern void my_print_help(const struct my_option *options); -extern void my_print_variables(const struct my_option *options); -extern void my_getopt_register_get_addr(my_getopt_value); - -ulonglong getopt_ull_limit_value(ulonglong num, const struct my_option *optp, - my_bool *fix); -longlong getopt_ll_limit_value(longlong, const struct my_option *, - my_bool *fix); -double getopt_double_limit_value(double num, const struct my_option *optp, - my_bool *fix); -my_bool getopt_compare_strings(const char *s, const char *t, uint length); - -C_MODE_END - -#endif /* _my_getopt_h */ - diff --git a/dep/mysqllite/include/my_global.h b/dep/mysqllite/include/my_global.h deleted file mode 100644 index c1ae8a6d6bc..00000000000 --- a/dep/mysqllite/include/my_global.h +++ /dev/null @@ -1,1483 +0,0 @@ -/* Copyright (C) 2000-2003 MySQL AB, 2009 Sun Microsystems, Inc - - 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 */ - -/* This is the include file that should be included 'first' in every C file. */ - -#ifndef _global_h -#define _global_h - -/* Client library users on Windows need this macro defined here. */ -#if !defined(__WIN__) && defined(_WIN32) -#define __WIN__ -#endif - -/* - InnoDB depends on some MySQL internals which other plugins should not - need. This is because of InnoDB's foreign key support, "safe" binlog - truncation, and other similar legacy features. - - We define accessors for these internals unconditionally, but do not - expose them in mysql/plugin.h. They are declared in ha_innodb.h for - InnoDB's use. -*/ -#define INNODB_COMPATIBILITY_HOOKS - -#ifdef __CYGWIN__ -/* We use a Unix API, so pretend it's not Windows */ -#undef WIN -#undef WIN32 -#undef _WIN -#undef _WIN32 -#undef _WIN64 -#undef __WIN__ -#undef __WIN32__ -#define HAVE_ERRNO_AS_DEFINE -#endif /* __CYGWIN__ */ - -/* to make command line shorter we'll define USE_PRAGMA_INTERFACE here */ -#ifdef USE_PRAGMA_IMPLEMENTATION -#define USE_PRAGMA_INTERFACE -#endif - -#if defined(__OpenBSD__) && (OpenBSD >= 200411) -#define HAVE_ERRNO_AS_DEFINE -#endif - -#if defined(i386) && !defined(__i386__) -#define __i386__ -#endif - -/* Macros to make switching between C and C++ mode easier */ -#ifdef __cplusplus -#define C_MODE_START extern "C" { -#define C_MODE_END } -#else -#define C_MODE_START -#define C_MODE_END -#endif - -#ifdef __cplusplus -#define CPP_UNNAMED_NS_START namespace { -#define CPP_UNNAMED_NS_END } -#endif - -#include <my_config.h> - -#ifdef WITH_PERFSCHEMA_STORAGE_ENGINE -#define HAVE_PSI_INTERFACE -#endif /* WITH_PERFSCHEMA_STORAGE_ENGINE */ - -/* Make it easier to add conditional code in _expressions_ */ -#ifdef __WIN__ -#define IF_WIN(A,B) A -#else -#define IF_WIN(A,B) B -#endif - -#ifdef HAVE_purify -#define IF_PURIFY(A,B) A -#else -#define IF_PURIFY(A,B) B -#endif - -#ifndef EMBEDDED_LIBRARY -#ifdef WITH_NDB_BINLOG -#define HAVE_NDB_BINLOG 1 -#endif -#endif /* !EMBEDDED_LIBRARY */ - -#ifndef EMBEDDED_LIBRARY -#define HAVE_REPLICATION -#define HAVE_EXTERNAL_CLIENT -#endif - -#if defined (_WIN32) -/* - 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 - 64 bit offsets. -*/ -#undef SIZEOF_OFF_T -#define SIZEOF_OFF_T 8 - -/* - Prevent inclusion of Windows GDI headers - they define symbol - ERROR that conflicts with mysql headers. -*/ -#ifndef NOGDI -#define NOGDI -#endif - -/* Include common headers.*/ -#include <winsock2.h> -#include <ws2tcpip.h> /* SOCKET */ -#include <io.h> /* access(), chmod() */ -#include <process.h> /* getpid() */ - -#define sleep(a) Sleep((a)*1000) - -/* Define missing access() modes. */ -#define F_OK 0 -#define W_OK 2 - -/* Define missing file locking constants. */ -#define F_RDLCK 1 -#define F_WRLCK 2 -#define F_UNLCK 3 -#define F_TO_EOF 0x3FFFFFFF - -/* Shared memory and named pipe connections are supported. */ -#define HAVE_SMEM 1 -#define HAVE_NAMED_PIPE 1 -#define shared_memory_buffer_length 16000 -#define default_shared_memory_base_name "MYSQL" -#endif /* _WIN32*/ - - -/* Workaround for _LARGE_FILES and _LARGE_FILE_API incompatibility on AIX */ -#if defined(_AIX) && defined(_LARGE_FILE_API) -#undef _LARGE_FILE_API -#endif - -/* - The macros below are used to allow build of Universal/fat binaries of - MySQL and MySQL applications under darwin. -*/ -#if defined(__APPLE__) && defined(__MACH__) -# undef SIZEOF_CHARP -# undef SIZEOF_SHORT -# undef SIZEOF_INT -# undef SIZEOF_LONG -# undef SIZEOF_LONG_LONG -# undef SIZEOF_OFF_T -# undef WORDS_BIGENDIAN -# define SIZEOF_SHORT 2 -# define SIZEOF_INT 4 -# define SIZEOF_LONG_LONG 8 -# define SIZEOF_OFF_T 8 -# if defined(__i386__) || defined(__ppc__) -# define SIZEOF_CHARP 4 -# define SIZEOF_LONG 4 -# elif defined(__x86_64__) || defined(__ppc64__) -# define SIZEOF_CHARP 8 -# define SIZEOF_LONG 8 -# else -# error Building FAT binary for an unknown architecture. -# endif -# if defined(__ppc__) || defined(__ppc64__) -# define WORDS_BIGENDIAN -# endif -#endif /* defined(__APPLE__) && defined(__MACH__) */ - - -/* - The macros below are borrowed from include/linux/compiler.h in the - Linux kernel. Use them to indicate the likelyhood of the truthfulness - of a condition. This serves two purposes - newer versions of gcc will be - able to optimize for branch predication, which could yield siginficant - performance gains in frequently executed sections of the code, and the - other reason to use them is for documentation -*/ - -#if !defined(__GNUC__) || (__GNUC__ == 2 && __GNUC_MINOR__ < 96) -#define __builtin_expect(x, expected_value) (x) -#endif - -#define likely(x) __builtin_expect((x),1) -#define unlikely(x) __builtin_expect((x),0) - -/* Fix problem with S_ISLNK() on Linux */ -#if defined(TARGET_OS_LINUX) || defined(__GLIBC__) -#undef _GNU_SOURCE -#define _GNU_SOURCE 1 -#endif - -/* - Temporary solution to solve bug#7156. Include "sys/types.h" before - the thread headers, else the function madvise() will not be defined -*/ -#if defined(HAVE_SYS_TYPES_H) && ( defined(sun) || defined(__sun) ) -#include <sys/types.h> -#endif - -#ifdef HAVE_THREADS_WITHOUT_SOCKETS -/* MIT pthreads does not work with unix sockets */ -#undef HAVE_SYS_UN_H -#endif - -#define __EXTENSIONS__ 1 /* We want some extension */ -#ifndef __STDC_EXT__ -#define __STDC_EXT__ 1 /* To get large file support on hpux */ -#endif - -/* - Solaris 9 include file <sys/feature_tests.h> refers to X/Open document - - System Interfaces and Headers, Issue 5 - - saying we should define _XOPEN_SOURCE=500 to get POSIX.1c prototypes, - but apparently other systems (namely FreeBSD) don't agree. - - On a newer Solaris 10, the above file recognizes also _XOPEN_SOURCE=600. - Furthermore, it tests that if a program requires older standard - (_XOPEN_SOURCE<600 or _POSIX_C_SOURCE<200112L) it cannot be - run on a new compiler (that defines _STDC_C99) and issues an #error. - It's also an #error if a program requires new standard (_XOPEN_SOURCE=600 - or _POSIX_C_SOURCE=200112L) and a compiler does not define _STDC_C99. - - To add more to this mess, Sun Studio C compiler defines _STDC_C99 while - C++ compiler does not! - - So, in a desperate attempt to get correct prototypes for both - C and C++ code, we define either _XOPEN_SOURCE=600 or _XOPEN_SOURCE=500 - depending on the compiler's announced C standard support. - - Cleaner solutions are welcome. -*/ -#ifdef __sun -#if __STDC_VERSION__ - 0 >= 199901L -#define _XOPEN_SOURCE 600 -#else -#define _XOPEN_SOURCE 500 -#endif -#endif - -#if !defined(__WIN__) -#ifndef _POSIX_PTHREAD_SEMANTICS -#define _POSIX_PTHREAD_SEMANTICS /* We want posix threads */ -#endif - -#if !defined(SCO) -#define _REENTRANT 1 /* Some thread libraries require this */ -#endif -#if !defined(_THREAD_SAFE) && !defined(_AIX) -#define _THREAD_SAFE /* Required for OSF1 */ -#endif -#if defined(HPUX10) || defined(HPUX11) -C_MODE_START /* HPUX needs this, signal.h bug */ -#include <pthread.h> -C_MODE_END -#else -#include <pthread.h> /* AIX must have this included first */ -#endif -#if !defined(SCO) && !defined(_REENTRANT) -#define _REENTRANT 1 /* Threads requires reentrant code */ -#endif -#endif /* !defined(__WIN__) */ - -/* Go around some bugs in different OS and compilers */ -#ifdef _AIX /* By soren@t.dk */ -#define _H_STRINGS -#define _SYS_STREAM_H -/* #define _AIX32_CURSES */ /* XXX: this breaks AIX 4.3.3 (others?). */ -#define ulonglong2double(A) my_ulonglong2double(A) -#define my_off_t2double(A) my_ulonglong2double(A) -C_MODE_START -double my_ulonglong2double(unsigned long long A); -C_MODE_END -#endif /* _AIX */ - -#ifdef HAVE_BROKEN_SNPRINTF /* HPUX 10.20 don't have this defined */ -#undef HAVE_SNPRINTF -#endif -#ifdef HAVE_BROKEN_PREAD -/* - pread()/pwrite() are not 64 bit safe on HP-UX 11.0 without - installing the kernel patch PHKL_20349 or greater -*/ -#undef HAVE_PREAD -#undef HAVE_PWRITE -#endif - -#ifdef UNDEF_HAVE_GETHOSTBYNAME_R /* For OSF4.x */ -#undef HAVE_GETHOSTBYNAME_R -#endif -#ifdef UNDEF_HAVE_INITGROUPS /* For AIX 4.3 */ -#undef HAVE_INITGROUPS -#endif - -/* gcc/egcs issues */ - -#if defined(__GNUC) && defined(__EXCEPTIONS) -#error "Please add -fno-exceptions to CXXFLAGS and reconfigure/recompile" -#endif - -#if defined(_lint) && !defined(lint) -#define lint -#endif -#if SIZEOF_LONG_LONG > 4 && !defined(_LONG_LONG) -#define _LONG_LONG 1 /* For AIX string library */ -#endif - -#ifndef stdin -#include <stdio.h> -#endif -#include <stdarg.h> -#ifdef HAVE_STDLIB_H -#include <stdlib.h> -#endif -#ifdef HAVE_STDDEF_H -#include <stddef.h> -#endif - -#include <math.h> -#ifdef HAVE_LIMITS_H -#include <limits.h> -#endif -#ifdef HAVE_FLOAT_H -#include <float.h> -#endif -#ifdef HAVE_FENV_H -#include <fenv.h> /* For fesetround() */ -#endif - -#ifdef HAVE_SYS_TYPES_H -#include <sys/types.h> -#endif -#ifdef HAVE_FCNTL_H -#include <fcntl.h> -#endif -#ifdef HAVE_SYS_TIMEB_H -#include <sys/timeb.h> /* Avoid warnings on SCO */ -#endif -#if TIME_WITH_SYS_TIME -# include <sys/time.h> -# include <time.h> -#else -# if HAVE_SYS_TIME_H -# include <sys/time.h> -# else -# include <time.h> -# endif -#endif /* TIME_WITH_SYS_TIME */ -#ifdef HAVE_UNISTD_H -#include <unistd.h> -#endif -#if defined(__cplusplus) && defined(NO_CPLUSPLUS_ALLOCA) -#undef HAVE_ALLOCA -#undef HAVE_ALLOCA_H -#endif -#ifdef HAVE_ALLOCA_H -#include <alloca.h> -#endif - -#include <errno.h> /* Recommended by debian */ -/* We need the following to go around a problem with openssl on solaris */ -#if defined(HAVE_CRYPT_H) -#include <crypt.h> -#endif - -/* - A lot of our programs uses asserts, so better to always include it - This also fixes a problem when people uses DBUG_ASSERT without including - assert.h -*/ -#include <assert.h> - -/* an assert that works at compile-time. only for constant expression */ -#ifndef __GNUC__ -#define compile_time_assert(X) do { } while(0) -#else -#define compile_time_assert(X) \ - do \ - { \ - typedef char compile_time_assert[(X) ? 1 : -1]; \ - } while(0) -#endif - -/* Go around some bugs in different OS and compilers */ -#if defined (HPUX11) && defined(_LARGEFILE_SOURCE) -#ifndef _LARGEFILE64_SOURCE -#define _LARGEFILE64_SOURCE -#endif -#endif - -#if defined(_HPUX_SOURCE) && defined(HAVE_SYS_STREAM_H) -#include <sys/stream.h> /* HPUX 10.20 defines ulong here. UGLY !!! */ -#define HAVE_ULONG -#endif -#if defined(HPUX10) && defined(_LARGEFILE64_SOURCE) -/* Fix bug in setrlimit */ -#undef setrlimit -#define setrlimit cma_setrlimit64 -#endif -/* Declare madvise where it is not declared for C++, like Solaris */ -#if HAVE_MADVISE && !HAVE_DECL_MADVISE && defined(__cplusplus) -extern "C" int madvise(void *addr, size_t len, int behav); -#endif - -#define QUOTE_ARG(x) #x /* Quote argument (before cpp) */ -#define STRINGIFY_ARG(x) QUOTE_ARG(x) /* Quote argument, after cpp */ - -/* Paranoid settings. Define I_AM_PARANOID if you are paranoid */ -#ifdef I_AM_PARANOID -#define DONT_ALLOW_USER_CHANGE 1 -#define DONT_USE_MYSQL_PWD 1 -#endif - -/* Does the system remember a signal handler after a signal ? */ -#if !defined(HAVE_BSD_SIGNALS) && !defined(HAVE_SIGACTION) -#define SIGNAL_HANDLER_RESET_ON_DELIVERY -#endif - -/* - 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 -#define LINT_INIT(var) -#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. - - 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). -*/ -#if defined(_lint) || defined(FORCE_INIT_OF_VARS) || \ - defined(__cplusplus) || !defined(__GNUC__) -#define UNINIT_VAR(x) x= 0 -#else -/* GCC specific self-initialization which inhibits the warning. */ -#define UNINIT_VAR(x) x= x -#endif - -#if !defined(HAVE_UINT) -#undef HAVE_UINT -#define HAVE_UINT -typedef unsigned int uint; -typedef unsigned short ushort; -#endif - -#define swap_variables(t, a, b) { t dummy; dummy= a; a= b; b= dummy; } -#define test(a) ((a) ? 1 : 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 test_all_bits(a,b) (((a) & (b)) == (b)) -#define array_elements(A) ((uint) (sizeof(A)/sizeof(A[0]))) - -/* Define some general constants */ -#ifndef TRUE -#define TRUE (1) /* Logical true */ -#define FALSE (0) /* Logical false */ -#endif - -#include <my_compiler.h> - -/* - Wen using the embedded library, users might run into link problems, - duplicate declaration of __cxa_pure_virtual, solved by declaring it a - weak symbol. -*/ -#if defined(USE_MYSYS_NEW) && ! defined(DONT_DECLARE_CXA_PURE_VIRTUAL) -C_MODE_START -int __cxa_pure_virtual () __attribute__ ((weak)); -C_MODE_END -#endif - -/* The DBUG_ON flag always takes precedence over default DBUG_OFF */ -#if defined(DBUG_ON) && defined(DBUG_OFF) -#undef DBUG_OFF -#endif - -/* We might be forced to turn debug off, if not turned off already */ -#if (defined(FORCE_DBUG_OFF) || defined(_lint)) && !defined(DBUG_OFF) -# define DBUG_OFF -# ifdef DBUG_ON -# undef DBUG_ON -# endif -#endif - -/* Some types that is different between systems */ - -typedef int File; /* File descriptor */ -#ifdef _WIN32 -typedef SOCKET my_socket; -#else -typedef int my_socket; /* File descriptor for sockets */ -#define INVALID_SOCKET -1 -#endif -/* Type for fuctions that handles signals */ -#define sig_handler RETSIGTYPE -C_MODE_START -typedef void (*sig_return)();/* Returns type from signal */ -C_MODE_END -#if defined(__GNUC__) && !defined(_lint) -typedef char pchar; /* Mixed prototypes can take char */ -typedef char puchar; /* Mixed prototypes can take char */ -typedef char pbool; /* Mixed prototypes can take char */ -typedef short pshort; /* Mixed prototypes can take short int */ -typedef float pfloat; /* Mixed prototypes can take float */ -#else -typedef int pchar; /* Mixed prototypes can't take char */ -typedef uint puchar; /* Mixed prototypes can't take char */ -typedef int pbool; /* Mixed prototypes can't take char */ -typedef int pshort; /* Mixed prototypes can't take short int */ -typedef double pfloat; /* Mixed prototypes can't take float */ -#endif -C_MODE_START -typedef int (*qsort_cmp)(const void *,const void *); -typedef int (*qsort_cmp2)(void*, const void *,const void *); -C_MODE_END -#define qsort_t RETQSORTTYPE /* Broken GCC cant handle typedef !!!! */ -#ifdef HAVE_SYS_SOCKET_H -#include <sys/socket.h> -#endif -typedef SOCKET_SIZE_TYPE size_socket; - -#ifndef SOCKOPT_OPTLEN_TYPE -#define SOCKOPT_OPTLEN_TYPE size_socket -#endif - -/* file create flags */ - -#ifndef O_SHARE /* Probably not windows */ -#define O_SHARE 0 /* Flag to my_open for shared files */ -#ifndef O_BINARY -#define O_BINARY 0 /* Flag to my_open for binary files */ -#endif -#ifndef FILE_BINARY -#define FILE_BINARY O_BINARY /* Flag to my_fopen for binary streams */ -#endif -#ifdef HAVE_FCNTL -#define HAVE_FCNTL_LOCK -#define F_TO_EOF 0L /* Param to lockf() to lock rest of file */ -#endif -#endif /* O_SHARE */ - -#ifndef O_TEMPORARY -#define O_TEMPORARY 0 -#endif -#ifndef O_SHORT_LIVED -#define O_SHORT_LIVED 0 -#endif -#ifndef O_NOFOLLOW -#define O_NOFOLLOW 0 -#endif - -/* additional file share flags for win32 */ -#ifdef __WIN__ -#define _SH_DENYRWD 0x110 /* deny read/write mode & delete */ -#define _SH_DENYWRD 0x120 /* deny write mode & delete */ -#define _SH_DENYRDD 0x130 /* deny read mode & delete */ -#define _SH_DENYDEL 0x140 /* deny delete only */ -#endif /* __WIN__ */ - - -/* General constants */ -#define FN_LEN 256 /* Max file name len */ -#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_REFLEN 512 /* Max length of full path-name */ -#define FN_EXTCHAR '.' -#define FN_HOMELIB '~' /* ~/ is used as abbrev for home dir */ -#define FN_CURLIB '.' /* ./ is used as abbrev for current dir */ -#define FN_PARENTDIR ".." /* Parent directory; Must be a string */ - -#ifdef _WIN32 -#define FN_LIBCHAR '\\' -#define FN_LIBCHAR2 '/' -#define FN_DIRSEP "/\\" /* Valid directory separators */ -#define FN_ROOTDIR "\\" -#define FN_DEVCHAR ':' -#define FN_NETWORK_DRIVES /* Uses \\ to indicate network drives */ -#define FN_NO_CASE_SENCE /* Files are not case-sensitive */ -#else -#define FN_LIBCHAR '/' -#define FN_LIBCHAR2 '/' -#define FN_DIRSEP "/" /* Valid directory separators */ -#define FN_ROOTDIR "/" -#endif - -/* - MY_FILE_MIN is Windows speciality and is used to quickly detect - the mismatch of CRT and mysys file IO usage on Windows at runtime. - CRT file descriptors can be in the range 0-2047, whereas descriptors returned - by my_open() will start with 2048. If a file descriptor with value less then - MY_FILE_MIN is passed to mysys IO function, chances are it stemms from - open()/fileno() and not my_open()/my_fileno. - - For Posix, mysys functions are light wrappers around libc, and MY_FILE_MIN - is logically 0. -*/ - -#ifdef _WIN32 -#define MY_FILE_MIN 2048 -#else -#define MY_FILE_MIN 0 -#endif - -/* - MY_NFILE is the default size of my_file_info array. - - It is larger on Windows, because it all file handles are stored in my_file_info - Default size is 16384 and this should be enough for most cases.If it is not - enough, --max-open-files with larger value can be used. - - For Posix , my_file_info array is only used to store filenames for - error reporting and its size is not a limitation for number of open files. -*/ -#ifdef _WIN32 -#define MY_NFILE (16384 + MY_FILE_MIN) -#else -#define MY_NFILE 64 -#endif - -#ifndef OS_FILE_LIMIT -#define OS_FILE_LIMIT UINT_MAX -#endif - -/* - 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 - isam btree library. eg to big to slow. -*/ -#define IO_SIZE 4096 -/* - How much overhead does malloc have. The code often allocates - something like 1024-MALLOC_OVERHEAD bytes -*/ -#define MALLOC_OVERHEAD 8 - - /* get memory in huncs */ -#define ONCE_ALLOC_INIT (uint) (4096-MALLOC_OVERHEAD) - /* Typical record cash */ -#define RECORD_CACHE_SIZE (uint) (64*1024-MALLOC_OVERHEAD) - /* Typical key cash */ -#define KEY_CACHE_SIZE (uint) (8*1024*1024) - /* Default size of a key cache block */ -#define KEY_CACHE_BLOCK_SIZE (uint) 1024 - - - /* Some things that this system doesn't have */ - -#ifdef _WIN32 -#define NO_DIR_LIBRARY /* Not standard dir-library */ -#endif - -/* Some defines of functions for portability */ - -#undef remove /* Crashes MySQL on SCO 5.0.0 */ -#ifndef __WIN__ -#define closesocket(A) close(A) -#endif - -#if (_MSC_VER) -#if !defined(_WIN64) -inline double my_ulonglong2double(unsigned long long value) -{ - long long nr=(long long) value; - if (nr >= 0) - return (double) nr; - return (18446744073709551616.0 + (double) nr); -} -#define ulonglong2double my_ulonglong2double -#define my_off_t2double my_ulonglong2double -#endif /* _WIN64 */ -inline unsigned long long my_double2ulonglong(double d) -{ - double t= d - (double) 0x8000000000000000ULL; - - if (t >= 0) - return ((unsigned long long) t) + 0x8000000000000000ULL; - return (unsigned long long) d; -} -#define double2ulonglong my_double2ulonglong -#endif - -#ifndef ulonglong2double -#define ulonglong2double(A) ((double) (ulonglong) (A)) -#define my_off_t2double(A) ((double) (my_off_t) (A)) -#endif -#ifndef double2ulonglong -#define double2ulonglong(A) ((ulonglong) (double) (A)) -#endif - -#ifndef offsetof -#define offsetof(TYPE, MEMBER) ((size_t) &((TYPE *)0)->MEMBER) -#endif -#define ulong_to_double(X) ((double) (ulong) (X)) - -#ifndef STACK_DIRECTION -#error "please add -DSTACK_DIRECTION=1 or -1 to your CPPFLAGS" -#endif - -#if !defined(HAVE_STRTOK_R) -#define strtok_r(A,B,C) strtok((A),(B)) -#endif - -/* This is from the old m-machine.h file */ - -#if SIZEOF_LONG_LONG > 4 -#define HAVE_LONG_LONG 1 -#endif - -/* - 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. -*/ - -#if defined(HAVE_LONG_LONG) && !defined(LONGLONG_MIN) -#define LONGLONG_MIN ((long long) 0x8000000000000000LL) -#define LONGLONG_MAX ((long long) 0x7FFFFFFFFFFFFFFFLL) -#endif - -#if defined(HAVE_LONG_LONG) && !defined(ULONGLONG_MAX) -/* First check for ANSI C99 definition: */ -#ifdef ULLONG_MAX -#define ULONGLONG_MAX ULLONG_MAX -#else -#define ULONGLONG_MAX ((unsigned long long)(~0ULL)) -#endif -#endif /* defined (HAVE_LONG_LONG) && !defined(ULONGLONG_MAX)*/ - -#define INT_MIN64 (~0x7FFFFFFFFFFFFFFFLL) -#define INT_MAX64 0x7FFFFFFFFFFFFFFFLL -#define INT_MIN32 (~0x7FFFFFFFL) -#define INT_MAX32 0x7FFFFFFFL -#define UINT_MAX32 0xFFFFFFFFL -#define INT_MIN24 (~0x007FFFFF) -#define INT_MAX24 0x007FFFFF -#define UINT_MAX24 0x00FFFFFF -#define INT_MIN16 (~0x7FFF) -#define INT_MAX16 0x7FFF -#define UINT_MAX16 0xFFFF -#define INT_MIN8 (~0x7F) -#define INT_MAX8 0x7F -#define UINT_MAX8 0xFF - -/* From limits.h instead */ -#ifndef DBL_MIN -#define DBL_MIN 4.94065645841246544e-324 -#define FLT_MIN ((float)1.40129846432481707e-45) -#endif -#ifndef DBL_MAX -#define DBL_MAX 1.79769313486231470e+308 -#define FLT_MAX ((float)3.40282346638528860e+38) -#endif -#ifndef SIZE_T_MAX -#define SIZE_T_MAX (~((size_t) 0)) -#endif - -#ifndef isfinite -#ifdef HAVE_FINITE -#define isfinite(x) finite(x) -#else -#define finite(x) (1.0 / fabs(x) > 0.0) -#endif /* HAVE_FINITE */ -#endif /* isfinite */ - -#ifndef HAVE_ISNAN -#define isnan(x) ((x) != (x)) -#endif - -#ifdef HAVE_ISINF -/* Check if C compiler is affected by GCC bug #39228 */ -#if !defined(__cplusplus) && defined(HAVE_BROKEN_ISINF) -/* Force store/reload of the argument to/from a 64-bit double */ -static inline double my_isinf(double x) -{ - volatile double t= x; - return isinf(t); -} -#else -/* System-provided isinf() is available and safe to use */ -#define my_isinf(X) isinf(X) -#endif -#else /* !HAVE_ISINF */ -#define my_isinf(X) (!finite(X) && !isnan(X)) -#endif - -/* Define missing math constants. */ -#ifndef M_PI -#define M_PI 3.14159265358979323846 -#endif -#ifndef M_E -#define M_E 2.7182818284590452354 -#endif -#ifndef M_LN2 -#define M_LN2 0.69314718055994530942 -#endif - -/* - Max size that must be added to a so that we know Size to make - adressable obj. -*/ -#if SIZEOF_CHARP == 4 -typedef long my_ptrdiff_t; -#else -typedef long long my_ptrdiff_t; -#endif - -#define MY_ALIGN(A,L) (((A) + (L) - 1) & ~((L) - 1)) -#define ALIGN_SIZE(A) MY_ALIGN((A),sizeof(double)) -/* Size to make adressable obj. */ -#define ADD_TO_PTR(ptr,size,type) (type) ((uchar*) (ptr)+size) -#define PTR_BYTE_DIFF(A,B) (my_ptrdiff_t) ((uchar*) (A) - (uchar*) (B)) - -/* - 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 - 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 - still OK to assume that all instances of the class has the same offsets - for the same members). - - This is temporary solution which should be removed once File_parser class - and related routines are refactored. -*/ - -#define my_offsetof(TYPE, MEMBER) \ - ((size_t)((char *)&(((TYPE *)0x10)->MEMBER) - (char*)0x10)) - -#define NullS (char *) 0 - -#ifdef STDCALL -#undef STDCALL -#endif - -#ifdef _WIN32 -#define STDCALL __stdcall -#else -#define STDCALL -#endif - -/* Typdefs for easyier portability */ - -#ifndef HAVE_UCHAR -typedef unsigned char uchar; /* Short for unsigned char */ -#endif - -#ifndef HAVE_INT8 -typedef signed char int8; /* Signed integer >= 8 bits */ -#endif -#ifndef HAVE_UINT8 -typedef unsigned char uint8; /* Unsigned integer >= 8 bits */ -#endif -#ifndef HAVE_INT16 -typedef short int16; -#endif -#ifndef HAVE_UINT16 -typedef unsigned short uint16; -#endif -#if SIZEOF_INT == 4 -#ifndef HAVE_INT32 -typedef int int32; -#endif -#ifndef HAVE_UINT32 -typedef unsigned int uint32; -#endif -#elif SIZEOF_LONG == 4 -#ifndef HAVE_INT32 -typedef long int32; -#endif -#ifndef HAVE_UINT32 -typedef unsigned long uint32; -#endif -#else -#error Neither int or long is of 4 bytes width -#endif - -#if !defined(HAVE_ULONG) && !defined(__USE_MISC) -typedef unsigned long ulong; /* Short for unsigned long */ -#endif -#ifndef longlong_defined -/* - Using [unsigned] long long is preferable as [u]longlong because we use - [unsigned] long long unconditionally in many places, - for example in constants with [U]LL suffix. -*/ -#if defined(HAVE_LONG_LONG) && SIZEOF_LONG_LONG == 8 -typedef unsigned long long int ulonglong; /* ulong or unsigned long long */ -typedef long long int longlong; -#else -typedef unsigned long ulonglong; /* ulong or unsigned long long */ -typedef long longlong; -#endif -#endif -#ifndef HAVE_INT64 -typedef longlong int64; -#endif -#ifndef HAVE_UINT64 -typedef ulonglong uint64; -#endif - -#if defined(NO_CLIENT_LONG_LONG) -typedef unsigned long my_ulonglong; -#elif defined (__WIN__) -typedef unsigned __int64 my_ulonglong; -#else -typedef unsigned long long my_ulonglong; -#endif - -#if SIZEOF_CHARP == SIZEOF_INT -typedef int intptr; -#elif SIZEOF_CHARP == SIZEOF_LONG -typedef long intptr; -#elif SIZEOF_CHARP == SIZEOF_LONG_LONG -typedef long long intptr; -#else -#error sizeof(void *) is neither sizeof(int) nor sizeof(long) nor sizeof(long long) -#endif - -#define MY_ERRPTR ((void*)(intptr)1) - -#if defined(_WIN32) -typedef unsigned long long my_off_t; -typedef unsigned long long os_off_t; -#else -typedef off_t os_off_t; -#if SIZEOF_OFF_T > 4 -typedef ulonglong my_off_t; -#else -typedef unsigned long my_off_t; -#endif -#endif /*_WIN32*/ -#define MY_FILEPOS_ERROR (~(my_off_t) 0) - -/* - TODO Convert these to use Bitmap class. - */ -typedef ulonglong table_map; /* Used for table bits in join */ -typedef ulong nesting_map; /* Used for flags of nesting constructs */ - -#if defined(__WIN__) -#define socket_errno WSAGetLastError() -#define SOCKET_EINTR WSAEINTR -#define SOCKET_EAGAIN WSAEINPROGRESS -#define SOCKET_ETIMEDOUT WSAETIMEDOUT -#define SOCKET_EWOULDBLOCK WSAEWOULDBLOCK -#define SOCKET_EADDRINUSE WSAEADDRINUSE -#define SOCKET_ENFILE ENFILE -#define SOCKET_EMFILE EMFILE -#else /* Unix */ -#define socket_errno errno -#define closesocket(A) close(A) -#define SOCKET_EINTR EINTR -#define SOCKET_EAGAIN EAGAIN -#define SOCKET_ETIMEDOUT SOCKET_EINTR -#define SOCKET_EWOULDBLOCK EWOULDBLOCK -#define SOCKET_EADDRINUSE EADDRINUSE -#define SOCKET_ENFILE ENFILE -#define SOCKET_EMFILE EMFILE -#endif - -typedef int myf; /* Type of MyFlags in my_funcs */ -typedef char my_bool; /* Small bool */ - -/* Macros for converting *constants* to the right type */ -#define MYF(v) (myf) (v) - -#ifndef LL -#ifdef HAVE_LONG_LONG -#define LL(A) A ## LL -#else -#define LL(A) A ## L -#endif -#endif - -#ifndef ULL -#ifdef HAVE_LONG_LONG -#define ULL(A) A ## ULL -#else -#define ULL(A) A ## UL -#endif -#endif - -/* - Defines to make it possible to prioritize register assignments. No - longer that important with modern compilers. -*/ -#ifndef USING_X -#define reg1 register -#define reg2 register -#define reg3 register -#define reg4 register -#define reg5 register -#define reg6 register -#define reg7 register -#define reg8 register -#define reg9 register -#define reg10 register -#define reg11 register -#define reg12 register -#define reg13 register -#define reg14 register -#define reg15 register -#define reg16 register -#endif - -#include <my_dbug.h> - -/* Some helper macros */ -#define YESNO(X) ((X) ? "yes" : "no") - -#define MY_HOW_OFTEN_TO_ALARM 2 /* How often we want info on screen */ -#define MY_HOW_OFTEN_TO_WRITE 1000 /* How often we want info on screen */ - - - -/* - Define-funktions for reading and storing in machine independent format - (low byte first) -*/ - -/* Optimized store functions for Intel x86 */ -#if defined(__i386__) || defined(_WIN32) -#define sint2korr(A) (*((int16 *) (A))) -#define sint3korr(A) ((int32) ((((uchar) (A)[2]) & 128) ? \ - (((uint32) 255L << 24) | \ - (((uint32) (uchar) (A)[2]) << 16) |\ - (((uint32) (uchar) (A)[1]) << 8) | \ - ((uint32) (uchar) (A)[0])) : \ - (((uint32) (uchar) (A)[2]) << 16) |\ - (((uint32) (uchar) (A)[1]) << 8) | \ - ((uint32) (uchar) (A)[0]))) -#define sint4korr(A) (*((long *) (A))) -#define uint2korr(A) (*((uint16 *) (A))) -#if defined(HAVE_purify) && !defined(_WIN32) -#define uint3korr(A) (uint32) (((uint32) ((uchar) (A)[0])) +\ - (((uint32) ((uchar) (A)[1])) << 8) +\ - (((uint32) ((uchar) (A)[2])) << 16)) -#else -/* - ATTENTION ! - - Please, note, uint3korr reads 4 bytes (not 3) ! - It means, that you have to provide enough allocated space ! -*/ -#define uint3korr(A) (long) (*((unsigned int *) (A)) & 0xFFFFFF) -#endif /* HAVE_purify && !_WIN32 */ -#define uint4korr(A) (*((uint32 *) (A))) -#define uint5korr(A) ((ulonglong)(((uint32) ((uchar) (A)[0])) +\ - (((uint32) ((uchar) (A)[1])) << 8) +\ - (((uint32) ((uchar) (A)[2])) << 16) +\ - (((uint32) ((uchar) (A)[3])) << 24)) +\ - (((ulonglong) ((uchar) (A)[4])) << 32)) -#define uint6korr(A) ((ulonglong)(((uint32) ((uchar) (A)[0])) + \ - (((uint32) ((uchar) (A)[1])) << 8) + \ - (((uint32) ((uchar) (A)[2])) << 16) + \ - (((uint32) ((uchar) (A)[3])) << 24)) + \ - (((ulonglong) ((uchar) (A)[4])) << 32) + \ - (((ulonglong) ((uchar) (A)[5])) << 40)) -#define uint8korr(A) (*((ulonglong *) (A))) -#define sint8korr(A) (*((longlong *) (A))) -#define int2store(T,A) *((uint16*) (T))= (uint16) (A) -#define int3store(T,A) do { *(T)= (uchar) ((A));\ - *(T+1)=(uchar) (((uint) (A) >> 8));\ - *(T+2)=(uchar) (((A) >> 16)); } while (0) -#define int4store(T,A) *((long *) (T))= (long) (A) -#define int5store(T,A) do { *(T)= (uchar)((A));\ - *((T)+1)=(uchar) (((A) >> 8));\ - *((T)+2)=(uchar) (((A) >> 16));\ - *((T)+3)=(uchar) (((A) >> 24)); \ - *((T)+4)=(uchar) (((A) >> 32)); } while(0) -#define int6store(T,A) do { *(T)= (uchar)((A)); \ - *((T)+1)=(uchar) (((A) >> 8)); \ - *((T)+2)=(uchar) (((A) >> 16)); \ - *((T)+3)=(uchar) (((A) >> 24)); \ - *((T)+4)=(uchar) (((A) >> 32)); \ - *((T)+5)=(uchar) (((A) >> 40)); } while(0) -#define int8store(T,A) *((ulonglong *) (T))= (ulonglong) (A) - -typedef union { - double v; - long m[2]; -} doubleget_union; -#define doubleget(V,M) \ -do { doubleget_union _tmp; \ - _tmp.m[0] = *((long*)(M)); \ - _tmp.m[1] = *(((long*) (M))+1); \ - (V) = _tmp.v; } while(0) -#define doublestore(T,V) do { *((long *) T) = ((doubleget_union *)&V)->m[0]; \ - *(((long *) T)+1) = ((doubleget_union *)&V)->m[1]; \ - } while (0) -#define float4get(V,M) do { *((float *) &(V)) = *((float*) (M)); } while(0) -#define float8get(V,M) doubleget((V),(M)) -#define float4store(V,M) memcpy((uchar*) V,(uchar*) (&M),sizeof(float)) -#define floatstore(T,V) memcpy((uchar*)(T), (uchar*)(&V),sizeof(float)) -#define floatget(V,M) memcpy((uchar*) &V,(uchar*) (M),sizeof(float)) -#define float8store(V,M) doublestore((V),(M)) -#else - -/* - We're here if it's not a IA-32 architecture (Win32 and UNIX IA-32 defines - were done before) -*/ -#define sint2korr(A) (int16) (((int16) ((uchar) (A)[0])) +\ - ((int16) ((int16) (A)[1]) << 8)) -#define sint3korr(A) ((int32) ((((uchar) (A)[2]) & 128) ? \ - (((uint32) 255L << 24) | \ - (((uint32) (uchar) (A)[2]) << 16) |\ - (((uint32) (uchar) (A)[1]) << 8) | \ - ((uint32) (uchar) (A)[0])) : \ - (((uint32) (uchar) (A)[2]) << 16) |\ - (((uint32) (uchar) (A)[1]) << 8) | \ - ((uint32) (uchar) (A)[0]))) -#define sint4korr(A) (int32) (((int32) ((uchar) (A)[0])) +\ - (((int32) ((uchar) (A)[1]) << 8)) +\ - (((int32) ((uchar) (A)[2]) << 16)) +\ - (((int32) ((int16) (A)[3]) << 24))) -#define sint8korr(A) (longlong) uint8korr(A) -#define uint2korr(A) (uint16) (((uint16) ((uchar) (A)[0])) +\ - ((uint16) ((uchar) (A)[1]) << 8)) -#define uint3korr(A) (uint32) (((uint32) ((uchar) (A)[0])) +\ - (((uint32) ((uchar) (A)[1])) << 8) +\ - (((uint32) ((uchar) (A)[2])) << 16)) -#define uint4korr(A) (uint32) (((uint32) ((uchar) (A)[0])) +\ - (((uint32) ((uchar) (A)[1])) << 8) +\ - (((uint32) ((uchar) (A)[2])) << 16) +\ - (((uint32) ((uchar) (A)[3])) << 24)) -#define uint5korr(A) ((ulonglong)(((uint32) ((uchar) (A)[0])) +\ - (((uint32) ((uchar) (A)[1])) << 8) +\ - (((uint32) ((uchar) (A)[2])) << 16) +\ - (((uint32) ((uchar) (A)[3])) << 24)) +\ - (((ulonglong) ((uchar) (A)[4])) << 32)) -#define uint6korr(A) ((ulonglong)(((uint32) ((uchar) (A)[0])) + \ - (((uint32) ((uchar) (A)[1])) << 8) + \ - (((uint32) ((uchar) (A)[2])) << 16) + \ - (((uint32) ((uchar) (A)[3])) << 24)) + \ - (((ulonglong) ((uchar) (A)[4])) << 32) + \ - (((ulonglong) ((uchar) (A)[5])) << 40)) -#define uint8korr(A) ((ulonglong)(((uint32) ((uchar) (A)[0])) +\ - (((uint32) ((uchar) (A)[1])) << 8) +\ - (((uint32) ((uchar) (A)[2])) << 16) +\ - (((uint32) ((uchar) (A)[3])) << 24)) +\ - (((ulonglong) (((uint32) ((uchar) (A)[4])) +\ - (((uint32) ((uchar) (A)[5])) << 8) +\ - (((uint32) ((uchar) (A)[6])) << 16) +\ - (((uint32) ((uchar) (A)[7])) << 24))) <<\ - 32)) -#define int2store(T,A) do { uint def_temp= (uint) (A) ;\ - *((uchar*) (T))= (uchar)(def_temp); \ - *((uchar*) (T)+1)=(uchar)((def_temp >> 8)); \ - } while(0) -#define int3store(T,A) do { /*lint -save -e734 */\ - *((uchar*)(T))=(uchar) ((A));\ - *((uchar*) (T)+1)=(uchar) (((A) >> 8));\ - *((uchar*)(T)+2)=(uchar) (((A) >> 16)); \ - /*lint -restore */} while(0) -#define int4store(T,A) do { *((char *)(T))=(char) ((A));\ - *(((char *)(T))+1)=(char) (((A) >> 8));\ - *(((char *)(T))+2)=(char) (((A) >> 16));\ - *(((char *)(T))+3)=(char) (((A) >> 24)); } while(0) -#define int5store(T,A) do { *((char *)(T))= (char)((A)); \ - *(((char *)(T))+1)= (char)(((A) >> 8)); \ - *(((char *)(T))+2)= (char)(((A) >> 16)); \ - *(((char *)(T))+3)= (char)(((A) >> 24)); \ - *(((char *)(T))+4)= (char)(((A) >> 32)); \ - } while(0) -#define int6store(T,A) do { *((char *)(T))= (char)((A)); \ - *(((char *)(T))+1)= (char)(((A) >> 8)); \ - *(((char *)(T))+2)= (char)(((A) >> 16)); \ - *(((char *)(T))+3)= (char)(((A) >> 24)); \ - *(((char *)(T))+4)= (char)(((A) >> 32)); \ - *(((char *)(T))+5)= (char)(((A) >> 40)); \ - } while(0) -#define int8store(T,A) do { uint def_temp= (uint) (A), def_temp2= (uint) ((A) >> 32); \ - int4store((T),def_temp); \ - int4store((T+4),def_temp2); } while(0) -#ifdef WORDS_BIGENDIAN -#define float4store(T,A) do { *(T)= ((uchar *) &A)[3];\ - *((T)+1)=(char) ((uchar *) &A)[2];\ - *((T)+2)=(char) ((uchar *) &A)[1];\ - *((T)+3)=(char) ((uchar *) &A)[0]; } while(0) - -#define float4get(V,M) do { float def_temp;\ - ((uchar*) &def_temp)[0]=(M)[3];\ - ((uchar*) &def_temp)[1]=(M)[2];\ - ((uchar*) &def_temp)[2]=(M)[1];\ - ((uchar*) &def_temp)[3]=(M)[0];\ - (V)=def_temp; } while(0) -#define float8store(T,V) do { *(T)= ((uchar *) &V)[7];\ - *((T)+1)=(char) ((uchar *) &V)[6];\ - *((T)+2)=(char) ((uchar *) &V)[5];\ - *((T)+3)=(char) ((uchar *) &V)[4];\ - *((T)+4)=(char) ((uchar *) &V)[3];\ - *((T)+5)=(char) ((uchar *) &V)[2];\ - *((T)+6)=(char) ((uchar *) &V)[1];\ - *((T)+7)=(char) ((uchar *) &V)[0]; } while(0) - -#define float8get(V,M) do { double def_temp;\ - ((uchar*) &def_temp)[0]=(M)[7];\ - ((uchar*) &def_temp)[1]=(M)[6];\ - ((uchar*) &def_temp)[2]=(M)[5];\ - ((uchar*) &def_temp)[3]=(M)[4];\ - ((uchar*) &def_temp)[4]=(M)[3];\ - ((uchar*) &def_temp)[5]=(M)[2];\ - ((uchar*) &def_temp)[6]=(M)[1];\ - ((uchar*) &def_temp)[7]=(M)[0];\ - (V) = def_temp; } while(0) -#else -#define float4get(V,M) memcpy(&V, (M), sizeof(float)) -#define float4store(V,M) memcpy(V, (&M), sizeof(float)) - -#if defined(__FLOAT_WORD_ORDER) && (__FLOAT_WORD_ORDER == __BIG_ENDIAN) -#define doublestore(T,V) do { *(((char*)T)+0)=(char) ((uchar *) &V)[4];\ - *(((char*)T)+1)=(char) ((uchar *) &V)[5];\ - *(((char*)T)+2)=(char) ((uchar *) &V)[6];\ - *(((char*)T)+3)=(char) ((uchar *) &V)[7];\ - *(((char*)T)+4)=(char) ((uchar *) &V)[0];\ - *(((char*)T)+5)=(char) ((uchar *) &V)[1];\ - *(((char*)T)+6)=(char) ((uchar *) &V)[2];\ - *(((char*)T)+7)=(char) ((uchar *) &V)[3]; }\ - while(0) -#define doubleget(V,M) do { double def_temp;\ - ((uchar*) &def_temp)[0]=(M)[4];\ - ((uchar*) &def_temp)[1]=(M)[5];\ - ((uchar*) &def_temp)[2]=(M)[6];\ - ((uchar*) &def_temp)[3]=(M)[7];\ - ((uchar*) &def_temp)[4]=(M)[0];\ - ((uchar*) &def_temp)[5]=(M)[1];\ - ((uchar*) &def_temp)[6]=(M)[2];\ - ((uchar*) &def_temp)[7]=(M)[3];\ - (V) = def_temp; } while(0) -#endif /* __FLOAT_WORD_ORDER */ - -#define float8get(V,M) doubleget((V),(M)) -#define float8store(V,M) doublestore((V),(M)) -#endif /* WORDS_BIGENDIAN */ - -#endif /* __i386__ OR _WIN32 */ - -/* - Macro for reading 32-bit integer from network byte order (big-endian) - from unaligned memory location. -*/ -#define int4net(A) (int32) (((uint32) ((uchar) (A)[3])) |\ - (((uint32) ((uchar) (A)[2])) << 8) |\ - (((uint32) ((uchar) (A)[1])) << 16) |\ - (((uint32) ((uchar) (A)[0])) << 24)) -/* - Define-funktions for reading and storing in machine format from/to - short/long to/from some place in memory V should be a (not - register) variable, M is a pointer to byte -*/ - -#ifdef WORDS_BIGENDIAN - -#define ushortget(V,M) do { V = (uint16) (((uint16) ((uchar) (M)[1]))+\ - ((uint16) ((uint16) (M)[0]) << 8)); } while(0) -#define shortget(V,M) do { V = (short) (((short) ((uchar) (M)[1]))+\ - ((short) ((short) (M)[0]) << 8)); } while(0) -#define longget(V,M) do { int32 def_temp;\ - ((uchar*) &def_temp)[0]=(M)[0];\ - ((uchar*) &def_temp)[1]=(M)[1];\ - ((uchar*) &def_temp)[2]=(M)[2];\ - ((uchar*) &def_temp)[3]=(M)[3];\ - (V)=def_temp; } while(0) -#define ulongget(V,M) do { uint32 def_temp;\ - ((uchar*) &def_temp)[0]=(M)[0];\ - ((uchar*) &def_temp)[1]=(M)[1];\ - ((uchar*) &def_temp)[2]=(M)[2];\ - ((uchar*) &def_temp)[3]=(M)[3];\ - (V)=def_temp; } while(0) -#define shortstore(T,A) do { uint def_temp=(uint) (A) ;\ - *(((char*)T)+1)=(char)(def_temp); \ - *(((char*)T)+0)=(char)(def_temp >> 8); } while(0) -#define longstore(T,A) do { *(((char*)T)+3)=((A));\ - *(((char*)T)+2)=(((A) >> 8));\ - *(((char*)T)+1)=(((A) >> 16));\ - *(((char*)T)+0)=(((A) >> 24)); } while(0) - -#define floatget(V,M) memcpy(&V, (M), sizeof(float)) -#define floatstore(T,V) memcpy((T), (void*) (&V), sizeof(float)) -#define doubleget(V,M) memcpy(&V, (M), sizeof(double)) -#define doublestore(T,V) memcpy((T), (void *) &V, sizeof(double)) -#define longlongget(V,M) memcpy(&V, (M), sizeof(ulonglong)) -#define longlongstore(T,V) memcpy((T), &V, sizeof(ulonglong)) - -#else - -#define ushortget(V,M) do { V = uint2korr(M); } while(0) -#define shortget(V,M) do { V = sint2korr(M); } while(0) -#define longget(V,M) do { V = sint4korr(M); } while(0) -#define ulongget(V,M) do { V = uint4korr(M); } while(0) -#define shortstore(T,V) int2store(T,V) -#define longstore(T,V) int4store(T,V) -#ifndef floatstore -#define floatstore(T,V) memcpy((T), (void *) (&V), sizeof(float)) -#define floatget(V,M) memcpy(&V, (M), sizeof(float)) -#endif -#ifndef doubleget -#define doubleget(V,M) memcpy(&V, (M), sizeof(double)) -#define doublestore(T,V) memcpy((T), (void *) &V, sizeof(double)) -#endif /* doubleget */ -#define longlongget(V,M) memcpy(&V, (M), sizeof(ulonglong)) -#define longlongstore(T,V) memcpy((T), &V, sizeof(ulonglong)) - -#endif /* WORDS_BIGENDIAN */ - -#ifdef HAVE_CHARSET_utf8 -#define MYSQL_UNIVERSAL_CLIENT_CHARSET "utf8" -#else -#define MYSQL_UNIVERSAL_CLIENT_CHARSET MYSQL_DEFAULT_CHARSET_NAME -#endif - -#if defined(EMBEDDED_LIBRARY) && !defined(HAVE_EMBEDDED_PRIVILEGE_CONTROL) -#define NO_EMBEDDED_ACCESS_CHECKS -#endif - -#if defined(_WIN32) -#define dlsym(lib, name) (void*)GetProcAddress((HMODULE)lib, name) -#define dlopen(libname, unused) LoadLibraryEx(libname, NULL, 0) -#define dlclose(lib) FreeLibrary((HMODULE)lib) -#ifndef HAVE_DLOPEN -#define HAVE_DLOPEN -#endif -#endif - -#ifdef HAVE_DLOPEN -#if defined(HAVE_DLFCN_H) -#include <dlfcn.h> -#endif -#endif - -#ifndef HAVE_DLERROR -#ifdef _WIN32 -#define dlerror() "" -#else -#define dlerror() "No support for dynamic loading (static build?)" -#endif -#endif - - -/* - * Include standard definitions of operator new and delete. - */ -#ifdef __cplusplus -#include <new> -#endif - -/* Length of decimal number represented by INT32. */ -#define MY_INT32_NUM_DECIMAL_DIGITS 11 - -/* Length of decimal number represented by INT64. */ -#define MY_INT64_NUM_DECIMAL_DIGITS 21 - -/* Define some useful general macros (should be done after all headers). */ -#if !defined(max) -#define max(a, b) ((a) > (b) ? (a) : (b)) -#define min(a, b) ((a) < (b) ? (a) : (b)) -#endif - -/* - Only Linux is known to need an explicit sync of the directory to make sure a - file creation/deletion/renaming in(from,to) this directory durable. -*/ -#ifdef TARGET_OS_LINUX -#define NEED_EXPLICIT_SYNC_DIR 1 -#endif - -#if !defined(__cplusplus) && !defined(bool) -#define bool In_C_you_should_use_my_bool_instead() -#endif - -/* Provide __func__ macro definition for platforms that miss it. */ -#if __STDC_VERSION__ < 199901L -# if __GNUC__ >= 2 -# define __func__ __FUNCTION__ -# else -# define __func__ "<unknown>" -# endif -#elif defined(_MSC_VER) -# if _MSC_VER < 1300 -# define __func__ "<unknown>" -# else -# define __func__ __FUNCTION__ -# endif -#elif defined(__BORLANDC__) -# define __func__ __FUNC__ -#else -# define __func__ "<unknown>" -#endif - -#ifndef HAVE_RINT -/** - All integers up to this number can be represented exactly as double precision - values (DBL_MANT_DIG == 53 for IEEE 754 hardware). -*/ -#define MAX_EXACT_INTEGER ((1LL << DBL_MANT_DIG) - 1) - -/** - rint(3) implementation for platforms that do not have it. - Always rounds to the nearest integer with ties being rounded to the nearest - even integer to mimic glibc's rint() behavior in the "round-to-nearest" - FPU mode. Hardware-specific optimizations are possible (frndint on x86). - Unlike this implementation, hardware will also honor the FPU rounding mode. -*/ - -static inline double rint(double x) -{ - double f, i; - f = modf(x, &i); - /* - All doubles with absolute values > MAX_EXACT_INTEGER are even anyway, - no need to check it. - */ - if (x > 0.0) - i += (double) ((f > 0.5) || (f == 0.5 && - i <= (double) MAX_EXACT_INTEGER && - (longlong) i % 2)); - else - i -= (double) ((f < -0.5) || (f == -0.5 && - i >= (double) -MAX_EXACT_INTEGER && - (longlong) i % 2)); - return i; -} -#endif /* HAVE_RINT */ - -/* - MYSQL_PLUGIN_IMPORT macro is used to export mysqld data - (i.e variables) for usage in storage engine loadable plugins. - Outside of Windows, it is dummy. -*/ -#ifndef MYSQL_PLUGIN_IMPORT -#if (defined(_WIN32) && defined(MYSQL_DYNAMIC_PLUGIN)) -#define MYSQL_PLUGIN_IMPORT __declspec(dllimport) -#else -#define MYSQL_PLUGIN_IMPORT -#endif -#endif - -/* Defines that are unique to the embedded version of MySQL */ - -#ifdef EMBEDDED_LIBRARY - -/* 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 */ - -#undef HAVE_OPENSSL -#undef HAVE_SMEM /* No shared memory */ -#undef HAVE_NDBCLUSTER_DB /* No NDB cluster */ - -#endif /* EMBEDDED_LIBRARY */ - -#endif /* my_global_h */ diff --git a/dep/mysqllite/include/my_list.h b/dep/mysqllite/include/my_list.h deleted file mode 100644 index ff086e1725b..00000000000 --- a/dep/mysqllite/include/my_list.h +++ /dev/null @@ -1,45 +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 */ - -#ifndef _list_h_ -#define _list_h_ - -#ifdef __cplusplus -extern "C" { -#endif - -typedef struct st_list { - struct st_list *prev,*next; - void *data; -} LIST; - -typedef int (*list_walk_action)(void *,void *); - -extern LIST *list_add(LIST *root,LIST *element); -extern LIST *list_delete(LIST *root,LIST *element); -extern LIST *list_cons(void *data,LIST *root); -extern LIST *list_reverse(LIST *root); -extern void list_free(LIST *root,unsigned int free_data); -extern unsigned int list_length(LIST *); -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(old); } - -#ifdef __cplusplus -} -#endif -#endif diff --git a/dep/mysqllite/include/my_net.h b/dep/mysqllite/include/my_net.h deleted file mode 100644 index 5762f5da06e..00000000000 --- a/dep/mysqllite/include/my_net.h +++ /dev/null @@ -1,110 +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 */ - -/* - This file is also used to make handling of sockets and ioctl() - portable accross systems. - -*/ - -#ifndef _my_net_h -#define _my_net_h - -#include "my_global.h" /* C_MODE_START, C_MODE_END */ - -C_MODE_START - -#include <errno.h> -#ifdef HAVE_SYS_SOCKET_H -#include <sys/socket.h> -#endif -#ifdef HAVE_NETINET_IN_H -#include <netinet/in.h> -#endif -#ifdef HAVE_ARPA_INET_H -#include <arpa/inet.h> -#endif -#ifdef HAVE_POLL -#include <sys/poll.h> -#endif -#ifdef HAVE_SYS_IOCTL_H -#include <sys/ioctl.h> -#endif - -#if !defined(__WIN__) && !defined(HAVE_BROKEN_NETINET_INCLUDES) -#include <netinet/in_systm.h> -#include <netinet/in.h> -#include <netinet/ip.h> -#if !defined(alpha_linux_port) -#include <netinet/tcp.h> -#endif -#endif - -#if defined(__WIN__) -#define O_NONBLOCK 1 /* For emulation of fcntl() */ - -/* - SHUT_RDWR is called SD_BOTH in windows and - is defined to 2 in winsock2.h - #define SD_BOTH 0x02 -*/ -#define SHUT_RDWR 0x02 - -#endif - -/* - 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 & FreeBSD64bit - & Solaris64bit, in_addr_t is equivalent to uint32. And on Linux32bit too. -*/ -#ifndef HAVE_IN_ADDR_T -#define in_addr_t uint32 -#endif - -/* - Handling of gethostbyname_r() -*/ - -#if !defined(HAVE_GETHOSTBYNAME_R) -struct hostent *my_gethostbyname_r(const char *name, - struct hostent *result, char *buffer, - int buflen, int *h_errnop); -void my_gethostbyname_r_free(); -#elif defined(HAVE_PTHREAD_ATTR_CREATE) || defined(_AIX) || defined(HAVE_GETHOSTBYNAME_R_GLIBC2_STYLE) -struct hostent *my_gethostbyname_r(const char *name, - struct hostent *result, char *buffer, - int buflen, int *h_errnop); -#define my_gethostbyname_r_free() -#if !defined(HAVE_GETHOSTBYNAME_R_GLIBC2_STYLE) && !defined(HPUX10) -#define GETHOSTBYNAME_BUFF_SIZE sizeof(struct hostent_data) -#endif /* !defined(HAVE_GETHOSTBYNAME_R_GLIBC2_STYLE) */ - -#elif defined(HAVE_GETHOSTBYNAME_R_RETURN_INT) -#define GETHOSTBYNAME_BUFF_SIZE sizeof(struct hostent_data) -struct hostent *my_gethostbyname_r(const char *name, - struct hostent *result, char *buffer, - int buflen, int *h_errnop); -#define my_gethostbyname_r_free() -#else -#define my_gethostbyname_r(A,B,C,D,E) gethostbyname_r((A),(B),(C),(D),(E)) -#define my_gethostbyname_r_free() -#endif /* !defined(HAVE_GETHOSTBYNAME_R) */ - -#ifndef GETHOSTBYNAME_BUFF_SIZE -#define GETHOSTBYNAME_BUFF_SIZE 2048 -#endif - -C_MODE_END -#endif diff --git a/dep/mysqllite/include/my_pthread.h b/dep/mysqllite/include/my_pthread.h deleted file mode 100644 index f1636cad136..00000000000 --- a/dep/mysqllite/include/my_pthread.h +++ /dev/null @@ -1,943 +0,0 @@ -/* Copyright (C) 2000-2008 MySQL AB, 2008-2009 Sun Microsystems, Inc. - - 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 */ - -/* Defines to make different thread packages compatible */ - -#ifndef _my_pthread_h -#define _my_pthread_h - -#include "my_global.h" /* myf */ - -#ifndef ETIME -#define ETIME ETIMEDOUT /* For FreeBSD */ -#endif - -#ifdef __cplusplus -#define EXTERNC extern "C" -extern "C" { -#else -#define EXTERNC -#endif /* __cplusplus */ - -#if defined(__WIN__) -typedef CRITICAL_SECTION pthread_mutex_t; -typedef DWORD pthread_t; -typedef struct thread_attr { - DWORD dwStackSize ; - DWORD dwCreatingFlag ; -} pthread_attr_t ; - -typedef struct { int dummy; } pthread_condattr_t; - -/* Implementation of posix conditions */ - -typedef struct st_pthread_link { - DWORD thread_id; - struct st_pthread_link *next; -} pthread_link; - -/** - Implementation of Windows condition variables. - We use native conditions on Vista and later, and fallback to own - implementation on earlier OS version. -*/ -typedef union -{ - /* Native condition (used on Vista and later) */ - CONDITION_VARIABLE native_cond; - - /* 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; - - -typedef int pthread_mutexattr_t; -#define pthread_self() GetCurrentThreadId() -#define pthread_handler_t EXTERNC void * __cdecl -typedef void * (__cdecl *pthread_handler)(void *); - -typedef volatile LONG my_pthread_once_t; -#define MY_PTHREAD_ONCE_INIT 0 -#define MY_PTHREAD_ONCE_INPROGRESS 1 -#define MY_PTHREAD_ONCE_DONE 2 - -/* - Struct and macros to be used in combination with the - windows implementation of pthread_cond_timedwait -*/ - -/* - Declare a union to make sure FILETIME is properly aligned - so it can be used directly as a 64 bit value. The value - stored is in 100ns units. - */ - union ft64 { - FILETIME ft; - __int64 i64; - }; -struct timespec { - union ft64 tv; - /* The max timeout value in millisecond for pthread_cond_timedwait */ - long max_timeout_msec; -}; -#define set_timespec(ABSTIME,SEC) { \ - GetSystemTimeAsFileTime(&((ABSTIME).tv.ft)); \ - (ABSTIME).tv.i64+= (__int64)(SEC)*10000000; \ - (ABSTIME).max_timeout_msec= (long)((SEC)*1000); \ -} -#define set_timespec_nsec(ABSTIME,NSEC) { \ - GetSystemTimeAsFileTime(&((ABSTIME).tv.ft)); \ - (ABSTIME).tv.i64+= (__int64)(NSEC)/100; \ - (ABSTIME).max_timeout_msec= (long)((NSEC)/1000000); \ -} - -/** - Compare two timespec structs. - - @retval 1 If TS1 ends after TS2. - - @retval 0 If TS1 is equal to TS2. - - @retval -1 If TS1 ends before TS2. -*/ -#define cmp_timespec(TS1, TS2) \ - ((TS1.tv.i64 > TS2.tv.i64) ? 1 : \ - ((TS1.tv.i64 < TS2.tv.i64) ? -1 : 0)) - - -int win_pthread_mutex_trylock(pthread_mutex_t *mutex); -int pthread_create(pthread_t *, const pthread_attr_t *, pthread_handler, void *); -int pthread_cond_init(pthread_cond_t *cond, const pthread_condattr_t *attr); -int pthread_cond_wait(pthread_cond_t *cond, pthread_mutex_t *mutex); -int pthread_cond_timedwait(pthread_cond_t *cond, pthread_mutex_t *mutex, - struct timespec *abstime); -int pthread_cond_signal(pthread_cond_t *cond); -int pthread_cond_broadcast(pthread_cond_t *cond); -int pthread_cond_destroy(pthread_cond_t *cond); -int pthread_attr_init(pthread_attr_t *connect_att); -int pthread_attr_setstacksize(pthread_attr_t *connect_att,DWORD stack); -int pthread_attr_destroy(pthread_attr_t *connect_att); -int my_pthread_once(my_pthread_once_t *once_control,void (*init_routine)(void)); -struct tm *localtime_r(const time_t *timep,struct tm *tmp); -struct tm *gmtime_r(const time_t *timep,struct tm *tmp); - -void pthread_exit(void *a); -int pthread_join(pthread_t thread, void **value_ptr); -int pthread_cancel(pthread_t thread); - -#ifndef ETIMEDOUT -#define ETIMEDOUT 145 /* Win32 doesn't have this */ -#endif -#define HAVE_LOCALTIME_R 1 -#define _REENTRANT 1 -#define HAVE_PTHREAD_ATTR_SETSTACKSIZE 1 - - -#undef SAFE_MUTEX /* This will cause conflicts */ -#define pthread_key(T,V) DWORD V -#define pthread_key_create(A,B) ((*A=TlsAlloc())==0xFFFFFFFF) -#define pthread_key_delete(A) TlsFree(A) -#define my_pthread_setspecific_ptr(T,V) (!TlsSetValue((T),(V))) -#define pthread_setspecific(A,B) (!TlsSetValue((A),(B))) -#define pthread_getspecific(A) (TlsGetValue(A)) -#define my_pthread_getspecific(T,A) ((T) TlsGetValue(A)) -#define my_pthread_getspecific_ptr(T,V) ((T) TlsGetValue(V)) - -#define pthread_equal(A,B) ((A) == (B)) -#define pthread_mutex_init(A,B) (InitializeCriticalSection(A),0) -#define pthread_mutex_lock(A) (EnterCriticalSection(A),0) -#define pthread_mutex_trylock(A) win_pthread_mutex_trylock((A)) -#define pthread_mutex_unlock(A) (LeaveCriticalSection(A), 0) -#define pthread_mutex_destroy(A) (DeleteCriticalSection(A), 0) -#define pthread_kill(A,B) pthread_dummy((A) ? 0 : ESRCH) - - -/* Dummy defines for easier code */ -#define pthread_attr_setdetachstate(A,B) pthread_dummy(0) -#define pthread_attr_setscope(A,B) -#define pthread_detach_this_thread() -#define pthread_condattr_init(A) -#define pthread_condattr_destroy(A) -#define pthread_yield() SwitchToThread() -#define my_sigset(A,B) signal(A,B) - -#else /* Normal threads */ - -#ifdef HAVE_rts_threads -#define sigwait org_sigwait -#include <signal.h> -#undef sigwait -#endif -#include <pthread.h> -#ifndef _REENTRANT -#define _REENTRANT -#endif -#ifdef HAVE_THR_SETCONCURRENCY -#include <thread.h> /* Probably solaris */ -#endif -#ifdef HAVE_SCHED_H -#include <sched.h> -#endif -#ifdef HAVE_SYNCH_H -#include <synch.h> -#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)) -#define pthread_detach_this_thread() -#define pthread_handler_t EXTERNC void * -typedef void *(* pthread_handler)(void *); - -#define my_pthread_once_t pthread_once_t -#if defined(PTHREAD_ONCE_INITIALIZER) -#define MY_PTHREAD_ONCE_INIT PTHREAD_ONCE_INITIALIZER -#else -#define MY_PTHREAD_ONCE_INIT PTHREAD_ONCE_INIT -#endif -#define my_pthread_once(C,F) pthread_once(C,F) - -/* Test first for RTS or FSU threads */ - -#if defined(PTHREAD_SCOPE_GLOBAL) && !defined(PTHREAD_SCOPE_SYSTEM) -#define HAVE_rts_threads -extern int my_pthread_create_detached; -#define pthread_sigmask(A,B,C) sigprocmask((A),(B),(C)) -#define PTHREAD_CREATE_DETACHED &my_pthread_create_detached -#define PTHREAD_SCOPE_SYSTEM PTHREAD_SCOPE_GLOBAL -#define PTHREAD_SCOPE_PROCESS PTHREAD_SCOPE_LOCAL -#define USE_ALARM_THREAD -#endif /* defined(PTHREAD_SCOPE_GLOBAL) && !defined(PTHREAD_SCOPE_SYSTEM) */ - -#if defined(_BSDI_VERSION) && _BSDI_VERSION < 199910 -int sigwait(sigset_t *set, int *sig); -#endif - -#ifndef HAVE_NONPOSIX_SIGWAIT -#define my_sigwait(A,B) sigwait((A),(B)) -#else -int my_sigwait(const sigset_t *set,int *sig); -#endif - -#ifdef HAVE_NONPOSIX_PTHREAD_MUTEX_INIT -#ifndef SAFE_MUTEX -#define pthread_mutex_init(a,b) my_pthread_mutex_init((a),(b)) -extern int my_pthread_mutex_init(pthread_mutex_t *mp, - const pthread_mutexattr_t *attr); -#endif /* SAFE_MUTEX */ -#define pthread_cond_init(a,b) my_pthread_cond_init((a),(b)) -extern int my_pthread_cond_init(pthread_cond_t *mp, - const pthread_condattr_t *attr); -#endif /* HAVE_NONPOSIX_PTHREAD_MUTEX_INIT */ - -#if defined(HAVE_SIGTHREADMASK) && !defined(HAVE_PTHREAD_SIGMASK) -#define pthread_sigmask(A,B,C) sigthreadmask((A),(B),(C)) -#endif - -#if !defined(HAVE_SIGWAIT) && !defined(HAVE_rts_threads) && !defined(sigwait) && !defined(alpha_linux_port) && !defined(HAVE_NONPOSIX_SIGWAIT) && !defined(HAVE_DEC_3_2_THREADS) && !defined(_AIX) -int sigwait(sigset_t *setp, int *sigp); /* Use our implemention */ -#endif - - -/* - 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, such - 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. -*/ -#if defined(HAVE_SIGACTION) && !defined(my_sigset) -#define my_sigset(A,B) do { struct sigaction l_s; sigset_t l_set; \ - DBUG_ASSERT((A) != 0); \ - sigemptyset(&l_set); \ - l_s.sa_handler = (B); \ - l_s.sa_mask = l_set; \ - l_s.sa_flags = 0; \ - sigaction((A), &l_s, NULL); \ - } while (0) -#elif defined(HAVE_SIGSET) && !defined(my_sigset) -#define my_sigset(A,B) sigset((A),(B)) -#elif !defined(my_sigset) -#define my_sigset(A,B) signal((A),(B)) -#endif - -#if !defined(HAVE_PTHREAD_ATTR_SETSCOPE) || defined(HAVE_DEC_3_2_THREADS) -#define pthread_attr_setscope(A,B) -#undef HAVE_GETHOSTBYADDR_R /* No definition */ -#endif - -#if defined(HAVE_BROKEN_PTHREAD_COND_TIMEDWAIT) && !defined(SAFE_MUTEX) -extern int my_pthread_cond_timedwait(pthread_cond_t *cond, - pthread_mutex_t *mutex, - struct timespec *abstime); -#define pthread_cond_timedwait(A,B,C) my_pthread_cond_timedwait((A),(B),(C)) -#endif - -#if !defined( HAVE_NONPOSIX_PTHREAD_GETSPECIFIC) -#define my_pthread_getspecific(A,B) ((A) pthread_getspecific(B)) -#else -#define my_pthread_getspecific(A,B) ((A) my_pthread_getspecific_imp(B)) -void *my_pthread_getspecific_imp(pthread_key_t key); -#endif - -#ifndef HAVE_LOCALTIME_R -struct tm *localtime_r(const time_t *clock, struct tm *res); -#endif - -#ifndef HAVE_GMTIME_R -struct tm *gmtime_r(const time_t *clock, struct tm *res); -#endif - -#ifdef HAVE_PTHREAD_CONDATTR_CREATE -/* DCE threads on HPUX 10.20 */ -#define pthread_condattr_init pthread_condattr_create -#define pthread_condattr_destroy pthread_condattr_delete -#endif - -/* FSU THREADS */ -#if !defined(HAVE_PTHREAD_KEY_DELETE) && !defined(pthread_key_delete) -#define pthread_key_delete(A) pthread_dummy(0) -#endif - -#ifdef HAVE_CTHREADS_WRAPPER /* For MacOSX */ -#define pthread_cond_destroy(A) pthread_dummy(0) -#define pthread_mutex_destroy(A) pthread_dummy(0) -#define pthread_attr_delete(A) pthread_dummy(0) -#define pthread_condattr_delete(A) pthread_dummy(0) -#define pthread_attr_setstacksize(A,B) pthread_dummy(0) -#define pthread_equal(A,B) ((A) == (B)) -#define pthread_cond_timedwait(a,b,c) pthread_cond_wait((a),(b)) -#define pthread_attr_init(A) pthread_attr_create(A) -#define pthread_attr_destroy(A) pthread_attr_delete(A) -#define pthread_attr_setdetachstate(A,B) pthread_dummy(0) -#define pthread_create(A,B,C,D) pthread_create((A),*(B),(C),(D)) -#define pthread_sigmask(A,B,C) sigprocmask((A),(B),(C)) -#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); } -#endif - -#ifdef HAVE_DARWIN5_THREADS -#define pthread_sigmask(A,B,C) sigprocmask((A),(B),(C)) -#define pthread_kill(A,B) pthread_dummy((A) ? 0 : ESRCH) -#define pthread_condattr_init(A) pthread_dummy(0) -#define pthread_condattr_destroy(A) pthread_dummy(0) -#undef pthread_detach_this_thread -#define pthread_detach_this_thread() { pthread_t tmp=pthread_self() ; pthread_detach(tmp); } -#endif - -#if ((defined(HAVE_PTHREAD_ATTR_CREATE) && !defined(HAVE_SIGWAIT)) || defined(HAVE_DEC_3_2_THREADS)) && !defined(HAVE_CTHREADS_WRAPPER) -/* This is set on AIX_3_2 and Siemens unix (and DEC OSF/1 3.2 too) */ -#define pthread_key_create(A,B) \ - pthread_keycreate(A,(B) ?\ - (pthread_destructor_t) (B) :\ - (pthread_destructor_t) pthread_dummy) -#define pthread_attr_init(A) pthread_attr_create(A) -#define pthread_attr_destroy(A) pthread_attr_delete(A) -#define pthread_attr_setdetachstate(A,B) pthread_dummy(0) -#define pthread_create(A,B,C,D) pthread_create((A),*(B),(C),(D)) -#ifndef pthread_sigmask -#define pthread_sigmask(A,B,C) sigprocmask((A),(B),(C)) -#endif -#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); } -#else /* HAVE_PTHREAD_ATTR_CREATE && !HAVE_SIGWAIT */ -#define HAVE_PTHREAD_KILL -#endif - -#endif /* defined(__WIN__) */ - -#if defined(HPUX10) && !defined(DONT_REMAP_PTHREAD_FUNCTIONS) -#undef pthread_cond_timedwait -#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, - struct timespec *abstime); -#endif - -#if defined(HPUX10) -#define pthread_attr_getstacksize(A,B) my_pthread_attr_getstacksize(A,B) -void my_pthread_attr_getstacksize(pthread_attr_t *attrib, size_t *size); -#endif - -#if defined(HAVE_POSIX1003_4a_MUTEX) && !defined(DONT_REMAP_PTHREAD_FUNCTIONS) -#undef pthread_mutex_trylock -#define pthread_mutex_trylock(a) my_pthread_mutex_trylock((a)) -int my_pthread_mutex_trylock(pthread_mutex_t *mutex); -#endif - -#if !defined(HAVE_PTHREAD_YIELD_ONE_ARG) && !defined(HAVE_PTHREAD_YIELD_ZERO_ARG) -/* no pthread_yield() available */ -#ifdef HAVE_SCHED_YIELD -#define pthread_yield() sched_yield() -#elif defined(HAVE_PTHREAD_YIELD_NP) /* can be Mac OS X */ -#define pthread_yield() pthread_yield_np() -#elif defined(HAVE_THR_YIELD) -#define pthread_yield() thr_yield() -#endif -#endif - -/* - The defines set_timespec and set_timespec_nsec should be used - for calculating an absolute time at which - pthread_cond_timedwait should timeout -*/ -#ifdef HAVE_TIMESPEC_TS_SEC -#ifndef set_timespec -#define set_timespec(ABSTIME,SEC) \ -{ \ - (ABSTIME).ts_sec=time(0) + (time_t) (SEC); \ - (ABSTIME).ts_nsec=0; \ -} -#endif /* !set_timespec */ -#ifndef set_timespec_nsec -#define set_timespec_nsec(ABSTIME,NSEC) \ -{ \ - ulonglong now= my_getsystime() + (NSEC/100); \ - (ABSTIME).ts_sec= (now / ULL(10000000)); \ - (ABSTIME).ts_nsec= (now % ULL(10000000) * 100 + ((NSEC) % 100)); \ -} -#endif /* !set_timespec_nsec */ -#else -#ifndef set_timespec -#define set_timespec(ABSTIME,SEC) \ -{\ - struct timeval tv;\ - gettimeofday(&tv,0);\ - (ABSTIME).tv_sec=tv.tv_sec+(time_t) (SEC);\ - (ABSTIME).tv_nsec=tv.tv_usec*1000;\ -} -#endif /* !set_timespec */ -#ifndef set_timespec_nsec -#define set_timespec_nsec(ABSTIME,NSEC) \ -{\ - ulonglong now= my_getsystime() + (NSEC/100); \ - (ABSTIME).tv_sec= (time_t) (now / ULL(10000000)); \ - (ABSTIME).tv_nsec= (long) (now % ULL(10000000) * 100 + ((NSEC) % 100)); \ -} -#endif /* !set_timespec_nsec */ -#endif /* HAVE_TIMESPEC_TS_SEC */ - -/** - Compare two timespec structs. - - @retval 1 If TS1 ends after TS2. - - @retval 0 If TS1 is equal to TS2. - - @retval -1 If TS1 ends before TS2. -*/ -#ifdef HAVE_TIMESPEC_TS_SEC -#ifndef cmp_timespec -#define cmp_timespec(TS1, TS2) \ - ((TS1.ts_sec > TS2.ts_sec || \ - (TS1.ts_sec == TS2.ts_sec && TS1.ts_nsec > TS2.ts_nsec)) ? 1 : \ - ((TS1.ts_sec < TS2.ts_sec || \ - (TS1.ts_sec == TS2.ts_sec && TS1.ts_nsec < TS2.ts_nsec)) ? -1 : 0)) -#endif /* !cmp_timespec */ -#else -#ifndef cmp_timespec -#define cmp_timespec(TS1, TS2) \ - ((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_sec == TS2.tv_sec && TS1.tv_nsec < TS2.tv_nsec)) ? -1 : 0)) -#endif /* !cmp_timespec */ -#endif /* HAVE_TIMESPEC_TS_SEC */ - - /* safe_mutex adds checking to mutex for easier debugging */ - -typedef struct st_safe_mutex_t -{ - pthread_mutex_t global,mutex; - const char *file; - uint line,count; - pthread_t thread; -#ifdef SAFE_MUTEX_DETECT_DESTROY - struct st_safe_mutex_info_t *info; /* to track destroying of mutexes */ -#endif -} safe_mutex_t; - -#ifdef SAFE_MUTEX_DETECT_DESTROY -/* - Used to track the destroying of mutexes. This needs to be a seperate - structure because the safe_mutex_t structure could be freed before - the mutexes are destroyed. -*/ - -typedef struct st_safe_mutex_info_t -{ - struct st_safe_mutex_info_t *next; - struct st_safe_mutex_info_t *prev; - const char *init_file; - uint32 init_line; -} safe_mutex_info_t; -#endif /* SAFE_MUTEX_DETECT_DESTROY */ - -int safe_mutex_init(safe_mutex_t *mp, const pthread_mutexattr_t *attr, - const char *file, uint line); -int safe_mutex_lock(safe_mutex_t *mp, my_bool try_lock, 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_cond_wait(pthread_cond_t *cond, safe_mutex_t *mp,const char *file, - uint line); -int safe_cond_timedwait(pthread_cond_t *cond, safe_mutex_t *mp, - const struct timespec *abstime, - const char *file, uint line); -void safe_mutex_global_init(void); -void safe_mutex_end(FILE *file); - - /* Wrappers if safe mutex is actually used */ -#ifdef SAFE_MUTEX -#undef pthread_mutex_init -#undef pthread_mutex_lock -#undef pthread_mutex_unlock -#undef pthread_mutex_destroy -#undef pthread_mutex_wait -#undef pthread_mutex_timedwait -#undef pthread_mutex_t -#undef pthread_cond_wait -#undef pthread_cond_timedwait -#undef pthread_mutex_trylock -#define pthread_mutex_init(A,B) safe_mutex_init((A),(B),__FILE__,__LINE__) -#define pthread_mutex_lock(A) safe_mutex_lock((A), FALSE, __FILE__, __LINE__) -#define pthread_mutex_unlock(A) safe_mutex_unlock((A),__FILE__,__LINE__) -#define pthread_mutex_destroy(A) safe_mutex_destroy((A),__FILE__,__LINE__) -#define pthread_cond_wait(A,B) safe_cond_wait((A),(B),__FILE__,__LINE__) -#define pthread_cond_timedwait(A,B,C) safe_cond_timedwait((A),(B),(C),__FILE__,__LINE__) -#define pthread_mutex_trylock(A) safe_mutex_lock((A), TRUE, __FILE__, __LINE__) -#define pthread_mutex_t safe_mutex_t -#define safe_mutex_assert_owner(mp) \ - DBUG_ASSERT((mp)->count > 0 && \ - pthread_equal(pthread_self(), (mp)->thread)) -#define safe_mutex_assert_not_owner(mp) \ - DBUG_ASSERT(! (mp)->count || \ - ! pthread_equal(pthread_self(), (mp)->thread)) -#else -#define safe_mutex_assert_owner(mp) -#define safe_mutex_assert_not_owner(mp) -#endif /* SAFE_MUTEX */ - -#if defined(MY_PTHREAD_FASTMUTEX) && !defined(SAFE_MUTEX) -typedef struct st_my_pthread_fastmutex_t -{ - pthread_mutex_t mutex; - uint spins; - uint rng_state; -} my_pthread_fastmutex_t; -void fastmutex_global_init(void); - -int my_pthread_fastmutex_init(my_pthread_fastmutex_t *mp, - const pthread_mutexattr_t *attr); -int my_pthread_fastmutex_lock(my_pthread_fastmutex_t *mp); - -#undef pthread_mutex_init -#undef pthread_mutex_lock -#undef pthread_mutex_unlock -#undef pthread_mutex_destroy -#undef pthread_mutex_wait -#undef pthread_mutex_timedwait -#undef pthread_mutex_t -#undef pthread_cond_wait -#undef pthread_cond_timedwait -#undef pthread_mutex_trylock -#define pthread_mutex_init(A,B) my_pthread_fastmutex_init((A),(B)) -#define pthread_mutex_lock(A) my_pthread_fastmutex_lock(A) -#define pthread_mutex_unlock(A) pthread_mutex_unlock(&(A)->mutex) -#define pthread_mutex_destroy(A) pthread_mutex_destroy(&(A)->mutex) -#define pthread_cond_wait(A,B) pthread_cond_wait((A),&(B)->mutex) -#define pthread_cond_timedwait(A,B,C) pthread_cond_timedwait((A),&(B)->mutex,(C)) -#define pthread_mutex_trylock(A) pthread_mutex_trylock(&(A)->mutex) -#define pthread_mutex_t my_pthread_fastmutex_t -#endif /* defined(MY_PTHREAD_FASTMUTEX) && !defined(SAFE_MUTEX) */ - - /* READ-WRITE thread locking */ - -#ifdef HAVE_BROKEN_RWLOCK /* For OpenUnix */ -#undef HAVE_PTHREAD_RWLOCK_RDLOCK -#undef HAVE_RWLOCK_INIT -#undef HAVE_RWLOCK_T -#endif - -#if defined(USE_MUTEX_INSTEAD_OF_RW_LOCKS) -/* use these defs for simple mutex locking */ -#define rw_lock_t pthread_mutex_t -#define my_rwlock_init(A,B) pthread_mutex_init((A),(B)) -#define rw_rdlock(A) pthread_mutex_lock((A)) -#define rw_wrlock(A) pthread_mutex_lock((A)) -#define rw_tryrdlock(A) pthread_mutex_trylock((A)) -#define rw_trywrlock(A) pthread_mutex_trylock((A)) -#define rw_unlock(A) pthread_mutex_unlock((A)) -#define rwlock_destroy(A) pthread_mutex_destroy((A)) -#elif defined(HAVE_PTHREAD_RWLOCK_RDLOCK) -#define rw_lock_t pthread_rwlock_t -#define my_rwlock_init(A,B) pthread_rwlock_init((A),(B)) -#define rw_rdlock(A) pthread_rwlock_rdlock(A) -#define rw_wrlock(A) pthread_rwlock_wrlock(A) -#define rw_tryrdlock(A) pthread_rwlock_tryrdlock((A)) -#define rw_trywrlock(A) pthread_rwlock_trywrlock((A)) -#define rw_unlock(A) pthread_rwlock_unlock(A) -#define rwlock_destroy(A) pthread_rwlock_destroy(A) -#elif defined(HAVE_RWLOCK_INIT) -#ifdef HAVE_RWLOCK_T /* For example Solaris 2.6-> */ -#define rw_lock_t rwlock_t -#endif -#define my_rwlock_init(A,B) rwlock_init((A),USYNC_THREAD,0) -#else -/* Use our own version of read/write locks */ -#define NEED_MY_RW_LOCK 1 -#define rw_lock_t my_rw_lock_t -#define my_rwlock_init(A,B) my_rw_init((A)) -#define rw_rdlock(A) my_rw_rdlock((A)) -#define rw_wrlock(A) my_rw_wrlock((A)) -#define rw_tryrdlock(A) my_rw_tryrdlock((A)) -#define rw_trywrlock(A) my_rw_trywrlock((A)) -#define rw_unlock(A) my_rw_unlock((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 */ - - -/** - Portable implementation of special type of read-write locks. - - 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. - - TODO/FIXME: We should consider alleviating this requirement as - it blocks us from doing certain performance optimizations. -*/ - -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_rdlock(rw_pr_lock_t *); -extern int rw_pr_wrlock(rw_pr_lock_t *); -extern int rw_pr_unlock(rw_pr_lock_t *); -extern int rw_pr_destroy(rw_pr_lock_t *); -#ifdef SAFE_MUTEX -#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 -#define rw_pr_lock_assert_write_owner(A) -#define rw_pr_lock_assert_not_write_owner(A) -#endif /* SAFE_MUTEX */ - - -#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 we have - to use own implementation. -*/ -typedef struct st_my_rw_lock_t { - 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; - -#endif /*! _WIN32 */ - -extern int my_rw_init(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_wrlock(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_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 */ - - -#define GETHOSTBYADDR_BUFF_SIZE 2048 - -#ifndef HAVE_THR_SETCONCURRENCY -#define thr_setconcurrency(A) pthread_dummy(0) -#endif -#if !defined(HAVE_PTHREAD_ATTR_SETSTACKSIZE) && ! defined(pthread_attr_setstacksize) -#define pthread_attr_setstacksize(A,B) pthread_dummy(0) -#endif - -/* Define mutex types, see my_thr_init.c */ -#define MY_MUTEX_INIT_SLOW NULL -#ifdef PTHREAD_ADAPTIVE_MUTEX_INITIALIZER_NP -extern pthread_mutexattr_t my_fast_mutexattr; -#define MY_MUTEX_INIT_FAST &my_fast_mutexattr -#else -#define MY_MUTEX_INIT_FAST NULL -#endif -#ifdef PTHREAD_ERRORCHECK_MUTEX_INITIALIZER_NP -extern pthread_mutexattr_t my_errorcheck_mutexattr; -#define MY_MUTEX_INIT_ERRCHK &my_errorcheck_mutexattr -#else -#define MY_MUTEX_INIT_ERRCHK NULL -#endif - -#ifndef ESRCH -/* Define it to something */ -#define ESRCH 1 -#endif - -typedef ulong my_thread_id; - -extern my_bool my_thread_global_init(void); -extern my_bool my_thread_basic_global_init(void); -extern void my_thread_basic_global_reinit(void); -extern void my_thread_global_end(void); -extern my_bool my_thread_init(void); -extern void my_thread_end(void); -extern const char *my_thread_name(void); -extern my_thread_id my_thread_dbug_id(void); -extern int pthread_dummy(int); - -/* All thread specific variables are in the following struct */ - -#define THREAD_NAME_SIZE 10 -#ifndef DEFAULT_THREAD_STACK -#if SIZEOF_CHARP > 4 -/* - MySQL can survive with 32K, but some glibc libraries require > 128K stack - To resolve hostnames. Also recursive stored procedures needs stack. -*/ -#define DEFAULT_THREAD_STACK (256*1024L) -#else -#define DEFAULT_THREAD_STACK (192*1024) -#endif -#endif - -#include <mysql/psi/mysql_thread.h> - -#define INSTRUMENT_ME 0 - -struct st_my_thread_var -{ - int thr_errno; - mysql_cond_t suspend; - mysql_mutex_t mutex; - mysql_mutex_t * volatile current_mutex; - mysql_cond_t * volatile current_cond; - pthread_t pthread_self; - my_thread_id id; - int cmp_length; - int volatile abort; - my_bool init; - struct st_my_thread_var *next,**prev; - void *opt_info; - void *stack_ends_here; -#ifndef DBUG_OFF - void *dbug; - char name[THREAD_NAME_SIZE+1]; -#endif -}; - -extern struct st_my_thread_var *_my_thread_var(void) __attribute__ ((const)); -extern void **my_thread_var_dbug(); -extern uint my_thread_end_wait_time; -#define my_thread_var (_my_thread_var()) -#define my_errno my_thread_var->thr_errno -/* - Keep track of shutdown,signal, and main threads so that my_end() will not - report errors with them -*/ - -/* Which kind of thread library is in use */ - -#define THD_LIB_OTHER 1 -#define THD_LIB_NPTL 2 -#define THD_LIB_LT 4 - -extern uint thd_lib_detected; - -/* - thread_safe_xxx functions are for critical statistic or counters. - The implementation is guaranteed to be thread safe, on all platforms. - Note that the calling code should *not* assume the counter is protected - by the mutex given, as the implementation of these helpers may change - to use my_atomic operations instead. -*/ - -#ifndef thread_safe_increment -#ifdef _WIN32 -#define thread_safe_increment(V,L) InterlockedIncrement((long*) &(V)) -#define thread_safe_decrement(V,L) InterlockedDecrement((long*) &(V)) -#else -#define thread_safe_increment(V,L) \ - (mysql_mutex_lock((L)), (V)++, mysql_mutex_unlock((L))) -#define thread_safe_decrement(V,L) \ - (mysql_mutex_lock((L)), (V)--, mysql_mutex_unlock((L))) -#endif -#endif - -#ifndef thread_safe_add -#ifdef _WIN32 -#define thread_safe_add(V,C,L) InterlockedExchangeAdd((long*) &(V),(C)) -#define thread_safe_sub(V,C,L) InterlockedExchangeAdd((long*) &(V),-(long) (C)) -#else -#define thread_safe_add(V,C,L) \ - (mysql_mutex_lock((L)), (V)+=(C), mysql_mutex_unlock((L))) -#define thread_safe_sub(V,C,L) \ - (mysql_mutex_lock((L)), (V)-=(C), mysql_mutex_unlock((L))) -#endif -#endif - - -/* - statistics_xxx functions are for non critical statistic, - maintained in global variables. - When compiling with SAFE_STATISTICS: - - race conditions can not occur. - - some locking occurs, which may cause performance degradation. - - When compiling without SAFE_STATISTICS: - - race conditions can occur, making the result slightly inaccurate. - - the lock given is not honored. -*/ -#ifdef SAFE_STATISTICS -#define statistic_increment(V,L) thread_safe_increment((V),(L)) -#define statistic_decrement(V,L) thread_safe_decrement((V),(L)) -#define statistic_add(V,C,L) thread_safe_add((V),(C),(L)) -#define statistic_sub(V,C,L) thread_safe_sub((V),(C),(L)) -#else -#define statistic_decrement(V,L) (V)-- -#define statistic_increment(V,L) (V)++ -#define statistic_add(V,C,L) (V)+=(C) -#define statistic_sub(V,C,L) (V)-=(C) -#endif /* SAFE_STATISTICS */ - -/* - No locking needed, the counter is owned by the thread -*/ -#define status_var_increment(V) (V)++ -#define status_var_decrement(V) (V)-- -#define status_var_add(V,C) (V)+=(C) -#define status_var_sub(V,C) (V)-=(C) - -#ifdef __cplusplus -} -#endif -#endif /* _my_ptread_h */ diff --git a/dep/mysqllite/include/my_sys.h b/dep/mysqllite/include/my_sys.h deleted file mode 100644 index 96b40415c56..00000000000 --- a/dep/mysqllite/include/my_sys.h +++ /dev/null @@ -1,959 +0,0 @@ -/* Copyright (c) 2000, 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 - 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 */ - -#ifndef _my_sys_h -#define _my_sys_h - -#include "my_global.h" /* C_MODE_START, C_MODE_END */ - -C_MODE_START - -#ifdef HAVE_AIOWAIT -#include <sys/asynch.h> /* Used by record-cache */ -typedef struct my_aio_result { - aio_result_t result; - int pending; -} my_aio_result; -#endif - -#ifdef HAVE_VALGRIND -# include <valgrind/memcheck.h> -# define MEM_UNDEFINED(a,len) VALGRIND_MAKE_MEM_UNDEFINED(a,len) -# define MEM_NOACCESS(a,len) VALGRIND_MAKE_MEM_NOACCESS(a,len) -# define MEM_CHECK_ADDRESSABLE(a,len) VALGRIND_CHECK_MEM_IS_ADDRESSABLE(a,len) -# define MEM_CHECK_DEFINED(a,len) VALGRIND_CHECK_MEM_IS_DEFINED(a,len) -#else /* HAVE_VALGRIND */ -# define MEM_UNDEFINED(a,len) ((void) 0) -# define MEM_NOACCESS(a,len) ((void) 0) -# define MEM_CHECK_ADDRESSABLE(a,len) ((void) 0) -# define MEM_CHECK_DEFINED(a,len) ((void) 0) -#endif /* HAVE_VALGRIND */ - -#include <my_pthread.h> - -#include <m_ctype.h> /* for CHARSET_INFO */ -#include <stdarg.h> -#include <typelib.h> -#ifdef _WIN32 -#include <malloc.h> /*for alloca*/ -#endif - -#define MY_INIT(name) { my_progname= name; my_init(); } - -/** - Max length of an error message generated by mysys utilities. - Some mysys functions produce error messages. These mostly go - to stderr. - This constant defines the size of the buffer used to format - the message. It should be kept in sync with MYSQL_ERRMSG_SIZE, - since sometimes mysys errors are stored in the server diagnostics - area, and we would like to avoid unexpected truncation. -*/ -#define MYSYS_ERRMSG_SIZE (512) - -#define MY_FILE_ERROR ((size_t) -1) - - /* General bitmaps for my_func's */ -#define MY_FFNF 1 /* Fatal if file not found */ -#define MY_FNABP 2 /* Fatal if not all bytes read/writen */ -#define MY_NABP 4 /* Error if not all bytes read/writen */ -#define MY_FAE 8 /* Fatal if any 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_IGNORE_BADFD 32 /* my_sync: ignore 'bad descriptor' errors */ -#define MY_SYNC_DIR 8192 /* my_create/delete/rename: sync directory */ -#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_DONT_CHECK_FILESIZE 128 /* Option to init_io_cache() */ -#define MY_LINK_WARNING 32 /* my_redel() gives warning if links */ -#define MY_COPYTIME 64 /* my_redel() copys time */ -#define MY_DELETE_OLD 256 /* my_create_with_symlink() */ -#define MY_RESOLVE_LINK 128 /* my_realpath(); Only resolve links */ -#define MY_HOLD_ORIGINAL_MODES 128 /* my_copy() holds to file modes */ -#define MY_REDEL_MAKE_BACKUP 256 -#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_ZEROFILL 32 /* my_malloc(), fill array with zero */ -#define MY_ALLOW_ZERO_PTR 64 /* my_realloc() ; zero ptr -> malloc */ -#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_DONT_OVERWRITE_FILE 1024 /* my_copy: Don't overwrite file */ -#define MY_THREADSAFE 2048 /* my_seek(): lock fd mutex */ -#define MY_SYNC 4096 /* my_copy(): sync dst file */ - -#define MY_CHECK_ERROR 1 /* Params to my_end; Check open-close */ -#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 ME_HIGHBYTE 8 /* Shift for colours */ -#define ME_NOCUR 1 /* Don't use curses message */ -#define ME_OLDWIN 2 /* Use old window */ -#define ME_BELL 4 /* Ring bell then printing message */ -#define ME_HOLDTANG 8 /* Don't delete last keys */ -#define ME_WAITTOT 16 /* Wait for errtime secs of for a action */ -#define ME_WAITTANG 32 /* Wait for a user action */ -#define ME_NOREFRESH 64 /* Dont refresh screen */ -#define ME_NOINPUT 128 /* Dont use the input libary */ -#define ME_COLOUR1 ((1 << ME_HIGHBYTE)) /* Possibly error-colours */ -#define ME_COLOUR2 ((2 << ME_HIGHBYTE)) -#define ME_COLOUR3 ((3 << ME_HIGHBYTE)) -#define ME_FATALERROR 1024 /* Fatal statement error */ - - /* Bits in last argument to fn_format */ -#define MY_REPLACE_DIR 1 /* replace dir in name with 'dir' */ -#define MY_REPLACE_EXT 2 /* replace extension with 'ext' */ -#define MY_UNPACK_FILENAME 4 /* Unpack name (~ -> home) */ -#define MY_PACK_FILENAME 8 /* Pack name (home -> ~) */ -#define MY_RESOLVE_SYMLINKS 16 /* Resolve all symbolic links */ -#define MY_RETURN_REAL_PATH 32 /* return full path for file */ -#define MY_SAFE_PATH 64 /* Return NULL if too long path */ -#define MY_RELATIVE_PATH 128 /* name is relative to 'dir' */ -#define MY_APPEND_EXT 256 /* add 'ext' as additional extension*/ - - - /* My seek flags */ -#define MY_SEEK_SET 0 -#define MY_SEEK_CUR 1 -#define MY_SEEK_END 2 - - /* Some constants */ -#define MY_WAIT_FOR_USER_TO_FIX_PANIC 60 /* in seconds */ -#define MY_WAIT_GIVE_USER_A_MESSAGE 10 /* Every 10 times of prev */ -#define MIN_COMPRESS_LENGTH 50 /* Don't compress small bl. */ -#define DFLT_INIT_HITS 3 - - /* root_alloc flags */ -#define MY_KEEP_PREALLOC 1 -#define MY_MARK_BLOCKS_FREE 2 /* move used to free list and reuse them */ - - /* Internal error numbers (for assembler functions) */ -#define MY_ERRNO_EDOM 33 -#define MY_ERRNO_ERANGE 34 - - /* Bits for get_date timeflag */ -#define GETDATE_DATE_TIME 1 -#define GETDATE_SHORT_DATE 2 -#define GETDATE_HHMMSSTIME 4 -#define GETDATE_GMT 8 -#define GETDATE_FIXEDLENGTH 16 - - /* defines when allocating data */ -extern void *my_malloc(size_t Size,myf MyFlags); -extern void *my_multi_malloc(myf MyFlags, ...); -extern void *my_realloc(void *oldpoint, size_t Size, myf MyFlags); -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); -#define TRASH(A,B) do{MEM_CHECK_ADDRESSABLE(A,B);MEM_UNDEFINED(A,B);} while (0) -#if defined(ENABLED_DEBUG_SYNC) -extern void (*debug_sync_C_callback_ptr)(const char *, size_t); -#define DEBUG_SYNC_C(_sync_point_name_) do { \ - if (debug_sync_C_callback_ptr != NULL) \ - (*debug_sync_C_callback_ptr)(STRING_WITH_LEN(_sync_point_name_)); } \ - while(0) -#else -#define DEBUG_SYNC_C(_sync_point_name_) -#endif /* defined(ENABLED_DEBUG_SYNC) */ - -#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); -#else -#define my_get_large_page_size() (0) -#define my_large_malloc(A,B) my_malloc_lock((A),(B)) -#define my_large_free(A) my_free_lock((A)) -#endif /* HAVE_LARGE_PAGES */ - -#ifdef HAVE_ALLOCA -#if defined(_AIX) && !defined(__GNUC__) && !defined(_AIX43) -#pragma alloca -#endif /* _AIX */ -#if defined(__MWERKS__) -#undef alloca -#define alloca _alloca -#endif /* __MWERKS__ */ -#if defined(__GNUC__) && !defined(HAVE_ALLOCA_H) && ! defined(alloca) -#define alloca __builtin_alloca -#endif /* GNUC */ -#define my_alloca(SZ) alloca((size_t) (SZ)) -#define my_afree(PTR) {} -#else -#define my_alloca(SZ) my_malloc(SZ,MYF(MY_FAE)) -#define my_afree(PTR) my_free(PTR) -#endif /* HAVE_ALLOCA */ - -#ifndef errno /* did we already get it? */ -#ifdef HAVE_ERRNO_AS_DEFINE -#include <errno.h> /* errno is a define */ -#else -extern int errno; /* declare errno */ -#endif -#endif /* #ifndef errno */ -extern char *home_dir; /* Home directory for user */ -extern const char *my_progname; /* program-name (printed in errors) */ -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); -extern uint my_file_limit; -extern ulong my_thread_stack_size; - -extern const char *(*proc_info_hook)(void *, const char *, const char *, - const char *, const unsigned int); - -#ifdef HAVE_LARGE_PAGES -extern my_bool my_use_large_pages; -extern uint my_large_page_size; -#endif - -/* charsets */ -#define MY_ALL_CHARSETS_SIZE 2048 -extern MYSQL_PLUGIN_IMPORT CHARSET_INFO *default_charset_info; -extern MYSQL_PLUGIN_IMPORT CHARSET_INFO *all_charsets[MY_ALL_CHARSETS_SIZE]; -extern CHARSET_INFO compiled_charsets[]; - -/* statistics */ -extern ulong my_file_opened,my_stream_opened, my_tmp_file_created; -extern ulong my_file_total_opened; -extern uint mysys_usage_id; -extern my_bool my_init_done; - - /* Point to current my_message() */ -extern void (*my_sigtstp_cleanup)(void), - /* Executed before jump to shell */ - (*my_sigtstp_restart)(void), - (*my_abort_hook)(int); - /* Executed when comming from shell */ -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 ulong my_default_record_cache_size; -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 */ -extern const char *my_defaults_extra_file; -extern const char *my_defaults_group_suffix; -extern const char *my_defaults_file; - -extern my_bool timed_mutexes; - -enum loglevel { - ERROR_LEVEL, - WARNING_LEVEL, - INFORMATION_LEVEL -}; - -enum cache_type -{ - TYPE_NOT_SET= 0, READ_CACHE, WRITE_CACHE, - SEQ_READ_APPEND /* sequential read or append */, - READ_FIFO, READ_NET,WRITE_NET}; - -enum flush_type -{ - FLUSH_KEEP, /* flush block and keep it in the cache */ - FLUSH_RELEASE, /* flush block and remove it from the cache */ - FLUSH_IGNORE_CHANGED, /* remove block from the cache */ - /* - As my_disable_flush_pagecache_blocks is always 0, the following option - is strictly equivalent to FLUSH_KEEP - */ - FLUSH_FORCE_WRITE -}; - -typedef struct st_record_cache /* Used when cacheing records */ -{ - File file; - int rc_seek,error,inited; - uint rc_length,read_length,reclength; - my_off_t rc_record_pos,end_of_file; - uchar *rc_buff,*rc_buff2,*rc_pos,*rc_end,*rc_request_pos; -#ifdef HAVE_AIOWAIT - int use_async_io; - my_aio_result aio_result; -#endif - enum cache_type type; -} RECORD_CACHE; - -enum file_type -{ - UNOPEN = 0, FILE_BY_OPEN, FILE_BY_CREATE, STREAM_BY_FOPEN, STREAM_BY_FDOPEN, - FILE_BY_MKSTEMP, FILE_BY_DUP -}; - -struct st_my_file_info -{ - char *name; -#ifdef _WIN32 - HANDLE fhandle; /* win32 file handle */ - int oflag; /* open flags, e.g O_APPEND */ -#endif - enum file_type type; -#if !defined(HAVE_PREAD) && !defined(_WIN32) - mysql_mutex_t mutex; -#endif -}; - -extern struct st_my_file_info *my_file_info; - -typedef struct st_dynamic_array -{ - uchar *buffer; - uint elements,max_element; - uint alloc_increment; - uint size_of_element; -} DYNAMIC_ARRAY; - -typedef struct st_my_tmpdir -{ - DYNAMIC_ARRAY full_list; - char **list; - uint cur, max; - mysql_mutex_t mutex; -} MY_TMPDIR; - -typedef struct st_dynamic_string -{ - char *str; - size_t length,max_length,alloc_increment; -} DYNAMIC_STRING; - -struct st_io_cache; -typedef int (*IO_CACHE_CALLBACK)(struct st_io_cache*); - -typedef struct st_io_cache_share -{ - mysql_mutex_t mutex; /* To sync on reads into buffer. */ - mysql_cond_t cond; /* To wait for signals. */ - mysql_cond_t cond_writer; /* For a synchronized writer. */ - /* Offset in file corresponding to the first byte of buffer. */ - my_off_t pos_in_file; - /* If a synchronized write cache is the source of the data. */ - struct st_io_cache *source_cache; - uchar *buffer; /* The read buffer. */ - uchar *read_end; /* Behind last valid byte of buffer. */ - int running_threads; /* threads not in lock. */ - int total_threads; /* threads sharing the cache. */ - int error; /* Last error. */ -#ifdef NOT_YET_IMPLEMENTED - /* whether the structure should be free'd */ - my_bool alloced; -#endif -} IO_CACHE_SHARE; - -typedef struct st_io_cache /* Used when cacheing files */ -{ - /* Offset in file corresponding to the first byte of uchar* buffer. */ - my_off_t pos_in_file; - /* - The offset of end of file for READ_CACHE and WRITE_CACHE. - For SEQ_READ_APPEND it the maximum of the actual end of file and - the position represented by read_end. - */ - my_off_t end_of_file; - /* Points to current read position in the buffer */ - uchar *read_pos; - /* the non-inclusive boundary in the buffer for the currently valid read */ - uchar *read_end; - uchar *buffer; /* The read buffer */ - /* Used in ASYNC_IO */ - uchar *request_pos; - - /* Only used in WRITE caches and in SEQ_READ_APPEND to buffer writes */ - uchar *write_buffer; - /* - Only used in SEQ_READ_APPEND, and points to the current read position - in the write buffer. Note that reads in SEQ_READ_APPEND caches can - happen from both read buffer (uchar* buffer) and write buffer - (uchar* write_buffer). - */ - uchar *append_read_pos; - /* Points to current write position in the write buffer */ - uchar *write_pos; - /* The non-inclusive boundary of the valid write area */ - uchar *write_end; - - /* - Current_pos and current_end are convenience variables used by - my_b_tell() and other routines that need to know the current offset - current_pos points to &write_pos, and current_end to &write_end in a - WRITE_CACHE, and &read_pos and &read_end respectively otherwise - */ - uchar **current_pos, **current_end; - - /* - The lock is for append buffer used in SEQ_READ_APPEND cache - need mutex copying from append buffer to read buffer. - */ - mysql_mutex_t append_buffer_lock; - /* - The following is used when several threads are reading the - same file in parallel. They are synchronized on disk - accesses reading the cached part of the file asynchronously. - It should be set to NULL to disable the feature. Only - READ_CACHE mode is supported. - */ - IO_CACHE_SHARE *share; - - /* - A caller will use my_b_read() macro to read from the cache - if the data is already in cache, it will be simply copied with - memcpy() and internal variables will be accordinging updated with - no functions invoked. However, if the data is not fully in the cache, - my_b_read() will call read_function to fetch the data. read_function - must never be invoked directly. - */ - int (*read_function)(struct st_io_cache *,uchar *,size_t); - /* - Same idea as in the case of read_function, except my_b_write() needs to - be replaced with my_b_append() for a SEQ_READ_APPEND cache - */ - int (*write_function)(struct st_io_cache *,const uchar *,size_t); - /* - Specifies the type of the cache. Depending on the type of the cache - certain operations might not be available and yield unpredicatable - results. Details to be documented later - */ - enum cache_type type; - /* - Callbacks when the actual read I/O happens. These were added and - are currently used for binary logging of LOAD DATA INFILE - when a - block is read from the file, we create a block create/append event, and - when IO_CACHE is closed, we create an end event. These functions could, - of course be used for other things - */ - IO_CACHE_CALLBACK pre_read; - IO_CACHE_CALLBACK post_read; - IO_CACHE_CALLBACK pre_close; - /* - Counts the number of times, when we were forced to use disk. We use it to - increase the binlog_cache_disk_use and binlog_stmt_cache_disk_use status - variables. - */ - ulong disk_writes; - void* arg; /* for use by pre/post_read */ - char *file_name; /* if used with 'open_cached_file' */ - char *dir,*prefix; - File file; /* file descriptor */ - /* - seek_not_done is set by my_b_seek() to inform the upcoming read/write - operation that a seek needs to be preformed prior to the actual I/O - error is 0 if the cache operation was successful, -1 if there was a - "hard" error, and the actual number of I/O-ed bytes if the read/write was - partial. - */ - int seek_not_done,error; - /* buffer_length is memory size allocated for buffer or write_buffer */ - size_t buffer_length; - /* read_length is the same as buffer_length except when we use async io */ - size_t read_length; - myf myflags; /* Flags used to my_read/my_write */ - /* - alloced_buffer is 1 if the buffer was allocated by init_io_cache() and - 0 if it was supplied by the user. - Currently READ_NET is the only one that will use a buffer allocated - somewhere else - */ - my_bool alloced_buffer; -#ifdef HAVE_AIOWAIT - /* - As inidicated by ifdef, this is for async I/O, which is not currently - used (because it's not reliable on all systems) - */ - uint inited; - my_off_t aio_read_pos; - my_aio_result aio_result; -#endif -} IO_CACHE; - -typedef int (*qsort2_cmp)(const void *, const void *, const void *); - - /* defines for mf_iocache */ - - /* Test if buffer is inited */ -#define my_b_clear(info) (info)->buffer=0 -#define my_b_inited(info) (info)->buffer -#define my_b_EOF INT_MIN - -#define my_b_read(info,Buffer,Count) \ - ((info)->read_pos + (Count) <= (info)->read_end ?\ - (memcpy(Buffer,(info)->read_pos,(size_t) (Count)), \ - ((info)->read_pos+=(Count)),0) :\ - (*(info)->read_function)((info),Buffer,Count)) - -#define my_b_write(info,Buffer,Count) \ - ((info)->write_pos + (Count) <=(info)->write_end ?\ - (memcpy((info)->write_pos, (Buffer), (size_t)(Count)),\ - ((info)->write_pos+=(Count)),0) : \ - (*(info)->write_function)((info),(uchar *)(Buffer),(Count))) - -#define my_b_get(info) \ - ((info)->read_pos != (info)->read_end ?\ - ((info)->read_pos++, (int) (uchar) (info)->read_pos[-1]) :\ - _my_b_get(info)) - - /* my_b_write_byte dosn't have any err-check */ -#define my_b_write_byte(info,chr) \ - (((info)->write_pos < (info)->write_end) ?\ - ((*(info)->write_pos++)=(chr)) :\ - (_my_b_write(info,0,0) , ((*(info)->write_pos++)=(chr)))) - -#define my_b_fill_cache(info) \ - (((info)->read_end=(info)->read_pos),(*(info)->read_function)(info,0,0)) - -#define my_b_tell(info) ((info)->pos_in_file + \ - (size_t) (*(info)->current_pos - (info)->request_pos)) - -#define my_b_get_buffer_start(info) (info)->request_pos -#define my_b_get_bytes_in_buffer(info) (char*) (info)->read_end - \ - (char*) my_b_get_buffer_start(info) -#define my_b_get_pos_in_file(info) (info)->pos_in_file - -/* tell write offset in the SEQ_APPEND cache */ -int my_b_copy_to_file(IO_CACHE *cache, FILE *file); -my_off_t my_b_append_tell(IO_CACHE* info); -my_off_t my_b_safe_tell(IO_CACHE* info); /* picks the correct tell() */ - -#define my_b_bytes_in_cache(info) (size_t) (*(info)->current_end - \ - *(info)->current_pos) - -typedef uint32 ha_checksum; - -/* Define the type of function to be passed to process_default_option_files */ -typedef int (*Process_option_func)(void *ctx, const char *group_name, - const char *option); - -#include <my_alloc.h> - - - /* Prototypes for mysys and my_func functions */ - -extern int my_copy(const char *from,const char *to,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_setwd(const char *dir,myf MyFlags); -extern int my_lock(File fd,int op,my_off_t start, my_off_t length,myf MyFlags); -extern void *my_once_alloc(size_t Size,myf MyFlags); -extern void my_once_free(void); -extern char *my_once_strdup(const char *src,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_register_filename(File fd, const char *FileName, - enum file_type type_of_file, - uint error_message_number, myf MyFlags); -extern File my_create(const char *FileName,int CreateFlags, - int AccessFlags, myf MyFlags); -extern int my_close(File Filedes,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_is_symlink(const char *filename); -extern int my_realpath(char *to, const char *filename, myf MyFlags); -extern File my_create_with_symlink(const char *linkname, const char *filename, - int createflags, int access_flags, - 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 MyFlags); -extern int my_symlink(const char *content, const char *linkname, myf MyFlags); -extern size_t my_read(File Filedes,uchar *Buffer,size_t Count,myf MyFlags); -extern size_t my_pread(File Filedes,uchar *Buffer,size_t Count,my_off_t offset, - myf MyFlags); -extern int my_rename(const char *from,const char *to,myf MyFlags); -extern my_off_t my_seek(File fd,my_off_t pos,int whence,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, - myf MyFlags); -extern size_t my_pwrite(File Filedes,const uchar *Buffer,size_t Count, - my_off_t offset,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, - 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); - -/* implemented in my_memmem.c */ -extern void *my_memmem(const void *haystack, size_t haystacklen, - const void *needle, size_t needlelen); - - -#ifdef _WIN32 -extern int my_access(const char *path, int amode); -#else -#define my_access access -#endif - -extern int check_if_legal_filename(const char *path); -extern int check_if_legal_tablename(const char *path); - -#ifdef _WIN32 -extern int nt_share_delete(const char *name,myf MyFlags); -#define my_delete_allow_opened(fname,flags) nt_share_delete((fname),(flags)) -#else -#define my_delete_allow_opened(fname,flags) my_delete((fname),(flags)) -#endif - -#ifdef _WIN32 -/* Windows-only functions (CRT equivalents)*/ -extern HANDLE my_get_osfhandle(File fd); -extern void my_osmaperr(unsigned long last_error); -#endif - -extern void init_glob_errs(void); -extern const char** get_global_errmsgs(); -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_fdopen(File Filedes,const char *name, int Flags,myf MyFlags); -extern FILE *my_freopen(const char *path, const char *mode, FILE *stream); -extern int my_fclose(FILE *fd,myf MyFlags); -extern File my_fileno(FILE *fd); -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(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) (), - 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_stderr(uint my_err, const char *str, myf MyFlags); -extern my_bool my_basic_init(void); -extern my_bool my_init(void); -extern void my_end(int infoflag); -extern int my_redel(const char *from, const char *to, int MyFlags); -extern int my_copystat(const char *from, const char *to, int MyFlags); -extern char * my_filename(File fd); - -#ifdef EXTRA_DEBUG -void my_print_open_files(void); -#else -#define my_print_open_files() -#endif - -extern my_bool init_tmpdir(MY_TMPDIR *tmpdir, const char *pathlist); -extern char *my_tmpdir(MY_TMPDIR *tmpdir); -extern void free_tmpdir(MY_TMPDIR *tmpdir); - -extern void my_remember_signal(int signal_number,sig_handler (*func)(int)); -extern size_t dirname_part(char * to,const char *name, size_t *to_res_length); -extern size_t dirname_length(const char *name); -#define base_name(A) (A+dirname_length(A)) -extern int test_if_hard_path(const char *dir_name); -extern my_bool has_path(const char *name); -extern char *convert_dirname(char *to, const char *from, const char *from_end); -extern void to_unix_path(char * name); -extern char * fn_ext(const char *name); -extern char * fn_same(char * toname,const char *name,int flag); -extern char * fn_format(char * to,const char *name,const char *dir, - const char *form, uint flag); -extern size_t strlength(const char *str); -extern void pack_dirname(char * to,const char *from); -extern size_t normalize_dirname(char * to, const char *from); -extern size_t unpack_dirname(char * to,const char *from); -extern size_t cleanup_dirname(char * to,const char *from); -extern size_t system_filename(char * to,const char *from); -extern size_t unpack_filename(char * to,const char *from); -extern char * intern_filename(char * to,const char *from); -extern char * directory_file_name(char * dst, const char *src); -extern int pack_filename(char * to, const char *name, size_t max_length); -extern char * my_path(char * to,const char *progname, - const char *own_pathname_part); -extern char * my_load_path(char * to, const char *path, - const char *own_path_prefix); -extern int wild_compare(const char *str,const char *wildstr, - pbool str_is_pattern); -extern my_bool array_append_string_unique(const char *str, - const char **array, size_t size); -extern void get_date(char * to,int timeflag,time_t use_time); -extern void soundex(CHARSET_INFO *, char * out_pntr, char * in_pntr, - pbool remove_garbage); -extern int init_record_cache(RECORD_CACHE *info,size_t cachesize,File file, - size_t reclength,enum cache_type type, - pbool use_async_io); -extern int read_cache_record(RECORD_CACHE *info,uchar *to); -extern int end_record_cache(RECORD_CACHE *info); -extern int write_cache_record(RECORD_CACHE *info,my_off_t filepos, - const uchar *record,size_t length); -extern int flush_write_cache(RECORD_CACHE *info); -extern void handle_recived_signals(void); - -extern sig_handler my_set_alarm_variable(int signo); -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, - size_t size_of_element,uchar *buffer[]); -extern qsort_t my_qsort(void *base_ptr, size_t total_elems, size_t size, - qsort_cmp cmp); -extern qsort_t my_qsort2(void *base_ptr, size_t total_elems, size_t size, - qsort2_cmp cmp, void *cmp_argument); -extern qsort2_cmp get_ptr_compare(size_t); -void my_store_ptr(uchar *buff, size_t pack_length, my_off_t pos); -my_off_t my_get_ptr(uchar *ptr, size_t pack_length); -extern int init_io_cache(IO_CACHE *info,File file,size_t cachesize, - enum cache_type type,my_off_t seek_offset, - pbool use_async_io, myf cache_myflags); -extern my_bool reinit_io_cache(IO_CACHE *info,enum cache_type type, - my_off_t seek_offset,pbool use_async_io, - pbool clear_cache); -extern void setup_io_cache(IO_CACHE* info); -extern int _my_b_read(IO_CACHE *info,uchar *Buffer,size_t Count); -extern int _my_b_read_r(IO_CACHE *info,uchar *Buffer,size_t Count); -extern void init_io_cache_share(IO_CACHE *read_cache, IO_CACHE_SHARE *cshare, - IO_CACHE *write_cache, uint num_threads); -extern void remove_io_thread(IO_CACHE *info); -extern int _my_b_seq_read(IO_CACHE *info,uchar *Buffer,size_t Count); -extern int _my_b_net_read(IO_CACHE *info,uchar *Buffer,size_t Count); -extern int _my_b_get(IO_CACHE *info); -extern int _my_b_async_read(IO_CACHE *info,uchar *Buffer,size_t Count); -extern int _my_b_write(IO_CACHE *info,const uchar *Buffer,size_t Count); -extern int my_b_append(IO_CACHE *info,const uchar *Buffer,size_t Count); -extern int my_b_safe_write(IO_CACHE *info,const uchar *Buffer,size_t Count); - -extern int my_block_write(IO_CACHE *info, const uchar *Buffer, - size_t Count, my_off_t pos); -extern int my_b_flush_io_cache(IO_CACHE *info, int need_append_buffer_lock); - -#define flush_io_cache(info) my_b_flush_io_cache((info),1) - -extern int end_io_cache(IO_CACHE *info); -extern size_t my_b_fill(IO_CACHE *info); -extern void my_b_seek(IO_CACHE *info,my_off_t pos); -extern size_t my_b_gets(IO_CACHE *info, char *to, size_t max_length); -extern my_off_t my_b_filelength(IO_CACHE *info); -extern 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 my_bool open_cached_file(IO_CACHE *cache,const char *dir, - const char *prefix, size_t cache_size, - myf cache_myflags); -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) -#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); -extern my_bool insert_dynamic(DYNAMIC_ARRAY *array,uchar * element); -extern uchar *alloc_dynamic(DYNAMIC_ARRAY *array); -extern uchar *pop_dynamic(DYNAMIC_ARRAY*); -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 void get_dynamic(DYNAMIC_ARRAY *array,uchar * element,uint array_index); -extern void delete_dynamic(DYNAMIC_ARRAY *array); -extern void delete_dynamic_element(DYNAMIC_ARRAY *array, uint array_index); -extern void freeze_size(DYNAMIC_ARRAY *array); -extern int get_index_dynamic(DYNAMIC_ARRAY *array, uchar * element); -#define dynamic_array_ptr(array,array_index) ((array)->buffer+(array_index)*(array)->size_of_element) -#define dynamic_element(array,array_index,type) ((type)((array)->buffer) +(array_index)) -#define push_dynamic(A,B) insert_dynamic((A),(B)) -#define reset_dynamic(array) ((array)->elements= 0) -#define sort_dynamic(A,cmp) my_qsort((A)->buffer, (A)->elements, (A)->size_of_element, (cmp)) - -extern my_bool init_dynamic_string(DYNAMIC_STRING *str, const char *init_str, - size_t init_alloc,size_t alloc_increment); -extern my_bool dynstr_append(DYNAMIC_STRING *str, const char *append); -my_bool dynstr_append_mem(DYNAMIC_STRING *str, const char *append, - size_t length); -extern my_bool dynstr_append_os_quoted(DYNAMIC_STRING *str, const char *append, - ...); -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_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); -#else -#define my_malloc_lock(A,B) my_malloc((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) -#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, - size_t pre_alloc_size); -extern void *alloc_root(MEM_ROOT *mem_root, size_t Size); -extern void *multi_alloc_root(MEM_ROOT *mem_root, ...); -extern void free_root(MEM_ROOT *root, myf MyFLAGS); -extern void set_prealloc_root(MEM_ROOT *root, char *ptr); -extern void reset_root_defaults(MEM_ROOT *mem_root, size_t block_size, - size_t prealloc_size); -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 void *memdup_root(MEM_ROOT *root,const void *str, size_t len); -extern int get_defaults_options(int argc, char **argv, - char **defaults, char **extra_defaults, - char **group_suffix); -extern const char *args_separator; -extern int my_load_defaults(const char *conf_file, const char **groups, - int *argc, char ***argv, const char ***); -extern int load_defaults(const char *conf_file, const char **groups, - int *argc, char ***argv); -extern int my_search_option_files(const char *conf_file, int *argc, - char ***argv, uint *args_used, - Process_option_func func, void *func_ctx, - const char **default_directories); -extern void free_defaults(char **argv); -extern void my_print_default_files(const char *conf_file); -extern void print_defaults(const char *conf_file, const char **groups); -extern my_bool my_compress(uchar *, size_t *, size_t *); -extern my_bool my_uncompress(uchar *, size_t , size_t *); -extern uchar *my_compress_alloc(const uchar *packet, size_t *len, - size_t *complen); -extern int packfrm(uchar *, size_t, uchar **, size_t *); -extern int unpackfrm(uchar **, size_t *, const uchar *); - -extern ha_checksum my_checksum(ha_checksum crc, const uchar *mem, - size_t count); -extern void my_sleep(ulong m_seconds); -extern ulong crc32(ulong crc, const uchar *buf, uint len); -extern uint my_set_max_open_files(uint files); -void my_free_open_file_info(void); - -extern time_t my_time(myf flags); -extern ulonglong my_getsystime(void); -extern ulonglong my_micro_time(); -extern ulonglong my_micro_time_and_time(time_t *time_arg); -time_t my_time_possible_from_micro(ulonglong microtime); -extern my_bool my_gethwaddr(uchar *to); -extern int my_getncpus(); - -#ifdef HAVE_SYS_MMAN_H -#include <sys/mman.h> - -#ifndef MAP_NOSYNC -#define MAP_NOSYNC 0 -#endif -#ifndef MAP_NORESERVE -#define MAP_NORESERVE 0 /* For irix and AIX */ -#endif - -#ifdef HAVE_MMAP64 -#define my_mmap(a,b,c,d,e,f) mmap64(a,b,c,d,e,f) -#else -#define my_mmap(a,b,c,d,e,f) mmap(a,b,c,d,e,f) -#endif -#define my_munmap(a,b) munmap((a),(b)) - -#else -/* not a complete set of mmap() flags, but only those that nesessary */ -#define PROT_READ 1 -#define PROT_WRITE 2 -#define MAP_NORESERVE 0 -#define MAP_SHARED 0x0001 -#define MAP_PRIVATE 0x0002 -#define MAP_NOSYNC 0x0800 -#define MAP_FAILED ((void *)-1) -#define MS_SYNC 0x0000 - -#define HAVE_MMAP -void *my_mmap(void *, size_t, int, int, int, my_off_t); -int my_munmap(void *, size_t); -#endif - -/* my_getpagesize */ -#ifdef HAVE_GETPAGESIZE -#define my_getpagesize() getpagesize() -#else -int my_getpagesize(void); -#endif - -int my_msync(int, void *, size_t, int); - -/* character sets */ -extern uint get_charset_number(const char *cs_name, uint cs_flags); -extern uint get_collation_number(const char *name); -extern const char *get_charset_name(uint cs_number); - -extern CHARSET_INFO *get_charset(uint cs_number, myf flags); -extern CHARSET_INFO *get_charset_by_name(const char *cs_name, myf flags); -extern CHARSET_INFO *get_charset_by_csname(const char *cs_name, - uint cs_flags, myf my_flags); - -extern my_bool resolve_charset(const char *cs_name, - CHARSET_INFO *default_cs, - CHARSET_INFO **cs); -extern my_bool resolve_collation(const char *cl_name, - CHARSET_INFO *default_cl, - CHARSET_INFO **cl); -extern void free_charsets(void); -extern char *get_charsets_dir(char *buf); -extern my_bool my_charset_same(CHARSET_INFO *cs1, CHARSET_INFO *cs2); -extern my_bool init_compiled_charsets(myf flags); -extern void add_compiled_collation(CHARSET_INFO *cs); -extern size_t escape_string_for_mysql(CHARSET_INFO *charset_info, - char *to, size_t to_length, - const char *from, size_t length); -#ifdef __WIN__ -#define BACKSLASH_MBTAIL -/* File system character set */ -extern CHARSET_INFO *fs_character_set(void); -#endif -extern size_t escape_quotes_for_mysql(CHARSET_INFO *charset_info, - char *to, size_t to_length, - const char *from, size_t length); - -extern void thd_increment_bytes_sent(ulong length); -extern void thd_increment_bytes_received(ulong length); -extern void thd_increment_net_big_packet_count(ulong length); - -#ifdef __WIN__ -extern my_bool have_tcpip; /* Is set if tcpip is used */ - -/* implemented in my_windac.c */ - -int my_security_attr_create(SECURITY_ATTRIBUTES **psa, const char **perror, - DWORD owner_rights, DWORD everybody_rights); - -void my_security_attr_free(SECURITY_ATTRIBUTES *sa); - -/* implemented in my_conio.c */ -char* my_cgets(char *string, size_t clen, size_t* plen); - -#endif - -#include <mysql/psi/psi.h> - -#ifdef HAVE_PSI_INTERFACE -extern MYSQL_PLUGIN_IMPORT struct PSI_bootstrap *PSI_hook; -void my_init_mysys_psi_keys(void); -#endif - -struct st_mysql_file; -extern struct st_mysql_file *mysql_stdin; - -C_MODE_END -#endif /* _my_sys_h */ diff --git a/dep/mysqllite/include/my_xml.h b/dep/mysqllite/include/my_xml.h deleted file mode 100644 index 6a453ee90be..00000000000 --- a/dep/mysqllite/include/my_xml.h +++ /dev/null @@ -1,89 +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 */ - - -#ifndef _my_xml_h -#define _my_xml_h - -#ifdef __cplusplus -extern "C" { -#endif - - -#define MY_XML_OK 0 -#define MY_XML_ERROR 1 - -/* - A flag whether to use absolute tag names in call-back functions, - like "a", "a.b" and "a.b.c" (used in character set file parser), - or relative names like "a", "b" and "c". -*/ -#define MY_XML_FLAG_RELATIVE_NAMES 1 - -/* - A flag whether to skip normilization of text values before calling - call-back functions: i.e. skip leading/trailing spaces, - \r, \n, \t characters. -*/ -#define MY_XML_FLAG_SKIP_TEXT_NORMALIZATION 2 - -enum my_xml_node_type -{ - MY_XML_NODE_TAG, /* can have TAG, ATTR and TEXT children */ - MY_XML_NODE_ATTR, /* can have TEXT children */ - MY_XML_NODE_TEXT /* cannot have children */ -}; - -typedef struct xml_stack_st -{ - int flags; - enum my_xml_node_type current_node_type; - char errstr[128]; - char attr[128]; - char *attrend; - const char *beg; - const char *cur; - const char *end; - void *user_data; - int (*enter)(struct xml_stack_st *st,const char *val, size_t len); - int (*value)(struct xml_stack_st *st,const char *val, size_t len); - int (*leave_xml)(struct xml_stack_st *st,const char *val, size_t len); -} MY_XML_PARSER; - -void my_xml_parser_create(MY_XML_PARSER *st); -void my_xml_parser_free(MY_XML_PARSER *st); -int my_xml_parse(MY_XML_PARSER *st,const char *str, size_t len); - -void my_xml_set_value_handler(MY_XML_PARSER *st, int (*)(MY_XML_PARSER *, - const char *, - size_t len)); -void my_xml_set_enter_handler(MY_XML_PARSER *st, int (*)(MY_XML_PARSER *, - const char *, - size_t len)); -void my_xml_set_leave_handler(MY_XML_PARSER *st, int (*)(MY_XML_PARSER *, - const char *, - size_t len)); -void my_xml_set_user_data(MY_XML_PARSER *st, void *); - -size_t my_xml_error_pos(MY_XML_PARSER *st); -uint my_xml_error_lineno(MY_XML_PARSER *st); - -const char *my_xml_error_string(MY_XML_PARSER *st); - -#ifdef __cplusplus -} -#endif - -#endif /* _my_xml_h */ diff --git a/dep/mysqllite/include/mysql.h b/dep/mysqllite/include/mysql.h deleted file mode 100644 index d3b24f0198a..00000000000 --- a/dep/mysqllite/include/mysql.h +++ /dev/null @@ -1,713 +0,0 @@ -/* Copyright (C) 2000-2003 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 */ - -/* - This file defines the client API to MySQL and also the ABI of the - dynamically linked libmysqlclient. - - 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 - the file is changed so the ABI is broken, you must also update - the SHARED_LIB_MAJOR_VERSION in cmake/mysql_version.cmake -*/ - -#ifndef _mysql_h -#define _mysql_h - -#ifdef _AIX /* large-file support will break without this */ -#include <standards.h> -#endif - -#ifdef __CYGWIN__ /* CYGWIN implements a UNIX API */ -#undef WIN -#undef _WIN -#undef _WIN32 -#undef _WIN64 -#undef __WIN__ -#endif - -#ifdef __cplusplus -extern "C" { -#endif - -#ifndef _global_h /* If not standard header */ -#ifndef MYSQL_ABI_CHECK -#include <sys/types.h> -#endif -#ifdef __LCC__ -#include <winsock2.h> /* For windows */ -#endif -typedef char my_bool; -#if (defined(_WIN32) || defined(_WIN64)) && !defined(__WIN__) -#define __WIN__ -#endif -#if !defined(__WIN__) -#define STDCALL -#else -#define STDCALL __stdcall -#endif - -#ifndef my_socket_defined -#ifdef __WIN__ -#define my_socket SOCKET -#else -typedef int my_socket; -#endif /* __WIN__ */ -#endif /* my_socket_defined */ -#endif /* _global_h */ - -#include "mysql_version.h" -#include "mysql_com.h" -#include "mysql_time.h" - -#include "my_list.h" /* for LISTs used in 'MYSQL' and 'MYSQL_STMT' */ - -extern unsigned int mysql_port; -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 */ - -#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) -/** - Returns true if the value is a number which does not need quotes for - the sql_lex.cc parser to parse correctly. -*/ -#define IS_NUM(t) (((t) <= MYSQL_TYPE_INT24 && (t) != MYSQL_TYPE_TIMESTAMP) || (t) == MYSQL_TYPE_YEAR || (t) == MYSQL_TYPE_NEWDECIMAL) -#define IS_LONGDATA(t) ((t) >= MYSQL_TYPE_TINY_BLOB && (t) <= MYSQL_TYPE_STRING) - - -typedef struct st_mysql_field { - char *name; /* Name of column */ - char *org_name; /* Original column name, if an alias */ - char *table; /* Table of column if column was a field */ - char *org_table; /* Org table name, if table was an alias */ - char *db; /* Database for table */ - char *catalog; /* Catalog for table */ - char *def; /* Default value (set by mysql_list_fields) */ - unsigned long length; /* Width of column (create length) */ - unsigned long max_length; /* Max width for selected set */ - unsigned int name_length; - unsigned int org_name_length; - unsigned int table_length; - unsigned int org_table_length; - unsigned int db_length; - unsigned int catalog_length; - unsigned int def_length; - unsigned int flags; /* Div flags */ - unsigned int decimals; /* Number of decimals in field */ - unsigned int charsetnr; /* Character set */ - enum enum_field_types type; /* Type of field. See mysql_com.h for types */ - void *extension; -} MYSQL_FIELD; - -typedef char **MYSQL_ROW; /* return data as array of strings */ -typedef unsigned int MYSQL_FIELD_OFFSET; /* offset to current field */ - -#ifndef _global_h -#if defined(NO_CLIENT_LONG_LONG) -typedef unsigned long my_ulonglong; -#elif defined (__WIN__) -typedef unsigned __int64 my_ulonglong; -#else -typedef unsigned long long my_ulonglong; -#endif -#endif - -#include "typelib.h" - -#define MYSQL_COUNT_ERROR (~(my_ulonglong) 0) - -/* backward compatibility define - to be removed eventually */ -#define ER_WARN_DATA_TRUNCATED WARN_DATA_TRUNCATED - -typedef struct st_mysql_rows { - struct st_mysql_rows *next; /* list of rows */ - MYSQL_ROW data; - unsigned long length; -} MYSQL_ROWS; - -typedef MYSQL_ROWS *MYSQL_ROW_OFFSET; /* offset to current row */ - -#include "my_alloc.h" - -typedef struct embedded_query_result EMBEDDED_QUERY_RESULT; -typedef struct st_mysql_data { - MYSQL_ROWS *data; - struct embedded_query_result *embedded_info; - MEM_ROOT alloc; - my_ulonglong rows; - unsigned int fields; - /* extra info for embedded library */ - void *extension; -} MYSQL_DATA; - -enum mysql_option -{ - MYSQL_OPT_CONNECT_TIMEOUT, MYSQL_OPT_COMPRESS, MYSQL_OPT_NAMED_PIPE, - MYSQL_INIT_COMMAND, MYSQL_READ_DEFAULT_FILE, MYSQL_READ_DEFAULT_GROUP, - 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_WRITE_TIMEOUT, MYSQL_OPT_USE_RESULT, - MYSQL_OPT_USE_REMOTE_CONNECTION, MYSQL_OPT_USE_EMBEDDED_CONNECTION, - MYSQL_OPT_GUESS_CONNECTION, MYSQL_SET_CLIENT_IP, MYSQL_SECURE_AUTH, - MYSQL_REPORT_DATA_TRUNCATION, MYSQL_OPT_RECONNECT, - 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 { - unsigned int connect_timeout, read_timeout, write_timeout; - unsigned int port, protocol; - unsigned long client_flag; - char *host,*user,*password,*unix_socket,*db; - struct st_dynamic_array *init_commands; - char *my_cnf_file,*my_cnf_group, *charset_dir, *charset_name; - char *ssl_key; /* PEM key file */ - char *ssl_cert; /* PEM cert file */ - char *ssl_ca; /* PEM CA file */ - char *ssl_capath; /* PEM directory of CA-s? */ - char *ssl_cipher; /* cipher to use */ - char *shared_memory_base_name; - unsigned long max_allowed_packet; - my_bool use_ssl; /* if to use SSL or not */ - my_bool compress,named_pipe; - my_bool unused1; - my_bool unused2; - my_bool unused3; - my_bool unused4; - enum mysql_option methods_to_use; - char *client_ip; - /* Refuse client connecting to server if it uses old (pre-4.1.1) protocol */ - my_bool secure_auth; - /* 0 - never report, 1 - always report (default) */ - my_bool report_data_truncation; - - /* function pointers for local infile support */ - int (*local_infile_init)(void **, const char *, void *); - int (*local_infile_read)(void *, char *, unsigned int); - void (*local_infile_end)(void *); - int (*local_infile_error)(void *, char *, unsigned int); - void *local_infile_userdata; - struct st_mysql_options_extention *extension; -}; - -enum mysql_status -{ - MYSQL_STATUS_READY, MYSQL_STATUS_GET_RESULT, MYSQL_STATUS_USE_RESULT, - MYSQL_STATUS_STATEMENT_GET_RESULT -}; - -enum mysql_protocol_type -{ - MYSQL_PROTOCOL_DEFAULT, MYSQL_PROTOCOL_TCP, MYSQL_PROTOCOL_SOCKET, - MYSQL_PROTOCOL_PIPE, MYSQL_PROTOCOL_MEMORY -}; - -typedef struct character_set -{ - unsigned int number; /* character set number */ - unsigned int state; /* character set state */ - const char *csname; /* collation name */ - const char *name; /* character set name */ - const char *comment; /* comment */ - const char *dir; /* character set directory */ - unsigned int mbminlen; /* min. length for multibyte strings */ - unsigned int mbmaxlen; /* max. length for multibyte strings */ -} MY_CHARSET_INFO; - -struct st_mysql_methods; -struct st_mysql_stmt; - -typedef struct st_mysql -{ - NET net; /* Communication parameters */ - unsigned char *connector_fd; /* ConnectorFd for SSL */ - char *host,*user,*passwd,*unix_socket,*server_version,*host_info; - char *info, *db; - struct charset_info_st *charset; - MYSQL_FIELD *fields; - MEM_ROOT field_alloc; - my_ulonglong affected_rows; - my_ulonglong insert_id; /* id if insert on table with NEXTNR */ - my_ulonglong extra_info; /* Not used */ - unsigned long thread_id; /* Id for connection in server */ - unsigned long packet_length; - unsigned int port; - unsigned long client_flag,server_capabilities; - unsigned int protocol_version; - unsigned int field_count; - unsigned int server_status; - unsigned int server_language; - unsigned int warning_count; - struct st_mysql_options options; - enum mysql_status status; - my_bool free_me; /* If free in mysql_close */ - my_bool reconnect; /* set to 1 if automatic reconnect */ - - /* session-wide random string */ - char scramble[SCRAMBLE_LENGTH+1]; - my_bool unused1; - void *unused2, *unused3, *unused4, *unused5; - - LIST *stmts; /* list of all statements */ - const struct st_mysql_methods *methods; - void *thd; - /* - Points to boolean flag in MYSQL_RES or MYSQL_STMT. We set this flag - from mysql_stmt_close if close had to cancel result set of this object. - */ - my_bool *unbuffered_fetch_owner; - /* needed for embedded server - no net buffer to store the 'info' */ - char *info_buffer; - void *extension; -} MYSQL; - - -typedef struct st_mysql_res { - my_ulonglong row_count; - MYSQL_FIELD *fields; - MYSQL_DATA *data; - MYSQL_ROWS *data_cursor; - unsigned long *lengths; /* column lengths of current row */ - MYSQL *handle; /* for unbuffered reads */ - const struct st_mysql_methods *methods; - MYSQL_ROW row; /* If unbuffered read */ - MYSQL_ROW current_row; /* buffer to current row */ - MEM_ROOT field_alloc; - unsigned int field_count, current_field; - my_bool eof; /* Used by mysql_fetch_row */ - /* mysql_stmt_close() had to cancel this result */ - my_bool unbuffered_fetch_cancelled; - void *extension; -} MYSQL_RES; - - -#if !defined(MYSQL_SERVER) && !defined(MYSQL_CLIENT) -#define MYSQL_CLIENT -#endif - - -typedef struct st_mysql_parameters -{ - unsigned long *p_max_allowed_packet; - unsigned long *p_net_buffer_length; - void *extension; -} MYSQL_PARAMETERS; - -#if !defined(MYSQL_SERVER) && !defined(EMBEDDED_LIBRARY) -#define max_allowed_packet (*mysql_get_parameters()->p_max_allowed_packet) -#define net_buffer_length (*mysql_get_parameters()->p_net_buffer_length) -#endif - -/* - Set up and bring down the server; to ensure that applications will - work when linked against either the standard client library or the - embedded server library, these functions should be called. -*/ -int STDCALL mysql_server_init(int argc, char **argv, char **groups); -void STDCALL mysql_server_end(void); - -/* - mysql_server_init/end need to be called when using libmysqld or - libmysqlclient (exactly, mysql_server_init() is called by mysql_init() so - you don't need to call it explicitely; but you need to call - mysql_server_end() to free memory). The names are a bit misleading - (mysql_SERVER* to be used when using libmysqlCLIENT). So we add more general - names which suit well whether you're using libmysqld or libmysqlclient. We - intend to promote these aliases over the mysql_server* ones. -*/ -#define mysql_library_init mysql_server_init -#define mysql_library_end mysql_server_end - -MYSQL_PARAMETERS *STDCALL mysql_get_parameters(void); - -/* - Set up and bring down a thread; these function should be called - for each thread in an application which opens at least one MySQL - connection. All uses of the connection(s) should be between these - function calls. -*/ -my_bool STDCALL mysql_thread_init(void); -void STDCALL mysql_thread_end(void); - -/* - Functions to get information from the MYSQL and MYSQL_RES structures - Should definitely be used if one uses shared libraries. -*/ - -my_ulonglong STDCALL mysql_num_rows(MYSQL_RES *res); -unsigned int STDCALL mysql_num_fields(MYSQL_RES *res); -my_bool STDCALL mysql_eof(MYSQL_RES *res); -MYSQL_FIELD *STDCALL mysql_fetch_field_direct(MYSQL_RES *res, - unsigned int fieldnr); -MYSQL_FIELD * STDCALL mysql_fetch_fields(MYSQL_RES *res); -MYSQL_ROW_OFFSET STDCALL mysql_row_tell(MYSQL_RES *res); -MYSQL_FIELD_OFFSET STDCALL mysql_field_tell(MYSQL_RES *res); - -unsigned int STDCALL mysql_field_count(MYSQL *mysql); -my_ulonglong STDCALL mysql_affected_rows(MYSQL *mysql); -my_ulonglong STDCALL mysql_insert_id(MYSQL *mysql); -unsigned int STDCALL mysql_errno(MYSQL *mysql); -const char * STDCALL mysql_error(MYSQL *mysql); -const char *STDCALL mysql_sqlstate(MYSQL *mysql); -unsigned int STDCALL mysql_warning_count(MYSQL *mysql); -const char * STDCALL mysql_info(MYSQL *mysql); -unsigned long STDCALL mysql_thread_id(MYSQL *mysql); -const char * STDCALL mysql_character_set_name(MYSQL *mysql); -int STDCALL mysql_set_character_set(MYSQL *mysql, const char *csname); - -MYSQL * STDCALL mysql_init(MYSQL *mysql); -my_bool STDCALL mysql_ssl_set(MYSQL *mysql, const char *key, - const char *cert, const char *ca, - const char *capath, const char *cipher); -const char * STDCALL mysql_get_ssl_cipher(MYSQL *mysql); -my_bool STDCALL mysql_change_user(MYSQL *mysql, const char *user, - const char *passwd, const char *db); -MYSQL * STDCALL mysql_real_connect(MYSQL *mysql, const char *host, - const char *user, - const char *passwd, - const char *db, - unsigned int port, - const char *unix_socket, - unsigned long clientflag); -int STDCALL mysql_select_db(MYSQL *mysql, const char *db); -int STDCALL mysql_query(MYSQL *mysql, const char *q); -int STDCALL mysql_send_query(MYSQL *mysql, const char *q, - unsigned long length); -int STDCALL mysql_real_query(MYSQL *mysql, const char *q, - unsigned long length); -MYSQL_RES * STDCALL mysql_store_result(MYSQL *mysql); -MYSQL_RES * STDCALL mysql_use_result(MYSQL *mysql); - -void STDCALL mysql_get_character_set_info(MYSQL *mysql, - MY_CHARSET_INFO *charset); - -/* local infile support */ - -#define LOCAL_INFILE_ERROR_LEN 512 - -void -mysql_set_local_infile_handler(MYSQL *mysql, - int (*local_infile_init)(void **, const char *, - void *), - int (*local_infile_read)(void *, char *, - unsigned int), - void (*local_infile_end)(void *), - int (*local_infile_error)(void *, char*, - unsigned int), - void *); - -void -mysql_set_local_infile_default(MYSQL *mysql); - -int STDCALL mysql_shutdown(MYSQL *mysql, - enum mysql_enum_shutdown_level - shutdown_level); -int STDCALL mysql_dump_debug_info(MYSQL *mysql); -int STDCALL mysql_refresh(MYSQL *mysql, - unsigned int refresh_options); -int STDCALL mysql_kill(MYSQL *mysql,unsigned long pid); -int STDCALL mysql_set_server_option(MYSQL *mysql, - enum enum_mysql_set_option - option); -int STDCALL mysql_ping(MYSQL *mysql); -const char * STDCALL mysql_stat(MYSQL *mysql); -const char * STDCALL mysql_get_server_info(MYSQL *mysql); -const char * STDCALL mysql_get_client_info(void); -unsigned long STDCALL mysql_get_client_version(void); -const char * STDCALL mysql_get_host_info(MYSQL *mysql); -unsigned long STDCALL mysql_get_server_version(MYSQL *mysql); -unsigned int STDCALL mysql_get_proto_info(MYSQL *mysql); -MYSQL_RES * STDCALL mysql_list_dbs(MYSQL *mysql,const char *wild); -MYSQL_RES * STDCALL mysql_list_tables(MYSQL *mysql,const char *wild); -MYSQL_RES * STDCALL mysql_list_processes(MYSQL *mysql); -int STDCALL mysql_options(MYSQL *mysql,enum mysql_option option, - const void *arg); -void STDCALL mysql_free_result(MYSQL_RES *result); -void STDCALL mysql_data_seek(MYSQL_RES *result, - my_ulonglong offset); -MYSQL_ROW_OFFSET STDCALL mysql_row_seek(MYSQL_RES *result, - MYSQL_ROW_OFFSET offset); -MYSQL_FIELD_OFFSET STDCALL mysql_field_seek(MYSQL_RES *result, - MYSQL_FIELD_OFFSET offset); -MYSQL_ROW STDCALL mysql_fetch_row(MYSQL_RES *result); -unsigned long * STDCALL mysql_fetch_lengths(MYSQL_RES *result); -MYSQL_FIELD * STDCALL mysql_fetch_field(MYSQL_RES *result); -MYSQL_RES * STDCALL mysql_list_fields(MYSQL *mysql, const char *table, - const char *wild); -unsigned long STDCALL mysql_escape_string(char *to,const char *from, - unsigned long from_length); -unsigned long STDCALL mysql_hex_string(char *to,const char *from, - unsigned long from_length); -unsigned long STDCALL mysql_real_escape_string(MYSQL *mysql, - char *to,const char *from, - unsigned long length); -void STDCALL mysql_debug(const char *debug); -void STDCALL myodbc_remove_escape(MYSQL *mysql,char *name); -unsigned int STDCALL mysql_thread_safe(void); -my_bool STDCALL mysql_embedded(void); -my_bool STDCALL mysql_read_query_result(MYSQL *mysql); - - -/* - The following definitions are added for the enhanced - client-server protocol -*/ - -/* statement state */ -enum enum_mysql_stmt_state -{ - MYSQL_STMT_INIT_DONE= 1, MYSQL_STMT_PREPARE_DONE, MYSQL_STMT_EXECUTE_DONE, - MYSQL_STMT_FETCH_DONE -}; - - -/* - This structure is used to define bind information, and - internally by the client library. - Public members with their descriptions are listed below - (conventionally `On input' refers to the binds given to - mysql_stmt_bind_param, `On output' refers to the binds given - to mysql_stmt_bind_result): - - buffer_type - One of the MYSQL_* types, used to describe - the host language type of buffer. - On output: if column type is different from - buffer_type, column value is automatically converted - to buffer_type before it is stored in the buffer. - buffer - On input: points to the buffer with input data. - On output: points to the buffer capable to store - output data. - The type of memory pointed by buffer must correspond - to buffer_type. See the correspondence table in - the comment to mysql_stmt_bind_param. - - The two above members are mandatory for any kind of bind. - - buffer_length - the length of the buffer. You don't have to set - it for any fixed length buffer: float, double, - int, etc. It must be set however for variable-length - types, such as BLOBs or STRINGs. - - length - On input: in case when lengths of input values - are different for each execute, you can set this to - point at a variable containining value length. This - way the value length can be different in each execute. - If length is not NULL, buffer_length is not used. - Note, length can even point at buffer_length if - you keep bind structures around while fetching: - this way you can change buffer_length before - each execution, everything will work ok. - On output: if length is set, mysql_stmt_fetch will - write column length into it. - - is_null - On input: points to a boolean variable that should - be set to TRUE for NULL values. - This member is useful only if your data may be - NULL in some but not all cases. - If your data is never NULL, is_null should be set to 0. - If your data is always NULL, set buffer_type - to MYSQL_TYPE_NULL, and is_null will not be used. - - is_unsigned - On input: used to signify that values provided for one - of numeric types are unsigned. - On output describes signedness of the output buffer. - If, taking into account is_unsigned flag, column data - is out of range of the output buffer, data for this column - is regarded truncated. Note that this has no correspondence - to the sign of result set column, if you need to find it out - use mysql_stmt_result_metadata. - error - where to write a truncation error if it is present. - possible error value is: - 0 no truncation - 1 value is out of range or buffer is too small - - Please note that MYSQL_BIND also has internals members. -*/ - -typedef struct st_mysql_bind -{ - unsigned long *length; /* output length pointer */ - my_bool *is_null; /* Pointer to null indicator */ - void *buffer; /* buffer to get/put data */ - /* set this if you want to track data truncations happened during fetch */ - my_bool *error; - unsigned char *row_ptr; /* for the current data position */ - void (*store_param_func)(NET *net, struct st_mysql_bind *param); - void (*fetch_result)(struct st_mysql_bind *, MYSQL_FIELD *, - unsigned char **row); - void (*skip_result)(struct st_mysql_bind *, MYSQL_FIELD *, - unsigned char **row); - /* output buffer length, must be set when fetching str/binary */ - unsigned long buffer_length; - unsigned long offset; /* offset position for char/binary fetch */ - unsigned long length_value; /* Used if length is 0 */ - unsigned int param_number; /* For null count and error messages */ - unsigned int pack_length; /* Internal length for packed data */ - enum enum_field_types buffer_type; /* buffer type */ - my_bool error_value; /* used if error is 0 */ - my_bool is_unsigned; /* set if integer type is unsigned */ - my_bool long_data_used; /* If used with mysql_send_long_data */ - my_bool is_null_value; /* Used if is_null is 0 */ - void *extension; -} MYSQL_BIND; - - -/* statement handler */ -typedef struct st_mysql_stmt -{ - MEM_ROOT mem_root; /* root allocations */ - LIST list; /* list to keep track of all stmts */ - MYSQL *mysql; /* connection handle */ - MYSQL_BIND *params; /* input parameters */ - MYSQL_BIND *bind; /* output parameters */ - MYSQL_FIELD *fields; /* result set metadata */ - MYSQL_DATA result; /* cached result set */ - MYSQL_ROWS *data_cursor; /* current row in cached result */ - /* - mysql_stmt_fetch() calls this function to fetch one row (it's different - for buffered, unbuffered and cursor fetch). - */ - int (*read_row_func)(struct st_mysql_stmt *stmt, - unsigned char **row); - /* copy of mysql->affected_rows after statement execution */ - my_ulonglong affected_rows; - my_ulonglong insert_id; /* copy of mysql->insert_id */ - unsigned long stmt_id; /* Id for prepared statement */ - unsigned long flags; /* i.e. type of cursor to open */ - unsigned long prefetch_rows; /* number of rows per one COM_FETCH */ - /* - Copied from mysql->server_status after execute/fetch to know - server-side cursor status for this statement. - */ - unsigned int server_status; - unsigned int last_errno; /* error code */ - unsigned int param_count; /* input parameter count */ - unsigned int field_count; /* number of columns in result set */ - enum enum_mysql_stmt_state state; /* statement state */ - char last_error[MYSQL_ERRMSG_SIZE]; /* error message */ - char sqlstate[SQLSTATE_LENGTH+1]; - /* Types of input parameters should be sent to server */ - my_bool send_types_to_server; - my_bool bind_param_done; /* input buffers were supplied */ - unsigned char bind_result_done; /* output buffers were supplied */ - /* mysql_stmt_close() had to cancel this result */ - my_bool unbuffered_fetch_cancelled; - /* - Is set to true if we need to calculate field->max_length for - metadata fields when doing mysql_stmt_store_result. - */ - my_bool update_max_length; - void *extension; -} MYSQL_STMT; - -enum enum_stmt_attr_type -{ - /* - When doing mysql_stmt_store_result calculate max_length attribute - of statement metadata. This is to be consistent with the old API, - where this was done automatically. - In the new API we do that only by request because it slows down - mysql_stmt_store_result sufficiently. - */ - STMT_ATTR_UPDATE_MAX_LENGTH, - /* - unsigned long with combination of cursor flags (read only, for update, - etc) - */ - STMT_ATTR_CURSOR_TYPE, - /* - Amount of rows to retrieve from server per one fetch if using cursors. - Accepts unsigned long attribute in the range 1 - ulong_max - */ - STMT_ATTR_PREFETCH_ROWS -}; - - -MYSQL_STMT * STDCALL mysql_stmt_init(MYSQL *mysql); -int STDCALL mysql_stmt_prepare(MYSQL_STMT *stmt, const char *query, - unsigned long length); -int STDCALL mysql_stmt_execute(MYSQL_STMT *stmt); -int STDCALL mysql_stmt_fetch(MYSQL_STMT *stmt); -int STDCALL mysql_stmt_fetch_column(MYSQL_STMT *stmt, MYSQL_BIND *bind_arg, - unsigned int column, - unsigned long offset); -int STDCALL mysql_stmt_store_result(MYSQL_STMT *stmt); -unsigned long STDCALL mysql_stmt_param_count(MYSQL_STMT * stmt); -my_bool STDCALL mysql_stmt_attr_set(MYSQL_STMT *stmt, - enum enum_stmt_attr_type attr_type, - const void *attr); -my_bool STDCALL mysql_stmt_attr_get(MYSQL_STMT *stmt, - enum enum_stmt_attr_type attr_type, - void *attr); -my_bool STDCALL mysql_stmt_bind_param(MYSQL_STMT * stmt, MYSQL_BIND * bnd); -my_bool STDCALL mysql_stmt_bind_result(MYSQL_STMT * stmt, MYSQL_BIND * bnd); -my_bool STDCALL mysql_stmt_close(MYSQL_STMT * stmt); -my_bool STDCALL mysql_stmt_reset(MYSQL_STMT * stmt); -my_bool STDCALL mysql_stmt_free_result(MYSQL_STMT *stmt); -my_bool STDCALL mysql_stmt_send_long_data(MYSQL_STMT *stmt, - unsigned int param_number, - const char *data, - unsigned long length); -MYSQL_RES *STDCALL mysql_stmt_result_metadata(MYSQL_STMT *stmt); -MYSQL_RES *STDCALL mysql_stmt_param_metadata(MYSQL_STMT *stmt); -unsigned int STDCALL mysql_stmt_errno(MYSQL_STMT * stmt); -const char *STDCALL mysql_stmt_error(MYSQL_STMT * stmt); -const char *STDCALL mysql_stmt_sqlstate(MYSQL_STMT * stmt); -MYSQL_ROW_OFFSET STDCALL mysql_stmt_row_seek(MYSQL_STMT *stmt, - MYSQL_ROW_OFFSET offset); -MYSQL_ROW_OFFSET STDCALL mysql_stmt_row_tell(MYSQL_STMT *stmt); -void STDCALL mysql_stmt_data_seek(MYSQL_STMT *stmt, my_ulonglong offset); -my_ulonglong STDCALL mysql_stmt_num_rows(MYSQL_STMT *stmt); -my_ulonglong STDCALL mysql_stmt_affected_rows(MYSQL_STMT *stmt); -my_ulonglong STDCALL mysql_stmt_insert_id(MYSQL_STMT *stmt); -unsigned int STDCALL mysql_stmt_field_count(MYSQL_STMT *stmt); - -my_bool STDCALL mysql_commit(MYSQL * mysql); -my_bool STDCALL mysql_rollback(MYSQL * mysql); -my_bool STDCALL mysql_autocommit(MYSQL * mysql, my_bool auto_mode); -my_bool STDCALL mysql_more_results(MYSQL *mysql); -int STDCALL mysql_next_result(MYSQL *mysql); -int STDCALL mysql_stmt_next_result(MYSQL_STMT *stmt); -void STDCALL mysql_close(MYSQL *sock); - - -/* status return codes */ -#define MYSQL_NO_DATA 100 -#define MYSQL_DATA_TRUNCATED 101 - -#define mysql_reload(mysql) mysql_refresh((mysql),REFRESH_GRANT) - -#ifdef USE_OLD_FUNCTIONS -MYSQL * STDCALL mysql_connect(MYSQL *mysql, const char *host, - const char *user, const char *passwd); -int STDCALL mysql_create_db(MYSQL *mysql, const char *DB); -int STDCALL mysql_drop_db(MYSQL *mysql, const char *DB); -#endif -#define HAVE_MYSQL_REAL_CONNECT - -#ifdef __cplusplus -} -#endif - -#endif /* _mysql_h */ diff --git a/dep/mysqllite/include/mysql/client_plugin.h b/dep/mysqllite/include/mysql/client_plugin.h deleted file mode 100644 index cc3f468040f..00000000000 --- a/dep/mysqllite/include/mysql/client_plugin.h +++ /dev/null @@ -1,163 +0,0 @@ -#ifndef MYSQL_CLIENT_PLUGIN_INCLUDED -/* Copyright (C) 2010 Sun Microsystems, Inc. - - 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 */ - -/** - @file - - MySQL Client Plugin API - - This file defines the API for plugins that work on the client side -*/ -#define MYSQL_CLIENT_PLUGIN_INCLUDED - -#ifndef MYSQL_ABI_CHECK -#include <stdarg.h> -#include <stdlib.h> -#endif - -/* known plugin types */ -#define MYSQL_CLIENT_reserved1 0 -#define MYSQL_CLIENT_reserved2 1 -#define MYSQL_CLIENT_AUTHENTICATION_PLUGIN 2 - -#define MYSQL_CLIENT_AUTHENTICATION_PLUGIN_INTERFACE_VERSION 0x0100 - -#define MYSQL_CLIENT_MAX_PLUGINS 3 - -#define mysql_declare_client_plugin(X) \ - MYSQL_PLUGIN_EXPORT struct st_mysql_client_plugin_ ## X \ - _mysql_client_plugin_declaration_ = { \ - MYSQL_CLIENT_ ## X ## _PLUGIN, \ - MYSQL_CLIENT_ ## X ## _PLUGIN_INTERFACE_VERSION, -#define mysql_end_client_plugin } - -/* generic plugin header structure */ -#define MYSQL_CLIENT_PLUGIN_HEADER \ - int type; \ - unsigned int interface_version; \ - const char *name; \ - const char *author; \ - const char *desc; \ - unsigned int version[3]; \ - const char *license; \ - void *mysql_api; \ - int (*init)(char *, size_t, int, va_list); \ - int (*deinit)(); \ - int (*options)(const char *option, const void *); - -struct st_mysql_client_plugin -{ - MYSQL_CLIENT_PLUGIN_HEADER -}; - -struct st_mysql; - -/******** authentication plugin specific declarations *********/ -#include <mysql/plugin_auth_common.h> - -struct st_mysql_client_plugin_AUTHENTICATION -{ - MYSQL_CLIENT_PLUGIN_HEADER - int (*authenticate_user)(MYSQL_PLUGIN_VIO *vio, struct st_mysql *mysql); -}; - -/******** using plugins ************/ - -/** - loads a plugin and initializes it - - @param mysql MYSQL structure. - @param name a name of the plugin to load - @param type type of plugin that should be loaded, -1 to disable type check - @param argc number of arguments to pass to the plugin initialization - function - @param ... arguments for the plugin initialization function - - @retval - a pointer to the loaded plugin, or NULL in case of a failure -*/ -struct st_mysql_client_plugin * -mysql_load_plugin(struct st_mysql *mysql, const char *name, int type, - int argc, ...); - -/** - loads a plugin and initializes it, taking va_list as an argument - - This is the same as mysql_load_plugin, but take va_list instead of - a list of arguments. - - @param mysql MYSQL structure. - @param name a name of the plugin to load - @param type type of plugin that should be loaded, -1 to disable type check - @param argc number of arguments to pass to the plugin initialization - function - @param args arguments for the plugin initialization function - - @retval - a pointer to the loaded plugin, or NULL in case of a failure -*/ -struct st_mysql_client_plugin * -mysql_load_plugin_v(struct st_mysql *mysql, const char *name, int type, - int argc, va_list args); - -/** - finds an already loaded plugin by name, or loads it, if necessary - - @param mysql MYSQL structure. - @param name a name of the plugin to load - @param type type of plugin that should be loaded - - @retval - a pointer to the plugin, or NULL in case of a failure -*/ -struct st_mysql_client_plugin * -mysql_client_find_plugin(struct st_mysql *mysql, const char *name, int type); - -/** - adds a plugin structure to the list of loaded plugins - - This is useful if an application has the necessary functionality - (for example, a special load data handler) statically linked into - the application binary. It can use this function to register the plugin - directly, avoiding the need to factor it out into a shared object. - - @param mysql MYSQL structure. It is only used for error reporting - @param plugin an st_mysql_client_plugin structure to register - - @retval - a pointer to the plugin, or NULL in case of a failure -*/ -struct st_mysql_client_plugin * -mysql_client_register_plugin(struct st_mysql *mysql, - struct st_mysql_client_plugin *plugin); - -/** - set plugin options - - Can be used to set extra options and affect behavior for a plugin. - This function may be called multiple times to set several options - - @param plugin an st_mysql_client_plugin structure - @param option a string which specifies the option to set - @param value value for the option. - - @retval 0 on success, 1 in case of failure -**/ -int STDCALL mysql_plugin_options(struct st_mysql_client_plugin *plugin, - const char *option, - const void *value); -#endif - diff --git a/dep/mysqllite/include/mysql/innodb_priv.h b/dep/mysqllite/include/mysql/innodb_priv.h deleted file mode 100644 index 5406c292b18..00000000000 --- a/dep/mysqllite/include/mysql/innodb_priv.h +++ /dev/null @@ -1,36 +0,0 @@ -/* Copyright (c) 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 - 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 */ - -#ifndef INNODB_PRIV_INCLUDED -#define INNODB_PRIV_INCLUDED - -/** @file Declaring server-internal functions that are used by InnoDB. */ - -#include <sql_priv.h> - -class THD; - -int get_quote_char_for_identifier(THD *thd, const char *name, uint length); -bool schema_table_store_record(THD *thd, TABLE *table); -void localtime_to_TIME(MYSQL_TIME *to, struct tm *from); -bool check_global_access(THD *thd, ulong want_access); -uint strconvert(CHARSET_INFO *from_cs, const char *from, - CHARSET_INFO *to_cs, char *to, uint to_length, - uint *errors); -void sql_print_error(const char *format, ...); - - - -#endif /* INNODB_PRIV_INCLUDED */ diff --git a/dep/mysqllite/include/mysql/plugin.h b/dep/mysqllite/include/mysql/plugin.h deleted file mode 100644 index 7ec68ff5040..00000000000 --- a/dep/mysqllite/include/mysql/plugin.h +++ /dev/null @@ -1,633 +0,0 @@ -/* Copyright (C) 2005 MySQL AB, 2009 Sun Microsystems, Inc. - - 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 */ - -#ifndef _my_plugin_h -#define _my_plugin_h - -/* - On Windows, exports from DLL need to be declared - Also, plugin needs to be declared as extern "C" because MSVC - unlike other compilers, uses C++ mangling for variables not only - for functions. -*/ -#if defined(_MSC_VER) -#if defined(MYSQL_DYNAMIC_PLUGIN) - #ifdef __cplusplus - #define MYSQL_PLUGIN_EXPORT extern "C" __declspec(dllexport) - #else - #define MYSQL_PLUGIN_EXPORT __declspec(dllexport) - #endif -#else /* MYSQL_DYNAMIC_PLUGIN */ - #ifdef __cplusplus - #define MYSQL_PLUGIN_EXPORT extern "C" - #else - #define MYSQL_PLUGIN_EXPORT - #endif -#endif /*MYSQL_DYNAMIC_PLUGIN */ -#else /*_MSC_VER */ -#define MYSQL_PLUGIN_EXPORT -#endif - -#ifdef __cplusplus -class THD; -class Item; -#define MYSQL_THD THD* -#else -#define MYSQL_THD void* -#endif - -#include <mysql/services.h> - -#define MYSQL_XIDDATASIZE 128 -/** - struct st_mysql_xid is binary compatible with the XID structure as - in the X/Open CAE Specification, Distributed Transaction Processing: - The XA Specification, X/Open Company Ltd., 1991. - http://www.opengroup.org/bookstore/catalog/c193.htm - - @see XID in sql/handler.h -*/ -struct st_mysql_xid { - long formatID; - long gtrid_length; - long bqual_length; - char data[MYSQL_XIDDATASIZE]; /* Not \0-terminated */ -}; -typedef struct st_mysql_xid MYSQL_XID; - -/************************************************************************* - Plugin API. Common for all plugin types. -*/ - -#define MYSQL_PLUGIN_INTERFACE_VERSION 0x0102 - -/* - The allowable types of plugins -*/ -#define MYSQL_UDF_PLUGIN 0 /* User-defined function */ -#define MYSQL_STORAGE_ENGINE_PLUGIN 1 /* Storage Engine */ -#define MYSQL_FTPARSER_PLUGIN 2 /* Full-text parser plugin */ -#define MYSQL_DAEMON_PLUGIN 3 /* The daemon/raw plugin type */ -#define MYSQL_INFORMATION_SCHEMA_PLUGIN 4 /* The I_S plugin type */ -#define MYSQL_AUDIT_PLUGIN 5 /* The Audit plugin type */ -#define MYSQL_REPLICATION_PLUGIN 6 /* The replication plugin type */ -#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 */ -#define PLUGIN_LICENSE_PROPRIETARY 0 -#define PLUGIN_LICENSE_GPL 1 -#define PLUGIN_LICENSE_BSD 2 - -#define PLUGIN_LICENSE_PROPRIETARY_STRING "PROPRIETARY" -#define PLUGIN_LICENSE_GPL_STRING "GPL" -#define PLUGIN_LICENSE_BSD_STRING "BSD" - -/* - Macros for beginning and ending plugin declarations. Between - mysql_declare_plugin and mysql_declare_plugin_end there should - be a st_mysql_plugin struct for each plugin to be declared. -*/ - - -#ifndef MYSQL_DYNAMIC_PLUGIN -#define __MYSQL_DECLARE_PLUGIN(NAME, VERSION, PSIZE, DECLS) \ -MYSQL_PLUGIN_EXPORT int VERSION= MYSQL_PLUGIN_INTERFACE_VERSION; \ -MYSQL_PLUGIN_EXPORT int PSIZE= sizeof(struct st_mysql_plugin); \ -MYSQL_PLUGIN_EXPORT struct st_mysql_plugin DECLS[]= { -#else -#define __MYSQL_DECLARE_PLUGIN(NAME, VERSION, PSIZE, DECLS) \ -MYSQL_PLUGIN_EXPORT int _mysql_plugin_interface_version_= MYSQL_PLUGIN_INTERFACE_VERSION; \ -MYSQL_PLUGIN_EXPORT int _mysql_sizeof_struct_st_plugin_= sizeof(struct st_mysql_plugin); \ -MYSQL_PLUGIN_EXPORT struct st_mysql_plugin _mysql_plugin_declarations_[]= { -#endif - -#define mysql_declare_plugin(NAME) \ -__MYSQL_DECLARE_PLUGIN(NAME, \ - builtin_ ## NAME ## _plugin_interface_version, \ - builtin_ ## NAME ## _sizeof_struct_st_plugin, \ - builtin_ ## NAME ## _plugin) - -#define mysql_declare_plugin_end ,{0,0,0,0,0,0,0,0,0,0,0,0}} - -/* - declarations for SHOW STATUS support in plugins -*/ -enum enum_mysql_show_type -{ - SHOW_UNDEF, SHOW_BOOL, SHOW_INT, SHOW_LONG, - SHOW_LONGLONG, SHOW_CHAR, SHOW_CHAR_PTR, - SHOW_ARRAY, SHOW_FUNC, SHOW_DOUBLE, - SHOW_always_last -}; - -struct st_mysql_show_var { - const char *name; - char *value; - enum enum_mysql_show_type type; -}; - -#define SHOW_VAR_FUNC_BUFF_SIZE 1024 -typedef int (*mysql_show_var_func)(MYSQL_THD, struct st_mysql_show_var*, char *); - - -/* - declarations for server variables and command line options -*/ - - -#define PLUGIN_VAR_BOOL 0x0001 -#define PLUGIN_VAR_INT 0x0002 -#define PLUGIN_VAR_LONG 0x0003 -#define PLUGIN_VAR_LONGLONG 0x0004 -#define PLUGIN_VAR_STR 0x0005 -#define PLUGIN_VAR_ENUM 0x0006 -#define PLUGIN_VAR_SET 0x0007 -#define PLUGIN_VAR_UNSIGNED 0x0080 -#define PLUGIN_VAR_THDLOCAL 0x0100 /* Variable is per-connection */ -#define PLUGIN_VAR_READONLY 0x0200 /* Server variable is read only */ -#define PLUGIN_VAR_NOSYSVAR 0x0400 /* Not a server variable */ -#define PLUGIN_VAR_NOCMDOPT 0x0800 /* Not a command line option */ -#define PLUGIN_VAR_NOCMDARG 0x1000 /* No argument for cmd line */ -#define PLUGIN_VAR_RQCMDARG 0x0000 /* Argument required for cmd line */ -#define PLUGIN_VAR_OPCMDARG 0x2000 /* Argument optional for cmd line */ -#define PLUGIN_VAR_MEMALLOC 0x8000 /* String needs memory allocated */ - -struct st_mysql_sys_var; -struct st_mysql_value; - -/* - SYNOPSIS - (*mysql_var_check_func)() - thd thread handle - var dynamic variable being altered - save pointer to temporary storage - value user provided value - RETURN - 0 user provided value is OK and the update func may be called. - any other value indicates error. - - This function should parse the user provided value and store in the - provided temporary storage any data as required by the update func. - There is sufficient space in the temporary storage to store a double. - Note that the update func may not be called if any other error occurs - so any memory allocated should be thread-local so that it may be freed - automatically at the end of the statement. -*/ - -typedef int (*mysql_var_check_func)(MYSQL_THD thd, - struct st_mysql_sys_var *var, - void *save, struct st_mysql_value *value); - -/* - SYNOPSIS - (*mysql_var_update_func)() - thd thread handle - var dynamic variable being altered - var_ptr pointer to dynamic variable - save pointer to temporary storage - RETURN - NONE - - This function should use the validated value stored in the temporary store - and persist it in the provided pointer to the dynamic variable. - For example, strings may require memory to be allocated. -*/ -typedef void (*mysql_var_update_func)(MYSQL_THD thd, - struct st_mysql_sys_var *var, - void *var_ptr, const void *save); - - -/* the following declarations are for internal use only */ - - -#define PLUGIN_VAR_MASK \ - (PLUGIN_VAR_READONLY | PLUGIN_VAR_NOSYSVAR | \ - PLUGIN_VAR_NOCMDOPT | PLUGIN_VAR_NOCMDARG | \ - PLUGIN_VAR_OPCMDARG | PLUGIN_VAR_RQCMDARG | PLUGIN_VAR_MEMALLOC) - -#define MYSQL_PLUGIN_VAR_HEADER \ - int flags; \ - const char *name; \ - const char *comment; \ - mysql_var_check_func check; \ - mysql_var_update_func update - -#define MYSQL_SYSVAR_NAME(name) mysql_sysvar_ ## name -#define MYSQL_SYSVAR(name) \ - ((struct st_mysql_sys_var *)&(MYSQL_SYSVAR_NAME(name))) - -/* - for global variables, the value pointer is the first - element after the header, the default value is the second. - for thread variables, the value offset is the first - element after the header, the default value is the second. -*/ - - -#define DECLARE_MYSQL_SYSVAR_BASIC(name, type) struct { \ - MYSQL_PLUGIN_VAR_HEADER; \ - type *value; \ - const type def_val; \ -} MYSQL_SYSVAR_NAME(name) - -#define DECLARE_MYSQL_SYSVAR_SIMPLE(name, type) struct { \ - MYSQL_PLUGIN_VAR_HEADER; \ - type *value; type def_val; \ - type min_val; type max_val; \ - type blk_sz; \ -} MYSQL_SYSVAR_NAME(name) - -#define DECLARE_MYSQL_SYSVAR_TYPELIB(name, type) struct { \ - MYSQL_PLUGIN_VAR_HEADER; \ - type *value; type def_val; \ - TYPELIB *typelib; \ -} MYSQL_SYSVAR_NAME(name) - -#define DECLARE_THDVAR_FUNC(type) \ - type *(*resolve)(MYSQL_THD thd, int offset) - -#define DECLARE_MYSQL_THDVAR_BASIC(name, type) struct { \ - MYSQL_PLUGIN_VAR_HEADER; \ - int offset; \ - const type def_val; \ - DECLARE_THDVAR_FUNC(type); \ -} MYSQL_SYSVAR_NAME(name) - -#define DECLARE_MYSQL_THDVAR_SIMPLE(name, type) struct { \ - MYSQL_PLUGIN_VAR_HEADER; \ - int offset; \ - type def_val; type min_val; \ - type max_val; type blk_sz; \ - DECLARE_THDVAR_FUNC(type); \ -} MYSQL_SYSVAR_NAME(name) - -#define DECLARE_MYSQL_THDVAR_TYPELIB(name, type) struct { \ - MYSQL_PLUGIN_VAR_HEADER; \ - int offset; \ - type def_val; \ - DECLARE_THDVAR_FUNC(type); \ - TYPELIB *typelib; \ -} MYSQL_SYSVAR_NAME(name) - - -/* - the following declarations are for use by plugin implementors -*/ - -#define MYSQL_SYSVAR_BOOL(name, varname, opt, comment, check, update, def) \ -DECLARE_MYSQL_SYSVAR_BASIC(name, char) = { \ - PLUGIN_VAR_BOOL | ((opt) & PLUGIN_VAR_MASK), \ - #name, comment, check, update, &varname, def} - -#define MYSQL_SYSVAR_STR(name, varname, opt, comment, check, update, def) \ -DECLARE_MYSQL_SYSVAR_BASIC(name, char *) = { \ - PLUGIN_VAR_STR | ((opt) & PLUGIN_VAR_MASK), \ - #name, comment, check, update, &varname, def} - -#define MYSQL_SYSVAR_INT(name, varname, opt, comment, check, update, def, min, max, blk) \ -DECLARE_MYSQL_SYSVAR_SIMPLE(name, int) = { \ - PLUGIN_VAR_INT | ((opt) & PLUGIN_VAR_MASK), \ - #name, comment, check, update, &varname, def, min, max, blk } - -#define MYSQL_SYSVAR_UINT(name, varname, opt, comment, check, update, def, min, max, blk) \ -DECLARE_MYSQL_SYSVAR_SIMPLE(name, unsigned int) = { \ - PLUGIN_VAR_INT | PLUGIN_VAR_UNSIGNED | ((opt) & PLUGIN_VAR_MASK), \ - #name, comment, check, update, &varname, def, min, max, blk } - -#define MYSQL_SYSVAR_LONG(name, varname, opt, comment, check, update, def, min, max, blk) \ -DECLARE_MYSQL_SYSVAR_SIMPLE(name, long) = { \ - PLUGIN_VAR_LONG | ((opt) & PLUGIN_VAR_MASK), \ - #name, comment, check, update, &varname, def, min, max, blk } - -#define MYSQL_SYSVAR_ULONG(name, varname, opt, comment, check, update, def, min, max, blk) \ -DECLARE_MYSQL_SYSVAR_SIMPLE(name, unsigned long) = { \ - PLUGIN_VAR_LONG | PLUGIN_VAR_UNSIGNED | ((opt) & PLUGIN_VAR_MASK), \ - #name, comment, check, update, &varname, def, min, max, blk } - -#define MYSQL_SYSVAR_LONGLONG(name, varname, opt, comment, check, update, def, min, max, blk) \ -DECLARE_MYSQL_SYSVAR_SIMPLE(name, long long) = { \ - PLUGIN_VAR_LONGLONG | ((opt) & PLUGIN_VAR_MASK), \ - #name, comment, check, update, &varname, def, min, max, blk } - -#define MYSQL_SYSVAR_ULONGLONG(name, varname, opt, comment, check, update, def, min, max, blk) \ -DECLARE_MYSQL_SYSVAR_SIMPLE(name, unsigned long long) = { \ - PLUGIN_VAR_LONGLONG | PLUGIN_VAR_UNSIGNED | ((opt) & PLUGIN_VAR_MASK), \ - #name, comment, check, update, &varname, def, min, max, blk } - -#define MYSQL_SYSVAR_ENUM(name, varname, opt, comment, check, update, def, typelib) \ -DECLARE_MYSQL_SYSVAR_TYPELIB(name, unsigned long) = { \ - PLUGIN_VAR_ENUM | ((opt) & PLUGIN_VAR_MASK), \ - #name, comment, check, update, &varname, def, typelib } - -#define MYSQL_SYSVAR_SET(name, varname, opt, comment, check, update, def, typelib) \ -DECLARE_MYSQL_SYSVAR_TYPELIB(name, unsigned long long) = { \ - PLUGIN_VAR_SET | ((opt) & PLUGIN_VAR_MASK), \ - #name, comment, check, update, &varname, def, typelib } - -#define MYSQL_THDVAR_BOOL(name, opt, comment, check, update, def) \ -DECLARE_MYSQL_THDVAR_BASIC(name, char) = { \ - PLUGIN_VAR_BOOL | PLUGIN_VAR_THDLOCAL | ((opt) & PLUGIN_VAR_MASK), \ - #name, comment, check, update, -1, def, NULL} - -#define MYSQL_THDVAR_STR(name, opt, comment, check, update, def) \ -DECLARE_MYSQL_THDVAR_BASIC(name, char *) = { \ - PLUGIN_VAR_STR | PLUGIN_VAR_THDLOCAL | ((opt) & PLUGIN_VAR_MASK), \ - #name, comment, check, update, -1, def, NULL} - -#define MYSQL_THDVAR_INT(name, opt, comment, check, update, def, min, max, blk) \ -DECLARE_MYSQL_THDVAR_SIMPLE(name, int) = { \ - PLUGIN_VAR_INT | PLUGIN_VAR_THDLOCAL | ((opt) & PLUGIN_VAR_MASK), \ - #name, comment, check, update, -1, def, min, max, blk, NULL } - -#define MYSQL_THDVAR_UINT(name, opt, comment, check, update, def, min, max, blk) \ -DECLARE_MYSQL_THDVAR_SIMPLE(name, unsigned int) = { \ - PLUGIN_VAR_INT | PLUGIN_VAR_THDLOCAL | PLUGIN_VAR_UNSIGNED | ((opt) & PLUGIN_VAR_MASK), \ - #name, comment, check, update, -1, def, min, max, blk, NULL } - -#define MYSQL_THDVAR_LONG(name, opt, comment, check, update, def, min, max, blk) \ -DECLARE_MYSQL_THDVAR_SIMPLE(name, long) = { \ - PLUGIN_VAR_LONG | PLUGIN_VAR_THDLOCAL | ((opt) & PLUGIN_VAR_MASK), \ - #name, comment, check, update, -1, def, min, max, blk, NULL } - -#define MYSQL_THDVAR_ULONG(name, opt, comment, check, update, def, min, max, blk) \ -DECLARE_MYSQL_THDVAR_SIMPLE(name, unsigned long) = { \ - PLUGIN_VAR_LONG | PLUGIN_VAR_THDLOCAL | PLUGIN_VAR_UNSIGNED | ((opt) & PLUGIN_VAR_MASK), \ - #name, comment, check, update, -1, def, min, max, blk, NULL } - -#define MYSQL_THDVAR_LONGLONG(name, opt, comment, check, update, def, min, max, blk) \ -DECLARE_MYSQL_THDVAR_SIMPLE(name, long long) = { \ - PLUGIN_VAR_LONGLONG | PLUGIN_VAR_THDLOCAL | ((opt) & PLUGIN_VAR_MASK), \ - #name, comment, check, update, -1, def, min, max, blk, NULL } - -#define MYSQL_THDVAR_ULONGLONG(name, opt, comment, check, update, def, min, max, blk) \ -DECLARE_MYSQL_THDVAR_SIMPLE(name, unsigned long long) = { \ - PLUGIN_VAR_LONGLONG | PLUGIN_VAR_THDLOCAL | PLUGIN_VAR_UNSIGNED | ((opt) & PLUGIN_VAR_MASK), \ - #name, comment, check, update, -1, def, min, max, blk, NULL } - -#define MYSQL_THDVAR_ENUM(name, opt, comment, check, update, def, typelib) \ -DECLARE_MYSQL_THDVAR_TYPELIB(name, unsigned long) = { \ - PLUGIN_VAR_ENUM | PLUGIN_VAR_THDLOCAL | ((opt) & PLUGIN_VAR_MASK), \ - #name, comment, check, update, -1, def, NULL, typelib } - -#define MYSQL_THDVAR_SET(name, opt, comment, check, update, def, typelib) \ -DECLARE_MYSQL_THDVAR_TYPELIB(name, unsigned long long) = { \ - PLUGIN_VAR_SET | PLUGIN_VAR_THDLOCAL | ((opt) & PLUGIN_VAR_MASK), \ - #name, comment, check, update, -1, def, NULL, typelib } - -/* accessor macros */ - -#define SYSVAR(name) \ - (*(MYSQL_SYSVAR_NAME(name).value)) - -/* when thd == null, result points to global value */ -#define THDVAR(thd, name) \ - (*(MYSQL_SYSVAR_NAME(name).resolve(thd, MYSQL_SYSVAR_NAME(name).offset))) - - -/* - Plugin description structure. -*/ - -struct st_mysql_plugin -{ - int type; /* the plugin type (a MYSQL_XXX_PLUGIN value) */ - void *info; /* pointer to type-specific plugin descriptor */ - const char *name; /* plugin name */ - const char *author; /* plugin author (for I_S.PLUGINS) */ - const char *descr; /* general descriptive text (for I_S.PLUGINS) */ - int license; /* the plugin license (PLUGIN_LICENSE_XXX) */ - int (*init)(void *); /* the function to invoke when plugin is loaded */ - int (*deinit)(void *);/* the function to invoke when plugin is unloaded */ - unsigned int version; /* plugin version (for I_S.PLUGINS) */ - struct st_mysql_show_var *status_vars; - struct st_mysql_sys_var **system_vars; - void * __reserved1; /* reserved for dependency checking */ -}; - -/************************************************************************* - API for Full-text parser plugin. (MYSQL_FTPARSER_PLUGIN) -*/ -#include "plugin_ftparser.h" - -/************************************************************************* - API for Storage Engine plugin. (MYSQL_DAEMON_PLUGIN) -*/ - -/* handlertons of different MySQL releases are incompatible */ -#define MYSQL_DAEMON_INTERFACE_VERSION (MYSQL_VERSION_ID << 8) - -/* - Here we define only the descriptor structure, that is referred from - st_mysql_plugin. -*/ - -struct st_mysql_daemon -{ - int interface_version; -}; - - -/************************************************************************* - API for I_S plugin. (MYSQL_INFORMATION_SCHEMA_PLUGIN) -*/ - -/* handlertons of different MySQL releases are incompatible */ -#define MYSQL_INFORMATION_SCHEMA_INTERFACE_VERSION (MYSQL_VERSION_ID << 8) - -/* - Here we define only the descriptor structure, that is referred from - st_mysql_plugin. -*/ - -struct st_mysql_information_schema -{ - int interface_version; -}; - - -/************************************************************************* - API for Storage Engine plugin. (MYSQL_STORAGE_ENGINE_PLUGIN) -*/ - -/* handlertons of different MySQL releases are incompatible */ -#define MYSQL_HANDLERTON_INTERFACE_VERSION (MYSQL_VERSION_ID << 8) - -/* - The real API is in the sql/handler.h - Here we define only the descriptor structure, that is referred from - st_mysql_plugin. -*/ - -struct st_mysql_storage_engine -{ - int interface_version; -}; - -struct handlerton; - - -/* - API for Replication plugin. (MYSQL_REPLICATION_PLUGIN) -*/ - #define MYSQL_REPLICATION_INTERFACE_VERSION 0x0100 - - /** - Replication plugin descriptor - */ - struct Mysql_replication { - int interface_version; - }; - -/************************************************************************* - st_mysql_value struct for reading values from mysqld. - Used by server variables framework to parse user-provided values. - Will be used for arguments when implementing UDFs. - - Note that val_str() returns a string in temporary memory - that will be freed at the end of statement. Copy the string - if you need it to persist. -*/ - -#define MYSQL_VALUE_TYPE_STRING 0 -#define MYSQL_VALUE_TYPE_REAL 1 -#define MYSQL_VALUE_TYPE_INT 2 - -struct st_mysql_value -{ - int (*value_type)(struct st_mysql_value *); - const char *(*val_str)(struct st_mysql_value *, char *buffer, int *length); - int (*val_real)(struct st_mysql_value *, double *realbuf); - int (*val_int)(struct st_mysql_value *, long long *intbuf); - int (*is_unsigned)(struct st_mysql_value *); -}; - - -/************************************************************************* - Miscellaneous functions for plugin implementors -*/ - -#ifdef __cplusplus -extern "C" { -#endif - -int thd_in_lock_tables(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); -int thd_sql_command(const MYSQL_THD thd); -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_storage_lock_wait(MYSQL_THD thd, long long value); -int thd_tx_isolation(const MYSQL_THD thd); -char *thd_security_context(MYSQL_THD thd, char *buffer, unsigned int length, - unsigned int max_query_len); -/* Increments the row counter, see THD::row_count */ -void thd_inc_row_count(MYSQL_THD thd); - -/** - Create a temporary file. - - @details - The temporary file is created in a location specified by the mysql - server configuration (--tmpdir option). The caller does not need to - delete the file, it will be deleted automatically. - - @param prefix prefix for temporary file name - @retval -1 error - @retval >= 0 a file handle that can be passed to dup or my_close -*/ -int mysql_tmpfile(const char *prefix); - -/** - Check the killed state of a connection - - @details - In MySQL support for the KILL statement is cooperative. The KILL - statement only sets a "killed" flag. This function returns the value - of that flag. A thread should check it often, especially inside - time-consuming loops, and gracefully abort the operation if it is - non-zero. - - @param thd user thread connection handle - @retval 0 the connection is active - @retval 1 the connection has been killed -*/ -int thd_killed(const MYSQL_THD thd); - - -/** - Return the thread id of a user thread - - @param thd user thread connection handle - @return thread id -*/ -unsigned long thd_get_thread_id(const MYSQL_THD thd); - -/** - Get the XID for this connection's transaction - - @param thd user thread connection handle - @param xid location where identifier is stored -*/ -void thd_get_xid(const MYSQL_THD thd, MYSQL_XID *xid); - -/** - Invalidate the query cache for a given table. - - @param thd user thread connection handle - @param key databasename\\0tablename\\0 - @param key_length length of key in bytes, including the NUL bytes - @param using_trx flag: TRUE if using transactions, FALSE otherwise -*/ -void mysql_query_cache_invalidate4(MYSQL_THD thd, - const char *key, unsigned int key_length, - int using_trx); - - -/** - Provide a handler data getter to simplify coding -*/ -void *thd_get_ha_data(const MYSQL_THD thd, const struct handlerton *hton); - - -/** - Provide a handler data setter to simplify coding - - @details - Set ha_data pointer (storage engine per-connection information). - - To avoid unclean deactivation (uninstall) of storage engine plugin - in the middle of transaction, additional storage engine plugin - lock is acquired. - - If ha_data is not null and storage engine plugin was not locked - by thd_set_ha_data() in this connection before, storage engine - plugin gets locked. - - If ha_data is null and storage engine plugin was locked by - thd_set_ha_data() in this connection before, storage engine - plugin lock gets released. - - If handlerton::close_connection() didn't reset ha_data, server does - it immediately after calling handlerton::close_connection(). -*/ -void thd_set_ha_data(MYSQL_THD thd, const struct handlerton *hton, - const void *ha_data); -#ifdef __cplusplus -} -#endif - -#endif - diff --git a/dep/mysqllite/include/mysql/plugin_audit.h b/dep/mysqllite/include/mysql/plugin_audit.h deleted file mode 100644 index 8811c832949..00000000000 --- a/dep/mysqllite/include/mysql/plugin_audit.h +++ /dev/null @@ -1,138 +0,0 @@ -/* Copyright (C) 2007 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 */ - -#ifndef _my_audit_h -#define _my_audit_h - -/************************************************************************* - API for Audit plugin. (MYSQL_AUDIT_PLUGIN) -*/ - -#include "plugin.h" - -#define MYSQL_AUDIT_CLASS_MASK_SIZE 1 - -#define MYSQL_AUDIT_INTERFACE_VERSION 0x0200 - -/* - The first word in every event class struct indicates the specific - class of the event. -*/ -struct mysql_event -{ - unsigned int event_class; -}; - - -/************************************************************************* - AUDIT CLASS : GENERAL - - LOG events occurs before emitting to the general query log. - ERROR events occur before transmitting errors to the user. - RESULT events occur after transmitting a resultset to the user. - STATUS events occur after transmitting a resultset or errors - to the user. -*/ - -#define MYSQL_AUDIT_GENERAL_CLASS 0 -#define MYSQL_AUDIT_GENERAL_CLASSMASK (1 << MYSQL_AUDIT_GENERAL_CLASS) -#define MYSQL_AUDIT_GENERAL_LOG 0 -#define MYSQL_AUDIT_GENERAL_ERROR 1 -#define MYSQL_AUDIT_GENERAL_RESULT 2 -#define MYSQL_AUDIT_GENERAL_STATUS 3 - -struct mysql_event_general -{ - unsigned int event_class; - unsigned int event_subclass; - int general_error_code; - unsigned long general_thread_id; - const char *general_user; - unsigned int general_user_length; - const char *general_command; - unsigned int general_command_length; - const char *general_query; - unsigned int general_query_length; - struct charset_info_st *general_charset; - unsigned long long general_time; - unsigned long long general_rows; -}; - - -/* - AUDIT CLASS : CONNECTION - - CONNECT occurs after authentication phase is completed. - DISCONNECT occurs after connection is terminated. - CHANGE_USER occurs after COM_CHANGE_USER RPC is completed. -*/ - -#define MYSQL_AUDIT_CONNECTION_CLASS 1 -#define MYSQL_AUDIT_CONNECTION_CLASSMASK (1 << MYSQL_AUDIT_CONNECTION_CLASS) -#define MYSQL_AUDIT_CONNECTION_CONNECT 0 -#define MYSQL_AUDIT_CONNECTION_DISCONNECT 1 -#define MYSQL_AUDIT_CONNECTION_CHANGE_USER 2 - -struct mysql_event_connection -{ - unsigned int event_class; - unsigned int event_subclass; - int status; - unsigned long thread_id; - const char *user; - unsigned int user_length; - const char *priv_user; - unsigned int priv_user_length; - const char *external_user; - unsigned int external_user_length; - const char *proxy_user; - unsigned int proxy_user_length; - const char *host; - unsigned int host_length; - const char *ip; - unsigned int ip_length; - const char *database; - unsigned int database_length; -}; - - -/************************************************************************* - Here we define the descriptor structure, that is referred from - st_mysql_plugin. - - release_thd() event occurs when the event class consumer is to be - disassociated from the specified THD. This would typically occur - before some operation which may require sleeping - such as when - waiting for the next query from the client. - - event_notify() is invoked whenever an event occurs which is of any - class for which the plugin has interest. The first word of the - mysql_event argument indicates the specific event class and the - remainder of the structure is as required for that class. - - class_mask is an array of bits used to indicate what event classes - that this plugin wants to receive. -*/ - -struct st_mysql_audit -{ - int interface_version; - void (*release_thd)(MYSQL_THD); - void (*event_notify)(MYSQL_THD, const struct mysql_event *); - unsigned long class_mask[MYSQL_AUDIT_CLASS_MASK_SIZE]; -}; - - -#endif diff --git a/dep/mysqllite/include/mysql/plugin_auth.h b/dep/mysqllite/include/mysql/plugin_auth.h deleted file mode 100644 index 420eb3bb80f..00000000000 --- a/dep/mysqllite/include/mysql/plugin_auth.h +++ /dev/null @@ -1,125 +0,0 @@ -#ifndef MYSQL_PLUGIN_AUTH_INCLUDED -/* Copyright (C) 2010 Sun Microsystems, Inc. - - 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 */ - -/** - @file - - Authentication Plugin API. - - This file defines the API for server authentication plugins. -*/ - -#define MYSQL_PLUGIN_AUTH_INCLUDED - -#include <mysql/plugin.h> - -#define MYSQL_AUTHENTICATION_INTERFACE_VERSION 0x0100 - -#include <mysql/plugin_auth_common.h> - -/* defines for MYSQL_SERVER_AUTH_INFO.password_used */ - -#define PASSWORD_USED_NO 0 -#define PASSWORD_USED_YES 1 -#define PASSWORD_USED_NO_MENTION 2 - - -/** - Provides server plugin access to authentication information -*/ -typedef struct st_mysql_server_auth_info -{ - /** - User name as sent by the client and shown in USER(). - NULL if the client packet with the user name was not received yet. - */ - char *user_name; - - /** - Length of user_name - */ - unsigned int user_name_length; - - /** - A corresponding column value from the mysql.user table for the - matching account name - */ - const char *auth_string; - - /** - Length of auth_string - */ - unsigned long auth_string_length; - - /** - Matching account name as found in the mysql.user table. - A plugin can override it with another name that will be - used by MySQL for authorization, and shown in CURRENT_USER() - */ - char authenticated_as[MYSQL_USERNAME_LENGTH+1]; - - - /** - The unique user name that was used by the plugin to authenticate. - Plugins should put null-terminated UTF-8 here. - Available through the @@EXTERNAL_USER variable. - */ - char external_user[512]; - - /** - This only affects the "Authentication failed. Password used: %s" - error message. has the following values : - 0 : %s will be NO. - 1 : %s will be YES. - 2 : there will be no %s. - Set it as appropriate or ignore at will. - */ - int password_used; - - /** - Set to the name of the connected client host, if it can be resolved, - or to its IP address otherwise. - */ - const char *host_or_ip; - - /** - Length of host_or_ip - */ - unsigned int host_or_ip_length; - -} MYSQL_SERVER_AUTH_INFO; - -/** - Server authentication plugin descriptor -*/ -struct st_mysql_auth -{ - int interface_version; /** version plugin uses */ - /** - A plugin that a client must use for authentication with this server - plugin. Can be NULL to mean "any plugin". - */ - const char *client_auth_plugin; - /** - Function provided by the plugin which should perform authentication (using - the vio functions if necessary) and return 0 if successful. The plugin can - also fill the info.authenticated_as field if a different username should be - used for authorization. - */ - int (*authenticate_user)(MYSQL_PLUGIN_VIO *vio, MYSQL_SERVER_AUTH_INFO *info); -}; -#endif - diff --git a/dep/mysqllite/include/mysql/plugin_auth_common.h b/dep/mysqllite/include/mysql/plugin_auth_common.h deleted file mode 100644 index 4ad92d01bfb..00000000000 --- a/dep/mysqllite/include/mysql/plugin_auth_common.h +++ /dev/null @@ -1,105 +0,0 @@ -#ifndef MYSQL_PLUGIN_AUTH_COMMON_INCLUDED -/* Copyright (C) 2010 Sun Microsystems, Inc. - - 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 */ - -/** - @file - - This file defines constants and data structures that are the same for - both client- and server-side authentication plugins. -*/ -#define MYSQL_PLUGIN_AUTH_COMMON_INCLUDED - -/** the max allowed length for a user name */ -#define MYSQL_USERNAME_LENGTH 48 - -/** - return values of the plugin authenticate_user() method. -*/ - -/** - Authentication failed. Additionally, all other CR_xxx values - (libmysql error code) can be used too. - - The client plugin may set the error code and the error message directly - in the MYSQL structure and return CR_ERROR. If a CR_xxx specific error - code was returned, an error message in the MYSQL structure will be - overwritten. If CR_ERROR is returned without setting the error in MYSQL, - CR_UNKNOWN_ERROR will be user. -*/ -#define CR_ERROR 0 -/** - Authentication (client part) was successful. It does not mean that the - authentication as a whole was successful, usually it only means - that the client was able to send the user name and the password to the - server. If CR_OK is returned, the libmysql reads the next packet expecting - it to be one of OK, ERROR, or CHANGE_PLUGIN packets. -*/ -#define CR_OK -1 -/** - Authentication was successful. - It means that the client has done its part successfully and also that - a plugin has read the last packet (one of OK, ERROR, CHANGE_PLUGIN). - In this case, libmysql will not read a packet from the server, - but it will use the data at mysql->net.read_pos. - - A plugin may return this value if the number of roundtrips in the - authentication protocol is not known in advance, and the client plugin - needs to read one packet more to determine if the authentication is finished - or not. -*/ -#define CR_OK_HANDSHAKE_COMPLETE -2 - -typedef struct st_plugin_vio_info -{ - enum { MYSQL_VIO_INVALID, MYSQL_VIO_TCP, MYSQL_VIO_SOCKET, - MYSQL_VIO_PIPE, MYSQL_VIO_MEMORY } protocol; - int socket; /**< it's set, if the protocol is SOCKET or TCP */ -#ifdef _WIN32 - HANDLE handle; /**< it's set, if the protocol is PIPE or MEMORY */ -#endif -} MYSQL_PLUGIN_VIO_INFO; - -/** - Provides plugin access to communication channel -*/ -typedef struct st_plugin_vio -{ - /** - Plugin provides a pointer reference and this function sets it to the - contents of any incoming packet. Returns the packet length, or -1 if - the plugin should terminate. - */ - int (*read_packet)(struct st_plugin_vio *vio, - unsigned char **buf); - - /** - Plugin provides a buffer with data and the length and this - function sends it as a packet. Returns 0 on success, 1 on failure. - */ - int (*write_packet)(struct st_plugin_vio *vio, - const unsigned char *packet, - int packet_len); - - /** - Fills in a st_plugin_vio_info structure, providing the information - about the connection. - */ - void (*info)(struct st_plugin_vio *vio, struct st_plugin_vio_info *info); - -} MYSQL_PLUGIN_VIO; - -#endif - diff --git a/dep/mysqllite/include/mysql/plugin_ftparser.h b/dep/mysqllite/include/mysql/plugin_ftparser.h deleted file mode 100644 index 7f9bde3a6a0..00000000000 --- a/dep/mysqllite/include/mysql/plugin_ftparser.h +++ /dev/null @@ -1,211 +0,0 @@ -/* Copyright (C) 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ - -#ifndef _my_plugin_ftparser_h -#define _my_plugin_ftparser_h -#include "plugin.h" - -/************************************************************************* - API for Full-text parser plugin. (MYSQL_FTPARSER_PLUGIN) -*/ - -#define MYSQL_FTPARSER_INTERFACE_VERSION 0x0100 - -/* Parsing modes. Set in MYSQL_FTPARSER_PARAM::mode */ -enum enum_ftparser_mode -{ -/* - Fast and simple mode. This mode is used for indexing, and natural - language queries. - - The parser is expected to return only those words that go into the - index. Stopwords or too short/long words should not be returned. The - 'boolean_info' argument of mysql_add_word() does not have to be set. -*/ - MYSQL_FTPARSER_SIMPLE_MODE= 0, - -/* - Parse with stopwords mode. This mode is used in boolean searches for - "phrase matching." - - The parser is not allowed to ignore words in this mode. Every word - should be returned, including stopwords and words that are too short - or long. The 'boolean_info' argument of mysql_add_word() does not - have to be set. -*/ - MYSQL_FTPARSER_WITH_STOPWORDS= 1, - -/* - Parse in boolean mode. This mode is used to parse a boolean query string. - - The parser should provide a valid MYSQL_FTPARSER_BOOLEAN_INFO - structure in the 'boolean_info' argument to mysql_add_word(). - Usually that means that the parser should recognize boolean operators - in the parsing stream and set appropriate fields in - MYSQL_FTPARSER_BOOLEAN_INFO structure accordingly. As for - MYSQL_FTPARSER_WITH_STOPWORDS mode, no word should be ignored. - Instead, use FT_TOKEN_STOPWORD for the token type of such a word. -*/ - MYSQL_FTPARSER_FULL_BOOLEAN_INFO= 2 -}; - -/* - Token types for boolean mode searching (used for the type member of - MYSQL_FTPARSER_BOOLEAN_INFO struct) - - FT_TOKEN_EOF: End of data. - FT_TOKEN_WORD: Regular word. - FT_TOKEN_LEFT_PAREN: Left parenthesis (start of group/sub-expression). - FT_TOKEN_RIGHT_PAREN: Right parenthesis (end of group/sub-expression). - FT_TOKEN_STOPWORD: Stopword. -*/ - -enum enum_ft_token_type -{ - FT_TOKEN_EOF= 0, - FT_TOKEN_WORD= 1, - FT_TOKEN_LEFT_PAREN= 2, - FT_TOKEN_RIGHT_PAREN= 3, - FT_TOKEN_STOPWORD= 4 -}; - -/* - This structure is used in boolean search mode only. It conveys - boolean-mode metadata to the MySQL search engine for every word in - the search query. A valid instance of this structure must be filled - in by the plugin parser and passed as an argument in the call to - mysql_add_word (the callback function in the MYSQL_FTPARSER_PARAM - structure) when a query is parsed in boolean mode. - - type: The token type. Should be one of the enum_ft_token_type values. - - yesno: Whether the word must be present for a match to occur: - >0 Must be present - <0 Must not be present - 0 Neither; the word is optional but its presence increases the relevance - With the default settings of the ft_boolean_syntax system variable, - >0 corresponds to the '+' operator, <0 corrresponds to the '-' operator, - and 0 means neither operator was used. - - weight_adjust: A weighting factor that determines how much a match - for the word counts. Positive values increase, negative - decrease the - relative word's importance in the query. - - wasign: The sign of the word's weight in the query. If it's non-negative - the match for the word will increase document relevance, if it's - negative - decrease (the word becomes a "noise word", the less of it the - better). - - trunc: Corresponds to the '*' operator in the default setting of the - ft_boolean_syntax system variable. -*/ - -typedef struct st_mysql_ftparser_boolean_info -{ - enum enum_ft_token_type type; - int yesno; - int weight_adjust; - char wasign; - char trunc; - /* These are parser state and must be removed. */ - char prev; - char *quot; -} MYSQL_FTPARSER_BOOLEAN_INFO; - -/* - The following flag means that buffer with a string (document, word) - may be overwritten by the caller before the end of the parsing (that is - before st_mysql_ftparser::deinit() call). If one needs the string - to survive between two successive calls of the parsing function, she - needs to save a copy of it. The flag may be set by MySQL before calling - st_mysql_ftparser::parse(), or it may be set by a plugin before calling - st_mysql_ftparser_param::mysql_parse() or - st_mysql_ftparser_param::mysql_add_word(). -*/ -#define MYSQL_FTFLAGS_NEED_COPY 1 - -/* - An argument of the full-text parser plugin. This structure is - filled in by MySQL server and passed to the parsing function of the - plugin as an in/out parameter. - - mysql_parse: A pointer to the built-in parser implementation of the - server. It's set by the server and can be used by the parser plugin - to invoke the MySQL default parser. If plugin's role is to extract - textual data from .doc, .pdf or .xml content, it might extract - plaintext from the content, and then pass the text to the default - MySQL parser to be parsed. - - mysql_add_word: A server callback to add a new word. When parsing - a document, the server sets this to point at a function that adds - the word to MySQL full-text index. When parsing a search query, - this function will add the new word to the list of words to search - for. The boolean_info argument can be NULL for all cases except - when mode is MYSQL_FTPARSER_FULL_BOOLEAN_INFO. - - ftparser_state: A generic pointer. The plugin can set it to point - to information to be used internally for its own purposes. - - mysql_ftparam: This is set by the server. It is used by MySQL functions - called via mysql_parse() and mysql_add_word() callback. The plugin - should not modify it. - - cs: Information about the character set of the document or query string. - - doc: A pointer to the document or query string to be parsed. - - length: Length of the document or query string, in bytes. - - flags: See MYSQL_FTFLAGS_* constants above. - - mode: The parsing mode. With boolean operators, with stopwords, or - nothing. See enum_ftparser_mode above. -*/ - -typedef struct st_mysql_ftparser_param -{ - int (*mysql_parse)(struct st_mysql_ftparser_param *, - char *doc, int doc_len); - int (*mysql_add_word)(struct st_mysql_ftparser_param *, - char *word, int word_len, - MYSQL_FTPARSER_BOOLEAN_INFO *boolean_info); - void *ftparser_state; - void *mysql_ftparam; - struct charset_info_st *cs; - char *doc; - int length; - int flags; - enum enum_ftparser_mode mode; -} MYSQL_FTPARSER_PARAM; - -/* - Full-text parser descriptor. - - interface_version is, e.g., MYSQL_FTPARSER_INTERFACE_VERSION. - The parsing, initialization, and deinitialization functions are - invoked per SQL statement for which the parser is used. -*/ - -struct st_mysql_ftparser -{ - int interface_version; - int (*parse)(MYSQL_FTPARSER_PARAM *param); - int (*init)(MYSQL_FTPARSER_PARAM *param); - int (*deinit)(MYSQL_FTPARSER_PARAM *param); -}; - - -#endif - diff --git a/dep/mysqllite/include/mysql/psi/mysql_file.h b/dep/mysqllite/include/mysql/psi/mysql_file.h deleted file mode 100644 index 6fc6689c47d..00000000000 --- a/dep/mysqllite/include/mysql/psi/mysql_file.h +++ /dev/null @@ -1,1434 +0,0 @@ -/* 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 - 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, - 51 Franklin Street, Suite 500, Boston, MA 02110-1335 USA */ - -#ifndef MYSQL_FILE_H -#define MYSQL_FILE_H - -#include <my_global.h> - -/* For strlen() */ -#include <string.h> -/* For MY_STAT */ -#include <my_dir.h> -/* For my_chsize */ -#include <my_sys.h> - -/** - @file mysql/psi/mysql_file.h - Instrumentation helpers for mysys file io. - This header file provides the necessary declarations - to use the mysys file API with the performance schema instrumentation. - In some compilers (SunStudio), 'static inline' functions, when declared - but not used, are not optimized away (because they are unused) by default, - so that including a static inline function from a header file does - create unwanted dependencies, causing unresolved symbols at link time. - Other compilers, like gcc, optimize these dependencies by default. - - Since the instrumented APIs declared here are wrapper on top - of mysys file io APIs, including mysql/psi/mysql_file.h assumes that - the dependency on my_sys already exists. -*/ - -#include "mysql/psi/psi.h" - -/** - @defgroup File_instrumentation File Instrumentation - @ingroup Instrumentation_interface - @{ -*/ - -/** - @def mysql_file_fgets(P1, P2, F) - Instrumented fgets. - @c mysql_file_fgets is a replacement for @c fgets. -*/ -#ifdef HAVE_PSI_INTERFACE - #define mysql_file_fgets(P1, P2, F) \ - inline_mysql_file_fgets(__FILE__, __LINE__, P1, P2, F) -#else - #define mysql_file_fgets(P1, P2, F) \ - inline_mysql_file_fgets(P1, P2, F) -#endif - -/** - @def mysql_file_fgetc(F) - Instrumented fgetc. - @c mysql_file_fgetc is a replacement for @c fgetc. -*/ -#ifdef HAVE_PSI_INTERFACE - #define mysql_file_fgetc(F) inline_mysql_file_fgetc(__FILE__, __LINE__, F) -#else - #define mysql_file_fgetc(F) inline_mysql_file_fgetc(F) -#endif - -/** - @def mysql_file_fputs(P1, F) - Instrumented fputs. - @c mysql_file_fputs is a replacement for @c fputs. -*/ -#ifdef HAVE_PSI_INTERFACE - #define mysql_file_fputs(P1, F) \ - inline_mysql_file_fputs(__FILE__, __LINE__, P1, F) -#else - #define mysql_file_fputs(P1, F)\ - inline_mysql_file_fputs(P1, F) -#endif - -/** - @def mysql_file_fputc(P1, F) - Instrumented fputc. - @c mysql_file_fputc is a replacement for @c fputc. -*/ -#ifdef HAVE_PSI_INTERFACE - #define mysql_file_fputc(P1, F) \ - inline_mysql_file_fputc(__FILE__, __LINE__, P1, F) -#else - #define mysql_file_fputc(P1, F) \ - inline_mysql_file_fputc(P1, F) -#endif - -/** - @def mysql_file_fprintf - Instrumented fprintf. - @c mysql_file_fprintf is a replacement for @c fprintf. -*/ -#define mysql_file_fprintf inline_mysql_file_fprintf - -/** - @def mysql_file_vfprintf(F, P1, P2) - Instrumented vfprintf. - @c mysql_file_vfprintf is a replacement for @c vfprintf. -*/ -#ifdef HAVE_PSI_INTERFACE - #define mysql_file_vfprintf(F, P1, P2) \ - inline_mysql_file_vfprintf(__FILE__, __LINE__, F, P1, P2) -#else - #define mysql_file_vfprintf(F, P1, P2) \ - inline_mysql_file_vfprintf(F, P1, P2) -#endif - -/** - @def mysql_file_fflush(F, P1, P2) - Instrumented fflush. - @c mysql_file_fflush is a replacement for @c fflush. -*/ -#ifdef HAVE_PSI_INTERFACE - #define mysql_file_fflush(F) \ - inline_mysql_file_fflush(__FILE__, __LINE__, F) -#else - #define mysql_file_fflush(F) \ - inline_mysql_file_fflush(F) -#endif - -/** - @def mysql_file_feof(F) - Instrumented feof. - @c mysql_file_feof is a replacement for @c feof. -*/ -#define mysql_file_feof(F) inline_mysql_file_feof(F) - -/** - @def mysql_file_fstat(FN, S, FL) - Instrumented fstat. - @c mysql_file_fstat is a replacement for @c my_fstat. -*/ -#ifdef HAVE_PSI_INTERFACE - #define mysql_file_fstat(FN, S, FL) \ - inline_mysql_file_fstat(__FILE__, __LINE__, FN, S, FL) -#else - #define mysql_file_fstat(FN, S, FL) \ - inline_mysql_file_fstat(FN, S, FL) -#endif - -/** - @def mysql_file_stat(K, FN, S, FL) - Instrumented stat. - @c mysql_file_stat is a replacement for @c my_stat. -*/ -#ifdef HAVE_PSI_INTERFACE - #define mysql_file_stat(K, FN, S, FL) \ - inline_mysql_file_stat(K, __FILE__, __LINE__, FN, S, FL) -#else - #define mysql_file_stat(K, FN, S, FL) \ - inline_mysql_file_stat(FN, S, FL) -#endif - -/** - @def mysql_file_chsize(F, P1, P2, P3) - Instrumented chsize. - @c mysql_file_chsize is a replacement for @c my_chsize. -*/ -#ifdef HAVE_PSI_INTERFACE - #define mysql_file_chsize(F, P1, P2, P3) \ - inline_mysql_file_chsize(__FILE__, __LINE__, F, P1, P2, P3) -#else - #define mysql_file_chsize(F, P1, P2, P3) \ - inline_mysql_file_chsize(F, P1, P2, P3) -#endif - -/** - @def mysql_file_fopen(K, N, F1, F2) - Instrumented fopen. - @c mysql_file_fopen is a replacement for @c my_fopen. -*/ -#ifdef HAVE_PSI_INTERFACE - #define mysql_file_fopen(K, N, F1, F2) \ - inline_mysql_file_fopen(K, __FILE__, __LINE__, N, F1, F2) -#else - #define mysql_file_fopen(K, N, F1, F2) \ - inline_mysql_file_fopen(N, F1, F2) -#endif - -/** - @def mysql_file_fclose(FD, FL) - Instrumented fclose. - @c mysql_file_fclose is a replacement for @c my_fclose. - Without the instrumentation, this call will have the same behavior as the - undocumented and possibly platform specific my_fclose(NULL, ...) behavior. - With the instrumentation, mysql_fclose(NULL, ...) will safely return 0, - which is an extension compared to my_fclose and is therefore compliant. - mysql_fclose is on purpose *not* implementing - @code DBUG_ASSERT(file != NULL) @endcode, - since doing so could introduce regressions. -*/ -#ifdef HAVE_PSI_INTERFACE - #define mysql_file_fclose(FD, FL) \ - inline_mysql_file_fclose(__FILE__, __LINE__, FD, FL) -#else - #define mysql_file_fclose(FD, FL) \ - inline_mysql_file_fclose(FD, FL) -#endif - -/** - @def mysql_file_fread(FD, P1, P2, P3) - Instrumented fread. - @c mysql_file_fread is a replacement for @c my_fread. -*/ -#ifdef HAVE_PSI_INTERFACE - #define mysql_file_fread(FD, P1, P2, P3) \ - inline_mysql_file_fread(__FILE__, __LINE__, FD, P1, P2, P3) -#else - #define mysql_file_fread(FD, P1, P2, P3) \ - inline_mysql_file_fread(FD, P1, P2, P3) -#endif - -/** - @def mysql_file_fwrite(FD, P1, P2, P3) - Instrumented fwrite. - @c mysql_file_fwrite is a replacement for @c my_fwrite. -*/ -#ifdef HAVE_PSI_INTERFACE - #define mysql_file_fwrite(FD, P1, P2, P3) \ - inline_mysql_file_fwrite(__FILE__, __LINE__, FD, P1, P2, P3) -#else - #define mysql_file_fwrite(FD, P1, P2, P3) \ - inline_mysql_file_fwrite(FD, P1, P2, P3) -#endif - -/** - @def mysql_file_fseek(FD, P, W, F) - Instrumented fseek. - @c mysql_file_fseek is a replacement for @c my_fseek. -*/ -#ifdef HAVE_PSI_INTERFACE - #define mysql_file_fseek(FD, P, W, F) \ - inline_mysql_file_fseek(__FILE__, __LINE__, FD, P, W, F) -#else - #define mysql_file_fseek(FD, P, W, F) \ - inline_mysql_file_fseek(FD, P, W, F) -#endif - -/** - @def mysql_file_ftell(FD, F) - Instrumented ftell. - @c mysql_file_ftell is a replacement for @c my_ftell. -*/ -#ifdef HAVE_PSI_INTERFACE - #define mysql_file_ftell(FD, F) \ - inline_mysql_file_ftell(__FILE__, __LINE__, FD, F) -#else - #define mysql_file_ftell(FD, F) \ - inline_mysql_file_ftell(FD, F) -#endif - -/** - @def mysql_file_create(K, N, F1, F2, F3) - Instrumented create. - @c mysql_file_create is a replacement for @c my_create. -*/ -#ifdef HAVE_PSI_INTERFACE - #define mysql_file_create(K, N, F1, F2, F3) \ - inline_mysql_file_create(K, __FILE__, __LINE__, N, F1, F2, F3) -#else - #define mysql_file_create(K, N, F1, F2, F3) \ - inline_mysql_file_create(N, F1, F2, F3) -#endif - -/** - @def mysql_file_create_temp(K, T, D, P, M, F) - Instrumented create_temp_file. - @c mysql_file_create_temp is a replacement for @c create_temp_file. -*/ -#ifdef HAVE_PSI_INTERFACE - #define mysql_file_create_temp(K, T, D, P, M, F) \ - inline_mysql_file_create_temp(K, T, D, P, M, F) -#else - #define mysql_file_create_temp(K, T, D, P, M, F) \ - inline_mysql_file_create_temp(T, D, P, M, F) -#endif - -/** - @def mysql_file_open(K, N, F1, F2) - Instrumented open. - @c mysql_file_open is a replacement for @c my_open. -*/ -#ifdef HAVE_PSI_INTERFACE - #define mysql_file_open(K, N, F1, F2) \ - inline_mysql_file_open(K, __FILE__, __LINE__, N, F1, F2) -#else - #define mysql_file_open(K, N, F1, F2) \ - inline_mysql_file_open(N, F1, F2) -#endif - -/** - @def mysql_file_close(FD, F) - Instrumented close. - @c mysql_file_close is a replacement for @c my_close. -*/ -#ifdef HAVE_PSI_INTERFACE - #define mysql_file_close(FD, F) \ - inline_mysql_file_close(__FILE__, __LINE__, FD, F) -#else - #define mysql_file_close(FD, F) \ - inline_mysql_file_close(FD, F) -#endif - -/** - @def mysql_file_read(FD, B, S, F) - Instrumented read. - @c mysql_read is a replacement for @c my_read. -*/ -#ifdef HAVE_PSI_INTERFACE - #define mysql_file_read(FD, B, S, F) \ - inline_mysql_file_read(__FILE__, __LINE__, FD, B, S, F) -#else - #define mysql_file_read(FD, B, S, F) \ - inline_mysql_file_read(FD, B, S, F) -#endif - -/** - @def mysql_file_write(FD, B, S, F) - Instrumented write. - @c mysql_file_write is a replacement for @c my_write. -*/ -#ifdef HAVE_PSI_INTERFACE - #define mysql_file_write(FD, B, S, F) \ - inline_mysql_file_write(__FILE__, __LINE__, FD, B, S, F) -#else - #define mysql_file_write(FD, B, S, F) \ - inline_mysql_file_write(FD, B, S, F) -#endif - -/** - @def mysql_file_pread(FD, B, S, O, F) - Instrumented pread. - @c mysql_pread is a replacement for @c my_pread. -*/ -#ifdef HAVE_PSI_INTERFACE - #define mysql_file_pread(FD, B, S, O, F) \ - inline_mysql_file_pread(__FILE__, __LINE__, FD, B, S, O, F) -#else - #define mysql_file_pread(FD, B, S, O, F) \ - inline_mysql_file_pread(FD, B, S, O, F) -#endif - -/** - @def mysql_file_pwrite(FD, B, S, O, F) - Instrumented pwrite. - @c mysql_file_pwrite is a replacement for @c my_pwrite. -*/ -#ifdef HAVE_PSI_INTERFACE - #define mysql_file_pwrite(FD, B, S, O, F) \ - inline_mysql_file_pwrite(__FILE__, __LINE__, FD, B, S, O, F) -#else - #define mysql_file_pwrite(FD, B, S, O, F) \ - inline_mysql_file_pwrite(FD, B, S, O, F) -#endif - -/** - @def mysql_file_seek(FD, P, W, F) - Instrumented seek. - @c mysql_file_seek is a replacement for @c my_seek. -*/ -#ifdef HAVE_PSI_INTERFACE - #define mysql_file_seek(FD, P, W, F) \ - inline_mysql_file_seek(__FILE__, __LINE__, FD, P, W, F) -#else - #define mysql_file_seek(FD, P, W, F) \ - inline_mysql_file_seek(FD, P, W, F) -#endif - -/** - @def mysql_file_tell(FD, F) - Instrumented tell. - @c mysql_file_tell is a replacement for @c my_tell. -*/ -#ifdef HAVE_PSI_INTERFACE - #define mysql_file_tell(FD, F) \ - inline_mysql_file_tell(__FILE__, __LINE__, FD, F) -#else - #define mysql_file_tell(FD, F) \ - inline_mysql_file_tell(FD, F) -#endif - -/** - @def mysql_file_delete(K, P1, P2) - Instrumented delete. - @c mysql_file_delete is a replacement for @c my_delete. -*/ -#ifdef HAVE_PSI_INTERFACE - #define mysql_file_delete(K, P1, P2) \ - inline_mysql_file_delete(K, __FILE__, __LINE__, P1, P2) -#else - #define mysql_file_delete(K, P1, P2) \ - inline_mysql_file_delete(P1, P2) -#endif - -/** - @def mysql_file_rename(K, P1, P2, P3) - Instrumented rename. - @c mysql_file_rename is a replacement for @c my_rename. -*/ -#ifdef HAVE_PSI_INTERFACE - #define mysql_file_rename(K, P1, P2, P3) \ - inline_mysql_file_rename(K, __FILE__, __LINE__, P1, P2, P3) -#else - #define mysql_file_rename(K, P1, P2, P3) \ - inline_mysql_file_rename(P1, P2, P3) -#endif - -/** - @def mysql_file_create_with_symlink(K, P1, P2, P3, P4, P5) - Instrumented create with symbolic link. - @c mysql_file_create_with_symlink is a replacement - for @c my_create_with_symlink. -*/ -#ifdef HAVE_PSI_INTERFACE - #define mysql_file_create_with_symlink(K, P1, P2, P3, P4, P5) \ - inline_mysql_file_create_with_symlink(K, __FILE__, __LINE__, \ - P1, P2, P3, P4, P5) -#else - #define mysql_file_create_with_symlink(K, P1, P2, P3, P4, P5) \ - inline_mysql_file_create_with_symlink(P1, P2, P3, P4, P5) -#endif - -/** - @def mysql_file_delete_with_symlink(K, P1, P2) - Instrumented delete with symbolic link. - @c mysql_file_delete_with_symlink is a replacement - for @c my_delete_with_symlink. -*/ -#ifdef HAVE_PSI_INTERFACE - #define mysql_file_delete_with_symlink(K, P1, P2) \ - inline_mysql_file_delete_with_symlink(K, __FILE__, __LINE__, P1, P2) -#else - #define mysql_file_delete_with_symlink(K, P1, P2) \ - inline_mysql_file_delete_with_symlink(P1, P2) -#endif - -/** - @def mysql_file_rename_with_symlink(K, P1, P2, P3) - Instrumented rename with symbolic link. - @c mysql_file_rename_with_symlink is a replacement - for @c my_rename_with_symlink. -*/ -#ifdef HAVE_PSI_INTERFACE - #define mysql_file_rename_with_symlink(K, P1, P2, P3) \ - inline_mysql_file_rename_with_symlink(K, __FILE__, __LINE__, P1, P2, P3) -#else - #define mysql_file_rename_with_symlink(K, P1, P2, P3) \ - inline_mysql_file_rename_with_symlink(P1, P2, P3) -#endif - -/** - @def mysql_file_sync(P1, P2) - Instrumented file sync. - @c mysql_file_sync is a replacement for @c my_sync. -*/ -#ifdef HAVE_PSI_INTERFACE - #define mysql_file_sync(P1, P2) \ - inline_mysql_file_sync(__FILE__, __LINE__, P1, P2) -#else - #define mysql_file_sync(P1, P2) \ - inline_mysql_file_sync(P1, P2) -#endif - -/** - An instrumented FILE structure. - @sa MYSQL_FILE -*/ -struct st_mysql_file -{ - /** The real file. */ - FILE *m_file; - /** - The instrumentation hook. - Note that this hook is not conditionally defined, - for binary compatibility of the @c MYSQL_FILE interface. - */ - struct PSI_file *m_psi; -}; - -/** - Type of an instrumented file. - @c MYSQL_FILE is a drop-in replacement for @c FILE. - @sa mysql_file_open -*/ -typedef struct st_mysql_file MYSQL_FILE; - -static inline char * -inline_mysql_file_fgets( -#ifdef HAVE_PSI_INTERFACE - const char *src_file, uint src_line, -#endif - char *str, int size, MYSQL_FILE *file) -{ - 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(&state, file->m_psi, - PSI_FILE_READ); - if (likely(locker != NULL)) - PSI_server->start_file_wait(locker, (size_t) size, src_file, src_line); - } -#endif - result= fgets(str, size, file->m_file); -#ifdef HAVE_PSI_INTERFACE - if (likely(locker != NULL)) - PSI_server->end_file_wait(locker, result ? strlen(result) : 0); -#endif - return result; -} - -static inline int -inline_mysql_file_fgetc( -#ifdef HAVE_PSI_INTERFACE - const char *src_file, uint src_line, -#endif - MYSQL_FILE *file) -{ - 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(&state, file->m_psi, - PSI_FILE_READ); - if (likely(locker != NULL)) - PSI_server->start_file_wait(locker, (size_t) 1, src_file, src_line); - } -#endif - result= fgetc(file->m_file); -#ifdef HAVE_PSI_INTERFACE - if (likely(locker != NULL)) - PSI_server->end_file_wait(locker, (size_t) 1); -#endif - return result; -} - -static inline int -inline_mysql_file_fputs( -#ifdef HAVE_PSI_INTERFACE - const char *src_file, uint src_line, -#endif - const char *str, MYSQL_FILE *file) -{ - 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(&state, file->m_psi, - PSI_FILE_WRITE); - if (likely(locker != NULL)) - { - bytes= str ? strlen(str) : 0; - PSI_server->start_file_wait(locker, bytes, src_file, src_line); - } - } -#endif - result= fputs(str, file->m_file); -#ifdef HAVE_PSI_INTERFACE - if (likely(locker != NULL)) - PSI_server->end_file_wait(locker, bytes); -#endif - return result; -} - -static inline int -inline_mysql_file_fputc( -#ifdef HAVE_PSI_INTERFACE - const char *src_file, uint src_line, -#endif - char c, MYSQL_FILE *file) -{ - 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(&state, file->m_psi, - PSI_FILE_WRITE); - if (likely(locker != NULL)) - PSI_server->start_file_wait(locker, (size_t) 1, src_file, src_line); - } -#endif - result= fputc(c, file->m_file); -#ifdef HAVE_PSI_INTERFACE - if (likely(locker != NULL)) - PSI_server->end_file_wait(locker, (size_t) 1); -#endif - return result; -} - -static inline int -inline_mysql_file_fprintf(MYSQL_FILE *file, const char *format, ...) -{ - /* - TODO: figure out how to pass src_file and src_line from the caller. - */ - int result; - 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(&state, file->m_psi, - PSI_FILE_WRITE); - if (likely(locker != NULL)) - PSI_server->start_file_wait(locker, (size_t) 0, __FILE__, __LINE__); - } -#endif - va_start(args, format); - result= vfprintf(file->m_file, format, args); - va_end(args); -#ifdef HAVE_PSI_INTERFACE - if (likely(locker != NULL)) - PSI_server->end_file_wait(locker, (size_t) result); -#endif - return result; -} - -static inline int -inline_mysql_file_vfprintf( -#ifdef HAVE_PSI_INTERFACE - const char *src_file, uint src_line, -#endif - MYSQL_FILE *file, const char *format, va_list args) -{ - 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(&state, file->m_psi, - PSI_FILE_WRITE); - if (likely(locker != NULL)) - PSI_server->start_file_wait(locker, (size_t) 0, src_file, src_line); - } -#endif - result= vfprintf(file->m_file, format, args); -#ifdef HAVE_PSI_INTERFACE - if (likely(locker != NULL)) - PSI_server->end_file_wait(locker, (size_t) result); -#endif - return result; -} - -static inline int -inline_mysql_file_fflush( -#ifdef HAVE_PSI_INTERFACE - const char *src_file, uint src_line, -#endif - MYSQL_FILE *file) -{ - 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(&state, file->m_psi, - PSI_FILE_FLUSH); - if (likely(locker != NULL)) - PSI_server->start_file_wait(locker, (size_t) 0, src_file, src_line); - } -#endif - result= fflush(file->m_file); -#ifdef HAVE_PSI_INTERFACE - if (likely(locker != NULL)) - PSI_server->end_file_wait(locker, (size_t) 0); -#endif - return result; -} - -static inline int inline_mysql_file_feof(MYSQL_FILE *file) -{ - /* Not instrumented, there is no wait involved */ - return feof(file->m_file); -} - -static inline int -inline_mysql_file_fstat( -#ifdef HAVE_PSI_INTERFACE - const char *src_file, uint src_line, -#endif - int filenr, MY_STAT *stat_area, myf flags) -{ - 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(&state, filenr, - PSI_FILE_FSTAT); - if (likely(locker != NULL)) - PSI_server->start_file_wait(locker, (size_t) 0, src_file, src_line); - } -#endif - result= my_fstat(filenr, stat_area, flags); -#ifdef HAVE_PSI_INTERFACE - if (likely(locker != NULL)) - PSI_server->end_file_wait(locker, (size_t) 0); -#endif - return result; -} - -static inline MY_STAT * -inline_mysql_file_stat( -#ifdef HAVE_PSI_INTERFACE - PSI_file_key key, const char *src_file, uint src_line, -#endif - const char *path, MY_STAT *stat_area, myf flags) -{ - 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(&state, - key, PSI_FILE_STAT, - path, &locker); - if (likely(locker != NULL)) - PSI_server->start_file_open_wait(locker, src_file, src_line); - } -#endif - result= my_stat(path, stat_area, flags); -#ifdef HAVE_PSI_INTERFACE - if (likely(locker != NULL)) - PSI_server->end_file_wait(locker, (size_t) 0); -#endif - return result; -} - -static inline int -inline_mysql_file_chsize( -#ifdef HAVE_PSI_INTERFACE - const char *src_file, uint src_line, -#endif - File file, my_off_t newlength, int filler, myf flags) -{ - 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(&state, file, - PSI_FILE_CHSIZE); - if (likely(locker != NULL)) - PSI_server->start_file_wait(locker, (size_t) newlength, src_file, - src_line); - } -#endif - result= my_chsize(file, newlength, filler, flags); -#ifdef HAVE_PSI_INTERFACE - if (likely(locker != NULL)) - PSI_server->end_file_wait(locker, (size_t) newlength); -#endif - return result; -} - -static inline MYSQL_FILE* -inline_mysql_file_fopen( -#ifdef HAVE_PSI_INTERFACE - PSI_file_key key, const char *src_file, uint src_line, -#endif - const char *filename, int flags, myf myFlags) -{ - MYSQL_FILE *that; - that= (MYSQL_FILE*) my_malloc(sizeof(MYSQL_FILE), MYF(MY_WME)); - if (likely(that != NULL)) - { - that->m_psi= NULL; - { -#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 - (&state, key, PSI_FILE_STREAM_OPEN, filename, that); - if (likely(locker != NULL)) - that->m_psi= PSI_server->start_file_open_wait(locker, src_file, - src_line); - } -#endif - that->m_file= my_fopen(filename, flags, myFlags); -#ifdef HAVE_PSI_INTERFACE - if (likely(locker != NULL)) - PSI_server->end_file_open_wait(locker); -#endif - if (unlikely(that->m_file == NULL)) - { - my_free(that); - return NULL; - } - } - } - return that; -} - -static inline int -inline_mysql_file_fclose( -#ifdef HAVE_PSI_INTERFACE - const char *src_file, uint src_line, -#endif - MYSQL_FILE *file, myf flags) -{ - int result= 0; - if (likely(file != NULL)) - { -#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(&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); - } -#endif - result= my_fclose(file->m_file, flags); -#ifdef HAVE_PSI_INTERFACE - if (likely(locker != NULL)) - PSI_server->end_file_wait(locker, (size_t) 0); -#endif - my_free(file); - } - return result; -} - -static inline size_t -inline_mysql_file_fread( -#ifdef HAVE_PSI_INTERFACE - const char *src_file, uint src_line, -#endif - MYSQL_FILE *file, uchar *buffer, size_t count, myf flags) -{ - 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(&state, file->m_psi, - PSI_FILE_READ); - if (likely(locker != NULL)) - PSI_server->start_file_wait(locker, count, src_file, src_line); - } -#endif - result= my_fread(file->m_file, buffer, count, flags); -#ifdef HAVE_PSI_INTERFACE - if (likely(locker != NULL)) - { - size_t bytes_read; - if (flags & (MY_NABP | MY_FNABP)) - bytes_read= (result == 0) ? count : 0; - else - bytes_read= (result != MY_FILE_ERROR) ? result : 0; - PSI_server->end_file_wait(locker, bytes_read); - } -#endif - return result; -} - -static inline size_t -inline_mysql_file_fwrite( -#ifdef HAVE_PSI_INTERFACE - const char *src_file, uint src_line, -#endif - MYSQL_FILE *file, const uchar *buffer, size_t count, myf flags) -{ - 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(&state, file->m_psi, - PSI_FILE_WRITE); - if (likely(locker != NULL)) - PSI_server->start_file_wait(locker, count, src_file, src_line); - } -#endif - result= my_fwrite(file->m_file, buffer, count, flags); -#ifdef HAVE_PSI_INTERFACE - if (likely(locker != NULL)) - { - size_t bytes_written; - if (flags & (MY_NABP | MY_FNABP)) - bytes_written= (result == 0) ? count : 0; - else - bytes_written= (result != MY_FILE_ERROR) ? result : 0; - PSI_server->end_file_wait(locker, bytes_written); - } -#endif - return result; -} - -static inline my_off_t -inline_mysql_file_fseek( -#ifdef HAVE_PSI_INTERFACE - const char *src_file, uint src_line, -#endif - MYSQL_FILE *file, my_off_t pos, int whence, myf flags) -{ - 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(&state, file->m_psi, - PSI_FILE_SEEK); - if (likely(locker != NULL)) - PSI_server->start_file_wait(locker, (size_t) 0, src_file, src_line); - } -#endif - result= my_fseek(file->m_file, pos, whence, flags); -#ifdef HAVE_PSI_INTERFACE - if (likely(locker != NULL)) - PSI_server->end_file_wait(locker, (size_t) 0); -#endif - return result; -} - -static inline my_off_t -inline_mysql_file_ftell( -#ifdef HAVE_PSI_INTERFACE - const char *src_file, uint src_line, -#endif - MYSQL_FILE *file, myf flags) -{ - 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(&state, file->m_psi, - PSI_FILE_TELL); - if (likely(locker != NULL)) - PSI_server->start_file_wait(locker, (size_t) 0, src_file, src_line); - } -#endif - result= my_ftell(file->m_file, flags); -#ifdef HAVE_PSI_INTERFACE - if (likely(locker != NULL)) - PSI_server->end_file_wait(locker, (size_t) 0); -#endif - return result; -} - -static inline File -inline_mysql_file_create( -#ifdef HAVE_PSI_INTERFACE - PSI_file_key key, const char *src_file, uint src_line, -#endif - const char *filename, int create_flags, int access_flags, myf myFlags) -{ - 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(&state, key, PSI_FILE_CREATE, - filename, &locker); - if (likely(locker != NULL)) - PSI_server->start_file_open_wait(locker, src_file, src_line); - } -#endif - file= my_create(filename, create_flags, access_flags, myFlags); -#ifdef HAVE_PSI_INTERFACE - if (likely(locker != NULL)) - PSI_server->end_file_open_wait_and_bind_to_descriptor(locker, file); -#endif - return file; -} - -static inline File -inline_mysql_file_create_temp( -#ifdef HAVE_PSI_INTERFACE - PSI_file_key key, -#endif - char *to, const char *dir, const char *pfx, int mode, myf myFlags) -{ - File file; - /* - TODO: This event is instrumented, but not timed. - The problem is that the file name is now known - before the create_temp_file call. - */ - file= create_temp_file(to, dir, pfx, mode, myFlags); -#ifdef HAVE_PSI_INTERFACE - if (likely(PSI_server != NULL)) - PSI_server->create_file(key, to, file); -#endif - return file; -} - -static inline File -inline_mysql_file_open( -#ifdef HAVE_PSI_INTERFACE - PSI_file_key key, const char *src_file, uint src_line, -#endif - const char *filename, int flags, myf myFlags) -{ - 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(&state, key, PSI_FILE_OPEN, - filename, &locker); - if (likely(locker != NULL)) - PSI_server->start_file_open_wait(locker, src_file, src_line); - } -#endif - file= my_open(filename, flags, myFlags); -#ifdef HAVE_PSI_INTERFACE - if (likely(locker != NULL)) - PSI_server->end_file_open_wait_and_bind_to_descriptor(locker, file); -#endif - return file; -} - -static inline int -inline_mysql_file_close( -#ifdef HAVE_PSI_INTERFACE - const char *src_file, uint src_line, -#endif - File file, myf flags) -{ - 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(&state, file, - PSI_FILE_CLOSE); - if (likely(locker != NULL)) - PSI_server->start_file_wait(locker, (size_t) 0, src_file, src_line); - } -#endif - result= my_close(file, flags); -#ifdef HAVE_PSI_INTERFACE - if (likely(locker != NULL)) - PSI_server->end_file_wait(locker, (size_t) 0); -#endif - return result; -} - -static inline size_t -inline_mysql_file_read( -#ifdef HAVE_PSI_INTERFACE - const char *src_file, uint src_line, -#endif - File file, uchar *buffer, size_t count, myf flags) -{ - 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(&state, file, - PSI_FILE_READ); - if (likely(locker != NULL)) - PSI_server->start_file_wait(locker, count, src_file, src_line); - } -#endif - result= my_read(file, buffer, count, flags); -#ifdef HAVE_PSI_INTERFACE - if (likely(locker != NULL)) - { - size_t bytes_read; - if (flags & (MY_NABP | MY_FNABP)) - bytes_read= (result == 0) ? count : 0; - else - bytes_read= (result != MY_FILE_ERROR) ? result : 0; - PSI_server->end_file_wait(locker, bytes_read); - } -#endif - return result; -} - -static inline size_t -inline_mysql_file_write( -#ifdef HAVE_PSI_INTERFACE - const char *src_file, uint src_line, -#endif - File file, const uchar *buffer, size_t count, myf flags) -{ - 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(&state, file, - PSI_FILE_WRITE); - if (likely(locker != NULL)) - PSI_server->start_file_wait(locker, count, src_file, src_line); - } -#endif - result= my_write(file, buffer, count, flags); -#ifdef HAVE_PSI_INTERFACE - if (likely(locker != NULL)) - { - size_t bytes_written; - if (flags & (MY_NABP | MY_FNABP)) - bytes_written= (result == 0) ? count : 0; - else - bytes_written= (result != MY_FILE_ERROR) ? result : 0; - PSI_server->end_file_wait(locker, bytes_written); - } -#endif - return result; -} - -static inline size_t -inline_mysql_file_pread( -#ifdef HAVE_PSI_INTERFACE - const char *src_file, uint src_line, -#endif - File file, uchar *buffer, size_t count, my_off_t offset, myf flags) -{ - 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(&state, file, PSI_FILE_READ); - if (likely(locker != NULL)) - PSI_server->start_file_wait(locker, count, src_file, src_line); - } -#endif - result= my_pread(file, buffer, count, offset, flags); -#ifdef HAVE_PSI_INTERFACE - if (likely(locker != NULL)) - { - size_t bytes_read; - if (flags & (MY_NABP | MY_FNABP)) - bytes_read= (result == 0) ? count : 0; - else - bytes_read= (result != MY_FILE_ERROR) ? result : 0; - PSI_server->end_file_wait(locker, bytes_read); - } -#endif - return result; -} - -static inline size_t -inline_mysql_file_pwrite( -#ifdef HAVE_PSI_INTERFACE - const char *src_file, uint src_line, -#endif - File file, const uchar *buffer, size_t count, my_off_t offset, myf flags) -{ - 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(&state, file, - PSI_FILE_WRITE); - if (likely(locker != NULL)) - PSI_server->start_file_wait(locker, count, src_file, src_line); - } -#endif - result= my_pwrite(file, buffer, count, offset, flags); -#ifdef HAVE_PSI_INTERFACE - if (likely(locker != NULL)) - { - size_t bytes_written; - if (flags & (MY_NABP | MY_FNABP)) - bytes_written= (result == 0) ? count : 0; - else - bytes_written= (result != MY_FILE_ERROR) ? result : 0; - PSI_server->end_file_wait(locker, bytes_written); - } -#endif - return result; -} - -static inline my_off_t -inline_mysql_file_seek( -#ifdef HAVE_PSI_INTERFACE - const char *src_file, uint src_line, -#endif - File file, my_off_t pos, int whence, myf flags) -{ - 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(&state, file, PSI_FILE_SEEK); - if (likely(locker != NULL)) - PSI_server->start_file_wait(locker, (size_t) 0, src_file, src_line); - } -#endif - result= my_seek(file, pos, whence, flags); -#ifdef HAVE_PSI_INTERFACE - if (likely(locker != NULL)) - PSI_server->end_file_wait(locker, (size_t) 0); -#endif - return result; -} - -static inline my_off_t -inline_mysql_file_tell( -#ifdef HAVE_PSI_INTERFACE - const char *src_file, uint src_line, -#endif - File file, myf flags) -{ - 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(&state, file, PSI_FILE_TELL); - if (likely(locker != NULL)) - PSI_server->start_file_wait(locker, (size_t) 0, src_file, src_line); - } -#endif - result= my_tell(file, flags); -#ifdef HAVE_PSI_INTERFACE - if (likely(locker != NULL)) - PSI_server->end_file_wait(locker, (size_t) 0); -#endif - return result; -} - -static inline int -inline_mysql_file_delete( -#ifdef HAVE_PSI_INTERFACE - PSI_file_key key, const char *src_file, uint src_line, -#endif - const char *name, myf flags) -{ - 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(&state, key, PSI_FILE_DELETE, - name, &locker); - if (likely(locker != NULL)) - PSI_server->start_file_wait(locker, (size_t) 0, src_file, src_line); - } -#endif - result= my_delete(name, flags); -#ifdef HAVE_PSI_INTERFACE - if (likely(locker != NULL)) - PSI_server->end_file_wait(locker, (size_t) 0); -#endif - return result; -} - -static inline int -inline_mysql_file_rename( -#ifdef HAVE_PSI_INTERFACE - PSI_file_key key, const char *src_file, uint src_line, -#endif - const char *from, const char *to, myf flags) -{ - 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(&state, key, PSI_FILE_RENAME, - to, &locker); - if (likely(locker != NULL)) - PSI_server->start_file_wait(locker, (size_t) 0, src_file, src_line); - } -#endif - result= my_rename(from, to, flags); -#ifdef HAVE_PSI_INTERFACE - if (likely(locker != NULL)) - PSI_server->end_file_wait(locker, (size_t) 0); -#endif - return result; -} - -static inline File -inline_mysql_file_create_with_symlink( -#ifdef HAVE_PSI_INTERFACE - PSI_file_key key, const char *src_file, uint src_line, -#endif - const char *linkname, const char *filename, int create_flags, - int access_flags, myf flags) -{ - 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(&state, key, PSI_FILE_CREATE, - filename, &locker); - if (likely(locker != NULL)) - PSI_server->start_file_open_wait(locker, src_file, src_line); - } -#endif - file= my_create_with_symlink(linkname, filename, create_flags, access_flags, - flags); -#ifdef HAVE_PSI_INTERFACE - if (likely(locker != NULL)) - PSI_server->end_file_open_wait_and_bind_to_descriptor(locker, file); -#endif - return file; -} - -static inline int -inline_mysql_file_delete_with_symlink( -#ifdef HAVE_PSI_INTERFACE - PSI_file_key key, const char *src_file, uint src_line, -#endif - const char *name, myf flags) -{ - 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(&state, key, PSI_FILE_DELETE, - name, &locker); - if (likely(locker != NULL)) - PSI_server->start_file_wait(locker, (size_t) 0, src_file, src_line); - } -#endif - result= my_delete_with_symlink(name, flags); -#ifdef HAVE_PSI_INTERFACE - if (likely(locker != NULL)) - PSI_server->end_file_wait(locker, (size_t) 0); -#endif - return result; -} - -static inline int -inline_mysql_file_rename_with_symlink( -#ifdef HAVE_PSI_INTERFACE - PSI_file_key key, const char *src_file, uint src_line, -#endif - const char *from, const char *to, myf flags) -{ - 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(&state, key, PSI_FILE_RENAME, - to, &locker); - if (likely(locker != NULL)) - PSI_server->start_file_wait(locker, (size_t) 0, src_file, src_line); - } -#endif - result= my_rename_with_symlink(from, to, flags); -#ifdef HAVE_PSI_INTERFACE - if (likely(locker != NULL)) - PSI_server->end_file_wait(locker, (size_t) 0); -#endif - return result; -} - -static inline int -inline_mysql_file_sync( -#ifdef HAVE_PSI_INTERFACE - const char *src_file, uint src_line, -#endif - File fd, myf flags) -{ - 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(&state, fd, PSI_FILE_SYNC); - if (likely(locker != NULL)) - PSI_server->start_file_wait(locker, (size_t) 0, src_file, src_line); - } -#endif - result= my_sync(fd, flags); -#ifdef HAVE_PSI_INTERFACE - if (likely(locker != NULL)) - PSI_server->end_file_wait(locker, (size_t) 0); -#endif - return result; -} - -/** @} (end of group File_instrumentation) */ - -#endif - diff --git a/dep/mysqllite/include/mysql/psi/mysql_thread.h b/dep/mysqllite/include/mysql/psi/mysql_thread.h deleted file mode 100644 index 5b8ea3dc5dc..00000000000 --- a/dep/mysqllite/include/mysql/psi/mysql_thread.h +++ /dev/null @@ -1,1071 +0,0 @@ -/* 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 - 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, - 51 Franklin Street, Suite 500, Boston, MA 02110-1335 USA */ - -#ifndef MYSQL_THREAD_H -#define MYSQL_THREAD_H - -/** - @file mysql/psi/mysql_thread.h - Instrumentation helpers for mysys threads, mutexes, - read write locks and conditions. - This header file provides the necessary declarations - to use the mysys thread API with the performance schema instrumentation. - In some compilers (SunStudio), 'static inline' functions, when declared - but not used, are not optimized away (because they are unused) by default, - so that including a static inline function from a header file does - create unwanted dependencies, causing unresolved symbols at link time. - Other compilers, like gcc, optimize these dependencies by default. - - Since the instrumented APIs declared here are wrapper on top - of my_pthread / safemutex / etc APIs, - including mysql/psi/mysql_thread.h assumes that - the dependency on my_pthread and safemutex already exists. -*/ -/* - Note: there are several orthogonal dimensions here. - - Dimension 1: Instrumentation - HAVE_PSI_INTERFACE is defined when the instrumentation is compiled in. - This may happen both in debug or production builds. - - Dimension 2: Debug - SAFE_MUTEX is defined when debug is compiled in. - This may happen both with and without instrumentation. - - Dimension 3: Platform - Mutexes are implemented with one of: - - the pthread library - - fast mutexes - - window apis - This is implemented by various macro definitions in my_pthread.h - - This causes complexity with '#ifdef'-ery that can't be avoided. -*/ - -#include "mysql/psi/psi.h" - -/** - @defgroup Thread_instrumentation Thread Instrumentation - @ingroup Instrumentation_interface - @{ -*/ - -/** - An instrumented mutex structure. - @sa mysql_mutex_t -*/ -struct st_mysql_mutex -{ - /** The real mutex. */ - pthread_mutex_t m_mutex; - /** - The instrumentation hook. - Note that this hook is not conditionally defined, - for binary compatibility of the @c mysql_mutex_t interface. - */ - struct PSI_mutex *m_psi; -}; - -/** - Type of an instrumented mutex. - @c mysql_mutex_t is a drop-in replacement for @c pthread_mutex_t. - @sa mysql_mutex_assert_owner - @sa mysql_mutex_assert_not_owner - @sa mysql_mutex_init - @sa mysql_mutex_lock - @sa mysql_mutex_unlock - @sa mysql_mutex_destroy -*/ -typedef struct st_mysql_mutex mysql_mutex_t; - -/** - An instrumented rwlock structure. - @sa mysql_rwlock_t -*/ -struct st_mysql_rwlock -{ - /** The real rwlock */ - rw_lock_t m_rwlock; - /** - The instrumentation hook. - Note that this hook is not conditionally defined, - for binary compatibility of the @c mysql_rwlock_t interface. - */ - struct PSI_rwlock *m_psi; -}; - -/** - An instrumented prlock structure. - @sa mysql_prlock_t -*/ -struct st_mysql_prlock -{ - /** The real prlock */ - rw_pr_lock_t m_prlock; - /** - The instrumentation hook. - Note that this hook is not conditionally defined, - for binary compatibility of the @c mysql_rwlock_t interface. - */ - struct PSI_rwlock *m_psi; -}; - -/** - Type of an instrumented rwlock. - @c mysql_rwlock_t is a drop-in replacement for @c pthread_rwlock_t. - @sa mysql_rwlock_init - @sa mysql_rwlock_rdlock - @sa mysql_rwlock_tryrdlock - @sa mysql_rwlock_wrlock - @sa mysql_rwlock_trywrlock - @sa mysql_rwlock_unlock - @sa mysql_rwlock_destroy -*/ -typedef struct st_mysql_rwlock mysql_rwlock_t; - -/** - Type of an instrumented prlock. - 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. - @sa mysql_prlock_init - @sa mysql_prlock_rdlock - @sa mysql_prlock_wrlock - @sa mysql_prlock_unlock - @sa mysql_prlock_destroy -*/ -typedef struct st_mysql_prlock mysql_prlock_t; - -/** - An instrumented cond structure. - @sa mysql_cond_t -*/ -struct st_mysql_cond -{ - /** The real condition */ - pthread_cond_t m_cond; - /** - The instrumentation hook. - Note that this hook is not conditionally defined, - for binary compatibility of the @c mysql_cond_t interface. - */ - struct PSI_cond *m_psi; -}; - -/** - Type of an instrumented condition. - @c mysql_cond_t is a drop-in replacement for @c pthread_cond_t. - @sa mysql_cond_init - @sa mysql_cond_wait - @sa mysql_cond_timedwait - @sa mysql_cond_signal - @sa mysql_cond_broadcast - @sa mysql_cond_destroy -*/ -typedef struct st_mysql_cond mysql_cond_t; - -/* - Consider the following code: - static inline void foo() { bar(); } - when foo() is never called. - - With gcc, foo() is a local static function, so the dependencies - are optimized away at compile time, and there is no dependency on bar(). - With other compilers (HP, Sun Studio), the function foo() implementation - is compiled, and bar() needs to be present to link. - - Due to the existing header dependencies in MySQL code, this header file - is sometime used when it is not needed, which in turn cause link failures - on some platforms. - The proper fix would be to cut these extra dependencies in the calling code. - DISABLE_MYSQL_THREAD_H is a work around to limit dependencies. - DISABLE_MYSQL_PRLOCK_H is similar, and is used to disable specifically - the prlock wrappers. -*/ -#ifndef DISABLE_MYSQL_THREAD_H - -/** - @def mysql_mutex_assert_owner(M) - Wrapper, to use safe_mutex_assert_owner with instrumented mutexes. - @c mysql_mutex_assert_owner is a drop-in replacement - for @c safe_mutex_assert_owner. -*/ -#define mysql_mutex_assert_owner(M) \ - safe_mutex_assert_owner(&(M)->m_mutex) - -/** - @def mysql_mutex_assert_not_owner(M) - Wrapper, to use safe_mutex_assert_not_owner with instrumented mutexes. - @c mysql_mutex_assert_not_owner is a drop-in replacement - for @c safe_mutex_assert_not_owner. -*/ -#define mysql_mutex_assert_not_owner(M) \ - 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) - Instrumented 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 M The mutex to initialize - @param A Mutex attributes -*/ - -#ifdef HAVE_PSI_INTERFACE - #ifdef SAFE_MUTEX - #define mysql_mutex_init(K, M, A) \ - inline_mysql_mutex_init(K, M, A, __FILE__, __LINE__) - #else - #define mysql_mutex_init(K, M, A) \ - inline_mysql_mutex_init(K, M, A) - #endif -#else - #ifdef SAFE_MUTEX - #define mysql_mutex_init(K, M, A) \ - inline_mysql_mutex_init(M, A, __FILE__, __LINE__) - #else - #define mysql_mutex_init(K, M, A) \ - inline_mysql_mutex_init(M, A) - #endif -#endif - -/** - @def mysql_mutex_destroy(M) - Instrumented mutex_destroy. - @c mysql_mutex_destroy is a drop-in replacement - for @c pthread_mutex_destroy. -*/ -#ifdef SAFE_MUTEX - #define mysql_mutex_destroy(M) \ - inline_mysql_mutex_destroy(M, __FILE__, __LINE__) -#else - #define mysql_mutex_destroy(M) \ - inline_mysql_mutex_destroy(M) -#endif - -/** - @def mysql_mutex_lock(M) - Instrumented mutex_lock. - @c mysql_mutex_lock is a drop-in replacement for @c pthread_mutex_lock. - @param M The mutex to lock -*/ - -#if defined(SAFE_MUTEX) || defined (HAVE_PSI_INTERFACE) - #define mysql_mutex_lock(M) \ - inline_mysql_mutex_lock(M, __FILE__, __LINE__) -#else - #define mysql_mutex_lock(M) \ - inline_mysql_mutex_lock(M) -#endif - -/** - @def mysql_mutex_trylock(M) - Instrumented mutex_lock. - @c mysql_mutex_trylock is a drop-in replacement - for @c pthread_mutex_trylock. -*/ - -#if defined(SAFE_MUTEX) || defined (HAVE_PSI_INTERFACE) - #define mysql_mutex_trylock(M) \ - inline_mysql_mutex_trylock(M, __FILE__, __LINE__) -#else - #define mysql_mutex_trylock(M) \ - inline_mysql_mutex_trylock(M) -#endif - -/** - @def mysql_mutex_unlock(M) - Instrumented mutex_unlock. - @c mysql_mutex_unlock is a drop-in replacement for @c pthread_mutex_unlock. -*/ -#ifdef SAFE_MUTEX - #define mysql_mutex_unlock(M) \ - inline_mysql_mutex_unlock(M, __FILE__, __LINE__) -#else - #define mysql_mutex_unlock(M) \ - inline_mysql_mutex_unlock(M) -#endif - -/** - @def mysql_rwlock_init(K, RW) - Instrumented rwlock_init. - @c mysql_rwlock_init is a replacement for @c pthread_rwlock_init. - Note that pthread_rwlockattr_t is not supported in MySQL. - @param K The PSI_rwlock_key for this instrumented rwlock - @param RW The rwlock to initialize -*/ -#ifdef HAVE_PSI_INTERFACE - #define mysql_rwlock_init(K, RW) inline_mysql_rwlock_init(K, RW) -#else - #define mysql_rwlock_init(K, RW) inline_mysql_rwlock_init(RW) -#endif - -/** - @def mysql_prlock_init(K, RW) - Instrumented rw_pr_init. - @c mysql_prlock_init is a replacement for @c rw_pr_init. - @param K The PSI_rwlock_key for this instrumented prlock - @param RW The prlock to initialize -*/ -#ifdef HAVE_PSI_INTERFACE - #define mysql_prlock_init(K, RW) inline_mysql_prlock_init(K, RW) -#else - #define mysql_prlock_init(K, RW) inline_mysql_prlock_init(RW) -#endif - -/** - @def mysql_rwlock_destroy(RW) - Instrumented rwlock_destroy. - @c mysql_rwlock_destroy is a drop-in replacement - for @c pthread_rwlock_destroy. -*/ -#define mysql_rwlock_destroy(RW) inline_mysql_rwlock_destroy(RW) - -/** - @def mysql_prlock_destroy(RW) - Instrumented rw_pr_destroy. - @c mysql_prlock_destroy is a drop-in replacement - for @c rw_pr_destroy. -*/ -#define mysql_prlock_destroy(RW) inline_mysql_prlock_destroy(RW) - -/** - @def mysql_rwlock_rdlock(RW) - Instrumented rwlock_rdlock. - @c mysql_rwlock_rdlock is a drop-in replacement - for @c pthread_rwlock_rdlock. -*/ -#ifdef HAVE_PSI_INTERFACE - #define mysql_rwlock_rdlock(RW) \ - inline_mysql_rwlock_rdlock(RW, __FILE__, __LINE__) -#else - #define mysql_rwlock_rdlock(RW) \ - inline_mysql_rwlock_rdlock(RW) -#endif - -/** - @def mysql_prlock_rdlock(RW) - Instrumented rw_pr_rdlock. - @c mysql_prlock_rdlock is a drop-in replacement - for @c rw_pr_rdlock. -*/ -#ifdef HAVE_PSI_INTERFACE - #define mysql_prlock_rdlock(RW) \ - inline_mysql_prlock_rdlock(RW, __FILE__, __LINE__) -#else - #define mysql_prlock_rdlock(RW) \ - inline_mysql_prlock_rdlock(RW) -#endif - -/** - @def mysql_rwlock_wrlock(RW) - Instrumented rwlock_wrlock. - @c mysql_rwlock_wrlock is a drop-in replacement - for @c pthread_rwlock_wrlock. -*/ -#ifdef HAVE_PSI_INTERFACE - #define mysql_rwlock_wrlock(RW) \ - inline_mysql_rwlock_wrlock(RW, __FILE__, __LINE__) -#else - #define mysql_rwlock_wrlock(RW) \ - inline_mysql_rwlock_wrlock(RW) -#endif - -/** - @def mysql_prlock_wrlock(RW) - Instrumented rw_pr_wrlock. - @c mysql_prlock_wrlock is a drop-in replacement - for @c rw_pr_wrlock. -*/ -#ifdef HAVE_PSI_INTERFACE - #define mysql_prlock_wrlock(RW) \ - inline_mysql_prlock_wrlock(RW, __FILE__, __LINE__) -#else - #define mysql_prlock_wrlock(RW) \ - inline_mysql_prlock_wrlock(RW) -#endif - -/** - @def mysql_rwlock_tryrdlock(RW) - Instrumented rwlock_tryrdlock. - @c mysql_rwlock_tryrdlock is a drop-in replacement - for @c pthread_rwlock_tryrdlock. -*/ -#ifdef HAVE_PSI_INTERFACE - #define mysql_rwlock_tryrdlock(RW) \ - inline_mysql_rwlock_tryrdlock(RW, __FILE__, __LINE__) -#else - #define mysql_rwlock_tryrdlock(RW) \ - inline_mysql_rwlock_tryrdlock(RW) -#endif - -/** - @def mysql_rwlock_trywrlock(RW) - Instrumented rwlock_trywrlock. - @c mysql_rwlock_trywrlock is a drop-in replacement - for @c pthread_rwlock_trywrlock. -*/ -#ifdef HAVE_PSI_INTERFACE - #define mysql_rwlock_trywrlock(RW) \ - inline_mysql_rwlock_trywrlock(RW, __FILE__, __LINE__) -#else - #define mysql_rwlock_trywrlock(RW) \ - inline_mysql_rwlock_trywrlock(RW) -#endif - -/** - @def mysql_rwlock_unlock(RW) - Instrumented rwlock_unlock. - @c mysql_rwlock_unlock is a drop-in replacement - for @c pthread_rwlock_unlock. -*/ -#define mysql_rwlock_unlock(RW) inline_mysql_rwlock_unlock(RW) - -/** - @def mysql_prlock_unlock(RW) - Instrumented rw_pr_unlock. - @c mysql_prlock_unlock is a drop-in replacement - for @c rw_pr_unlock. -*/ -#define mysql_prlock_unlock(RW) inline_mysql_prlock_unlock(RW) - -/** - @def mysql_cond_init(K, C, A) - Instrumented cond_init. - @c mysql_cond_init is a replacement for @c pthread_cond_init. - @param C The cond to initialize - @param K The PSI_cond_key for this instrumented cond - @param A Condition attributes -*/ -#ifdef HAVE_PSI_INTERFACE - #define mysql_cond_init(K, C, A) inline_mysql_cond_init(K, C, A) -#else - #define mysql_cond_init(K, C, A) inline_mysql_cond_init(C, A) -#endif - -/** - @def mysql_cond_destroy(C) - Instrumented cond_destroy. - @c mysql_cond_destroy is a drop-in replacement for @c pthread_cond_destroy. -*/ -#define mysql_cond_destroy(C) inline_mysql_cond_destroy(C) - -/** - @def mysql_cond_wait(C) - Instrumented cond_wait. - @c mysql_cond_wait is a drop-in replacement for @c pthread_cond_wait. -*/ -#ifdef HAVE_PSI_INTERFACE - #define mysql_cond_wait(C, M) \ - inline_mysql_cond_wait(C, M, __FILE__, __LINE__) -#else - #define mysql_cond_wait(C, M) \ - inline_mysql_cond_wait(C, M) -#endif - -/** - @def mysql_cond_timedwait(C, M, W) - Instrumented cond_timedwait. - @c mysql_cond_timedwait is a drop-in replacement - for @c pthread_cond_timedwait. -*/ -#ifdef HAVE_PSI_INTERFACE - #define mysql_cond_timedwait(C, M, W) \ - inline_mysql_cond_timedwait(C, M, W, __FILE__, __LINE__) -#else - #define mysql_cond_timedwait(C, M, W) \ - inline_mysql_cond_timedwait(C, M, W) -#endif - -/** - @def mysql_cond_signal(C) - Instrumented cond_signal. - @c mysql_cond_signal is a drop-in replacement for @c pthread_cond_signal. -*/ -#define mysql_cond_signal(C) inline_mysql_cond_signal(C) - -/** - @def mysql_cond_broadcast(C) - Instrumented cond_broadcast. - @c mysql_cond_broadcast is a drop-in replacement - for @c pthread_cond_broadcast. -*/ -#define mysql_cond_broadcast(C) inline_mysql_cond_broadcast(C) - - -/** - @def mysql_thread_create(K, P1, P2, P3, P4) - Instrumented pthread_create. - This function creates both the thread instrumentation and a thread. - @c mysql_thread_create is a replacement for @c pthread_create. - The parameter P4 (or, if it is NULL, P1) will be used as the - instrumented thread "indentity". - Providing a P1 / P4 parameter with a different value for each call - will on average improve performances, since this thread identity value - is used internally to randomize access to data and prevent contention. - This is optional, and the improvement is not guaranteed, only statistical. - @param K The PSI_thread_key for this instrumented thread - @param P1 pthread_create parameter 1 - @param P2 pthread_create parameter 2 - @param P3 pthread_create parameter 3 - @param P4 pthread_create parameter 4 -*/ -#ifdef HAVE_PSI_INTERFACE - #define mysql_thread_create(K, P1, P2, P3, P4) \ - inline_mysql_thread_create(K, P1, P2, P3, P4) -#else - #define mysql_thread_create(K, P1, P2, P3, P4) \ - pthread_create(P1, P2, P3, P4) -#endif - -/** - @def mysql_thread_set_psi_id(I) - Set the thread indentifier for the instrumentation. - @param I The thread identifier -*/ -#ifdef HAVE_PSI_INTERFACE - #define mysql_thread_set_psi_id(I) inline_mysql_thread_set_psi_id(I) -#else - #define mysql_thread_set_psi_id(I) do {} while (0) -#endif - -static inline int inline_mysql_mutex_init( -#ifdef HAVE_PSI_INTERFACE - PSI_mutex_key key, -#endif - mysql_mutex_t *that, - const pthread_mutexattr_t *attr -#ifdef SAFE_MUTEX - , const char *src_file, uint src_line -#endif - ) -{ -#ifdef HAVE_PSI_INTERFACE - that->m_psi= PSI_server ? PSI_server->init_mutex(key, &that->m_mutex) - : NULL; -#else - that->m_psi= NULL; -#endif -#ifdef SAFE_MUTEX - return safe_mutex_init(&that->m_mutex, attr, src_file, src_line); -#else - return pthread_mutex_init(&that->m_mutex, attr); -#endif -} - -static inline int inline_mysql_mutex_destroy( - mysql_mutex_t *that -#ifdef SAFE_MUTEX - , const char *src_file, uint src_line -#endif - ) -{ -#ifdef HAVE_PSI_INTERFACE - if (likely(PSI_server && that->m_psi)) - { - PSI_server->destroy_mutex(that->m_psi); - that->m_psi= NULL; - } -#endif -#ifdef SAFE_MUTEX - return safe_mutex_destroy(&that->m_mutex, src_file, src_line); -#else - return pthread_mutex_destroy(&that->m_mutex); -#endif -} - -static inline int inline_mysql_mutex_lock( - mysql_mutex_t *that -#if defined(SAFE_MUTEX) || defined (HAVE_PSI_INTERFACE) - , const char *src_file, uint src_line -#endif - ) -{ - 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(&state, that->m_psi, PSI_MUTEX_LOCK); - if (likely(locker != NULL)) - PSI_server->start_mutex_wait(locker, src_file, src_line); - } -#endif -#ifdef SAFE_MUTEX - result= safe_mutex_lock(&that->m_mutex, FALSE, src_file, src_line); -#else - result= pthread_mutex_lock(&that->m_mutex); -#endif -#ifdef HAVE_PSI_INTERFACE - if (likely(locker != NULL)) - PSI_server->end_mutex_wait(locker, result); -#endif - return result; -} - -static inline int inline_mysql_mutex_trylock( - mysql_mutex_t *that -#if defined(SAFE_MUTEX) || defined (HAVE_PSI_INTERFACE) - , const char *src_file, uint src_line -#endif - ) -{ - 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(&state, that->m_psi, PSI_MUTEX_TRYLOCK); - if (likely(locker != NULL)) - PSI_server->start_mutex_wait(locker, src_file, src_line); - } -#endif -#ifdef SAFE_MUTEX - result= safe_mutex_lock(&that->m_mutex, TRUE, src_file, src_line); -#else - result= pthread_mutex_trylock(&that->m_mutex); -#endif -#ifdef HAVE_PSI_INTERFACE - if (likely(locker != NULL)) - PSI_server->end_mutex_wait(locker, result); -#endif - return result; -} - -static inline int inline_mysql_mutex_unlock( - mysql_mutex_t *that -#ifdef SAFE_MUTEX - , const char *src_file, uint src_line -#endif - ) -{ - int result; -#ifdef HAVE_PSI_INTERFACE - if (likely(PSI_server && 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); -#else - result= pthread_mutex_unlock(&that->m_mutex); -#endif - return result; -} - -static inline int inline_mysql_rwlock_init( -#ifdef HAVE_PSI_INTERFACE - PSI_rwlock_key key, -#endif - mysql_rwlock_t *that) -{ -#ifdef HAVE_PSI_INTERFACE - that->m_psi= (PSI_server ? PSI_server->init_rwlock(key, &that->m_rwlock) - : NULL); -#else - that->m_psi= NULL; -#endif - /* - pthread_rwlockattr_t is not used in MySQL. - */ - return my_rwlock_init(&that->m_rwlock, NULL); -} - -#ifndef DISABLE_MYSQL_PRLOCK_H -static inline int inline_mysql_prlock_init( -#ifdef HAVE_PSI_INTERFACE - PSI_rwlock_key key, -#endif - mysql_prlock_t *that) -{ -#ifdef HAVE_PSI_INTERFACE - that->m_psi= (PSI_server ? PSI_server->init_rwlock(key, &that->m_prlock) - : NULL); -#else - that->m_psi= NULL; -#endif - return rw_pr_init(&that->m_prlock); -} -#endif - -static inline int inline_mysql_rwlock_destroy( - mysql_rwlock_t *that) -{ -#ifdef HAVE_PSI_INTERFACE - if (likely(PSI_server && that->m_psi)) - { - PSI_server->destroy_rwlock(that->m_psi); - that->m_psi= NULL; - } -#endif - return rwlock_destroy(&that->m_rwlock); -} - -#ifndef DISABLE_MYSQL_PRLOCK_H -static inline int inline_mysql_prlock_destroy( - mysql_prlock_t *that) -{ -#ifdef HAVE_PSI_INTERFACE - if (likely(PSI_server && that->m_psi)) - { - PSI_server->destroy_rwlock(that->m_psi); - that->m_psi= NULL; - } -#endif - return rw_pr_destroy(&that->m_prlock); -} -#endif - -static inline int inline_mysql_rwlock_rdlock( - mysql_rwlock_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; - PSI_rwlock_locker_state state; - if (likely(PSI_server && 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); - } -#endif - result= rw_rdlock(&that->m_rwlock); -#ifdef HAVE_PSI_INTERFACE - if (likely(locker != NULL)) - PSI_server->end_rwlock_rdwait(locker, result); -#endif - return result; -} - -#ifndef DISABLE_MYSQL_PRLOCK_H -static inline int inline_mysql_prlock_rdlock( - 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; - PSI_rwlock_locker_state state; - if (likely(PSI_server && 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); - } -#endif - result= rw_pr_rdlock(&that->m_prlock); -#ifdef HAVE_PSI_INTERFACE - if (likely(locker != NULL)) - PSI_server->end_rwlock_rdwait(locker, result); -#endif - return result; -} -#endif - -static inline int inline_mysql_rwlock_wrlock( - mysql_rwlock_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; - PSI_rwlock_locker_state state; - if (likely(PSI_server && 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); - } -#endif - result= rw_wrlock(&that->m_rwlock); -#ifdef HAVE_PSI_INTERFACE - if (likely(locker != NULL)) - PSI_server->end_rwlock_wrwait(locker, result); -#endif - return result; -} - -#ifndef DISABLE_MYSQL_PRLOCK_H -static inline int inline_mysql_prlock_wrlock( - 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; - PSI_rwlock_locker_state state; - if (likely(PSI_server && 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); - } -#endif - result= rw_pr_wrlock(&that->m_prlock); -#ifdef HAVE_PSI_INTERFACE - if (likely(locker != NULL)) - PSI_server->end_rwlock_wrwait(locker, result); -#endif - return result; -} -#endif - -static inline int inline_mysql_rwlock_tryrdlock( - mysql_rwlock_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; - PSI_rwlock_locker_state state; - if (likely(PSI_server && 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); - } -#endif - result= rw_tryrdlock(&that->m_rwlock); -#ifdef HAVE_PSI_INTERFACE - if (likely(locker != NULL)) - PSI_server->end_rwlock_rdwait(locker, result); -#endif - return result; -} - -static inline int inline_mysql_rwlock_trywrlock( - mysql_rwlock_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; - PSI_rwlock_locker_state state; - if (likely(PSI_server && 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); - } -#endif - result= rw_trywrlock(&that->m_rwlock); -#ifdef HAVE_PSI_INTERFACE - if (likely(locker != NULL)) - PSI_server->end_rwlock_wrwait(locker, result); -#endif - return result; -} - -static inline int inline_mysql_rwlock_unlock( - mysql_rwlock_t *that) -{ - int result; -#ifdef HAVE_PSI_INTERFACE - if (likely(PSI_server && that->m_psi)) - PSI_server->unlock_rwlock(that->m_psi); -#endif - result= rw_unlock(&that->m_rwlock); - return result; -} - -#ifndef DISABLE_MYSQL_PRLOCK_H -static inline int inline_mysql_prlock_unlock( - mysql_prlock_t *that) -{ - int result; -#ifdef HAVE_PSI_INTERFACE - if (likely(PSI_server && that->m_psi)) - PSI_server->unlock_rwlock(that->m_psi); -#endif - result= rw_pr_unlock(&that->m_prlock); - return result; -} -#endif - -static inline int inline_mysql_cond_init( -#ifdef HAVE_PSI_INTERFACE - PSI_cond_key key, -#endif - mysql_cond_t *that, - const pthread_condattr_t *attr) -{ -#ifdef HAVE_PSI_INTERFACE - that->m_psi= (PSI_server ? PSI_server->init_cond(key, &that->m_cond) - : NULL); -#else - that->m_psi= NULL; -#endif - return pthread_cond_init(&that->m_cond, attr); -} - -static inline int inline_mysql_cond_destroy( - mysql_cond_t *that) -{ -#ifdef HAVE_PSI_INTERFACE - if (likely(PSI_server && that->m_psi)) - { - PSI_server->destroy_cond(that->m_psi); - that->m_psi= NULL; - } -#endif - return pthread_cond_destroy(&that->m_cond); -} - -static inline int inline_mysql_cond_wait( - mysql_cond_t *that, - mysql_mutex_t *mutex -#ifdef HAVE_PSI_INTERFACE - , const char *src_file, uint src_line -#endif - ) -{ - 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(&state, that->m_psi, mutex->m_psi, - PSI_COND_WAIT); - if (likely(locker != NULL)) - PSI_server->start_cond_wait(locker, src_file, src_line); - } -#endif - result= pthread_cond_wait(&that->m_cond, &mutex->m_mutex); -#ifdef HAVE_PSI_INTERFACE - if (likely(locker != NULL)) - PSI_server->end_cond_wait(locker, result); -#endif - return result; -} - -static inline int inline_mysql_cond_timedwait( - mysql_cond_t *that, - mysql_mutex_t *mutex, - struct timespec *abstime -#ifdef HAVE_PSI_INTERFACE - , const char *src_file, uint src_line -#endif - ) -{ - 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(&state, that->m_psi, mutex->m_psi, - PSI_COND_TIMEDWAIT); - if (likely(locker != NULL)) - PSI_server->start_cond_wait(locker, src_file, src_line); - } -#endif - result= pthread_cond_timedwait(&that->m_cond, &mutex->m_mutex, abstime); -#ifdef HAVE_PSI_INTERFACE - if (likely(locker != NULL)) - PSI_server->end_cond_wait(locker, result); -#endif - return result; -} - -static inline int inline_mysql_cond_signal( - mysql_cond_t *that) -{ - int result; -#ifdef HAVE_PSI_INTERFACE - if (likely(PSI_server && that->m_psi)) - PSI_server->signal_cond(that->m_psi); -#endif - result= pthread_cond_signal(&that->m_cond); - return result; -} - -static inline int inline_mysql_cond_broadcast( - mysql_cond_t *that) -{ - int result; -#ifdef HAVE_PSI_INTERFACE - if (likely(PSI_server && that->m_psi)) - PSI_server->broadcast_cond(that->m_psi); -#endif - result= pthread_cond_broadcast(&that->m_cond); - return result; -} - -#ifdef HAVE_PSI_INTERFACE -static inline int inline_mysql_thread_create( - PSI_thread_key key, - pthread_t *thread, const pthread_attr_t *attr, - void *(*start_routine)(void*), void *arg) -{ - int result; - if (likely(PSI_server != NULL)) - result= PSI_server->spawn_thread(key, thread, attr, start_routine, arg); - else - result= pthread_create(thread, attr, start_routine, arg); - return result; -} - -static inline void inline_mysql_thread_set_psi_id(ulong id) -{ - if (likely(PSI_server != NULL)) - { - struct PSI_thread *psi= PSI_server->get_thread(); - if (likely(psi != NULL)) - PSI_server->set_thread_id(psi, id); - } -} -#endif - -#endif /* DISABLE_MYSQL_THREAD_H */ - -/** @} (end of group Thread_instrumentation) */ - -#endif - diff --git a/dep/mysqllite/include/mysql/psi/psi.h b/dep/mysqllite/include/mysql/psi/psi.h deleted file mode 100644 index 562e4a80fd5..00000000000 --- a/dep/mysqllite/include/mysql/psi/psi.h +++ /dev/null @@ -1,1312 +0,0 @@ -/* 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 - 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, - 51 Franklin Street, Suite 500, Boston, MA 02110-1335 USA */ - -#ifndef MYSQL_PERFORMANCE_SCHEMA_INTERFACE_H -#define MYSQL_PERFORMANCE_SCHEMA_INTERFACE_H - -#ifndef _global_h -/* - 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, - and the resulting binary won't build, or won't link, - or will crash at runtime - since various structures will have different binary definitions. -*/ -#error "You must include my_global.h in the code for the build to be correct." -#endif - -C_MODE_START - -/** - @file mysql/psi/psi.h - Performance schema instrumentation interface. - - @defgroup Instrumentation_interface Instrumentation Interface - @ingroup Performance_schema - @{ -*/ - -/** - Interface for an instrumented mutex. - This is an opaque structure. -*/ -struct PSI_mutex; - -/** - Interface for an instrumented rwlock. - This is an opaque structure. -*/ -struct PSI_rwlock; - -/** - Interface for an instrumented condition. - This is an opaque structure. -*/ -struct PSI_cond; - -/** - Interface for an instrumented table share. - This is an opaque structure. -*/ -struct PSI_table_share; - -/** - Interface for an instrumented table handle. - This is an opaque structure. -*/ -struct PSI_table; - -/** - Interface for an instrumented thread. - This is an opaque structure. -*/ -struct PSI_thread; - -/** - Interface for an instrumented file handle. - This is an opaque structure. -*/ -struct PSI_file; - -/** Entry point for the performance schema interface. */ -struct PSI_bootstrap -{ - /** - ABI interface finder. - Calling this method with an interface version number returns either - an instance of the ABI for this version, or NULL. - @param version the interface version number to find - @return a versioned interface (PSI_v1, PSI_v2 or PSI) - @sa PSI_VERSION_1 - @sa PSI_v1 - @sa PSI_VERSION_2 - @sa PSI_v2 - @sa PSI_CURRENT_VERSION - @sa PSI - */ - void* (*get_interface)(int version); -}; - -#ifdef HAVE_PSI_INTERFACE - -/** - @def PSI_VERSION_1 - Performance Schema Interface number for version 1. - This version is supported. -*/ -#define PSI_VERSION_1 1 - -/** - @def PSI_VERSION_2 - Performance Schema Interface number for version 2. - This version is not implemented, it's a placeholder. -*/ -#define PSI_VERSION_2 2 - -/** - @def PSI_CURRENT_VERSION - Performance Schema Interface number for the most recent version. - The most current version is @c PSI_VERSION_1 -*/ -#define PSI_CURRENT_VERSION 1 - -#ifndef USE_PSI_2 -#ifndef USE_PSI_1 -#define USE_PSI_1 -#endif -#endif - -/** - Interface for an instrumented mutex operation. - This is an opaque structure. -*/ -struct PSI_mutex_locker; - -/** - Interface for an instrumented rwlock operation. - This is an opaque structure. -*/ - -struct PSI_rwlock_locker; -/** - Interface for an instrumented condition operation. - This is an opaque structure. -*/ - -struct PSI_cond_locker; - -/** - Interface for an instrumented file operation. - This is an opaque structure. -*/ -struct PSI_file_locker; - -/** Operation performed on an instrumented mutex. */ -enum PSI_mutex_operation -{ - /** Lock. */ - PSI_MUTEX_LOCK= 0, - /** Lock attempt. */ - PSI_MUTEX_TRYLOCK= 1 -}; - -/** Operation performed on an instrumented rwlock. */ -enum PSI_rwlock_operation -{ - /** Read lock. */ - PSI_RWLOCK_READLOCK= 0, - /** Write lock. */ - PSI_RWLOCK_WRITELOCK= 1, - /** Read lock attempt. */ - PSI_RWLOCK_TRYREADLOCK= 2, - /** Write lock attempt. */ - PSI_RWLOCK_TRYWRITELOCK= 3 -}; - -/** Operation performed on an instrumented condition. */ -enum PSI_cond_operation -{ - /** Wait. */ - PSI_COND_WAIT= 0, - /** Wait, with timeout. */ - PSI_COND_TIMEDWAIT= 1 -}; - -/** Operation performed on an instrumented file. */ -enum PSI_file_operation -{ - /** File creation, as in @c create(). */ - PSI_FILE_CREATE= 0, - /** Temporary file creation, as in @c create_temp_file(). */ - PSI_FILE_CREATE_TMP= 1, - /** File open, as in @c open(). */ - PSI_FILE_OPEN= 2, - /** File open, as in @c fopen(). */ - PSI_FILE_STREAM_OPEN= 3, - /** File close, as in @c close(). */ - PSI_FILE_CLOSE= 4, - /** File close, as in @c fclose(). */ - PSI_FILE_STREAM_CLOSE= 5, - /** - Generic file read, such as @c fgets(), @c fgetc(), @c fread(), @c read(), - @c pread(). - */ - PSI_FILE_READ= 6, - /** - Generic file write, such as @c fputs(), @c fputc(), @c fprintf(), - @c vfprintf(), @c fwrite(), @c write(), @c pwrite(). - */ - PSI_FILE_WRITE= 7, - /** Generic file seek, such as @c fseek() or @c seek(). */ - PSI_FILE_SEEK= 8, - /** Generic file tell, such as @c ftell() or @c tell(). */ - PSI_FILE_TELL= 9, - /** File flush, as in @c fflush(). */ - PSI_FILE_FLUSH= 10, - /** File stat, as in @c stat(). */ - PSI_FILE_STAT= 11, - /** File stat, as in @c fstat(). */ - PSI_FILE_FSTAT= 12, - /** File chsize, as in @c my_chsize(). */ - PSI_FILE_CHSIZE= 13, - /** File delete, such as @c my_delete() or @c my_delete_with_symlink(). */ - PSI_FILE_DELETE= 14, - /** File rename, such as @c my_rename() or @c my_rename_with_symlink(). */ - PSI_FILE_RENAME= 15, - /** File sync, as in @c fsync() or @c my_sync(). */ - PSI_FILE_SYNC= 16 -}; - -/** - Interface for an instrumented table operation. - This is an opaque structure. -*/ -struct PSI_table_locker; - -/** - Instrumented mutex key. - To instrument a mutex, a mutex key must be obtained using @c register_mutex. - Using a zero key always disable the instrumentation. -*/ -typedef unsigned int PSI_mutex_key; - -/** - Instrumented rwlock key. - To instrument a rwlock, a rwlock key must be obtained - using @c register_rwlock. - Using a zero key always disable the instrumentation. -*/ -typedef unsigned int PSI_rwlock_key; - -/** - Instrumented cond key. - To instrument a condition, a condition key must be obtained - using @c register_cond. - Using a zero key always disable the instrumentation. -*/ -typedef unsigned int PSI_cond_key; - -/** - Instrumented thread key. - To instrument a thread, a thread key must be obtained - using @c register_thread. - Using a zero key always disable the instrumentation. -*/ -typedef unsigned int PSI_thread_key; - -/** - Instrumented file key. - To instrument a file, a file key must be obtained using @c register_file. - Using a zero key always disable the instrumentation. -*/ -typedef unsigned int PSI_file_key; - -/** - @def USE_PSI_1 - Define USE_PSI_1 to use the interface version 1. -*/ - -/** - @def USE_PSI_2 - Define USE_PSI_2 to use the interface version 2. -*/ - -/** - @def HAVE_PSI_1 - Define HAVE_PSI_1 if the interface version 1 needs to be compiled in. -*/ - -/** - @def HAVE_PSI_2 - Define HAVE_PSI_2 if the interface version 2 needs to be compiled in. -*/ - -/** - Global flag. - This flag indicate that an instrumentation point is a global variable, - or a singleton. -*/ -#define PSI_FLAG_GLOBAL (1 << 0) - -#ifdef USE_PSI_1 -#define HAVE_PSI_1 -#endif - -#ifdef HAVE_PSI_1 - -/** - @defgroup Group_PSI_v1 Application Binary Interface, version 1 - @ingroup Instrumentation_interface - @{ -*/ - -/** - Mutex information. - @since PSI_VERSION_1 - This structure is used to register an instrumented mutex. -*/ -struct PSI_mutex_info_v1 -{ - /** - Pointer to the key assigned to the registered mutex. - */ - PSI_mutex_key *m_key; - /** - The name of the mutex to register. - */ - const char *m_name; - /** - The flags of the mutex to register. - @sa PSI_FLAG_GLOBAL - */ - int m_flags; -}; - -/** - Rwlock information. - @since PSI_VERSION_1 - This structure is used to register an instrumented rwlock. -*/ -struct PSI_rwlock_info_v1 -{ - /** - Pointer to the key assigned to the registered rwlock. - */ - PSI_rwlock_key *m_key; - /** - The name of the rwlock to register. - */ - const char *m_name; - /** - The flags of the rwlock to register. - @sa PSI_FLAG_GLOBAL - */ - int m_flags; -}; - -/** - Condition information. - @since PSI_VERSION_1 - This structure is used to register an instrumented cond. -*/ -struct PSI_cond_info_v1 -{ - /** - Pointer to the key assigned to the registered cond. - */ - PSI_cond_key *m_key; - /** - The name of the cond to register. - */ - const char *m_name; - /** - The flags of the cond to register. - @sa PSI_FLAG_GLOBAL - */ - int m_flags; -}; - -/** - Thread instrument information. - @since PSI_VERSION_1 - This structure is used to register an instrumented thread. -*/ -struct PSI_thread_info_v1 -{ - /** - Pointer to the key assigned to the registered thread. - */ - PSI_thread_key *m_key; - /** - The name of the thread instrument to register. - */ - const char *m_name; - /** - The flags of the thread to register. - @sa PSI_FLAG_GLOBAL - */ - int m_flags; -}; - -/** - File instrument information. - @since PSI_VERSION_1 - This structure is used to register an instrumented file. -*/ -struct PSI_file_info_v1 -{ - /** - Pointer to the key assigned to the registered file. - */ - PSI_file_key *m_key; - /** - The name of the file instrument to register. - */ - const char *m_name; - /** - The flags of the file instrument to register. - @sa PSI_FLAG_GLOBAL - */ - 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. */ - -/** - Mutex registration API. - @param category a category name (typically a plugin name) - @param info an array of mutex info to register - @param count the size of the info array -*/ -typedef void (*register_mutex_v1_t) - (const char *category, struct PSI_mutex_info_v1 *info, int count); - -/** - Rwlock registration API. - @param category a category name (typically a plugin name) - @param info an array of rwlock info to register - @param count the size of the info array -*/ -typedef void (*register_rwlock_v1_t) - (const char *category, struct PSI_rwlock_info_v1 *info, int count); - -/** - Cond registration API. - @param category a category name (typically a plugin name) - @param info an array of cond info to register - @param count the size of the info array -*/ -typedef void (*register_cond_v1_t) - (const char *category, struct PSI_cond_info_v1 *info, int count); - -/** - Thread registration API. - @param category a category name (typically a plugin name) - @param info an array of thread info to register - @param count the size of the info array -*/ -typedef void (*register_thread_v1_t) - (const char *category, struct PSI_thread_info_v1 *info, int count); - -/** - File registration API. - @param category a category name (typically a plugin name) - @param info an array of file info to register - @param count the size of the info array -*/ -typedef void (*register_file_v1_t) - (const char *category, struct PSI_file_info_v1 *info, int count); - -/** - Mutex instrumentation initialisation API. - @param key the registered mutex key - @param identity the address of the mutex itself - @return an instrumented mutex -*/ -typedef struct PSI_mutex* (*init_mutex_v1_t) - (PSI_mutex_key key, const void *identity); - -/** - Mutex instrumentation destruction API. - @param mutex the mutex to destroy -*/ -typedef void (*destroy_mutex_v1_t)(struct PSI_mutex *mutex); - -/** - Rwlock instrumentation initialisation API. - @param key the registered rwlock key - @param identity the address of the rwlock itself - @return an instrumented rwlock -*/ -typedef struct PSI_rwlock* (*init_rwlock_v1_t) - (PSI_rwlock_key key, const void *identity); - -/** - Rwlock instrumentation destruction API. - @param rwlock the rwlock to destroy -*/ -typedef void (*destroy_rwlock_v1_t)(struct PSI_rwlock *rwlock); - -/** - Cond instrumentation initialisation API. - @param key the registered key - @param identity the address of the rwlock itself - @return an instrumented cond -*/ -typedef struct PSI_cond* (*init_cond_v1_t) - (PSI_cond_key key, const void *identity); - -/** - Cond instrumentation destruction API. - @param cond the rcond to destroy -*/ -typedef void (*destroy_cond_v1_t)(struct PSI_cond *cond); - -/** - Acquire a table info by name. - @param schema_name name of the table schema - @param schema_name_length length of schema_name - @param table_name name of the table - @param table_name_length length of table_name - @param identity table identity pointer, typically the table share - @return a table info, or NULL if the table is not instrumented -*/ -typedef struct PSI_table_share* (*get_table_share_v1_t) - (const char *schema_name, int schema_name_length, const char *table_name, - int table_name_length, const void *identity); - -/** - Release a table share. - @param info the table share to release -*/ -typedef void (*release_table_share_v1_t)(struct PSI_table_share *share); - -/** - Open an instrumentation table handle. - @param share the table to open - @param identity table handle identity - @return a table handle, or NULL -*/ -typedef struct PSI_table* (*open_table_v1_t) - (struct PSI_table_share *share, const void *identity); - -/** - Close an instrumentation table handle. - Note that the table handle is invalid after this call. - @param table the table handle to close -*/ -typedef void (*close_table_v1_t)(struct PSI_table *table); - -/** - Create a file instrumentation for a created file. - This method does not create the file itself, but is used to notify the - instrumentation interface that a file was just created. - @param key the file instrumentation key for this file - @param name the file name - @param file the file handle -*/ -typedef void (*create_file_v1_t)(PSI_file_key key, const char *name, - File file); - -/** - Spawn a thread. - This method creates a new thread, with instrumentation. - @param key the instrumentation key for this thread - @param thread the resulting thread - @param attr the thread attributes - @param start_routine the thread start routine - @param arg the thread start routine argument -*/ -typedef int (*spawn_thread_v1_t)(PSI_thread_key key, - pthread_t *thread, - const pthread_attr_t *attr, - void *(*start_routine)(void*), void *arg); - -/** - Create instrumentation for a thread. - @param key the registered key - @param identity an address typical of the thread - @return an instrumented thread -*/ -typedef struct PSI_thread* (*new_thread_v1_t) - (PSI_thread_key key, const void *identity, ulong thread_id); - -/** - Assign an id to an instrumented thread. - @param thread the instrumented thread - @param id the id to assign -*/ -typedef void (*set_thread_id_v1_t)(struct PSI_thread *thread, - unsigned long id); - -/** - Get the instrumentation for the running thread. - For this function to return a result, - the thread instrumentation must have been attached to the - running thread using @c set_thread() - @return the instrumentation for the running thread -*/ -typedef struct PSI_thread* (*get_thread_v1_t)(void); - -/** - Attach a thread instrumentation to the running thread. - In case of thread pools, this method should be called when - a worker thread picks a work item and runs it. - Also, this method should be called if the instrumented code does not - keep the pointer returned by @c new_thread() and relies on @c get_thread() - instead. - @param thread the thread instrumentation -*/ -typedef void (*set_thread_v1_t)(struct PSI_thread *thread); - -/** Delete the current thread instrumentation. */ -typedef void (*delete_current_thread_v1_t)(void); - -/** Delete a thread instrumentation. */ -typedef void (*delete_thread_v1_t)(struct PSI_thread *thread); - -/** - Get a 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_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_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_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_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 - @param identity a pointer representative of this file. - @return a file locker, or NULL -*/ -typedef struct PSI_file_locker* (*get_thread_file_name_locker_v1_t) - (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_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) - (struct PSI_file_locker_state_v1 *state, - File file, enum PSI_file_operation op); - -/** - Record a mutex instrumentation unlock event. - @param mutex the mutex instrumentation -*/ -typedef void (*unlock_mutex_v1_t) - (struct PSI_mutex *mutex); - -/** - Record a rwlock instrumentation unlock event. - @param rwlock the rwlock instrumentation -*/ -typedef void (*unlock_rwlock_v1_t) - (struct PSI_rwlock *rwlock); - -/** - Record a condition instrumentation signal event. - @param cond the cond instrumentation -*/ -typedef void (*signal_cond_v1_t) - (struct PSI_cond *cond); - -/** - Record a condition instrumentation broadcast event. - @param cond the cond instrumentation -*/ -typedef void (*broadcast_cond_v1_t) - (struct PSI_cond *cond); - -/** - Record a mutex instrumentation wait start event. - @param locker a thread locker for the running thread -*/ -typedef void (*start_mutex_wait_v1_t) - (struct PSI_mutex_locker *locker, const char *src_file, uint src_line); - -/** - Record a mutex instrumentation wait end event. - @param locker a thread locker for the running thread - @param rc the wait operation return code -*/ -typedef void (*end_mutex_wait_v1_t) - (struct PSI_mutex_locker *locker, int rc); - -/** - Record a rwlock instrumentation read wait start event. - @param locker a thread locker for the running thread - @param must must block: 1 for lock, 0 for trylock -*/ -typedef void (*start_rwlock_rdwait_v1_t) - (struct PSI_rwlock_locker *locker, const char *src_file, uint src_line); - -/** - Record a rwlock instrumentation read wait end event. - @param locker a thread locker for the running thread - @param rc the wait operation return code -*/ -typedef void (*end_rwlock_rdwait_v1_t) - (struct PSI_rwlock_locker *locker, int rc); - -/** - Record a rwlock instrumentation write wait start event. - @param locker a thread locker for the running thread - @param must must block: 1 for lock, 0 for trylock -*/ -typedef void (*start_rwlock_wrwait_v1_t) - (struct PSI_rwlock_locker *locker, const char *src_file, uint src_line); - -/** - Record a rwlock instrumentation write wait end event. - @param locker a thread locker for the running thread - @param rc the wait operation return code -*/ -typedef void (*end_rwlock_wrwait_v1_t) - (struct PSI_rwlock_locker *locker, int rc); - -/** - Record a condition instrumentation wait start event. - @param locker a thread locker for the running thread - @param must must block: 1 for wait, 0 for timedwait -*/ -typedef void (*start_cond_wait_v1_t) - (struct PSI_cond_locker *locker, const char *src_file, uint src_line); - -/** - Record a condition instrumentation wait end event. - @param locker a thread locker for the running thread - @param rc the wait operation return code -*/ -typedef void (*end_cond_wait_v1_t) - (struct PSI_cond_locker *locker, int rc); - -/** - Record a table instrumentation wait start event. - @param locker a table locker for the running thread - @param file the source file name - @param line the source line number -*/ -typedef void (*start_table_wait_v1_t) - (struct PSI_table_locker *locker, const char *src_file, uint src_line); - -/** - Record a table instrumentation wait end event. - @param locker a table locker for the running thread -*/ -typedef void (*end_table_wait_v1_t)(struct PSI_table_locker *locker); - -/** - Start a file instrumentation open operation. - @param locker the file locker - @param op the operation to perform - @param src_file the source file name - @param src_line the source line number - @return an instrumented file handle -*/ -typedef struct PSI_file* (*start_file_open_wait_v1_t) - (struct PSI_file_locker *locker, const char *src_file, uint src_line); - -/** - End a file instrumentation open operation, for file streams. - @param locker the file locker. -*/ -typedef void (*end_file_open_wait_v1_t)(struct PSI_file_locker *locker); - -/** - End a file instrumentation open operation, for non stream files. - @param locker the file locker. - @param file the file number assigned by open() or create() for this file. -*/ -typedef void (*end_file_open_wait_and_bind_to_descriptor_v1_t) - (struct PSI_file_locker *locker, File file); - -/** - Record a file instrumentation start event. - @param locker a file locker for the running thread - @param op file operation to be performed - @param count the number of bytes requested, or 0 if not applicable - @param src_file the source file name - @param src_line the source line number -*/ -typedef void (*start_file_wait_v1_t) - (struct PSI_file_locker *locker, size_t count, - const char *src_file, uint src_line); - -/** - Record a file instrumentation end event. - Note that for file close operations, the instrumented file handle - associated with the file (which was provided to obtain a locker) - is invalid after this call. - @param locker a file locker for the running thread - @param count the number of bytes actually used in the operation, - or 0 if not applicable, or -1 if the operation failed - @sa get_thread_file_name_locker - @sa get_thread_file_stream_locker - @sa get_thread_file_descriptor_locker -*/ -typedef void (*end_file_wait_v1_t) - (struct PSI_file_locker *locker, size_t count); - -/** - Performance Schema Interface, version 1. - @since PSI_VERSION_1 -*/ -struct PSI_v1 -{ - /** @sa register_mutex_v1_t. */ - register_mutex_v1_t register_mutex; - /** @sa register_rwlock_v1_t. */ - register_rwlock_v1_t register_rwlock; - /** @sa register_cond_v1_t. */ - register_cond_v1_t register_cond; - /** @sa register_thread_v1_t. */ - register_thread_v1_t register_thread; - /** @sa register_file_v1_t. */ - register_file_v1_t register_file; - /** @sa init_mutex_v1_t. */ - init_mutex_v1_t init_mutex; - /** @sa destroy_mutex_v1_t. */ - destroy_mutex_v1_t destroy_mutex; - /** @sa init_rwlock_v1_t. */ - init_rwlock_v1_t init_rwlock; - /** @sa destroy_rwlock_v1_t. */ - destroy_rwlock_v1_t destroy_rwlock; - /** @sa init_cond_v1_t. */ - init_cond_v1_t init_cond; - /** @sa destroy_cond_v1_t. */ - destroy_cond_v1_t destroy_cond; - /** @sa get_table_share_v1_t. */ - get_table_share_v1_t get_table_share; - /** @sa release_table_share_v1_t. */ - release_table_share_v1_t release_table_share; - /** @sa open_table_v1_t. */ - open_table_v1_t open_table; - /** @sa close_table_v1_t. */ - close_table_v1_t close_table; - /** @sa create_file_v1_t. */ - create_file_v1_t create_file; - /** @sa spawn_thread_v1_t. */ - spawn_thread_v1_t spawn_thread; - /** @sa new_thread_v1_t. */ - new_thread_v1_t new_thread; - /** @sa set_thread_id_v1_t. */ - set_thread_id_v1_t set_thread_id; - /** @sa get_thread_v1_t. */ - get_thread_v1_t get_thread; - /** @sa set_thread_v1_t. */ - set_thread_v1_t set_thread; - /** @sa delete_current_thread_v1_t. */ - delete_current_thread_v1_t delete_current_thread; - /** @sa delete_thread_v1_t. */ - delete_thread_v1_t delete_thread; - /** @sa get_thread_mutex_locker_v1_t. */ - get_thread_mutex_locker_v1_t get_thread_mutex_locker; - /** @sa get_thread_rwlock_locker_v1_t. */ - get_thread_rwlock_locker_v1_t get_thread_rwlock_locker; - /** @sa get_thread_cond_locker_v1_t. */ - get_thread_cond_locker_v1_t get_thread_cond_locker; - /** @sa get_thread_table_locker_v1_t. */ - get_thread_table_locker_v1_t get_thread_table_locker; - /** @sa get_thread_file_name_locker_v1_t. */ - get_thread_file_name_locker_v1_t get_thread_file_name_locker; - /** @sa get_thread_file_stream_locker_v1_t. */ - get_thread_file_stream_locker_v1_t get_thread_file_stream_locker; - /** @sa get_thread_file_descriptor_locker_v1_t. */ - get_thread_file_descriptor_locker_v1_t get_thread_file_descriptor_locker; - /** @sa unlock_mutex_v1_t. */ - unlock_mutex_v1_t unlock_mutex; - /** @sa unlock_rwlock_v1_t. */ - unlock_rwlock_v1_t unlock_rwlock; - /** @sa signal_cond_v1_t. */ - signal_cond_v1_t signal_cond; - /** @sa broadcast_cond_v1_t. */ - broadcast_cond_v1_t broadcast_cond; - /** @sa start_mutex_wait_v1_t. */ - start_mutex_wait_v1_t start_mutex_wait; - /** @sa end_mutex_wait_v1_t. */ - end_mutex_wait_v1_t end_mutex_wait; - /** @sa start_rwlock_rdwait_v1_t. */ - start_rwlock_rdwait_v1_t start_rwlock_rdwait; - /** @sa end_rwlock_rdwait_v1_t. */ - end_rwlock_rdwait_v1_t end_rwlock_rdwait; - /** @sa start_rwlock_wrwait_v1_t. */ - start_rwlock_wrwait_v1_t start_rwlock_wrwait; - /** @sa end_rwlock_wrwait_v1_t. */ - end_rwlock_wrwait_v1_t end_rwlock_wrwait; - /** @sa start_cond_wait_v1_t. */ - start_cond_wait_v1_t start_cond_wait; - /** @sa end_cond_wait_v1_t. */ - end_cond_wait_v1_t end_cond_wait; - /** @sa start_table_wait_v1_t. */ - start_table_wait_v1_t start_table_wait; - /** @sa end_table_wait_v1_t. */ - end_table_wait_v1_t end_table_wait; - /** @sa start_file_open_wait_v1_t. */ - start_file_open_wait_v1_t start_file_open_wait; - /** @sa end_file_open_wait_v1_t. */ - end_file_open_wait_v1_t end_file_open_wait; - /** @sa end_file_open_wait_and_bind_to_descriptor_v1_t. */ - end_file_open_wait_and_bind_to_descriptor_v1_t - end_file_open_wait_and_bind_to_descriptor; - /** @sa start_file_wait_v1_t. */ - start_file_wait_v1_t start_file_wait; - /** @sa end_file_wait_v1_t. */ - end_file_wait_v1_t end_file_wait; -}; - -/** @} (end of group Group_PSI_v1) */ - -#endif /* HAVE_PSI_1 */ - -#ifdef USE_PSI_2 -#define HAVE_PSI_2 -#endif - -#ifdef HAVE_PSI_2 - -/** - @defgroup Group_PSI_v2 Application Binary Interface, version 2 - @ingroup Instrumentation_interface - @{ -*/ - -/** - Performance Schema Interface, version 2. - This is a placeholder, this interface is not defined yet. - @since PSI_VERSION_2 -*/ -struct PSI_v2 -{ - /** Placeholder */ - int placeholder; - /* ... extended interface ... */ -}; - -/** Placeholder */ -struct PSI_mutex_info_v2 -{ - /** Placeholder */ - int placeholder; -}; - -/** Placeholder */ -struct PSI_rwlock_info_v2 -{ - /** Placeholder */ - int placeholder; -}; - -/** Placeholder */ -struct PSI_cond_info_v2 -{ - /** Placeholder */ - int placeholder; -}; - -/** Placeholder */ -struct PSI_thread_info_v2 -{ - /** Placeholder */ - int placeholder; -}; - -/** Placeholder */ -struct PSI_file_info_v2 -{ - /** 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) */ - -#endif /* HAVE_PSI_2 */ - -/** - @typedef PSI - The instrumentation interface for the current version. - @sa PSI_CURRENT_VERSION -*/ - -/** - @typedef PSI_mutex_info - The mutex information structure for the current version. -*/ - -/** - @typedef PSI_rwlock_info - The rwlock information structure for the current version. -*/ - -/** - @typedef PSI_cond_info - The cond information structure for the current version. -*/ - -/** - @typedef PSI_thread_info - The thread information structure for the current version. -*/ - -/** - @typedef PSI_file_info - The file information structure for the current version. -*/ - -/* Export the required version */ -#ifdef USE_PSI_1 -typedef struct PSI_v1 PSI; -typedef struct PSI_mutex_info_v1 PSI_mutex_info; -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 -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; -#endif - -#else /* HAVE_PSI_INTERFACE */ - -/** - Dummy structure, used to declare PSI_server when no instrumentation - is available. - The content does not matter, since PSI_server will be NULL. -*/ -struct PSI_none -{ - int opaque; -}; -typedef struct PSI_none PSI; - -#endif /* HAVE_PSI_INTERFACE */ - -extern MYSQL_PLUGIN_IMPORT PSI *PSI_server; - -/** @} */ - -C_MODE_END -#endif /* MYSQL_PERFORMANCE_SCHEMA_INTERFACE_H */ - diff --git a/dep/mysqllite/include/mysql/psi/psi_abi_v1.h b/dep/mysqllite/include/mysql/psi/psi_abi_v1.h deleted file mode 100644 index 0f62291696f..00000000000 --- a/dep/mysqllite/include/mysql/psi/psi_abi_v1.h +++ /dev/null @@ -1,26 +0,0 @@ -/* 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 - 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, - 51 Franklin Street, Suite 500, Boston, MA 02110-1335 USA */ - -/** - @file mysql/psi/psi_abi_v1.h - ABI check for mysql/psi/psi.h, when using PSI_VERSION_1. - This file is only used to automate detection of changes between versions. - Do not include this file, include mysql/psi/psi.h instead. -*/ -#define USE_PSI_1 -#define HAVE_PSI_INTERFACE -#define _global_h -#include "mysql/psi/psi.h" - diff --git a/dep/mysqllite/include/mysql/psi/psi_abi_v2.h b/dep/mysqllite/include/mysql/psi/psi_abi_v2.h deleted file mode 100644 index 08bca609b41..00000000000 --- a/dep/mysqllite/include/mysql/psi/psi_abi_v2.h +++ /dev/null @@ -1,26 +0,0 @@ -/* 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 - 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, - 51 Franklin Street, Suite 500, Boston, MA 02110-1335 USA */ - -/** - @file mysql/psi/psi_abi_v1.h - ABI check for mysql/psi/psi.h, when using PSI_VERSION_2. - This file is only used to automate detection of changes between versions. - Do not include this file, include mysql/psi/psi.h instead. -*/ -#define USE_PSI_2 -#define HAVE_PSI_INTERFACE -#define _global_h -#include "mysql/psi/psi.h" - diff --git a/dep/mysqllite/include/mysql/service_my_snprintf.h b/dep/mysqllite/include/mysql/service_my_snprintf.h deleted file mode 100644 index f6b4aa39dc5..00000000000 --- a/dep/mysqllite/include/mysql/service_my_snprintf.h +++ /dev/null @@ -1,101 +0,0 @@ -#ifndef MYSQL_SERVICE_MY_SNPRINTF_INCLUDED -/* Copyright (C) 2009 Sun Microsystems, Inc. - - 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 */ - -/** - @file - my_snprintf service - - Portable and limited vsnprintf() implementation. - - This is a portable, limited vsnprintf() implementation, with some - extra features. "Portable" means that it'll produce identical result - on all platforms (for example, on Windows and Linux system printf %e - formats the exponent differently, on different systems %p either - prints leading 0x or not, %s may accept null pointer or crash on - it). "Limited" means that it does not support all the C89 features. - But it supports few extensions, not in any standard. - - my_vsnprintf(to, n, fmt, ap) - - @param[out] to A buffer to store the result in - @param[in] n Store up to n-1 characters, followed by an end 0 - @param[in] fmt printf-like format string - @param[in] ap Arguments - - @return a number of bytes written to a buffer *excluding* terminating '\0' - - @post - The syntax of a format string is generally the same: - % <flag> <width> <precision> <length modifier> <format> - where everithing but the format is optional. - - Three one-character flags are recognized: - '0' has the standard zero-padding semantics; - '-' is parsed, but silently ignored; - '`' (backtick) is only supported for strings (%s) and means that the - string will be quoted according to MySQL identifier quoting rules. - - Both <width> and <precision> can be specified as numbers or '*'. - - <length modifier> can be 'l', 'll', or 'z'. - - Supported formats are 's' (null pointer is accepted, printed as - "(null)"), 'b' (extension, see below), 'c', 'd', 'i', 'u', 'x', 'o', - 'X', 'p' (works as 0x%x). - - Standard syntax for positional arguments $n is supported. - - Extensions: - - Flag '`' (backtick): see above. - - Format 'b': binary buffer, prints exactly <precision> bytes from the - argument, without stopping at '\0'. -*/ - -#ifdef __cplusplus -extern "C" { -#endif - -#ifndef MYSQL_ABI_CHECK -#include <stdarg.h> -#include <stdlib.h> -#endif - -extern struct my_snprintf_service_st { - size_t (*my_snprintf_type)(char*, size_t, const char*, ...); - size_t (*my_vsnprintf_type)(char *, size_t, const char*, va_list); -} *my_snprintf_service; - -#ifdef MYSQL_DYNAMIC_PLUGIN - -#define my_vsnprintf my_snprintf_service->my_vsnprintf_type -#define my_snprintf my_snprintf_service->my_snprintf_type - -#else - -size_t my_snprintf(char* to, size_t n, const char* fmt, ...); -size_t my_vsnprintf(char *to, size_t n, const char* fmt, va_list ap); - -#endif - -#ifdef __cplusplus -} -#endif - -#define MYSQL_SERVICE_MY_SNPRINTF_INCLUDED -#endif - diff --git a/dep/mysqllite/include/mysql/service_thd_alloc.h b/dep/mysqllite/include/mysql/service_thd_alloc.h deleted file mode 100644 index 7061c2bd4d5..00000000000 --- a/dep/mysqllite/include/mysql/service_thd_alloc.h +++ /dev/null @@ -1,130 +0,0 @@ -#ifndef MYSQL_SERVICE_THD_ALLOC_INCLUDED -/* Copyright (C) 2009 Sun Microsystems, Inc. - - 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 */ - -/** - @file - This service provdes functions to allocate memory in a connection local - memory pool. The memory allocated there will be automatically freed at the - end of the statement, don't use it for allocations that should live longer - than that. For short living allocations this is more efficient than - using my_malloc and friends, and automatic "garbage collection" allows not - to think about memory leaks. - - The pool is best for small to medium objects, don't use it for large - allocations - they are better served with my_malloc. -*/ - -#ifndef MYSQL_ABI_CHECK -#include <stdlib.h> -#endif - -#ifdef __cplusplus -extern "C" { -#endif - -struct st_mysql_lex_string -{ - char *str; - size_t length; -}; -typedef struct st_mysql_lex_string MYSQL_LEX_STRING; - -extern struct thd_alloc_service_st { - void *(*thd_alloc_func)(MYSQL_THD, unsigned int); - void *(*thd_calloc_func)(MYSQL_THD, unsigned int); - char *(*thd_strdup_func)(MYSQL_THD, const char *); - char *(*thd_strmake_func)(MYSQL_THD, const char *, unsigned int); - void *(*thd_memdup_func)(MYSQL_THD, const void*, unsigned int); - MYSQL_LEX_STRING *(*thd_make_lex_string_func)(MYSQL_THD, MYSQL_LEX_STRING *, - const char *, unsigned int, int); -} *thd_alloc_service; - -#ifdef MYSQL_DYNAMIC_PLUGIN - -#define thd_alloc(thd,size) (thd_alloc_service->thd_alloc_func((thd), (size))) - -#define thd_calloc(thd,size) (thd_alloc_service->thd_calloc_func((thd), (size))) - -#define thd_strdup(thd,str) (thd_alloc_service->thd_strdup_func((thd), (str))) - -#define thd_strmake(thd,str,size) \ - (thd_alloc_service->thd_strmake_func((thd), (str), (size))) - -#define thd_memdup(thd,str,size) \ - (thd_alloc_service->thd_memdup_func((thd), (str), (size))) - -#define thd_make_lex_string(thd, lex_str, str, size, allocate_lex_string) \ - (thd_alloc_service->thd_make_lex_string_func((thd), (lex_str), (str), \ - (size), (allocate_lex_string))) - -#else - -/** - Allocate memory in the connection's local memory pool - - @details - When properly used in place of @c my_malloc(), this can significantly - improve concurrency. Don't use this or related functions to allocate - large chunks of memory. Use for temporary storage only. The memory - will be freed automatically at the end of the statement; no explicit - code is required to prevent memory leaks. - - @see alloc_root() -*/ -void *thd_alloc(MYSQL_THD thd, unsigned int size); -/** - @see thd_alloc() -*/ -void *thd_calloc(MYSQL_THD thd, unsigned int size); -/** - @see thd_alloc() -*/ -char *thd_strdup(MYSQL_THD thd, const char *str); -/** - @see thd_alloc() -*/ -char *thd_strmake(MYSQL_THD thd, const char *str, unsigned int size); -/** - @see thd_alloc() -*/ -void *thd_memdup(MYSQL_THD thd, const void* str, unsigned int size); - -/** - Create a LEX_STRING in this connection's local memory pool - - @param thd user thread connection handle - @param lex_str pointer to LEX_STRING object to be initialized - @param str initializer to be copied into lex_str - @param size length of str, in bytes - @param allocate_lex_string flag: if TRUE, allocate new LEX_STRING object, - instead of using lex_str value - @return NULL on failure, or pointer to the LEX_STRING object - - @see thd_alloc() -*/ -MYSQL_LEX_STRING *thd_make_lex_string(MYSQL_THD thd, MYSQL_LEX_STRING *lex_str, - const char *str, unsigned int size, - int allocate_lex_string); - -#endif - -#ifdef __cplusplus -} -#endif - -#define MYSQL_SERVICE_THD_ALLOC_INCLUDED -#endif - diff --git a/dep/mysqllite/include/mysql/service_thd_wait.h b/dep/mysqllite/include/mysql/service_thd_wait.h deleted file mode 100644 index 2a8f5e610a3..00000000000 --- a/dep/mysqllite/include/mysql/service_thd_wait.h +++ /dev/null @@ -1,83 +0,0 @@ -/* Copyright (C) 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 - 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 */ - -#ifndef MYSQL_SERVICE_THD_WAIT_INCLUDED -#define MYSQL_SERVICE_THD_WAIT_INCLUDED - -/** - @file include/mysql/service_thd_wait.h - This service provides functions for plugins and storage engines to report - when they are going to sleep/stall. - - SYNOPSIS - thd_wait_begin() - call just before a wait begins - thd Thread object - Use NULL if the thd is NOT known. - wait_type Type of wait - 1 -- short wait (e.g. for mutex) - 2 -- medium wait (e.g. for disk io) - 3 -- large wait (e.g. for locked row/table) - NOTES - This is used by the threadpool to have better knowledge of which - threads that currently are actively running on CPUs. When a thread - reports that it's going to sleep/stall, the threadpool scheduler is - free to start another thread in the pool most likely. The expected wait - time is simply an indication of how long the wait is expected to - become, the real wait time could be very different. - - thd_wait_end() called immediately after the wait is complete - - thd_wait_end() MUST be called if thd_wait_begin() was called. - - Using thd_wait_...() service is optional but recommended. Using it will - improve performance as the thread pool will be more active at managing the - thread workload. -*/ - -#ifdef __cplusplus -extern "C" { -#endif - -typedef enum _thd_wait_type_e { - THD_WAIT_MUTEX= 1, - THD_WAIT_DISKIO= 2, - THD_WAIT_ROW_TABLE_LOCK= 3, - THD_WAIT_GLOBAL_LOCK= 4 -} thd_wait_type; - -extern struct thd_wait_service_st { - void (*thd_wait_begin_func)(MYSQL_THD, thd_wait_type); - void (*thd_wait_end_func)(MYSQL_THD); -} *thd_wait_service; - -#ifdef MYSQL_DYNAMIC_PLUGIN - -#define thd_wait_begin(_THD, _WAIT_TYPE) \ - thd_wait_service->thd_wait_begin_func(_THD, _WAIT_TYPE) -#define thd_wait_end(_THD) thd_wait_service->thd_wait_end_func(_THD) - -#else - -void thd_wait_begin(MYSQL_THD thd, thd_wait_type wait_type); -void thd_wait_end(MYSQL_THD thd); - -#endif - -#ifdef __cplusplus -} -#endif - -#endif - diff --git a/dep/mysqllite/include/mysql/service_thread_scheduler.h b/dep/mysqllite/include/mysql/service_thread_scheduler.h deleted file mode 100644 index a4396b721bd..00000000000 --- a/dep/mysqllite/include/mysql/service_thread_scheduler.h +++ /dev/null @@ -1,65 +0,0 @@ -/* - Copyright (C) 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 - 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 -*/ - -#ifndef SERVICE_THREAD_SCHEDULER_INCLUDED -#define SERVICE_THREAD_SCHEDULER_INCLUDED - -#ifdef __cplusplus -extern "C" { -#endif - -struct scheduler_functions; - -extern struct my_thread_scheduler_service { - int (*set)(struct scheduler_functions *scheduler); - int (*reset)(); -} *my_thread_scheduler_service; - -#ifdef MYSQL_DYNAMIC_PLUGIN - -#define my_thread_scheduler_set(F) my_thread_scheduler_service->set((F)) -#define my_thread_scheduler_reset() my_thread_scheduler_service->reset() - -#else - -/** - Set the thread scheduler to use for the server. - - @param scheduler Pointer to scheduler callbacks to use. - @retval 0 Scheduler installed correctly. - @retval 1 Invalid value (NULL) used for scheduler. -*/ -int my_thread_scheduler_set(struct scheduler_functions *scheduler); - -/** - Restore the previous thread scheduler. - - @note If no thread scheduler was installed previously with - thd_set_thread_scheduler, this function will report an error. - - @retval 0 Scheduler installed correctly. - @retval 1 No scheduler installed. -*/ -int my_thread_scheduler_reset(); - -#endif - -#ifdef __cplusplus -} -#endif - -#endif /* SERVICE_THREAD_SCHEDULER_INCLUDED */ diff --git a/dep/mysqllite/include/mysql/services.h b/dep/mysqllite/include/mysql/services.h deleted file mode 100644 index 6c67a582fb8..00000000000 --- a/dep/mysqllite/include/mysql/services.h +++ /dev/null @@ -1,32 +0,0 @@ -#ifndef MYSQL_SERVICES_INCLUDED -/* Copyright (C) 2009 Sun Microsystems, Inc. - - 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 */ - -#ifdef __cplusplus -extern "C" { -#endif - -#include <mysql/service_my_snprintf.h> -#include <mysql/service_thd_alloc.h> -#include <mysql/service_thd_wait.h> -#include <mysql/service_thread_scheduler.h> - -#ifdef __cplusplus -} -#endif - -#define MYSQL_SERVICES_INCLUDED -#endif - diff --git a/dep/mysqllite/include/mysql_com.h b/dep/mysqllite/include/mysql_com.h deleted file mode 100644 index f4c023721de..00000000000 --- a/dep/mysqllite/include/mysql_com.h +++ /dev/null @@ -1,572 +0,0 @@ -/* Copyright (c) 2000, 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 - 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 */ - -/* -** Common definition between mysql server & client -*/ - -#ifndef _mysql_com_h -#define _mysql_com_h - -#define HOSTNAME_LENGTH 60 -#define SYSTEM_CHARSET_MBMAXLEN 3 -#define NAME_CHAR_LEN 64 /* Field/table name length */ -#define USERNAME_CHAR_LENGTH 16 -#define NAME_LEN (NAME_CHAR_LEN*SYSTEM_CHARSET_MBMAXLEN) -#define USERNAME_LENGTH (USERNAME_CHAR_LENGTH*SYSTEM_CHARSET_MBMAXLEN) - -#define MYSQL_AUTODETECT_CHARSET_NAME "auto" - -#define SERVER_VERSION_LENGTH 60 -#define SQLSTATE_LENGTH 5 - -/* - Maximum length of comments -*/ -#define TABLE_COMMENT_INLINE_MAXLEN 180 /* pre 6.0: 60 characters */ -#define TABLE_COMMENT_MAXLEN 2048 -#define COLUMN_COMMENT_MAXLEN 1024 -#define INDEX_COMMENT_MAXLEN 1024 - -/* - USER_HOST_BUFF_SIZE -- length of string buffer, that is enough to contain - username and hostname parts of the user identifier with trailing zero in - MySQL standard format: - user_name_part@host_name_part\0 -*/ -#define USER_HOST_BUFF_SIZE HOSTNAME_LENGTH + USERNAME_LENGTH + 2 - -#define LOCAL_HOST "localhost" -#define LOCAL_HOST_NAMEDPIPE "." - - -#if defined(__WIN__) && !defined( _CUSTOMCONFIG_) -#define MYSQL_NAMEDPIPE "MySQL" -#define MYSQL_SERVICENAME "MySQL" -#endif /* __WIN__ */ - -/* - You should add new commands to the end of this list, otherwise old - servers won't be able to handle them as 'unsupported'. -*/ - -enum enum_server_command -{ - COM_SLEEP, COM_QUIT, COM_INIT_DB, COM_QUERY, COM_FIELD_LIST, - COM_CREATE_DB, COM_DROP_DB, COM_REFRESH, COM_SHUTDOWN, COM_STATISTICS, - COM_PROCESS_INFO, COM_CONNECT, COM_PROCESS_KILL, COM_DEBUG, COM_PING, - COM_TIME, COM_DELAYED_INSERT, COM_CHANGE_USER, COM_BINLOG_DUMP, - COM_TABLE_DUMP, COM_CONNECT_OUT, COM_REGISTER_SLAVE, - COM_STMT_PREPARE, COM_STMT_EXECUTE, COM_STMT_SEND_LONG_DATA, COM_STMT_CLOSE, - COM_STMT_RESET, COM_SET_OPTION, COM_STMT_FETCH, COM_DAEMON, - /* don't forget to update const char *command_name[] in sql_parse.cc */ - - /* Must be last */ - COM_END -}; - - -/* - Length of random string sent by server on handshake; this is also length of - obfuscated password, recieved from client -*/ -#define SCRAMBLE_LENGTH 20 -#define SCRAMBLE_LENGTH_323 8 -/* length of password stored in the db: new passwords are preceeded with '*' */ -#define SCRAMBLED_PASSWORD_CHAR_LENGTH (SCRAMBLE_LENGTH*2+1) -#define SCRAMBLED_PASSWORD_CHAR_LENGTH_323 (SCRAMBLE_LENGTH_323*2) - - -#define NOT_NULL_FLAG 1 /* Field can't be NULL */ -#define PRI_KEY_FLAG 2 /* Field is part of a primary key */ -#define UNIQUE_KEY_FLAG 4 /* Field is part of a unique key */ -#define MULTIPLE_KEY_FLAG 8 /* Field is part of a key */ -#define BLOB_FLAG 16 /* Field is a blob */ -#define UNSIGNED_FLAG 32 /* Field is unsigned */ -#define ZEROFILL_FLAG 64 /* Field is zerofill */ -#define BINARY_FLAG 128 /* Field is binary */ - -/* The following are only sent to new clients */ -#define ENUM_FLAG 256 /* field is an enum */ -#define AUTO_INCREMENT_FLAG 512 /* field is a autoincrement field */ -#define TIMESTAMP_FLAG 1024 /* Field is a timestamp */ -#define SET_FLAG 2048 /* field is a set */ -#define NO_DEFAULT_VALUE_FLAG 4096 /* Field doesn't have default value */ -#define ON_UPDATE_NOW_FLAG 8192 /* Field is set to NOW on UPDATE */ -#define NUM_FLAG 32768 /* Field is num (for clients) */ -#define PART_KEY_FLAG 16384 /* Intern; Part of some key */ -#define GROUP_FLAG 32768 /* Intern: Group field */ -#define UNIQUE_FLAG 65536 /* Intern: Used by sql_yacc */ -#define BINCMP_FLAG 131072 /* Intern: Used by sql_yacc */ -#define GET_FIXED_FIELDS_FLAG (1 << 18) /* Used to get fields in item tree */ -#define FIELD_IN_PART_FUNC_FLAG (1 << 19)/* Field part of partition func */ -#define FIELD_IN_ADD_INDEX (1<< 20) /* Intern: Field used in ADD INDEX */ -#define FIELD_IS_RENAMED (1<< 21) /* Intern: Field is being renamed */ - -#define REFRESH_GRANT 1 /* Refresh grant tables */ -#define REFRESH_LOG 2 /* Start on new log file */ -#define REFRESH_TABLES 4 /* close all tables */ -#define REFRESH_HOSTS 8 /* Flush host cache */ -#define REFRESH_STATUS 16 /* Flush status variables */ -#define REFRESH_THREADS 32 /* Flush thread cache */ -#define REFRESH_SLAVE 64 /* Reset master info and restart slave - thread */ -#define REFRESH_MASTER 128 /* Remove all bin logs in the index - and truncate the index */ -#define REFRESH_ERROR_LOG 256 /* Rotate only the erorr log */ -#define REFRESH_ENGINE_LOG 512 /* Flush all storage engine logs */ -#define REFRESH_BINARY_LOG 1024 /* Flush the binary log */ -#define REFRESH_RELAY_LOG 2048 /* Flush the relay log */ -#define REFRESH_GENERAL_LOG 4096 /* Flush the general log */ -#define REFRESH_SLOW_LOG 8192 /* Flush the slow query log */ - -/* The following can't be set with mysql_refresh() */ -#define REFRESH_READ_LOCK 16384 /* Lock tables for read */ -#define REFRESH_FAST 32768 /* Intern flag */ - -/* RESET (remove all queries) from query cache */ -#define REFRESH_QUERY_CACHE 65536 -#define REFRESH_QUERY_CACHE_FREE 0x20000L /* pack query cache */ -#define REFRESH_DES_KEY_FILE 0x40000L -#define REFRESH_USER_RESOURCES 0x80000L - -#define CLIENT_LONG_PASSWORD 1 /* new more secure passwords */ -#define CLIENT_FOUND_ROWS 2 /* Found instead of affected rows */ -#define CLIENT_LONG_FLAG 4 /* Get all column flags */ -#define CLIENT_CONNECT_WITH_DB 8 /* One can specify db on connect */ -#define CLIENT_NO_SCHEMA 16 /* Don't allow database.table.column */ -#define CLIENT_COMPRESS 32 /* Can use compression protocol */ -#define CLIENT_ODBC 64 /* Odbc client */ -#define CLIENT_LOCAL_FILES 128 /* Can use LOAD DATA LOCAL */ -#define CLIENT_IGNORE_SPACE 256 /* Ignore spaces before '(' */ -#define CLIENT_PROTOCOL_41 512 /* New 4.1 protocol */ -#define CLIENT_INTERACTIVE 1024 /* This is an interactive client */ -#define CLIENT_SSL 2048 /* Switch to SSL after handshake */ -#define CLIENT_IGNORE_SIGPIPE 4096 /* IGNORE sigpipes */ -#define CLIENT_TRANSACTIONS 8192 /* Client knows about transactions */ -#define CLIENT_RESERVED 16384 /* Old flag for 4.1 protocol */ -#define CLIENT_SECURE_CONNECTION 32768 /* New 4.1 authentication */ -#define CLIENT_MULTI_STATEMENTS (1UL << 16) /* Enable/disable multi-stmt support */ -#define CLIENT_MULTI_RESULTS (1UL << 17) /* Enable/disable multi-results */ -#define CLIENT_PS_MULTI_RESULTS (1UL << 18) /* Multi-results in PS-protocol */ - -#define CLIENT_PLUGIN_AUTH (1UL << 19) /* Client supports plugin authentication */ - -#define CLIENT_SSL_VERIFY_SERVER_CERT (1UL << 30) -#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 */ -#define CLIENT_ALL_FLAGS (CLIENT_LONG_PASSWORD | \ - CLIENT_FOUND_ROWS | \ - CLIENT_LONG_FLAG | \ - CLIENT_CONNECT_WITH_DB | \ - CLIENT_NO_SCHEMA | \ - CLIENT_COMPRESS | \ - CLIENT_ODBC | \ - CLIENT_LOCAL_FILES | \ - CLIENT_IGNORE_SPACE | \ - CLIENT_PROTOCOL_41 | \ - CLIENT_INTERACTIVE | \ - CLIENT_SSL | \ - CLIENT_IGNORE_SIGPIPE | \ - CLIENT_TRANSACTIONS | \ - CLIENT_RESERVED | \ - CLIENT_SECURE_CONNECTION | \ - CLIENT_MULTI_STATEMENTS | \ - CLIENT_MULTI_RESULTS | \ - CLIENT_PS_MULTI_RESULTS | \ - CLIENT_SSL_VERIFY_SERVER_CERT | \ - CLIENT_REMEMBER_OPTIONS | \ - CLIENT_PLUGIN_AUTH) - -/* - 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 switched - on before sending to the client during the connection handshake. -*/ -#define CLIENT_BASIC_FLAGS (((CLIENT_ALL_FLAGS & ~CLIENT_SSL) \ - & ~CLIENT_COMPRESS) \ - & ~CLIENT_SSL_VERIFY_SERVER_CERT) - -/** - Is raised when a multi-statement transaction - has been started, either explicitly, by means - of BEGIN or COMMIT AND CHAIN, or - implicitly, by the first transactional - statement, when autocommit=off. -*/ -#define SERVER_STATUS_IN_TRANS 1 -#define SERVER_STATUS_AUTOCOMMIT 2 /* Server in auto_commit mode */ -#define SERVER_MORE_RESULTS_EXISTS 8 /* Multi query - next query exists */ -#define SERVER_QUERY_NO_GOOD_INDEX_USED 16 -#define SERVER_QUERY_NO_INDEX_USED 32 -/** - The server was able to fulfill the clients request and opened a - read-only non-scrollable cursor for a query. This flag comes - in reply to COM_STMT_EXECUTE and COM_STMT_FETCH commands. -*/ -#define SERVER_STATUS_CURSOR_EXISTS 64 -/** - This flag is sent when a read-only cursor is exhausted, in reply to - COM_STMT_FETCH command. -*/ -#define SERVER_STATUS_LAST_ROW_SENT 128 -#define SERVER_STATUS_DB_DROPPED 256 /* A database was dropped */ -#define SERVER_STATUS_NO_BACKSLASH_ESCAPES 512 -/** - Sent to the client if after a prepared statement reprepare - we discovered that the new statement returns a different - number of result set columns. -*/ -#define SERVER_STATUS_METADATA_CHANGED 1024 -#define SERVER_QUERY_WAS_SLOW 2048 - -/** - To mark ResultSet containing output parameter values. -*/ -#define SERVER_PS_OUT_PARAMS 4096 - -/** - Server status flags that must be cleared when starting - execution of a new SQL statement. - Flags from this set are only added to the - current server status by the execution engine, but - never removed -- the execution engine expects them - to disappear automagically by the next command. -*/ -#define SERVER_STATUS_CLEAR_SET (SERVER_QUERY_NO_GOOD_INDEX_USED| \ - SERVER_QUERY_NO_INDEX_USED|\ - SERVER_MORE_RESULTS_EXISTS|\ - 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 NET_READ_TIMEOUT 30 /* Timeout on read */ -#define NET_WRITE_TIMEOUT 60 /* Timeout on write */ -#define NET_WAIT_TIMEOUT 8*60*60 /* Wait for new query */ - -#define ONLY_KILL_QUERY 1 - - -struct st_vio; /* Only C */ -typedef struct st_vio Vio; - -#define MAX_TINYINT_WIDTH 3 /* Max width for a TINY w.o. sign */ -#define MAX_SMALLINT_WIDTH 5 /* Max width for a SHORT w.o. sign */ -#define MAX_MEDIUMINT_WIDTH 8 /* Max width for a INT24 w.o. sign */ -#define MAX_INT_WIDTH 10 /* Max width for a LONG w.o. sign */ -#define MAX_BIGINT_WIDTH 20 /* Max width for a LONGLONG */ -#define MAX_CHAR_WIDTH 255 /* Max length for a CHAR colum */ -#define MAX_BLOB_WIDTH 16777216 /* Default width for blob */ - -typedef struct st_net { -#if !defined(CHECK_EMBEDDED_DIFFERENCES) || !defined(EMBEDDED_LIBRARY) - Vio *vio; - unsigned char *buff,*buff_end,*write_pos,*read_pos; - my_socket fd; /* For Perl DBI/dbd */ - /* - The following variable is set if we are doing several queries in one - command ( as in LOAD TABLE ... FROM MASTER ), - and do not want to confuse the client with OK at the wrong time - */ - unsigned long remain_in_buf,length, buf_length, where_b; - unsigned long max_packet,max_packet_size; - unsigned int pkt_nr,compress_pkt_nr; - unsigned int write_timeout, read_timeout, retry_count; - int fcntl; - unsigned int *return_status; - unsigned char reading_or_writing; - char save_char; - my_bool unused1; /* Please remove with the next incompatible ABI change. */ - my_bool unused2; /* Please remove with the next incompatible ABI change */ - my_bool compress; - my_bool unused3; /* Please remove with the next incompatible ABI change. */ - /* - Pointer to query object in query cache, do not equal NULL (0) for - queries in cache that have not stored its results yet - */ -#endif - /* - Unused, please remove with the next incompatible ABI change. - */ - unsigned char *unused; - unsigned int last_errno; - unsigned char error; - my_bool unused4; /* Please remove with the next incompatible ABI change. */ - my_bool unused5; /* Please remove with the next incompatible ABI change. */ - /** Client library error message buffer. Actually belongs to struct MYSQL. */ - char last_error[MYSQL_ERRMSG_SIZE]; - /** Client library sqlstate buffer. Set along with the error message. */ - char sqlstate[SQLSTATE_LENGTH+1]; - void *extension; -#if defined(MYSQL_SERVER) && !defined(EMBEDDED_LIBRARY) - /* - Controls whether a big packet should be skipped. - - Initially set to FALSE by default. Unauthenticated sessions must have - this set to FALSE so that the server can't be tricked to read packets - indefinitely. - */ - my_bool skip_big_packet; -#endif -} NET; - - -#define packet_error (~(unsigned long) 0) - -enum enum_field_types { MYSQL_TYPE_DECIMAL, MYSQL_TYPE_TINY, - MYSQL_TYPE_SHORT, MYSQL_TYPE_LONG, - MYSQL_TYPE_FLOAT, MYSQL_TYPE_DOUBLE, - MYSQL_TYPE_NULL, MYSQL_TYPE_TIMESTAMP, - MYSQL_TYPE_LONGLONG,MYSQL_TYPE_INT24, - MYSQL_TYPE_DATE, MYSQL_TYPE_TIME, - MYSQL_TYPE_DATETIME, MYSQL_TYPE_YEAR, - MYSQL_TYPE_NEWDATE, MYSQL_TYPE_VARCHAR, - MYSQL_TYPE_BIT, - MYSQL_TYPE_NEWDECIMAL=246, - MYSQL_TYPE_ENUM=247, - MYSQL_TYPE_SET=248, - MYSQL_TYPE_TINY_BLOB=249, - MYSQL_TYPE_MEDIUM_BLOB=250, - MYSQL_TYPE_LONG_BLOB=251, - MYSQL_TYPE_BLOB=252, - MYSQL_TYPE_VAR_STRING=253, - MYSQL_TYPE_STRING=254, - MYSQL_TYPE_GEOMETRY=255 - -}; - -/* For backward compatibility */ -#define CLIENT_MULTI_QUERIES CLIENT_MULTI_STATEMENTS -#define FIELD_TYPE_DECIMAL MYSQL_TYPE_DECIMAL -#define FIELD_TYPE_NEWDECIMAL MYSQL_TYPE_NEWDECIMAL -#define FIELD_TYPE_TINY MYSQL_TYPE_TINY -#define FIELD_TYPE_SHORT MYSQL_TYPE_SHORT -#define FIELD_TYPE_LONG MYSQL_TYPE_LONG -#define FIELD_TYPE_FLOAT MYSQL_TYPE_FLOAT -#define FIELD_TYPE_DOUBLE MYSQL_TYPE_DOUBLE -#define FIELD_TYPE_NULL MYSQL_TYPE_NULL -#define FIELD_TYPE_TIMESTAMP MYSQL_TYPE_TIMESTAMP -#define FIELD_TYPE_LONGLONG MYSQL_TYPE_LONGLONG -#define FIELD_TYPE_INT24 MYSQL_TYPE_INT24 -#define FIELD_TYPE_DATE MYSQL_TYPE_DATE -#define FIELD_TYPE_TIME MYSQL_TYPE_TIME -#define FIELD_TYPE_DATETIME MYSQL_TYPE_DATETIME -#define FIELD_TYPE_YEAR MYSQL_TYPE_YEAR -#define FIELD_TYPE_NEWDATE MYSQL_TYPE_NEWDATE -#define FIELD_TYPE_ENUM MYSQL_TYPE_ENUM -#define FIELD_TYPE_SET MYSQL_TYPE_SET -#define FIELD_TYPE_TINY_BLOB MYSQL_TYPE_TINY_BLOB -#define FIELD_TYPE_MEDIUM_BLOB MYSQL_TYPE_MEDIUM_BLOB -#define FIELD_TYPE_LONG_BLOB MYSQL_TYPE_LONG_BLOB -#define FIELD_TYPE_BLOB MYSQL_TYPE_BLOB -#define FIELD_TYPE_VAR_STRING MYSQL_TYPE_VAR_STRING -#define FIELD_TYPE_STRING MYSQL_TYPE_STRING -#define FIELD_TYPE_CHAR MYSQL_TYPE_TINY -#define FIELD_TYPE_INTERVAL MYSQL_TYPE_ENUM -#define FIELD_TYPE_GEOMETRY MYSQL_TYPE_GEOMETRY -#define FIELD_TYPE_BIT MYSQL_TYPE_BIT - - -/* Shutdown/kill enums and constants */ - -/* Bits for THD::killable. */ -#define MYSQL_SHUTDOWN_KILLABLE_CONNECT (unsigned char)(1 << 0) -#define MYSQL_SHUTDOWN_KILLABLE_TRANS (unsigned char)(1 << 1) -#define MYSQL_SHUTDOWN_KILLABLE_LOCK_TABLE (unsigned char)(1 << 2) -#define MYSQL_SHUTDOWN_KILLABLE_UPDATE (unsigned char)(1 << 3) - -enum mysql_enum_shutdown_level { - /* - We want levels to be in growing order of hardness (because we use number - comparisons). Note that DEFAULT does not respect the growing property, but - it's ok. - */ - SHUTDOWN_DEFAULT = 0, - /* wait for existing connections to finish */ - SHUTDOWN_WAIT_CONNECTIONS= MYSQL_SHUTDOWN_KILLABLE_CONNECT, - /* wait for existing trans to finish */ - SHUTDOWN_WAIT_TRANSACTIONS= MYSQL_SHUTDOWN_KILLABLE_TRANS, - /* wait for existing updates to finish (=> no partial MyISAM update) */ - SHUTDOWN_WAIT_UPDATES= MYSQL_SHUTDOWN_KILLABLE_UPDATE, - /* flush InnoDB buffers and other storage engines' buffers*/ - SHUTDOWN_WAIT_ALL_BUFFERS= (MYSQL_SHUTDOWN_KILLABLE_UPDATE << 1), - /* don't flush InnoDB buffers, flush other storage engines' buffers*/ - SHUTDOWN_WAIT_CRITICAL_BUFFERS= (MYSQL_SHUTDOWN_KILLABLE_UPDATE << 1) + 1, - /* Now the 2 levels of the KILL command */ -#if MYSQL_VERSION_ID >= 50000 - KILL_QUERY= 254, -#endif - KILL_CONNECTION= 255 -}; - - -enum enum_cursor_type -{ - CURSOR_TYPE_NO_CURSOR= 0, - CURSOR_TYPE_READ_ONLY= 1, - CURSOR_TYPE_FOR_UPDATE= 2, - CURSOR_TYPE_SCROLLABLE= 4 -}; - - -/* options for mysql_set_option */ -enum enum_mysql_set_option -{ - MYSQL_OPTION_MULTI_STATEMENTS_ON, - MYSQL_OPTION_MULTI_STATEMENTS_OFF -}; - -#define net_new_transaction(net) ((net)->pkt_nr=0) - -#ifdef __cplusplus -extern "C" { -#endif - -my_bool my_net_init(NET *net, Vio* vio); -void my_net_local_init(NET *net); -void net_end(NET *net); - void net_clear(NET *net, my_bool clear_buffer); -my_bool net_realloc(NET *net, size_t length); -my_bool net_flush(NET *net); -my_bool my_net_write(NET *net,const unsigned char *packet, size_t len); -my_bool net_write_command(NET *net,unsigned char command, - const unsigned char *header, size_t head_len, - const unsigned char *packet, size_t len); -int net_real_write(NET *net,const unsigned char *packet, size_t len); -unsigned long my_net_read(NET *net); - -#ifdef _global_h -void my_net_set_write_timeout(NET *net, uint timeout); -void my_net_set_read_timeout(NET *net, uint timeout); -#endif - -struct sockaddr; -int my_connect(my_socket s, const struct sockaddr *name, unsigned int namelen, - unsigned int timeout); - -struct rand_struct { - unsigned long seed1,seed2,max_value; - double max_value_dbl; -}; - -#ifdef __cplusplus -} -#endif - - /* The following is for user defined functions */ - -enum Item_result {STRING_RESULT=0, REAL_RESULT, INT_RESULT, ROW_RESULT, - DECIMAL_RESULT}; - -typedef struct st_udf_args -{ - unsigned int arg_count; /* Number of arguments */ - enum Item_result *arg_type; /* Pointer to item_results */ - char **args; /* Pointer to argument */ - unsigned long *lengths; /* Length of string arguments */ - char *maybe_null; /* Set to 1 for all maybe_null args */ - char **attributes; /* Pointer to attribute name */ - unsigned long *attribute_lengths; /* Length of attribute arguments */ - void *extension; -} UDF_ARGS; - - /* This holds information about the result */ - -typedef struct st_udf_init -{ - my_bool maybe_null; /* 1 if function can return NULL */ - unsigned int decimals; /* for real functions */ - unsigned long max_length; /* For string functions */ - char *ptr; /* free pointer for function data */ - my_bool const_item; /* 1 if function always returns the same value */ - void *extension; -} UDF_INIT; -/* - TODO: add a notion for determinism of the UDF. - See Item_udf_func::update_used_tables () -*/ - - /* Constants when using compression */ -#define NET_HEADER_SIZE 4 /* standard header size */ -#define COMP_HEADER_SIZE 3 /* compression header extra size */ - - /* Prototypes to password functions */ - -#ifdef __cplusplus -extern "C" { -#endif - -/* - These functions are used for authentication by client and server and - implemented in sql/password.c -*/ - -void randominit(struct rand_struct *, unsigned long seed1, - unsigned long seed2); -double my_rnd(struct rand_struct *); -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 password_len); -void make_scrambled_password_323(char *to, const char *password); -void scramble_323(char *to, const char *message, const char *password); -my_bool check_scramble_323(const unsigned char *reply, const char *message, - unsigned long *salt); -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_scrambled_password(char *to, const char *password); -void scramble(char *to, const char *message, const char *password); -my_bool check_scramble(const unsigned char *reply, const char *message, - const unsigned char *hash_stage2); -void get_salt_from_password(unsigned char *res, const char *password); -void make_password_from_salt(char *to, const unsigned char *hash_stage2); -char *octet2hex(char *to, const char *str, unsigned int len); - -/* end of password.c */ - -char *get_tty_password(const char *opt_message); -const char *mysql_errno_to_sqlstate(unsigned int mysql_errno); - -/* Some other useful functions */ - -my_bool my_thread_init(void); -void my_thread_end(void); - -#ifdef _global_h -ulong STDCALL net_field_length(uchar **packet); -my_ulonglong net_field_length_ll(uchar **packet); -uchar *net_store_length(uchar *pkg, ulonglong length); -#endif - -#ifdef __cplusplus -} -#endif - -#define NULL_LENGTH ((unsigned long) ~0) /* For net_store_length */ -#define MYSQL_STMT_HEADER 4 -#define MYSQL_LONG_DATA_HEADER 6 - -#define NOT_FIXED_DEC 31 -#endif diff --git a/dep/mysqllite/include/mysql_embed.h b/dep/mysqllite/include/mysql_embed.h deleted file mode 100644 index e860a4486eb..00000000000 --- a/dep/mysqllite/include/mysql_embed.h +++ /dev/null @@ -1,31 +0,0 @@ -#ifndef MYSQL_EMBED_INCLUDED -#define MYSQL_EMBED_INCLUDED - -/* 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 */ - -/* Defines that are unique to the embedded version of MySQL */ - -#ifdef EMBEDDED_LIBRARY - -/* 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 */ - -#undef HAVE_DLOPEN /* No udf functions */ -#undef HAVE_SMEM /* No shared memory */ -#undef HAVE_NDBCLUSTER_DB /* No NDB cluster */ - -#endif /* EMBEDDED_LIBRARY */ -#endif /* MYSQL_EMBED_INCLUDED */ diff --git a/dep/mysqllite/include/mysql_time.h b/dep/mysqllite/include/mysql_time.h deleted file mode 100644 index 0a3f17a81fb..00000000000 --- a/dep/mysqllite/include/mysql_time.h +++ /dev/null @@ -1,55 +0,0 @@ -/* Copyright (C) 2004 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 */ - -#ifndef _mysql_time_h_ -#define _mysql_time_h_ - -/* - Time declarations shared between the server and client API: - you should not add anything to this header unless it's used - (and hence should be visible) in mysql.h. - If you're looking for a place to add new time-related declaration, - it's most likely my_time.h. See also "C API Handling of Date - and Time Values" chapter in documentation. -*/ - -enum enum_mysql_timestamp_type -{ - MYSQL_TIMESTAMP_NONE= -2, MYSQL_TIMESTAMP_ERROR= -1, - MYSQL_TIMESTAMP_DATE= 0, MYSQL_TIMESTAMP_DATETIME= 1, MYSQL_TIMESTAMP_TIME= 2 -}; - - -/* - Structure which is used to represent datetime values inside MySQL. - - We assume that values in this structure are normalized, i.e. year <= 9999, - month <= 12, day <= 31, hour <= 23, hour <= 59, hour <= 59. Many functions - in server such as my_system_gmt_sec() or make_time() family of functions - rely on this (actually now usage of make_*() family relies on a bit weaker - restriction). Also functions that produce MYSQL_TIME as result ensure this. - There is one exception to this rule though if this structure holds time - value (time_type == MYSQL_TIMESTAMP_TIME) days and hour member can hold - bigger values. -*/ -typedef struct st_mysql_time -{ - unsigned int year, month, day, hour, minute, second; - unsigned long second_part; - my_bool neg; - enum enum_mysql_timestamp_type time_type; -} MYSQL_TIME; - -#endif /* _mysql_time_h_ */ diff --git a/dep/mysqllite/include/mysqld_ername.h b/dep/mysqllite/include/mysqld_ername.h deleted file mode 100644 index 7697b59d1eb..00000000000 --- a/dep/mysqllite/include/mysqld_ername.h +++ /dev/null @@ -1,708 +0,0 @@ -/* Autogenerated file, please don't edit */ - -{ "ER_HASHCHK", 1000, "hashchk" }, -{ "ER_NISAMCHK", 1001, "isamchk" }, -{ "ER_NO", 1002, "NO" }, -{ "ER_YES", 1003, "YES" }, -{ "ER_CANT_CREATE_FILE", 1004, "Can\'t create file \'%-.200s\' (errno: %d)" }, -{ "ER_CANT_CREATE_TABLE", 1005, "Can\'t create table \'%-.200s\' (errno: %d)" }, -{ "ER_CANT_CREATE_DB", 1006, "Can\'t create database \'%-.192s\' (errno: %d)" }, -{ "ER_DB_CREATE_EXISTS", 1007, "Can\'t create database \'%-.192s\'; database exists" }, -{ "ER_DB_DROP_EXISTS", 1008, "Can\'t drop database \'%-.192s\'; database doesn\'t exist" }, -{ "ER_DB_DROP_DELETE", 1009, "Error dropping database (can\'t delete \'%-.192s\', errno: %d)" }, -{ "ER_DB_DROP_RMDIR", 1010, "Error dropping database (can\'t rmdir \'%-.192s\', errno: %d)" }, -{ "ER_CANT_DELETE_FILE", 1011, "Error on delete of \'%-.192s\' (errno: %d)" }, -{ "ER_CANT_FIND_SYSTEM_REC", 1012, "Can\'t read record in system table" }, -{ "ER_CANT_GET_STAT", 1013, "Can\'t get status of \'%-.200s\' (errno: %d)" }, -{ "ER_CANT_GET_WD", 1014, "Can\'t get working directory (errno: %d)" }, -{ "ER_CANT_LOCK", 1015, "Can\'t lock file (errno: %d)" }, -{ "ER_CANT_OPEN_FILE", 1016, "Can\'t open file: \'%-.200s\' (errno: %d)" }, -{ "ER_FILE_NOT_FOUND", 1017, "Can\'t find file: \'%-.200s\' (errno: %d)" }, -{ "ER_CANT_READ_DIR", 1018, "Can\'t read dir of \'%-.192s\' (errno: %d)" }, -{ "ER_CANT_SET_WD", 1019, "Can\'t change dir to \'%-.192s\' (errno: %d)" }, -{ "ER_CHECKREAD", 1020, "Record has changed since last read in table \'%-.192s\'" }, -{ "ER_DISK_FULL", 1021, "Disk full (%s); waiting for someone to free some space..." }, -{ "ER_DUP_KEY", 1022, "Can\'t write; duplicate key in table \'%-.192s\'" }, -{ "ER_ERROR_ON_CLOSE", 1023, "Error on close of \'%-.192s\' (errno: %d)" }, -{ "ER_ERROR_ON_READ", 1024, "Error reading file \'%-.200s\' (errno: %d)" }, -{ "ER_ERROR_ON_RENAME", 1025, "Error on rename of \'%-.210s\' to \'%-.210s\' (errno: %d)" }, -{ "ER_ERROR_ON_WRITE", 1026, "Error writing file \'%-.200s\' (errno: %d)" }, -{ "ER_FILE_USED", 1027, "\'%-.192s\' is locked against change" }, -{ "ER_FILSORT_ABORT", 1028, "Sort aborted" }, -{ "ER_FORM_NOT_FOUND", 1029, "View \'%-.192s\' doesn\'t exist for \'%-.192s\'" }, -{ "ER_GET_ERRNO", 1030, "Got error %d from storage engine" }, -{ "ER_ILLEGAL_HA", 1031, "Table storage engine for \'%-.192s\' doesn\'t have this option" }, -{ "ER_KEY_NOT_FOUND", 1032, "Can\'t find record in \'%-.192s\'" }, -{ "ER_NOT_FORM_FILE", 1033, "Incorrect information in file: \'%-.200s\'" }, -{ "ER_NOT_KEYFILE", 1034, "Incorrect key file for table \'%-.200s\'; try to repair it" }, -{ "ER_OLD_KEYFILE", 1035, "Old key file for table \'%-.192s\'; repair it!" }, -{ "ER_OPEN_AS_READONLY", 1036, "Table \'%-.192s\' is read only" }, -{ "ER_OUTOFMEMORY", 1037, "Out of memory; restart server and try again (needed %d bytes)" }, -{ "ER_OUT_OF_SORTMEMORY", 1038, "Out of sort memory; increase server sort buffer size" }, -{ "ER_UNEXPECTED_EOF", 1039, "Unexpected EOF found when reading file \'%-.192s\' (errno: %d)" }, -{ "ER_CON_COUNT_ERROR", 1040, "Too many connections" }, -{ "ER_OUT_OF_RESOURCES", 1041, "Out of memory; check if mysqld or some other process uses all available memory; if not, you may have to use \'ulimit\' to allow mysqld to use more memory or you can add more swap space" }, -{ "ER_BAD_HOST_ERROR", 1042, "Can\'t get hostname for your address" }, -{ "ER_HANDSHAKE_ERROR", 1043, "Bad handshake" }, -{ "ER_DBACCESS_DENIED_ERROR", 1044, "Access denied for user \'%-.48s\'@\'%-.64s\' to database \'%-.192s\'" }, -{ "ER_ACCESS_DENIED_ERROR", 1045, "Access denied for user \'%-.48s\'@\'%-.64s\' (using password: %s)" }, -{ "ER_NO_DB_ERROR", 1046, "No database selected" }, -{ "ER_UNKNOWN_COM_ERROR", 1047, "Unknown command" }, -{ "ER_BAD_NULL_ERROR", 1048, "Column \'%-.192s\' cannot be null" }, -{ "ER_BAD_DB_ERROR", 1049, "Unknown database \'%-.192s\'" }, -{ "ER_TABLE_EXISTS_ERROR", 1050, "Table \'%-.192s\' already exists" }, -{ "ER_BAD_TABLE_ERROR", 1051, "Unknown table \'%-.100s\'" }, -{ "ER_NON_UNIQ_ERROR", 1052, "Column \'%-.192s\' in %-.192s is ambiguous" }, -{ "ER_SERVER_SHUTDOWN", 1053, "Server shutdown in progress" }, -{ "ER_BAD_FIELD_ERROR", 1054, "Unknown column \'%-.192s\' in \'%-.192s\'" }, -{ "ER_WRONG_FIELD_WITH_GROUP", 1055, "\'%-.192s\' isn\'t in GROUP BY" }, -{ "ER_WRONG_GROUP_FIELD", 1056, "Can\'t group on \'%-.192s\'" }, -{ "ER_WRONG_SUM_SELECT", 1057, "Statement has sum functions and columns in same statement" }, -{ "ER_WRONG_VALUE_COUNT", 1058, "Column count doesn\'t match value count" }, -{ "ER_TOO_LONG_IDENT", 1059, "Identifier name \'%-.100s\' is too long" }, -{ "ER_DUP_FIELDNAME", 1060, "Duplicate column name \'%-.192s\'" }, -{ "ER_DUP_KEYNAME", 1061, "Duplicate key name \'%-.192s\'" }, -{ "ER_DUP_ENTRY", 1062, "Duplicate entry \'%-.192s\' for key %d" }, -{ "ER_WRONG_FIELD_SPEC", 1063, "Incorrect column specifier for column \'%-.192s\'" }, -{ "ER_PARSE_ERROR", 1064, "%s near \'%-.80s\' at line %d" }, -{ "ER_EMPTY_QUERY", 1065, "Query was empty" }, -{ "ER_NONUNIQ_TABLE", 1066, "Not unique table/alias: \'%-.192s\'" }, -{ "ER_INVALID_DEFAULT", 1067, "Invalid default value for \'%-.192s\'" }, -{ "ER_MULTIPLE_PRI_KEY", 1068, "Multiple primary key defined" }, -{ "ER_TOO_MANY_KEYS", 1069, "Too many keys specified; max %d keys allowed" }, -{ "ER_TOO_MANY_KEY_PARTS", 1070, "Too many key parts specified; max %d parts allowed" }, -{ "ER_TOO_LONG_KEY", 1071, "Specified key was too long; max key length is %d bytes" }, -{ "ER_KEY_COLUMN_DOES_NOT_EXITS", 1072, "Key column \'%-.192s\' doesn\'t exist in table" }, -{ "ER_BLOB_USED_AS_KEY", 1073, "BLOB column \'%-.192s\' can\'t be used in key specification with the used table type" }, -{ "ER_TOO_BIG_FIELDLENGTH", 1074, "Column length too big for column \'%-.192s\' (max = %lu); use BLOB or TEXT instead" }, -{ "ER_WRONG_AUTO_KEY", 1075, "Incorrect table definition; there can be only one auto column and it must be defined as a key" }, -{ "ER_READY", 1076, "%s: ready for connections.\nVersion: \'%s\' socket: \'%s\' port: %d" }, -{ "ER_NORMAL_SHUTDOWN", 1077, "%s: Normal shutdown\n" }, -{ "ER_GOT_SIGNAL", 1078, "%s: Got signal %d. Aborting!\n" }, -{ "ER_SHUTDOWN_COMPLETE", 1079, "%s: Shutdown complete\n" }, -{ "ER_FORCING_CLOSE", 1080, "%s: Forcing close of thread %ld user: \'%-.48s\'\n" }, -{ "ER_IPSOCK_ERROR", 1081, "Can\'t create IP socket" }, -{ "ER_NO_SUCH_INDEX", 1082, "Table \'%-.192s\' has no index like the one used in CREATE INDEX; recreate the table" }, -{ "ER_WRONG_FIELD_TERMINATORS", 1083, "Field separator argument is not what is expected; check the manual" }, -{ "ER_BLOBS_AND_NO_TERMINATED", 1084, "You can\'t use fixed rowlength with BLOBs; please use \'fields terminated by\'" }, -{ "ER_TEXTFILE_NOT_READABLE", 1085, "The file \'%-.128s\' must be in the database directory or be readable by all" }, -{ "ER_FILE_EXISTS_ERROR", 1086, "File \'%-.200s\' already exists" }, -{ "ER_LOAD_INFO", 1087, "Records: %ld Deleted: %ld Skipped: %ld Warnings: %ld" }, -{ "ER_ALTER_INFO", 1088, "Records: %ld Duplicates: %ld" }, -{ "ER_WRONG_SUB_KEY", 1089, "Incorrect prefix key; the used key part isn\'t a string, the used length is longer than the key part, or the storage engine doesn\'t support unique prefix keys" }, -{ "ER_CANT_REMOVE_ALL_FIELDS", 1090, "You can\'t delete all columns with ALTER TABLE; use DROP TABLE instead" }, -{ "ER_CANT_DROP_FIELD_OR_KEY", 1091, "Can\'t DROP \'%-.192s\'; check that column/key exists" }, -{ "ER_INSERT_INFO", 1092, "Records: %ld Duplicates: %ld Warnings: %ld" }, -{ "ER_UPDATE_TABLE_USED", 1093, "You can\'t specify target table \'%-.192s\' for update in FROM clause" }, -{ "ER_NO_SUCH_THREAD", 1094, "Unknown thread id: %lu" }, -{ "ER_KILL_DENIED_ERROR", 1095, "You are not owner of thread %lu" }, -{ "ER_NO_TABLES_USED", 1096, "No tables used" }, -{ "ER_TOO_BIG_SET", 1097, "Too many strings for column %-.192s and SET" }, -{ "ER_NO_UNIQUE_LOGFILE", 1098, "Can\'t generate a unique log-filename %-.200s.(1-999)\n" }, -{ "ER_TABLE_NOT_LOCKED_FOR_WRITE", 1099, "Table \'%-.192s\' was locked with a READ lock and can\'t be updated" }, -{ "ER_TABLE_NOT_LOCKED", 1100, "Table \'%-.192s\' was not locked with LOCK TABLES" }, -{ "ER_BLOB_CANT_HAVE_DEFAULT", 1101, "BLOB/TEXT column \'%-.192s\' can\'t have a default value" }, -{ "ER_WRONG_DB_NAME", 1102, "Incorrect database name \'%-.100s\'" }, -{ "ER_WRONG_TABLE_NAME", 1103, "Incorrect table name \'%-.100s\'" }, -{ "ER_TOO_BIG_SELECT", 1104, "The SELECT would examine more than MAX_JOIN_SIZE rows; check your WHERE and use SET SQL_BIG_SELECTS=1 or SET SQL_MAX_JOIN_SIZE=# if the SELECT is okay" }, -{ "ER_UNKNOWN_ERROR", 1105, "Unknown error" }, -{ "ER_UNKNOWN_PROCEDURE", 1106, "Unknown procedure \'%-.192s\'" }, -{ "ER_WRONG_PARAMCOUNT_TO_PROCEDURE", 1107, "Incorrect parameter count to procedure \'%-.192s\'" }, -{ "ER_WRONG_PARAMETERS_TO_PROCEDURE", 1108, "Incorrect parameters to procedure \'%-.192s\'" }, -{ "ER_UNKNOWN_TABLE", 1109, "Unknown table \'%-.192s\' in %-.32s" }, -{ "ER_FIELD_SPECIFIED_TWICE", 1110, "Column \'%-.192s\' specified twice" }, -{ "ER_INVALID_GROUP_FUNC_USE", 1111, "Invalid use of group function" }, -{ "ER_UNSUPPORTED_EXTENSION", 1112, "Table \'%-.192s\' uses an extension that doesn\'t exist in this MySQL version" }, -{ "ER_TABLE_MUST_HAVE_COLUMNS", 1113, "A table must have at least 1 column" }, -{ "ER_RECORD_FILE_FULL", 1114, "The table \'%-.192s\' is full" }, -{ "ER_UNKNOWN_CHARACTER_SET", 1115, "Unknown character set: \'%-.64s\'" }, -{ "ER_TOO_MANY_TABLES", 1116, "Too many tables; MySQL can only use %d tables in a join" }, -{ "ER_TOO_MANY_FIELDS", 1117, "Too many columns" }, -{ "ER_TOO_BIG_ROWSIZE", 1118, "Row size too large. The maximum row size for the used table type, not counting BLOBs, is %ld. You have to change some columns to TEXT or BLOBs" }, -{ "ER_STACK_OVERRUN", 1119, "Thread stack overrun: Used: %ld of a %ld stack. Use \'mysqld --thread_stack=#\' to specify a bigger stack if needed" }, -{ "ER_WRONG_OUTER_JOIN", 1120, "Cross dependency found in OUTER JOIN; examine your ON conditions" }, -{ "ER_NULL_COLUMN_IN_INDEX", 1121, "Table handler doesn\'t support NULL in given index. Please change column \'%-.192s\' to be NOT NULL or use another handler" }, -{ "ER_CANT_FIND_UDF", 1122, "Can\'t load function \'%-.192s\'" }, -{ "ER_CANT_INITIALIZE_UDF", 1123, "Can\'t initialize function \'%-.192s\'; %-.80s" }, -{ "ER_UDF_NO_PATHS", 1124, "No paths allowed for shared library" }, -{ "ER_UDF_EXISTS", 1125, "Function \'%-.192s\' already exists" }, -{ "ER_CANT_OPEN_LIBRARY", 1126, "Can\'t open shared library \'%-.192s\' (errno: %d %-.128s)" }, -{ "ER_CANT_FIND_DL_ENTRY", 1127, "Can\'t find symbol \'%-.128s\' in library" }, -{ "ER_FUNCTION_NOT_DEFINED", 1128, "Function \'%-.192s\' is not defined" }, -{ "ER_HOST_IS_BLOCKED", 1129, "Host \'%-.64s\' is blocked because of many connection errors; unblock with \'mysqladmin flush-hosts\'" }, -{ "ER_HOST_NOT_PRIVILEGED", 1130, "Host \'%-.64s\' is not allowed to connect to this MySQL server" }, -{ "ER_PASSWORD_ANONYMOUS_USER", 1131, "You are using MySQL as an anonymous user and anonymous users are not allowed to change passwords" }, -{ "ER_PASSWORD_NOT_ALLOWED", 1132, "You must have privileges to update tables in the mysql database to be able to change passwords for others" }, -{ "ER_PASSWORD_NO_MATCH", 1133, "Can\'t find any matching row in the user table" }, -{ "ER_UPDATE_INFO", 1134, "Rows matched: %ld Changed: %ld Warnings: %ld" }, -{ "ER_CANT_CREATE_THREAD", 1135, "Can\'t create a new thread (errno %d); if you are not out of available memory, you can consult the manual for a possible OS-dependent bug" }, -{ "ER_WRONG_VALUE_COUNT_ON_ROW", 1136, "Column count doesn\'t match value count at row %ld" }, -{ "ER_CANT_REOPEN_TABLE", 1137, "Can\'t reopen table: \'%-.192s\'" }, -{ "ER_INVALID_USE_OF_NULL", 1138, "Invalid use of NULL value" }, -{ "ER_REGEXP_ERROR", 1139, "Got error \'%-.64s\' from regexp" }, -{ "ER_MIX_OF_GROUP_FUNC_AND_FIELDS", 1140, "Mixing of GROUP columns (MIN(),MAX(),COUNT(),...) with no GROUP columns is illegal if there is no GROUP BY clause" }, -{ "ER_NONEXISTING_GRANT", 1141, "There is no such grant defined for user \'%-.48s\' on host \'%-.64s\'" }, -{ "ER_TABLEACCESS_DENIED_ERROR", 1142, "%-.16s command denied to user \'%-.48s\'@\'%-.64s\' for table \'%-.192s\'" }, -{ "ER_COLUMNACCESS_DENIED_ERROR", 1143, "%-.16s command denied to user \'%-.48s\'@\'%-.64s\' for column \'%-.192s\' in table \'%-.192s\'" }, -{ "ER_ILLEGAL_GRANT_FOR_TABLE", 1144, "Illegal GRANT/REVOKE command; please consult the manual to see which privileges can be used" }, -{ "ER_GRANT_WRONG_HOST_OR_USER", 1145, "The host or user argument to GRANT is too long" }, -{ "ER_NO_SUCH_TABLE", 1146, "Table \'%-.192s.%-.192s\' doesn\'t exist" }, -{ "ER_NONEXISTING_TABLE_GRANT", 1147, "There is no such grant defined for user \'%-.48s\' on host \'%-.64s\' on table \'%-.192s\'" }, -{ "ER_NOT_ALLOWED_COMMAND", 1148, "The used command is not allowed with this MySQL version" }, -{ "ER_SYNTAX_ERROR", 1149, "You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use" }, -{ "ER_DELAYED_CANT_CHANGE_LOCK", 1150, "Delayed insert thread couldn\'t get requested lock for table %-.192s" }, -{ "ER_TOO_MANY_DELAYED_THREADS", 1151, "Too many delayed threads in use" }, -{ "ER_ABORTING_CONNECTION", 1152, "Aborted connection %ld to db: \'%-.192s\' user: \'%-.48s\' (%-.64s)" }, -{ "ER_NET_PACKET_TOO_LARGE", 1153, "Got a packet bigger than \'max_allowed_packet\' bytes" }, -{ "ER_NET_READ_ERROR_FROM_PIPE", 1154, "Got a read error from the connection pipe" }, -{ "ER_NET_FCNTL_ERROR", 1155, "Got an error from fcntl()" }, -{ "ER_NET_PACKETS_OUT_OF_ORDER", 1156, "Got packets out of order" }, -{ "ER_NET_UNCOMPRESS_ERROR", 1157, "Couldn\'t uncompress communication packet" }, -{ "ER_NET_READ_ERROR", 1158, "Got an error reading communication packets" }, -{ "ER_NET_READ_INTERRUPTED", 1159, "Got timeout reading communication packets" }, -{ "ER_NET_ERROR_ON_WRITE", 1160, "Got an error writing communication packets" }, -{ "ER_NET_WRITE_INTERRUPTED", 1161, "Got timeout writing communication packets" }, -{ "ER_TOO_LONG_STRING", 1162, "Result string is longer than \'max_allowed_packet\' bytes" }, -{ "ER_TABLE_CANT_HANDLE_BLOB", 1163, "The used table type doesn\'t support BLOB/TEXT columns" }, -{ "ER_TABLE_CANT_HANDLE_AUTO_INCREMENT", 1164, "The used table type doesn\'t support AUTO_INCREMENT columns" }, -{ "ER_DELAYED_INSERT_TABLE_LOCKED", 1165, "INSERT DELAYED can\'t be used with table \'%-.192s\' because it is locked with LOCK TABLES" }, -{ "ER_WRONG_COLUMN_NAME", 1166, "Incorrect column name \'%-.100s\'" }, -{ "ER_WRONG_KEY_COLUMN", 1167, "The used storage engine can\'t index column \'%-.192s\'" }, -{ "ER_WRONG_MRG_TABLE", 1168, "Unable to open underlying table which is differently defined or of non-MyISAM type or doesn\'t exist" }, -{ "ER_DUP_UNIQUE", 1169, "Can\'t write, because of unique constraint, to table \'%-.192s\'" }, -{ "ER_BLOB_KEY_WITHOUT_LENGTH", 1170, "BLOB/TEXT column \'%-.192s\' used in key specification without a key length" }, -{ "ER_PRIMARY_CANT_HAVE_NULL", 1171, "All parts of a PRIMARY KEY must be NOT NULL; if you need NULL in a key, use UNIQUE instead" }, -{ "ER_TOO_MANY_ROWS", 1172, "Result consisted of more than one row" }, -{ "ER_REQUIRES_PRIMARY_KEY", 1173, "This table type requires a primary key" }, -{ "ER_NO_RAID_COMPILED", 1174, "This version of MySQL is not compiled with RAID support" }, -{ "ER_UPDATE_WITHOUT_KEY_IN_SAFE_MODE", 1175, "You are using safe update mode and you tried to update a table without a WHERE that uses a KEY column" }, -{ "ER_KEY_DOES_NOT_EXITS", 1176, "Key \'%-.192s\' doesn\'t exist in table \'%-.192s\'" }, -{ "ER_CHECK_NO_SUCH_TABLE", 1177, "Can\'t open table" }, -{ "ER_CHECK_NOT_IMPLEMENTED", 1178, "The storage engine for the table doesn\'t support %s" }, -{ "ER_CANT_DO_THIS_DURING_AN_TRANSACTION", 1179, "You are not allowed to execute this command in a transaction" }, -{ "ER_ERROR_DURING_COMMIT", 1180, "Got error %d during COMMIT" }, -{ "ER_ERROR_DURING_ROLLBACK", 1181, "Got error %d during ROLLBACK" }, -{ "ER_ERROR_DURING_FLUSH_LOGS", 1182, "Got error %d during FLUSH_LOGS" }, -{ "ER_ERROR_DURING_CHECKPOINT", 1183, "Got error %d during CHECKPOINT" }, -{ "ER_NEW_ABORTING_CONNECTION", 1184, "Aborted connection %ld to db: \'%-.192s\' user: \'%-.48s\' host: \'%-.64s\' (%-.64s)" }, -{ "ER_DUMP_NOT_IMPLEMENTED", 1185, "The storage engine for the table does not support binary table dump" }, -{ "ER_FLUSH_MASTER_BINLOG_CLOSED", 1186, "Binlog closed, cannot RESET MASTER" }, -{ "ER_INDEX_REBUILD", 1187, "Failed rebuilding the index of dumped table \'%-.192s\'" }, -{ "ER_MASTER", 1188, "Error from master: \'%-.64s\'" }, -{ "ER_MASTER_NET_READ", 1189, "Net error reading from master" }, -{ "ER_MASTER_NET_WRITE", 1190, "Net error writing to master" }, -{ "ER_FT_MATCHING_KEY_NOT_FOUND", 1191, "Can\'t find FULLTEXT index matching the column list" }, -{ "ER_LOCK_OR_ACTIVE_TRANSACTION", 1192, "Can\'t execute the given command because you have active locked tables or an active transaction" }, -{ "ER_UNKNOWN_SYSTEM_VARIABLE", 1193, "Unknown system variable \'%-.64s\'" }, -{ "ER_CRASHED_ON_USAGE", 1194, "Table \'%-.192s\' is marked as crashed and should be repaired" }, -{ "ER_CRASHED_ON_REPAIR", 1195, "Table \'%-.192s\' is marked as crashed and last (automatic?) repair failed" }, -{ "ER_WARNING_NOT_COMPLETE_ROLLBACK", 1196, "Some non-transactional changed tables couldn\'t be rolled back" }, -{ "ER_TRANS_CACHE_FULL", 1197, "Multi-statement transaction required more than \'max_binlog_cache_size\' bytes of storage; increase this mysqld variable and try again" }, -{ "ER_SLAVE_MUST_STOP", 1198, "This operation cannot be performed with a running slave; run STOP SLAVE first" }, -{ "ER_SLAVE_NOT_RUNNING", 1199, "This operation requires a running slave; configure slave and do START SLAVE" }, -{ "ER_BAD_SLAVE", 1200, "The server is not configured as slave; fix in config file or with CHANGE MASTER TO" }, -{ "ER_MASTER_INFO", 1201, "Could not initialize master info structure; more error messages can be found in the MySQL error log" }, -{ "ER_SLAVE_THREAD", 1202, "Could not create slave thread; check system resources" }, -{ "ER_TOO_MANY_USER_CONNECTIONS", 1203, "User %-.64s already has more than \'max_user_connections\' active connections" }, -{ "ER_SET_CONSTANTS_ONLY", 1204, "You may only use constant expressions with SET" }, -{ "ER_LOCK_WAIT_TIMEOUT", 1205, "Lock wait timeout exceeded; try restarting transaction" }, -{ "ER_LOCK_TABLE_FULL", 1206, "The total number of locks exceeds the lock table size" }, -{ "ER_READ_ONLY_TRANSACTION", 1207, "Update locks cannot be acquired during a READ UNCOMMITTED transaction" }, -{ "ER_DROP_DB_WITH_READ_LOCK", 1208, "DROP DATABASE not allowed while thread is holding global read lock" }, -{ "ER_CREATE_DB_WITH_READ_LOCK", 1209, "CREATE DATABASE not allowed while thread is holding global read lock" }, -{ "ER_WRONG_ARGUMENTS", 1210, "Incorrect arguments to %s" }, -{ "ER_NO_PERMISSION_TO_CREATE_USER", 1211, "\'%-.48s\'@\'%-.64s\' is not allowed to create new users" }, -{ "ER_UNION_TABLES_IN_DIFFERENT_DIR", 1212, "Incorrect table definition; all MERGE tables must be in the same database" }, -{ "ER_LOCK_DEADLOCK", 1213, "Deadlock found when trying to get lock; try restarting transaction" }, -{ "ER_TABLE_CANT_HANDLE_FT", 1214, "The used table type doesn\'t support FULLTEXT indexes" }, -{ "ER_CANNOT_ADD_FOREIGN", 1215, "Cannot add foreign key constraint" }, -{ "ER_NO_REFERENCED_ROW", 1216, "Cannot add or update a child row: a foreign key constraint fails" }, -{ "ER_ROW_IS_REFERENCED", 1217, "Cannot delete or update a parent row: a foreign key constraint fails" }, -{ "ER_CONNECT_TO_MASTER", 1218, "Error connecting to master: %-.128s" }, -{ "ER_QUERY_ON_MASTER", 1219, "Error running query on master: %-.128s" }, -{ "ER_ERROR_WHEN_EXECUTING_COMMAND", 1220, "Error when executing command %s: %-.128s" }, -{ "ER_WRONG_USAGE", 1221, "Incorrect usage of %s and %s" }, -{ "ER_WRONG_NUMBER_OF_COLUMNS_IN_SELECT", 1222, "The used SELECT statements have a different number of columns" }, -{ "ER_CANT_UPDATE_WITH_READLOCK", 1223, "Can\'t execute the query because you have a conflicting read lock" }, -{ "ER_MIXING_NOT_ALLOWED", 1224, "Mixing of transactional and non-transactional tables is disabled" }, -{ "ER_DUP_ARGUMENT", 1225, "Option \'%s\' used twice in statement" }, -{ "ER_USER_LIMIT_REACHED", 1226, "User \'%-.64s\' has exceeded the \'%s\' resource (current value: %ld)" }, -{ "ER_SPECIFIC_ACCESS_DENIED_ERROR", 1227, "Access denied; you need (at least one of) the %-.128s privilege(s) for this operation" }, -{ "ER_LOCAL_VARIABLE", 1228, "Variable \'%-.64s\' is a SESSION variable and can\'t be used with SET GLOBAL" }, -{ "ER_GLOBAL_VARIABLE", 1229, "Variable \'%-.64s\' is a GLOBAL variable and should be set with SET GLOBAL" }, -{ "ER_NO_DEFAULT", 1230, "Variable \'%-.64s\' doesn\'t have a default value" }, -{ "ER_WRONG_VALUE_FOR_VAR", 1231, "Variable \'%-.64s\' can\'t be set to the value of \'%-.200s\'" }, -{ "ER_WRONG_TYPE_FOR_VAR", 1232, "Incorrect argument type to variable \'%-.64s\'" }, -{ "ER_VAR_CANT_BE_READ", 1233, "Variable \'%-.64s\' can only be set, not read" }, -{ "ER_CANT_USE_OPTION_HERE", 1234, "Incorrect usage/placement of \'%s\'" }, -{ "ER_NOT_SUPPORTED_YET", 1235, "This version of MySQL doesn\'t yet support \'%s\'" }, -{ "ER_MASTER_FATAL_ERROR_READING_BINLOG", 1236, "Got fatal error %d from master when reading data from binary log: \'%-.128s\'" }, -{ "ER_SLAVE_IGNORED_TABLE", 1237, "Slave SQL thread ignored the query because of replicate-*-table rules" }, -{ "ER_INCORRECT_GLOBAL_LOCAL_VAR", 1238, "Variable \'%-.192s\' is a %s variable" }, -{ "ER_WRONG_FK_DEF", 1239, "Incorrect foreign key definition for \'%-.192s\': %s" }, -{ "ER_KEY_REF_DO_NOT_MATCH_TABLE_REF", 1240, "Key reference and table reference don\'t match" }, -{ "ER_OPERAND_COLUMNS", 1241, "Operand should contain %d column(s)" }, -{ "ER_SUBQUERY_NO_1_ROW", 1242, "Subquery returns more than 1 row" }, -{ "ER_UNKNOWN_STMT_HANDLER", 1243, "Unknown prepared statement handler (%.*s) given to %s" }, -{ "ER_CORRUPT_HELP_DB", 1244, "Help database is corrupt or does not exist" }, -{ "ER_CYCLIC_REFERENCE", 1245, "Cyclic reference on subqueries" }, -{ "ER_AUTO_CONVERT", 1246, "Converting column \'%s\' from %s to %s" }, -{ "ER_ILLEGAL_REFERENCE", 1247, "Reference \'%-.64s\' not supported (%s)" }, -{ "ER_DERIVED_MUST_HAVE_ALIAS", 1248, "Every derived table must have its own alias" }, -{ "ER_SELECT_REDUCED", 1249, "Select %u was reduced during optimization" }, -{ "ER_TABLENAME_NOT_ALLOWED_HERE", 1250, "Table \'%-.192s\' from one of the SELECTs cannot be used in %-.32s" }, -{ "ER_NOT_SUPPORTED_AUTH_MODE", 1251, "Client does not support authentication protocol requested by server; consider upgrading MySQL client" }, -{ "ER_SPATIAL_CANT_HAVE_NULL", 1252, "All parts of a SPATIAL index must be NOT NULL" }, -{ "ER_COLLATION_CHARSET_MISMATCH", 1253, "COLLATION \'%s\' is not valid for CHARACTER SET \'%s\'" }, -{ "ER_SLAVE_WAS_RUNNING", 1254, "Slave is already running" }, -{ "ER_SLAVE_WAS_NOT_RUNNING", 1255, "Slave already has been stopped" }, -{ "ER_TOO_BIG_FOR_UNCOMPRESS", 1256, "Uncompressed data size too large; the maximum size is %d (probably, length of uncompressed data was corrupted)" }, -{ "ER_ZLIB_Z_MEM_ERROR", 1257, "ZLIB: Not enough memory" }, -{ "ER_ZLIB_Z_BUF_ERROR", 1258, "ZLIB: Not enough room in the output buffer (probably, length of uncompressed data was corrupted)" }, -{ "ER_ZLIB_Z_DATA_ERROR", 1259, "ZLIB: Input data corrupted" }, -{ "ER_CUT_VALUE_GROUP_CONCAT", 1260, "Row %u was cut by GROUP_CONCAT()" }, -{ "ER_WARN_TOO_FEW_RECORDS", 1261, "Row %ld doesn\'t contain data for all columns" }, -{ "ER_WARN_TOO_MANY_RECORDS", 1262, "Row %ld was truncated; it contained more data than there were input columns" }, -{ "ER_WARN_NULL_TO_NOTNULL", 1263, "Column set to default value; NULL supplied to NOT NULL column \'%s\' at row %ld" }, -{ "ER_WARN_DATA_OUT_OF_RANGE", 1264, "Out of range value for column \'%s\' at row %ld" }, -{ "WARN_DATA_TRUNCATED", 1265, "Data truncated for column \'%s\' at row %ld" }, -{ "ER_WARN_USING_OTHER_HANDLER", 1266, "Using storage engine %s for table \'%s\'" }, -{ "ER_CANT_AGGREGATE_2COLLATIONS", 1267, "Illegal mix of collations (%s,%s) and (%s,%s) for operation \'%s\'" }, -{ "ER_DROP_USER", 1268, "Cannot drop one or more of the requested users" }, -{ "ER_REVOKE_GRANTS", 1269, "Can\'t revoke all privileges for one or more of the requested users" }, -{ "ER_CANT_AGGREGATE_3COLLATIONS", 1270, "Illegal mix of collations (%s,%s), (%s,%s), (%s,%s) for operation \'%s\'" }, -{ "ER_CANT_AGGREGATE_NCOLLATIONS", 1271, "Illegal mix of collations for operation \'%s\'" }, -{ "ER_VARIABLE_IS_NOT_STRUCT", 1272, "Variable \'%-.64s\' is not a variable component (can\'t be used as XXXX.variable_name)" }, -{ "ER_UNKNOWN_COLLATION", 1273, "Unknown collation: \'%-.64s\'" }, -{ "ER_SLAVE_IGNORED_SSL_PARAMS", 1274, "SSL parameters in CHANGE MASTER are ignored because this MySQL slave was compiled without SSL support; they can be used later if MySQL slave with SSL is started" }, -{ "ER_SERVER_IS_IN_SECURE_AUTH_MODE", 1275, "Server is running in --secure-auth mode, but \'%s\'@\'%s\' has a password in the old format; please change the password to the new format" }, -{ "ER_WARN_FIELD_RESOLVED", 1276, "Field or reference \'%-.192s%s%-.192s%s%-.192s\' of SELECT #%d was resolved in SELECT #%d" }, -{ "ER_BAD_SLAVE_UNTIL_COND", 1277, "Incorrect parameter or combination of parameters for START SLAVE UNTIL" }, -{ "ER_MISSING_SKIP_SLAVE", 1278, "It is recommended to use --skip-slave-start when doing step-by-step replication with START SLAVE UNTIL; otherwise, you will get problems if you get an unexpected slave\'s mysqld restart" }, -{ "ER_UNTIL_COND_IGNORED", 1279, "SQL thread is not to be started so UNTIL options are ignored" }, -{ "ER_WRONG_NAME_FOR_INDEX", 1280, "Incorrect index name \'%-.100s\'" }, -{ "ER_WRONG_NAME_FOR_CATALOG", 1281, "Incorrect catalog name \'%-.100s\'" }, -{ "ER_WARN_QC_RESIZE", 1282, "Query cache failed to set size %lu; new query cache size is %lu" }, -{ "ER_BAD_FT_COLUMN", 1283, "Column \'%-.192s\' cannot be part of FULLTEXT index" }, -{ "ER_UNKNOWN_KEY_CACHE", 1284, "Unknown key cache \'%-.100s\'" }, -{ "ER_WARN_HOSTNAME_WONT_WORK", 1285, "MySQL is started in --skip-name-resolve mode; you must restart it without this switch for this grant to work" }, -{ "ER_UNKNOWN_STORAGE_ENGINE", 1286, "Unknown storage engine \'%s\'" }, -{ "ER_WARN_DEPRECATED_SYNTAX", 1287, "\'%s\' is deprecated and will be removed in a future release. Please use %s instead" }, -{ "ER_NON_UPDATABLE_TABLE", 1288, "The target table %-.100s of the %s is not updatable" }, -{ "ER_FEATURE_DISABLED", 1289, "The \'%s\' feature is disabled; you need MySQL built with \'%s\' to have it working" }, -{ "ER_OPTION_PREVENTS_STATEMENT", 1290, "The MySQL server is running with the %s option so it cannot execute this statement" }, -{ "ER_DUPLICATED_VALUE_IN_TYPE", 1291, "Column \'%-.100s\' has duplicated value \'%-.64s\' in %s" }, -{ "ER_TRUNCATED_WRONG_VALUE", 1292, "Truncated incorrect %-.32s value: \'%-.128s\'" }, -{ "ER_TOO_MUCH_AUTO_TIMESTAMP_COLS", 1293, "Incorrect table definition; there can be only one TIMESTAMP column with CURRENT_TIMESTAMP in DEFAULT or ON UPDATE clause" }, -{ "ER_INVALID_ON_UPDATE", 1294, "Invalid ON UPDATE clause for \'%-.192s\' column" }, -{ "ER_UNSUPPORTED_PS", 1295, "This command is not supported in the prepared statement protocol yet" }, -{ "ER_GET_ERRMSG", 1296, "Got error %d \'%-.100s\' from %s" }, -{ "ER_GET_TEMPORARY_ERRMSG", 1297, "Got temporary error %d \'%-.100s\' from %s" }, -{ "ER_UNKNOWN_TIME_ZONE", 1298, "Unknown or incorrect time zone: \'%-.64s\'" }, -{ "ER_WARN_INVALID_TIMESTAMP", 1299, "Invalid TIMESTAMP value in column \'%s\' at row %ld" }, -{ "ER_INVALID_CHARACTER_STRING", 1300, "Invalid %s character string: \'%.64s\'" }, -{ "ER_WARN_ALLOWED_PACKET_OVERFLOWED", 1301, "Result of %s() was larger than max_allowed_packet (%ld) - truncated" }, -{ "ER_CONFLICTING_DECLARATIONS", 1302, "Conflicting declarations: \'%s%s\' and \'%s%s\'" }, -{ "ER_SP_NO_RECURSIVE_CREATE", 1303, "Can\'t create a %s from within another stored routine" }, -{ "ER_SP_ALREADY_EXISTS", 1304, "%s %s already exists" }, -{ "ER_SP_DOES_NOT_EXIST", 1305, "%s %s does not exist" }, -{ "ER_SP_DROP_FAILED", 1306, "Failed to DROP %s %s" }, -{ "ER_SP_STORE_FAILED", 1307, "Failed to CREATE %s %s" }, -{ "ER_SP_LILABEL_MISMATCH", 1308, "%s with no matching label: %s" }, -{ "ER_SP_LABEL_REDEFINE", 1309, "Redefining label %s" }, -{ "ER_SP_LABEL_MISMATCH", 1310, "End-label %s without match" }, -{ "ER_SP_UNINIT_VAR", 1311, "Referring to uninitialized variable %s" }, -{ "ER_SP_BADSELECT", 1312, "PROCEDURE %s can\'t return a result set in the given context" }, -{ "ER_SP_BADRETURN", 1313, "RETURN is only allowed in a FUNCTION" }, -{ "ER_SP_BADSTATEMENT", 1314, "%s is not allowed in stored procedures" }, -{ "ER_UPDATE_LOG_DEPRECATED_IGNORED", 1315, "The update log is deprecated and replaced by the binary log; SET SQL_LOG_UPDATE has been ignored. This option will be removed in MySQL 5.6." }, -{ "ER_UPDATE_LOG_DEPRECATED_TRANSLATED", 1316, "The update log is deprecated and replaced by the binary log; SET SQL_LOG_UPDATE has been translated to SET SQL_LOG_BIN. This option will be removed in MySQL 5.6." }, -{ "ER_QUERY_INTERRUPTED", 1317, "Query execution was interrupted" }, -{ "ER_SP_WRONG_NO_OF_ARGS", 1318, "Incorrect number of arguments for %s %s; expected %u, got %u" }, -{ "ER_SP_COND_MISMATCH", 1319, "Undefined CONDITION: %s" }, -{ "ER_SP_NORETURN", 1320, "No RETURN found in FUNCTION %s" }, -{ "ER_SP_NORETURNEND", 1321, "FUNCTION %s ended without RETURN" }, -{ "ER_SP_BAD_CURSOR_QUERY", 1322, "Cursor statement must be a SELECT" }, -{ "ER_SP_BAD_CURSOR_SELECT", 1323, "Cursor SELECT must not have INTO" }, -{ "ER_SP_CURSOR_MISMATCH", 1324, "Undefined CURSOR: %s" }, -{ "ER_SP_CURSOR_ALREADY_OPEN", 1325, "Cursor is already open" }, -{ "ER_SP_CURSOR_NOT_OPEN", 1326, "Cursor is not open" }, -{ "ER_SP_UNDECLARED_VAR", 1327, "Undeclared variable: %s" }, -{ "ER_SP_WRONG_NO_OF_FETCH_ARGS", 1328, "Incorrect number of FETCH variables" }, -{ "ER_SP_FETCH_NO_DATA", 1329, "No data - zero rows fetched, selected, or processed" }, -{ "ER_SP_DUP_PARAM", 1330, "Duplicate parameter: %s" }, -{ "ER_SP_DUP_VAR", 1331, "Duplicate variable: %s" }, -{ "ER_SP_DUP_COND", 1332, "Duplicate condition: %s" }, -{ "ER_SP_DUP_CURS", 1333, "Duplicate cursor: %s" }, -{ "ER_SP_CANT_ALTER", 1334, "Failed to ALTER %s %s" }, -{ "ER_SP_SUBSELECT_NYI", 1335, "Subquery value not supported" }, -{ "ER_STMT_NOT_ALLOWED_IN_SF_OR_TRG", 1336, "%s is not allowed in stored function or trigger" }, -{ "ER_SP_VARCOND_AFTER_CURSHNDLR", 1337, "Variable or condition declaration after cursor or handler declaration" }, -{ "ER_SP_CURSOR_AFTER_HANDLER", 1338, "Cursor declaration after handler declaration" }, -{ "ER_SP_CASE_NOT_FOUND", 1339, "Case not found for CASE statement" }, -{ "ER_FPARSER_TOO_BIG_FILE", 1340, "Configuration file \'%-.192s\' is too big" }, -{ "ER_FPARSER_BAD_HEADER", 1341, "Malformed file type header in file \'%-.192s\'" }, -{ "ER_FPARSER_EOF_IN_COMMENT", 1342, "Unexpected end of file while parsing comment \'%-.200s\'" }, -{ "ER_FPARSER_ERROR_IN_PARAMETER", 1343, "Error while parsing parameter \'%-.192s\' (line: \'%-.192s\')" }, -{ "ER_FPARSER_EOF_IN_UNKNOWN_PARAMETER", 1344, "Unexpected end of file while skipping unknown parameter \'%-.192s\'" }, -{ "ER_VIEW_NO_EXPLAIN", 1345, "EXPLAIN/SHOW can not be issued; lacking privileges for underlying table" }, -{ "ER_FRM_UNKNOWN_TYPE", 1346, "File \'%-.192s\' has unknown type \'%-.64s\' in its header" }, -{ "ER_WRONG_OBJECT", 1347, "\'%-.192s.%-.192s\' is not %s" }, -{ "ER_NONUPDATEABLE_COLUMN", 1348, "Column \'%-.192s\' is not updatable" }, -{ "ER_VIEW_SELECT_DERIVED", 1349, "View\'s SELECT contains a subquery in the FROM clause" }, -{ "ER_VIEW_SELECT_CLAUSE", 1350, "View\'s SELECT contains a \'%s\' clause" }, -{ "ER_VIEW_SELECT_VARIABLE", 1351, "View\'s SELECT contains a variable or parameter" }, -{ "ER_VIEW_SELECT_TMPTABLE", 1352, "View\'s SELECT refers to a temporary table \'%-.192s\'" }, -{ "ER_VIEW_WRONG_LIST", 1353, "View\'s SELECT and view\'s field list have different column counts" }, -{ "ER_WARN_VIEW_MERGE", 1354, "View merge algorithm can\'t be used here for now (assumed undefined algorithm)" }, -{ "ER_WARN_VIEW_WITHOUT_KEY", 1355, "View being updated does not have complete key of underlying table in it" }, -{ "ER_VIEW_INVALID", 1356, "View \'%-.192s.%-.192s\' references invalid table(s) or column(s) or function(s) or definer/invoker of view lack rights to use them" }, -{ "ER_SP_NO_DROP_SP", 1357, "Can\'t drop or alter a %s from within another stored routine" }, -{ "ER_SP_GOTO_IN_HNDLR", 1358, "GOTO is not allowed in a stored procedure handler" }, -{ "ER_TRG_ALREADY_EXISTS", 1359, "Trigger already exists" }, -{ "ER_TRG_DOES_NOT_EXIST", 1360, "Trigger does not exist" }, -{ "ER_TRG_ON_VIEW_OR_TEMP_TABLE", 1361, "Trigger\'s \'%-.192s\' is view or temporary table" }, -{ "ER_TRG_CANT_CHANGE_ROW", 1362, "Updating of %s row is not allowed in %strigger" }, -{ "ER_TRG_NO_SUCH_ROW_IN_TRG", 1363, "There is no %s row in %s trigger" }, -{ "ER_NO_DEFAULT_FOR_FIELD", 1364, "Field \'%-.192s\' doesn\'t have a default value" }, -{ "ER_DIVISION_BY_ZERO", 1365, "Division by 0" }, -{ "ER_TRUNCATED_WRONG_VALUE_FOR_FIELD", 1366, "Incorrect %-.32s value: \'%-.128s\' for column \'%.192s\' at row %ld" }, -{ "ER_ILLEGAL_VALUE_FOR_TYPE", 1367, "Illegal %s \'%-.192s\' value found during parsing" }, -{ "ER_VIEW_NONUPD_CHECK", 1368, "CHECK OPTION on non-updatable view \'%-.192s.%-.192s\'" }, -{ "ER_VIEW_CHECK_FAILED", 1369, "CHECK OPTION failed \'%-.192s.%-.192s\'" }, -{ "ER_PROCACCESS_DENIED_ERROR", 1370, "%-.16s command denied to user \'%-.48s\'@\'%-.64s\' for routine \'%-.192s\'" }, -{ "ER_RELAY_LOG_FAIL", 1371, "Failed purging old relay logs: %s" }, -{ "ER_PASSWD_LENGTH", 1372, "Password hash should be a %d-digit hexadecimal number" }, -{ "ER_UNKNOWN_TARGET_BINLOG", 1373, "Target log not found in binlog index" }, -{ "ER_IO_ERR_LOG_INDEX_READ", 1374, "I/O error reading log index file" }, -{ "ER_BINLOG_PURGE_PROHIBITED", 1375, "Server configuration does not permit binlog purge" }, -{ "ER_FSEEK_FAIL", 1376, "Failed on fseek()" }, -{ "ER_BINLOG_PURGE_FATAL_ERR", 1377, "Fatal error during log purge" }, -{ "ER_LOG_IN_USE", 1378, "A purgeable log is in use, will not purge" }, -{ "ER_LOG_PURGE_UNKNOWN_ERR", 1379, "Unknown error during log purge" }, -{ "ER_RELAY_LOG_INIT", 1380, "Failed initializing relay log position: %s" }, -{ "ER_NO_BINARY_LOGGING", 1381, "You are not using binary logging" }, -{ "ER_RESERVED_SYNTAX", 1382, "The \'%-.64s\' syntax is reserved for purposes internal to the MySQL server" }, -{ "ER_WSAS_FAILED", 1383, "WSAStartup Failed" }, -{ "ER_DIFF_GROUPS_PROC", 1384, "Can\'t handle procedures with different groups yet" }, -{ "ER_NO_GROUP_FOR_PROC", 1385, "Select must have a group with this procedure" }, -{ "ER_ORDER_WITH_PROC", 1386, "Can\'t use ORDER clause with this procedure" }, -{ "ER_LOGGING_PROHIBIT_CHANGING_OF", 1387, "Binary logging and replication forbid changing the global server %s" }, -{ "ER_NO_FILE_MAPPING", 1388, "Can\'t map file: %-.200s, errno: %d" }, -{ "ER_WRONG_MAGIC", 1389, "Wrong magic in %-.64s" }, -{ "ER_PS_MANY_PARAM", 1390, "Prepared statement contains too many placeholders" }, -{ "ER_KEY_PART_0", 1391, "Key part \'%-.192s\' length cannot be 0" }, -{ "ER_VIEW_CHECKSUM", 1392, "View text checksum failed" }, -{ "ER_VIEW_MULTIUPDATE", 1393, "Can not modify more than one base table through a join view \'%-.192s.%-.192s\'" }, -{ "ER_VIEW_NO_INSERT_FIELD_LIST", 1394, "Can not insert into join view \'%-.192s.%-.192s\' without fields list" }, -{ "ER_VIEW_DELETE_MERGE_VIEW", 1395, "Can not delete from join view \'%-.192s.%-.192s\'" }, -{ "ER_CANNOT_USER", 1396, "Operation %s failed for %.256s" }, -{ "ER_XAER_NOTA", 1397, "XAER_NOTA: Unknown XID" }, -{ "ER_XAER_INVAL", 1398, "XAER_INVAL: Invalid arguments (or unsupported command)" }, -{ "ER_XAER_RMFAIL", 1399, "XAER_RMFAIL: The command cannot be executed when global transaction is in the %.64s state" }, -{ "ER_XAER_OUTSIDE", 1400, "XAER_OUTSIDE: Some work is done outside global transaction" }, -{ "ER_XAER_RMERR", 1401, "XAER_RMERR: Fatal error occurred in the transaction branch - check your data for consistency" }, -{ "ER_XA_RBROLLBACK", 1402, "XA_RBROLLBACK: Transaction branch was rolled back" }, -{ "ER_NONEXISTING_PROC_GRANT", 1403, "There is no such grant defined for user \'%-.48s\' on host \'%-.64s\' on routine \'%-.192s\'" }, -{ "ER_PROC_AUTO_GRANT_FAIL", 1404, "Failed to grant EXECUTE and ALTER ROUTINE privileges" }, -{ "ER_PROC_AUTO_REVOKE_FAIL", 1405, "Failed to revoke all privileges to dropped routine" }, -{ "ER_DATA_TOO_LONG", 1406, "Data too long for column \'%s\' at row %ld" }, -{ "ER_SP_BAD_SQLSTATE", 1407, "Bad SQLSTATE: \'%s\'" }, -{ "ER_STARTUP", 1408, "%s: ready for connections.\nVersion: \'%s\' socket: \'%s\' port: %d %s" }, -{ "ER_LOAD_FROM_FIXED_SIZE_ROWS_TO_VAR", 1409, "Can\'t load value from file with fixed size rows to variable" }, -{ "ER_CANT_CREATE_USER_WITH_GRANT", 1410, "You are not allowed to create a user with GRANT" }, -{ "ER_WRONG_VALUE_FOR_TYPE", 1411, "Incorrect %-.32s value: \'%-.128s\' for function %-.32s" }, -{ "ER_TABLE_DEF_CHANGED", 1412, "Table definition has changed, please retry transaction" }, -{ "ER_SP_DUP_HANDLER", 1413, "Duplicate handler declared in the same block" }, -{ "ER_SP_NOT_VAR_ARG", 1414, "OUT or INOUT argument %d for routine %s is not a variable or NEW pseudo-variable in BEFORE trigger" }, -{ "ER_SP_NO_RETSET", 1415, "Not allowed to return a result set from a %s" }, -{ "ER_CANT_CREATE_GEOMETRY_OBJECT", 1416, "Cannot get geometry object from data you send to the GEOMETRY field" }, -{ "ER_FAILED_ROUTINE_BREAK_BINLOG", 1417, "A routine failed and has neither NO SQL nor READS SQL DATA in its declaration and binary logging is enabled; if non-transactional tables were updated, the binary log will miss their changes" }, -{ "ER_BINLOG_UNSAFE_ROUTINE", 1418, "This function has none of DETERMINISTIC, NO SQL, or READS SQL DATA in its declaration and binary logging is enabled (you *might* want to use the less safe log_bin_trust_function_creators variable)" }, -{ "ER_BINLOG_CREATE_ROUTINE_NEED_SUPER", 1419, "You do not have the SUPER privilege and binary logging is enabled (you *might* want to use the less safe log_bin_trust_function_creators variable)" }, -{ "ER_EXEC_STMT_WITH_OPEN_CURSOR", 1420, "You can\'t execute a prepared statement which has an open cursor associated with it. Reset the statement to re-execute it." }, -{ "ER_STMT_HAS_NO_OPEN_CURSOR", 1421, "The statement (%lu) has no open cursor." }, -{ "ER_COMMIT_NOT_ALLOWED_IN_SF_OR_TRG", 1422, "Explicit or implicit commit is not allowed in stored function or trigger." }, -{ "ER_NO_DEFAULT_FOR_VIEW_FIELD", 1423, "Field of view \'%-.192s.%-.192s\' underlying table doesn\'t have a default value" }, -{ "ER_SP_NO_RECURSION", 1424, "Recursive stored functions and triggers are not allowed." }, -{ "ER_TOO_BIG_SCALE", 1425, "Too big scale %d specified for column \'%-.192s\'. Maximum is %lu." }, -{ "ER_TOO_BIG_PRECISION", 1426, "Too big precision %d specified for column \'%-.192s\'. Maximum is %lu." }, -{ "ER_M_BIGGER_THAN_D", 1427, "For float(M,D), double(M,D) or decimal(M,D), M must be >= D (column \'%-.192s\')." }, -{ "ER_WRONG_LOCK_OF_SYSTEM_TABLE", 1428, "You can\'t combine write-locking of system tables with other tables or lock types" }, -{ "ER_CONNECT_TO_FOREIGN_DATA_SOURCE", 1429, "Unable to connect to foreign data source: %.64s" }, -{ "ER_QUERY_ON_FOREIGN_DATA_SOURCE", 1430, "There was a problem processing the query on the foreign data source. Data source error: %-.64s" }, -{ "ER_FOREIGN_DATA_SOURCE_DOESNT_EXIST", 1431, "The foreign data source you are trying to reference does not exist. Data source error: %-.64s" }, -{ "ER_FOREIGN_DATA_STRING_INVALID_CANT_CREATE", 1432, "Can\'t create federated table. The data source connection string \'%-.64s\' is not in the correct format" }, -{ "ER_FOREIGN_DATA_STRING_INVALID", 1433, "The data source connection string \'%-.64s\' is not in the correct format" }, -{ "ER_CANT_CREATE_FEDERATED_TABLE", 1434, "Can\'t create federated table. Foreign data src error: %-.64s" }, -{ "ER_TRG_IN_WRONG_SCHEMA", 1435, "Trigger in wrong schema" }, -{ "ER_STACK_OVERRUN_NEED_MORE", 1436, "Thread stack overrun: %ld bytes used of a %ld byte stack, and %ld bytes needed. Use \'mysqld --thread_stack=#\' to specify a bigger stack." }, -{ "ER_TOO_LONG_BODY", 1437, "Routine body for \'%-.100s\' is too long" }, -{ "ER_WARN_CANT_DROP_DEFAULT_KEYCACHE", 1438, "Cannot drop default keycache" }, -{ "ER_TOO_BIG_DISPLAYWIDTH", 1439, "Display width out of range for column \'%-.192s\' (max = %lu)" }, -{ "ER_XAER_DUPID", 1440, "XAER_DUPID: The XID already exists" }, -{ "ER_DATETIME_FUNCTION_OVERFLOW", 1441, "Datetime function: %-.32s field overflow" }, -{ "ER_CANT_UPDATE_USED_TABLE_IN_SF_OR_TRG", 1442, "Can\'t update table \'%-.192s\' in stored function/trigger because it is already used by statement which invoked this stored function/trigger." }, -{ "ER_VIEW_PREVENT_UPDATE", 1443, "The definition of table \'%-.192s\' prevents operation %.192s on table \'%-.192s\'." }, -{ "ER_PS_NO_RECURSION", 1444, "The prepared statement contains a stored routine call that refers to that same statement. It\'s not allowed to execute a prepared statement in such a recursive manner" }, -{ "ER_SP_CANT_SET_AUTOCOMMIT", 1445, "Not allowed to set autocommit from a stored function or trigger" }, -{ "ER_MALFORMED_DEFINER", 1446, "Definer is not fully qualified" }, -{ "ER_VIEW_FRM_NO_USER", 1447, "View \'%-.192s\'.\'%-.192s\' has no definer information (old table format). Current user is used as definer. Please recreate the view!" }, -{ "ER_VIEW_OTHER_USER", 1448, "You need the SUPER privilege for creation view with \'%-.192s\'@\'%-.192s\' definer" }, -{ "ER_NO_SUCH_USER", 1449, "The user specified as a definer (\'%-.64s\'@\'%-.64s\') does not exist" }, -{ "ER_FORBID_SCHEMA_CHANGE", 1450, "Changing schema from \'%-.192s\' to \'%-.192s\' is not allowed." }, -{ "ER_ROW_IS_REFERENCED_2", 1451, "Cannot delete or update a parent row: a foreign key constraint fails (%.192s)" }, -{ "ER_NO_REFERENCED_ROW_2", 1452, "Cannot add or update a child row: a foreign key constraint fails (%.192s)" }, -{ "ER_SP_BAD_VAR_SHADOW", 1453, "Variable \'%-.64s\' must be quoted with `...`, or renamed" }, -{ "ER_TRG_NO_DEFINER", 1454, "No definer attribute for trigger \'%-.192s\'.\'%-.192s\'. The trigger will be activated under the authorization of the invoker, which may have insufficient privileges. Please recreate the trigger." }, -{ "ER_OLD_FILE_FORMAT", 1455, "\'%-.192s\' has an old format, you should re-create the \'%s\' object(s)" }, -{ "ER_SP_RECURSION_LIMIT", 1456, "Recursive limit %d (as set by the max_sp_recursion_depth variable) was exceeded for routine %.192s" }, -{ "ER_SP_PROC_TABLE_CORRUPT", 1457, "Failed to load routine %-.192s. The table mysql.proc is missing, corrupt, or contains bad data (internal code %d)" }, -{ "ER_SP_WRONG_NAME", 1458, "Incorrect routine name \'%-.192s\'" }, -{ "ER_TABLE_NEEDS_UPGRADE", 1459, "Table upgrade required. Please do \"REPAIR TABLE `%-.32s`\" or dump/reload to fix it!" }, -{ "ER_SP_NO_AGGREGATE", 1460, "AGGREGATE is not supported for stored functions" }, -{ "ER_MAX_PREPARED_STMT_COUNT_REACHED", 1461, "Can\'t create more than max_prepared_stmt_count statements (current value: %lu)" }, -{ "ER_VIEW_RECURSIVE", 1462, "`%-.192s`.`%-.192s` contains view recursion" }, -{ "ER_NON_GROUPING_FIELD_USED", 1463, "non-grouping field \'%-.192s\' is used in %-.64s clause" }, -{ "ER_TABLE_CANT_HANDLE_SPKEYS", 1464, "The used table type doesn\'t support SPATIAL indexes" }, -{ "ER_NO_TRIGGERS_ON_SYSTEM_SCHEMA", 1465, "Triggers can not be created on system tables" }, -{ "ER_REMOVED_SPACES", 1466, "Leading spaces are removed from name \'%s\'" }, -{ "ER_AUTOINC_READ_FAILED", 1467, "Failed to read auto-increment value from storage engine" }, -{ "ER_USERNAME", 1468, "user name" }, -{ "ER_HOSTNAME", 1469, "host name" }, -{ "ER_WRONG_STRING_LENGTH", 1470, "String \'%-.70s\' is too long for %s (should be no longer than %d)" }, -{ "ER_NON_INSERTABLE_TABLE", 1471, "The target table %-.100s of the %s is not insertable-into" }, -{ "ER_ADMIN_WRONG_MRG_TABLE", 1472, "Table \'%-.64s\' is differently defined or of non-MyISAM type or doesn\'t exist" }, -{ "ER_TOO_HIGH_LEVEL_OF_NESTING_FOR_SELECT", 1473, "Too high level of nesting for select" }, -{ "ER_NAME_BECOMES_EMPTY", 1474, "Name \'%-.64s\' has become \'\'" }, -{ "ER_AMBIGUOUS_FIELD_TERM", 1475, "First character of the FIELDS TERMINATED string is ambiguous; please use non-optional and non-empty FIELDS ENCLOSED BY" }, -{ "ER_FOREIGN_SERVER_EXISTS", 1476, "The foreign server, %s, you are trying to create already exists." }, -{ "ER_FOREIGN_SERVER_DOESNT_EXIST", 1477, "The foreign server name you are trying to reference does not exist. Data source error: %-.64s" }, -{ "ER_ILLEGAL_HA_CREATE_OPTION", 1478, "Table storage engine \'%-.64s\' does not support the create option \'%.64s\'" }, -{ "ER_PARTITION_REQUIRES_VALUES_ERROR", 1479, "Syntax error: %-.64s PARTITIONING requires definition of VALUES %-.64s for each partition" }, -{ "ER_PARTITION_WRONG_VALUES_ERROR", 1480, "Only %-.64s PARTITIONING can use VALUES %-.64s in partition definition" }, -{ "ER_PARTITION_MAXVALUE_ERROR", 1481, "MAXVALUE can only be used in last partition definition" }, -{ "ER_PARTITION_SUBPARTITION_ERROR", 1482, "Subpartitions can only be hash partitions and by key" }, -{ "ER_PARTITION_SUBPART_MIX_ERROR", 1483, "Must define subpartitions on all partitions if on one partition" }, -{ "ER_PARTITION_WRONG_NO_PART_ERROR", 1484, "Wrong number of partitions defined, mismatch with previous setting" }, -{ "ER_PARTITION_WRONG_NO_SUBPART_ERROR", 1485, "Wrong number of subpartitions defined, mismatch with previous setting" }, -{ "ER_WRONG_EXPR_IN_PARTITION_FUNC_ERROR", 1486, "Constant, random or timezone-dependent expressions in (sub)partitioning function are not allowed" }, -{ "ER_NO_CONST_EXPR_IN_RANGE_OR_LIST_ERROR", 1487, "Expression in RANGE/LIST VALUES must be constant" }, -{ "ER_FIELD_NOT_FOUND_PART_ERROR", 1488, "Field in list of fields for partition function not found in table" }, -{ "ER_LIST_OF_FIELDS_ONLY_IN_HASH_ERROR", 1489, "List of fields is only allowed in KEY partitions" }, -{ "ER_INCONSISTENT_PARTITION_INFO_ERROR", 1490, "The partition info in the frm file is not consistent with what can be written into the frm file" }, -{ "ER_PARTITION_FUNC_NOT_ALLOWED_ERROR", 1491, "The %-.192s function returns the wrong type" }, -{ "ER_PARTITIONS_MUST_BE_DEFINED_ERROR", 1492, "For %-.64s partitions each partition must be defined" }, -{ "ER_RANGE_NOT_INCREASING_ERROR", 1493, "VALUES LESS THAN value must be strictly increasing for each partition" }, -{ "ER_INCONSISTENT_TYPE_OF_FUNCTIONS_ERROR", 1494, "VALUES value must be of same type as partition function" }, -{ "ER_MULTIPLE_DEF_CONST_IN_LIST_PART_ERROR", 1495, "Multiple definition of same constant in list partitioning" }, -{ "ER_PARTITION_ENTRY_ERROR", 1496, "Partitioning can not be used stand-alone in query" }, -{ "ER_MIX_HANDLER_ERROR", 1497, "The mix of handlers in the partitions is not allowed in this version of MySQL" }, -{ "ER_PARTITION_NOT_DEFINED_ERROR", 1498, "For the partitioned engine it is necessary to define all %-.64s" }, -{ "ER_TOO_MANY_PARTITIONS_ERROR", 1499, "Too many partitions (including subpartitions) were defined" }, -{ "ER_SUBPARTITION_ERROR", 1500, "It is only possible to mix RANGE/LIST partitioning with HASH/KEY partitioning for subpartitioning" }, -{ "ER_CANT_CREATE_HANDLER_FILE", 1501, "Failed to create specific handler file" }, -{ "ER_BLOB_FIELD_IN_PART_FUNC_ERROR", 1502, "A BLOB field is not allowed in partition function" }, -{ "ER_UNIQUE_KEY_NEED_ALL_FIELDS_IN_PF", 1503, "A %-.192s must include all columns in the table\'s partitioning function" }, -{ "ER_NO_PARTS_ERROR", 1504, "Number of %-.64s = 0 is not an allowed value" }, -{ "ER_PARTITION_MGMT_ON_NONPARTITIONED", 1505, "Partition management on a not partitioned table is not possible" }, -{ "ER_FOREIGN_KEY_ON_PARTITIONED", 1506, "Foreign key clause is not yet supported in conjunction with partitioning" }, -{ "ER_DROP_PARTITION_NON_EXISTENT", 1507, "Error in list of partitions to %-.64s" }, -{ "ER_DROP_LAST_PARTITION", 1508, "Cannot remove all partitions, use DROP TABLE instead" }, -{ "ER_COALESCE_ONLY_ON_HASH_PARTITION", 1509, "COALESCE PARTITION can only be used on HASH/KEY partitions" }, -{ "ER_REORG_HASH_ONLY_ON_SAME_NO", 1510, "REORGANIZE PARTITION can only be used to reorganize partitions not to change their numbers" }, -{ "ER_REORG_NO_PARAM_ERROR", 1511, "REORGANIZE PARTITION without parameters can only be used on auto-partitioned tables using HASH PARTITIONs" }, -{ "ER_ONLY_ON_RANGE_LIST_PARTITION", 1512, "%-.64s PARTITION can only be used on RANGE/LIST partitions" }, -{ "ER_ADD_PARTITION_SUBPART_ERROR", 1513, "Trying to Add partition(s) with wrong number of subpartitions" }, -{ "ER_ADD_PARTITION_NO_NEW_PARTITION", 1514, "At least one partition must be added" }, -{ "ER_COALESCE_PARTITION_NO_PARTITION", 1515, "At least one partition must be coalesced" }, -{ "ER_REORG_PARTITION_NOT_EXIST", 1516, "More partitions to reorganize than there are partitions" }, -{ "ER_SAME_NAME_PARTITION", 1517, "Duplicate partition name %-.192s" }, -{ "ER_NO_BINLOG_ERROR", 1518, "It is not allowed to shut off binlog on this command" }, -{ "ER_CONSECUTIVE_REORG_PARTITIONS", 1519, "When reorganizing a set of partitions they must be in consecutive order" }, -{ "ER_REORG_OUTSIDE_RANGE", 1520, "Reorganize of range partitions cannot change total ranges except for last partition where it can extend the range" }, -{ "ER_PARTITION_FUNCTION_FAILURE", 1521, "Partition function not supported in this version for this handler" }, -{ "ER_PART_STATE_ERROR", 1522, "Partition state cannot be defined from CREATE/ALTER TABLE" }, -{ "ER_LIMITED_PART_RANGE", 1523, "The %-.64s handler only supports 32 bit integers in VALUES" }, -{ "ER_PLUGIN_IS_NOT_LOADED", 1524, "Plugin \'%-.192s\' is not loaded" }, -{ "ER_WRONG_VALUE", 1525, "Incorrect %-.32s value: \'%-.128s\'" }, -{ "ER_NO_PARTITION_FOR_GIVEN_VALUE", 1526, "Table has no partition for value %-.64s" }, -{ "ER_FILEGROUP_OPTION_ONLY_ONCE", 1527, "It is not allowed to specify %s more than once" }, -{ "ER_CREATE_FILEGROUP_FAILED", 1528, "Failed to create %s" }, -{ "ER_DROP_FILEGROUP_FAILED", 1529, "Failed to drop %s" }, -{ "ER_TABLESPACE_AUTO_EXTEND_ERROR", 1530, "The handler doesn\'t support autoextend of tablespaces" }, -{ "ER_WRONG_SIZE_NUMBER", 1531, "A size parameter was incorrectly specified, either number or on the form 10M" }, -{ "ER_SIZE_OVERFLOW_ERROR", 1532, "The size number was correct but we don\'t allow the digit part to be more than 2 billion" }, -{ "ER_ALTER_FILEGROUP_FAILED", 1533, "Failed to alter: %s" }, -{ "ER_BINLOG_ROW_LOGGING_FAILED", 1534, "Writing one row to the row-based binary log failed" }, -{ "ER_BINLOG_ROW_WRONG_TABLE_DEF", 1535, "Table definition on master and slave does not match: %s" }, -{ "ER_BINLOG_ROW_RBR_TO_SBR", 1536, "Slave running with --log-slave-updates must use row-based binary logging to be able to replicate row-based binary log events" }, -{ "ER_EVENT_ALREADY_EXISTS", 1537, "Event \'%-.192s\' already exists" }, -{ "ER_EVENT_STORE_FAILED", 1538, "Failed to store event %s. Error code %d from storage engine." }, -{ "ER_EVENT_DOES_NOT_EXIST", 1539, "Unknown event \'%-.192s\'" }, -{ "ER_EVENT_CANT_ALTER", 1540, "Failed to alter event \'%-.192s\'" }, -{ "ER_EVENT_DROP_FAILED", 1541, "Failed to drop %s" }, -{ "ER_EVENT_INTERVAL_NOT_POSITIVE_OR_TOO_BIG", 1542, "INTERVAL is either not positive or too big" }, -{ "ER_EVENT_ENDS_BEFORE_STARTS", 1543, "ENDS is either invalid or before STARTS" }, -{ "ER_EVENT_EXEC_TIME_IN_THE_PAST", 1544, "Event execution time is in the past. Event has been disabled" }, -{ "ER_EVENT_OPEN_TABLE_FAILED", 1545, "Failed to open mysql.event" }, -{ "ER_EVENT_NEITHER_M_EXPR_NOR_M_AT", 1546, "No datetime expression provided" }, -{ "ER_COL_COUNT_DOESNT_MATCH_CORRUPTED", 1547, "Column count of mysql.%s is wrong. Expected %d, found %d. The table is probably corrupted" }, -{ "ER_CANNOT_LOAD_FROM_TABLE", 1548, "Cannot load from mysql.%s. The table is probably corrupted" }, -{ "ER_EVENT_CANNOT_DELETE", 1549, "Failed to delete the event from mysql.event" }, -{ "ER_EVENT_COMPILE_ERROR", 1550, "Error during compilation of event\'s body" }, -{ "ER_EVENT_SAME_NAME", 1551, "Same old and new event name" }, -{ "ER_EVENT_DATA_TOO_LONG", 1552, "Data for column \'%s\' too long" }, -{ "ER_DROP_INDEX_FK", 1553, "Cannot drop index \'%-.192s\': needed in a foreign key constraint" }, -{ "ER_WARN_DEPRECATED_SYNTAX_WITH_VER", 1554, "The syntax \'%s\' is deprecated and will be removed in MySQL %s. Please use %s instead" }, -{ "ER_CANT_WRITE_LOCK_LOG_TABLE", 1555, "You can\'t write-lock a log table. Only read access is possible" }, -{ "ER_CANT_LOCK_LOG_TABLE", 1556, "You can\'t use locks with log tables." }, -{ "ER_FOREIGN_DUPLICATE_KEY", 1557, "Upholding foreign key constraints for table \'%.192s\', entry \'%-.192s\', key %d would lead to a duplicate entry" }, -{ "ER_COL_COUNT_DOESNT_MATCH_PLEASE_UPDATE", 1558, "Column count of mysql.%s is wrong. Expected %d, found %d. Created with MySQL %d, now running %d. Please use mysql_upgrade to fix this error." }, -{ "ER_TEMP_TABLE_PREVENTS_SWITCH_OUT_OF_RBR", 1559, "Cannot switch out of the row-based binary log format when the session has open temporary tables" }, -{ "ER_STORED_FUNCTION_PREVENTS_SWITCH_BINLOG_FORMAT", 1560, "Cannot change the binary logging format inside a stored function or trigger" }, -{ "ER_NDB_CANT_SWITCH_BINLOG_FORMAT", 1561, "The NDB cluster engine does not support changing the binlog format on the fly yet" }, -{ "ER_PARTITION_NO_TEMPORARY", 1562, "Cannot create temporary table with partitions" }, -{ "ER_PARTITION_CONST_DOMAIN_ERROR", 1563, "Partition constant is out of partition function domain" }, -{ "ER_PARTITION_FUNCTION_IS_NOT_ALLOWED", 1564, "This partition function is not allowed" }, -{ "ER_DDL_LOG_ERROR", 1565, "Error in DDL log" }, -{ "ER_NULL_IN_VALUES_LESS_THAN", 1566, "Not allowed to use NULL value in VALUES LESS THAN" }, -{ "ER_WRONG_PARTITION_NAME", 1567, "Incorrect partition name" }, -{ "ER_CANT_CHANGE_TX_ISOLATION", 1568, "Transaction isolation level can\'t be changed while a transaction is in progress" }, -{ "ER_DUP_ENTRY_AUTOINCREMENT_CASE", 1569, "ALTER TABLE causes auto_increment resequencing, resulting in duplicate entry \'%-.192s\' for key \'%-.192s\'" }, -{ "ER_EVENT_MODIFY_QUEUE_ERROR", 1570, "Internal scheduler error %d" }, -{ "ER_EVENT_SET_VAR_ERROR", 1571, "Error during starting/stopping of the scheduler. Error code %u" }, -{ "ER_PARTITION_MERGE_ERROR", 1572, "Engine cannot be used in partitioned tables" }, -{ "ER_CANT_ACTIVATE_LOG", 1573, "Cannot activate \'%-.64s\' log" }, -{ "ER_RBR_NOT_AVAILABLE", 1574, "The server was not built with row-based replication" }, -{ "ER_BASE64_DECODE_ERROR", 1575, "Decoding of base64 string failed" }, -{ "ER_EVENT_RECURSION_FORBIDDEN", 1576, "Recursion of EVENT DDL statements is forbidden when body is present" }, -{ "ER_EVENTS_DB_ERROR", 1577, "Cannot proceed because system tables used by Event Scheduler were found damaged at server start" }, -{ "ER_ONLY_INTEGERS_ALLOWED", 1578, "Only integers allowed as number here" }, -{ "ER_UNSUPORTED_LOG_ENGINE", 1579, "This storage engine cannot be used for log tables\"" }, -{ "ER_BAD_LOG_STATEMENT", 1580, "You cannot \'%s\' a log table if logging is enabled" }, -{ "ER_CANT_RENAME_LOG_TABLE", 1581, "Cannot rename \'%s\'. When logging enabled, rename to/from log table must rename two tables: the log table to an archive table and another table back to \'%s\'" }, -{ "ER_WRONG_PARAMCOUNT_TO_NATIVE_FCT", 1582, "Incorrect parameter count in the call to native function \'%-.192s\'" }, -{ "ER_WRONG_PARAMETERS_TO_NATIVE_FCT", 1583, "Incorrect parameters in the call to native function \'%-.192s\'" }, -{ "ER_WRONG_PARAMETERS_TO_STORED_FCT", 1584, "Incorrect parameters in the call to stored function \'%-.192s\'" }, -{ "ER_NATIVE_FCT_NAME_COLLISION", 1585, "This function \'%-.192s\' has the same name as a native function" }, -{ "ER_DUP_ENTRY_WITH_KEY_NAME", 1586, "Duplicate entry \'%-.64s\' for key \'%-.192s\'" }, -{ "ER_BINLOG_PURGE_EMFILE", 1587, "Too many files opened, please execute the command again" }, -{ "ER_EVENT_CANNOT_CREATE_IN_THE_PAST", 1588, "Event execution time is in the past and ON COMPLETION NOT PRESERVE is set. The event was dropped immediately after creation." }, -{ "ER_EVENT_CANNOT_ALTER_IN_THE_PAST", 1589, "Event execution time is in the past and ON COMPLETION NOT PRESERVE is set. The event was dropped immediately after creation." }, -{ "ER_SLAVE_INCIDENT", 1590, "The incident %s occured on the master. Message: %-.64s" }, -{ "ER_NO_PARTITION_FOR_GIVEN_VALUE_SILENT", 1591, "Table has no partition for some existing values" }, -{ "ER_BINLOG_UNSAFE_STATEMENT", 1592, "Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. %s" }, -{ "ER_SLAVE_FATAL_ERROR", 1593, "Fatal error: %s" }, -{ "ER_SLAVE_RELAY_LOG_READ_FAILURE", 1594, "Relay log read failure: %s" }, -{ "ER_SLAVE_RELAY_LOG_WRITE_FAILURE", 1595, "Relay log write failure: %s" }, -{ "ER_SLAVE_CREATE_EVENT_FAILURE", 1596, "Failed to create %s" }, -{ "ER_SLAVE_MASTER_COM_FAILURE", 1597, "Master command %s failed: %s" }, -{ "ER_BINLOG_LOGGING_IMPOSSIBLE", 1598, "Binary logging not possible. Message: %s" }, -{ "ER_VIEW_NO_CREATION_CTX", 1599, "View `%-.64s`.`%-.64s` has no creation context" }, -{ "ER_VIEW_INVALID_CREATION_CTX", 1600, "Creation context of view `%-.64s`.`%-.64s\' is invalid" }, -{ "ER_SR_INVALID_CREATION_CTX", 1601, "Creation context of stored routine `%-.64s`.`%-.64s` is invalid" }, -{ "ER_TRG_CORRUPTED_FILE", 1602, "Corrupted TRG file for table `%-.64s`.`%-.64s`" }, -{ "ER_TRG_NO_CREATION_CTX", 1603, "Triggers for table `%-.64s`.`%-.64s` have no creation context" }, -{ "ER_TRG_INVALID_CREATION_CTX", 1604, "Trigger creation context of table `%-.64s`.`%-.64s` is invalid" }, -{ "ER_EVENT_INVALID_CREATION_CTX", 1605, "Creation context of event `%-.64s`.`%-.64s` is invalid" }, -{ "ER_TRG_CANT_OPEN_TABLE", 1606, "Cannot open table for trigger `%-.64s`.`%-.64s`" }, -{ "ER_CANT_CREATE_SROUTINE", 1607, "Cannot create stored routine `%-.64s`. Check warnings" }, -{ "ER_NEVER_USED", 1608, "Ambiguous slave modes combination. %s" }, -{ "ER_NO_FORMAT_DESCRIPTION_EVENT_BEFORE_BINLOG_STATEMENT", 1609, "The BINLOG statement of type `%s` was not preceded by a format description BINLOG statement." }, -{ "ER_SLAVE_CORRUPT_EVENT", 1610, "Corrupted replication event was detected" }, -{ "ER_LOAD_DATA_INVALID_COLUMN", 1611, "Invalid column reference (%-.64s) in LOAD DATA" }, -{ "ER_LOG_PURGE_NO_FILE", 1612, "Being purged log %s was not found" }, -{ "ER_XA_RBTIMEOUT", 1613, "XA_RBTIMEOUT: Transaction branch was rolled back: took too long" }, -{ "ER_XA_RBDEADLOCK", 1614, "XA_RBDEADLOCK: Transaction branch was rolled back: deadlock was detected" }, -{ "ER_NEED_REPREPARE", 1615, "Prepared statement needs to be re-prepared" }, -{ "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_OPTION_IGNORED", 1618, "<%-.64s> option ignored" }, -{ "WARN_PLUGIN_DELETE_BUILTIN", 1619, "Built-in plugins cannot be deleted" }, -{ "WARN_PLUGIN_BUSY", 1620, "Plugin is busy and will be uninstalled on shutdown" }, -{ "ER_VARIABLE_IS_READONLY", 1621, "%s variable \'%s\' is read-only. Use SET %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 restarted" }, -{ "ER_SLAVE_HEARTBEAT_FAILURE", 1623, "Unexpected master\'s heartbeat data: %s" }, -{ "ER_SLAVE_HEARTBEAT_VALUE_OUT_OF_RANGE", 1624, "The requested value for the heartbeat period is either negative or exceeds the maximum allowed (%s seconds)." }, -{ "ER_NDB_REPLICATION_SCHEMA_ERROR", 1625, "Bad schema for mysql.ndb_replication table. 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. Message: %-.128s\"" }, -{ "ER_TOO_LONG_TABLE_COMMENT", 1628, "Comment for table \'%-.64s\' is too long (max = %lu)" }, -{ "ER_TOO_LONG_FIELD_COMMENT", 1629, "Comment for field \'%-.64s\' is too long (max = %lu)" }, -{ "ER_FUNC_INEXISTENT_NAME_COLLISION", 1630, "FUNCTION %s does not exist. Check the \'Function Name Parsing and Resolution\' section in the Reference Manual" }, -{ "ER_DATABASE_NAME", 1631, "Database" }, -{ "ER_TABLE_NAME", 1632, "Table" }, -{ "ER_PARTITION_NAME", 1633, "Partition" }, -{ "ER_SUBPARTITION_NAME", 1634, "Subpartition" }, -{ "ER_TEMPORARY_NAME", 1635, "Temporary" }, -{ "ER_RENAMED_NAME", 1636, "Renamed" }, -{ "ER_TOO_MANY_CONCURRENT_TRXS", 1637, "Too many active concurrent transactions" }, -{ "WARN_NON_ASCII_SEPARATOR_NOT_IMPLEMENTED", 1638, "Non-ASCII separator arguments are not fully supported" }, -{ "ER_DEBUG_SYNC_TIMEOUT", 1639, "debug sync point wait timed out" }, -{ "ER_DEBUG_SYNC_HIT_LIMIT", 1640, "debug sync point hit limit reached" }, -{ "ER_DUP_SIGNAL_SET", 1641, "Duplicate condition information item \'%s\'" }, -{ "ER_SIGNAL_WARN", 1642, "Unhandled user-defined warning condition" }, -{ "ER_SIGNAL_NOT_FOUND", 1643, "Unhandled user-defined not found condition" }, -{ "ER_SIGNAL_EXCEPTION", 1644, "Unhandled user-defined exception condition" }, -{ "ER_RESIGNAL_WITHOUT_ACTIVE_HANDLER", 1645, "RESIGNAL when handler not active" }, -{ "ER_SIGNAL_BAD_CONDITION_TYPE", 1646, "SIGNAL/RESIGNAL can only use a CONDITION defined with SQLSTATE" }, -{ "WARN_COND_ITEM_TRUNCATED", 1647, "Data truncated for condition item \'%s\'" }, -{ "ER_COND_ITEM_TOO_LONG", 1648, "Data too long for condition item \'%s\'" }, -{ "ER_UNKNOWN_LOCALE", 1649, "Unknown locale: \'%-.64s\'" }, -{ "ER_SLAVE_IGNORE_SERVER_IDS", 1650, "The requested server id %d clashes with the slave startup option --replicate-same-server-id" }, -{ "ER_QUERY_CACHE_DISABLED", 1651, "Query cache is disabled; restart the server with query_cache_type=1 to enable it" }, -{ "ER_SAME_NAME_PARTITION_FIELD", 1652, "Duplicate partition field name \'%-.192s\'" }, -{ "ER_PARTITION_COLUMN_LIST_ERROR", 1653, "Inconsistency in usage of column lists for partitioning" }, -{ "ER_WRONG_TYPE_COLUMN_VALUE_ERROR", 1654, "Partition column values of incorrect type" }, -{ "ER_TOO_MANY_PARTITION_FUNC_FIELDS_ERROR", 1655, "Too many fields in \'%-.192s\'" }, -{ "ER_MAXVALUE_IN_VALUES_IN", 1656, "Cannot use MAXVALUE as value in VALUES IN" }, -{ "ER_TOO_MANY_VALUES_ERROR", 1657, "Cannot have more than one value for this type of %-.64s partitioning" }, -{ "ER_ROW_SINGLE_PARTITION_FIELD_ERROR", 1658, "Row expressions in VALUES IN only allowed for multi-field column partitioning" }, -{ "ER_FIELD_TYPE_NOT_ALLOWED_AS_PARTITION_FIELD", 1659, "Field \'%-.192s\' is of a not allowed type for this type of partitioning" }, -{ "ER_PARTITION_FIELDS_TOO_LONG", 1660, "The total length of the partitioning fields is too large" }, -{ "ER_BINLOG_ROW_ENGINE_AND_STMT_ENGINE", 1661, "Cannot execute statement: impossible to write to binary log since both row-incapable engines and statement-incapable engines are involved." }, -{ "ER_BINLOG_ROW_MODE_AND_STMT_ENGINE", 1662, "Cannot execute statement: impossible to write to binary log since BINLOG_FORMAT = ROW and at least one table uses a storage engine limited to statement-based logging." }, -{ "ER_BINLOG_UNSAFE_AND_STMT_ENGINE", 1663, "Cannot execute statement: impossible to write to binary log since statement is unsafe, storage engine is limited to statement-based logging, and BINLOG_FORMAT = MIXED. %s" }, -{ "ER_BINLOG_ROW_INJECTION_AND_STMT_ENGINE", 1664, "Cannot execute statement: impossible to write to binary log since statement is in row format and at least one table uses a storage engine limited to statement-based logging." }, -{ "ER_BINLOG_STMT_MODE_AND_ROW_ENGINE", 1665, "Cannot execute statement: impossible to write to binary log since BINLOG_FORMAT = STATEMENT and at least one table uses a storage engine limited to row-based logging.%s" }, -{ "ER_BINLOG_ROW_INJECTION_AND_STMT_MODE", 1666, "Cannot execute statement: impossible to write to binary log since statement is in row format and BINLOG_FORMAT = STATEMENT." }, -{ "ER_BINLOG_MULTIPLE_ENGINES_AND_SELF_LOGGING_ENGINE", 1667, "Cannot execute statement: impossible to write to binary log since more than one engine is involved and at least one engine is self-logging." }, -{ "ER_BINLOG_UNSAFE_LIMIT", 1668, "The statement is unsafe because it uses a LIMIT clause. This is unsafe because the set of rows included cannot be predicted." }, -{ "ER_BINLOG_UNSAFE_INSERT_DELAYED", 1669, "The statement is unsafe because it uses INSERT DELAYED. This is unsafe because the times when rows are inserted cannot be predicted." }, -{ "ER_BINLOG_UNSAFE_SYSTEM_TABLE", 1670, "The statement is unsafe because it uses the general log, slow query log, or performance_schema table(s). This is unsafe because system tables may differ on slaves." }, -{ "ER_BINLOG_UNSAFE_AUTOINC_COLUMNS", 1671, "Statement is unsafe because it invokes a trigger or a stored function that inserts into an AUTO_INCREMENT column. Inserted values cannot be logged correctly." }, -{ "ER_BINLOG_UNSAFE_UDF", 1672, "Statement is unsafe because it uses a UDF which may not return the same value on the slave." }, -{ "ER_BINLOG_UNSAFE_SYSTEM_VARIABLE", 1673, "Statement is unsafe because it uses a system variable that may have a different value on the slave." }, -{ "ER_BINLOG_UNSAFE_SYSTEM_FUNCTION", 1674, "Statement is unsafe because it uses a system function that may return a different value on the slave." }, -{ "ER_BINLOG_UNSAFE_NONTRANS_AFTER_TRANS", 1675, "Statement is unsafe because it accesses a non-transactional table after accessing a transactional table within the same transaction." }, -{ "ER_MESSAGE_AND_STATEMENT", 1676, "%s Statement: %s" }, -{ "ER_SLAVE_CONVERSION_FAILED", 1677, "Column %d of table \'%-.192s.%-.192s\' cannot be converted from type \'%-.32s\' to type \'%-.32s\'" }, -{ "ER_SLAVE_CANT_CREATE_CONVERSION", 1678, "Can\'t create conversion table for table \'%-.192s.%-.192s\'" }, -{ "ER_INSIDE_TRANSACTION_PREVENTS_SWITCH_BINLOG_FORMAT", 1679, "Cannot modify @@session.binlog_format inside a transaction" }, -{ "ER_PATH_LENGTH", 1680, "The path specified for %.64s is too long." }, -{ "ER_WARN_DEPRECATED_SYNTAX_NO_REPLACEMENT", 1681, "The syntax \'%s\' is deprecated and will be removed in MySQL %s." }, -{ "ER_WRONG_NATIVE_TABLE_STRUCTURE", 1682, "Native table \'%-.64s\'.\'%-.64s\' has the wrong structure" }, -{ "ER_WRONG_PERFSCHEMA_USAGE", 1683, "Invalid performance_schema usage." }, -{ "ER_WARN_I_S_SKIPPED_TABLE", 1684, "Table \'%s\'.\'%s\' was skipped since its definition is being modified by concurrent DDL statement" }, -{ "ER_INSIDE_TRANSACTION_PREVENTS_SWITCH_BINLOG_DIRECT", 1685, "Cannot modify @@session.binlog_direct_non_transactional_updates inside a transaction" }, -{ "ER_STORED_FUNCTION_PREVENTS_SWITCH_BINLOG_DIRECT", 1686, "Cannot change the binlog direct flag inside a stored function or trigger" }, -{ "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 long (max = %lu)" }, -{ "ER_LOCK_ABORTED", 1689, "Wait on a lock was aborted due to a pending exclusive lock" }, -{ "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 in LIMIT clause" }, -{ "ER_BINLOG_UNSAFE_MULTIPLE_ENGINES_AND_SELF_LOGGING_ENGINE", 1692, "Mixing self-logging and non-self-logging engines in a statement is unsafe." }, -{ "ER_BINLOG_UNSAFE_MIXED_STATEMENT", 1693, "Statement accesses nontransactional 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_STORED_FUNCTION_PREVENTS_SWITCH_SQL_LOG_BIN", 1695, "Cannot change the sql_log_bin inside a stored function or trigger" }, -{ "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 for users authenticating via plugins" }, -{ "ER_GRANT_PLUGIN_USER_EXISTS", 1700, "GRANT with IDENTIFIED WITH is illegal 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 and can not be unloaded" }, -{ "ER_SLAVE_HEARTBEAT_VALUE_OUT_OF_RANGE_MIN", 1703, "The requested value for 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 for the heartbeat period exceeds the value of `slave_net_timeout\' seconds. A sensible value for the period should be less than the timeout." }, -{ "ER_STMT_CACHE_FULL", 1705, "Multi-row statements required more than \'max_binlog_stmt_cache_size\' bytes of storage; increase this mysqld variable and try again" }, diff --git a/dep/mysqllite/include/mysqld_error.h b/dep/mysqllite/include/mysqld_error.h deleted file mode 100644 index b886241cfb4..00000000000 --- a/dep/mysqllite/include/mysqld_error.h +++ /dev/null @@ -1,710 +0,0 @@ -/* Autogenerated file, please don't edit */ - -#define ER_ERROR_FIRST 1000 -#define ER_HASHCHK 1000 -#define ER_NISAMCHK 1001 -#define ER_NO 1002 -#define ER_YES 1003 -#define ER_CANT_CREATE_FILE 1004 -#define ER_CANT_CREATE_TABLE 1005 -#define ER_CANT_CREATE_DB 1006 -#define ER_DB_CREATE_EXISTS 1007 -#define ER_DB_DROP_EXISTS 1008 -#define ER_DB_DROP_DELETE 1009 -#define ER_DB_DROP_RMDIR 1010 -#define ER_CANT_DELETE_FILE 1011 -#define ER_CANT_FIND_SYSTEM_REC 1012 -#define ER_CANT_GET_STAT 1013 -#define ER_CANT_GET_WD 1014 -#define ER_CANT_LOCK 1015 -#define ER_CANT_OPEN_FILE 1016 -#define ER_FILE_NOT_FOUND 1017 -#define ER_CANT_READ_DIR 1018 -#define ER_CANT_SET_WD 1019 -#define ER_CHECKREAD 1020 -#define ER_DISK_FULL 1021 -#define ER_DUP_KEY 1022 -#define ER_ERROR_ON_CLOSE 1023 -#define ER_ERROR_ON_READ 1024 -#define ER_ERROR_ON_RENAME 1025 -#define ER_ERROR_ON_WRITE 1026 -#define ER_FILE_USED 1027 -#define ER_FILSORT_ABORT 1028 -#define ER_FORM_NOT_FOUND 1029 -#define ER_GET_ERRNO 1030 -#define ER_ILLEGAL_HA 1031 -#define ER_KEY_NOT_FOUND 1032 -#define ER_NOT_FORM_FILE 1033 -#define ER_NOT_KEYFILE 1034 -#define ER_OLD_KEYFILE 1035 -#define ER_OPEN_AS_READONLY 1036 -#define ER_OUTOFMEMORY 1037 -#define ER_OUT_OF_SORTMEMORY 1038 -#define ER_UNEXPECTED_EOF 1039 -#define ER_CON_COUNT_ERROR 1040 -#define ER_OUT_OF_RESOURCES 1041 -#define ER_BAD_HOST_ERROR 1042 -#define ER_HANDSHAKE_ERROR 1043 -#define ER_DBACCESS_DENIED_ERROR 1044 -#define ER_ACCESS_DENIED_ERROR 1045 -#define ER_NO_DB_ERROR 1046 -#define ER_UNKNOWN_COM_ERROR 1047 -#define ER_BAD_NULL_ERROR 1048 -#define ER_BAD_DB_ERROR 1049 -#define ER_TABLE_EXISTS_ERROR 1050 -#define ER_BAD_TABLE_ERROR 1051 -#define ER_NON_UNIQ_ERROR 1052 -#define ER_SERVER_SHUTDOWN 1053 -#define ER_BAD_FIELD_ERROR 1054 -#define ER_WRONG_FIELD_WITH_GROUP 1055 -#define ER_WRONG_GROUP_FIELD 1056 -#define ER_WRONG_SUM_SELECT 1057 -#define ER_WRONG_VALUE_COUNT 1058 -#define ER_TOO_LONG_IDENT 1059 -#define ER_DUP_FIELDNAME 1060 -#define ER_DUP_KEYNAME 1061 -#define ER_DUP_ENTRY 1062 -#define ER_WRONG_FIELD_SPEC 1063 -#define ER_PARSE_ERROR 1064 -#define ER_EMPTY_QUERY 1065 -#define ER_NONUNIQ_TABLE 1066 -#define ER_INVALID_DEFAULT 1067 -#define ER_MULTIPLE_PRI_KEY 1068 -#define ER_TOO_MANY_KEYS 1069 -#define ER_TOO_MANY_KEY_PARTS 1070 -#define ER_TOO_LONG_KEY 1071 -#define ER_KEY_COLUMN_DOES_NOT_EXITS 1072 -#define ER_BLOB_USED_AS_KEY 1073 -#define ER_TOO_BIG_FIELDLENGTH 1074 -#define ER_WRONG_AUTO_KEY 1075 -#define ER_READY 1076 -#define ER_NORMAL_SHUTDOWN 1077 -#define ER_GOT_SIGNAL 1078 -#define ER_SHUTDOWN_COMPLETE 1079 -#define ER_FORCING_CLOSE 1080 -#define ER_IPSOCK_ERROR 1081 -#define ER_NO_SUCH_INDEX 1082 -#define ER_WRONG_FIELD_TERMINATORS 1083 -#define ER_BLOBS_AND_NO_TERMINATED 1084 -#define ER_TEXTFILE_NOT_READABLE 1085 -#define ER_FILE_EXISTS_ERROR 1086 -#define ER_LOAD_INFO 1087 -#define ER_ALTER_INFO 1088 -#define ER_WRONG_SUB_KEY 1089 -#define ER_CANT_REMOVE_ALL_FIELDS 1090 -#define ER_CANT_DROP_FIELD_OR_KEY 1091 -#define ER_INSERT_INFO 1092 -#define ER_UPDATE_TABLE_USED 1093 -#define ER_NO_SUCH_THREAD 1094 -#define ER_KILL_DENIED_ERROR 1095 -#define ER_NO_TABLES_USED 1096 -#define ER_TOO_BIG_SET 1097 -#define ER_NO_UNIQUE_LOGFILE 1098 -#define ER_TABLE_NOT_LOCKED_FOR_WRITE 1099 -#define ER_TABLE_NOT_LOCKED 1100 -#define ER_BLOB_CANT_HAVE_DEFAULT 1101 -#define ER_WRONG_DB_NAME 1102 -#define ER_WRONG_TABLE_NAME 1103 -#define ER_TOO_BIG_SELECT 1104 -#define ER_UNKNOWN_ERROR 1105 -#define ER_UNKNOWN_PROCEDURE 1106 -#define ER_WRONG_PARAMCOUNT_TO_PROCEDURE 1107 -#define ER_WRONG_PARAMETERS_TO_PROCEDURE 1108 -#define ER_UNKNOWN_TABLE 1109 -#define ER_FIELD_SPECIFIED_TWICE 1110 -#define ER_INVALID_GROUP_FUNC_USE 1111 -#define ER_UNSUPPORTED_EXTENSION 1112 -#define ER_TABLE_MUST_HAVE_COLUMNS 1113 -#define ER_RECORD_FILE_FULL 1114 -#define ER_UNKNOWN_CHARACTER_SET 1115 -#define ER_TOO_MANY_TABLES 1116 -#define ER_TOO_MANY_FIELDS 1117 -#define ER_TOO_BIG_ROWSIZE 1118 -#define ER_STACK_OVERRUN 1119 -#define ER_WRONG_OUTER_JOIN 1120 -#define ER_NULL_COLUMN_IN_INDEX 1121 -#define ER_CANT_FIND_UDF 1122 -#define ER_CANT_INITIALIZE_UDF 1123 -#define ER_UDF_NO_PATHS 1124 -#define ER_UDF_EXISTS 1125 -#define ER_CANT_OPEN_LIBRARY 1126 -#define ER_CANT_FIND_DL_ENTRY 1127 -#define ER_FUNCTION_NOT_DEFINED 1128 -#define ER_HOST_IS_BLOCKED 1129 -#define ER_HOST_NOT_PRIVILEGED 1130 -#define ER_PASSWORD_ANONYMOUS_USER 1131 -#define ER_PASSWORD_NOT_ALLOWED 1132 -#define ER_PASSWORD_NO_MATCH 1133 -#define ER_UPDATE_INFO 1134 -#define ER_CANT_CREATE_THREAD 1135 -#define ER_WRONG_VALUE_COUNT_ON_ROW 1136 -#define ER_CANT_REOPEN_TABLE 1137 -#define ER_INVALID_USE_OF_NULL 1138 -#define ER_REGEXP_ERROR 1139 -#define ER_MIX_OF_GROUP_FUNC_AND_FIELDS 1140 -#define ER_NONEXISTING_GRANT 1141 -#define ER_TABLEACCESS_DENIED_ERROR 1142 -#define ER_COLUMNACCESS_DENIED_ERROR 1143 -#define ER_ILLEGAL_GRANT_FOR_TABLE 1144 -#define ER_GRANT_WRONG_HOST_OR_USER 1145 -#define ER_NO_SUCH_TABLE 1146 -#define ER_NONEXISTING_TABLE_GRANT 1147 -#define ER_NOT_ALLOWED_COMMAND 1148 -#define ER_SYNTAX_ERROR 1149 -#define ER_DELAYED_CANT_CHANGE_LOCK 1150 -#define ER_TOO_MANY_DELAYED_THREADS 1151 -#define ER_ABORTING_CONNECTION 1152 -#define ER_NET_PACKET_TOO_LARGE 1153 -#define ER_NET_READ_ERROR_FROM_PIPE 1154 -#define ER_NET_FCNTL_ERROR 1155 -#define ER_NET_PACKETS_OUT_OF_ORDER 1156 -#define ER_NET_UNCOMPRESS_ERROR 1157 -#define ER_NET_READ_ERROR 1158 -#define ER_NET_READ_INTERRUPTED 1159 -#define ER_NET_ERROR_ON_WRITE 1160 -#define ER_NET_WRITE_INTERRUPTED 1161 -#define ER_TOO_LONG_STRING 1162 -#define ER_TABLE_CANT_HANDLE_BLOB 1163 -#define ER_TABLE_CANT_HANDLE_AUTO_INCREMENT 1164 -#define ER_DELAYED_INSERT_TABLE_LOCKED 1165 -#define ER_WRONG_COLUMN_NAME 1166 -#define ER_WRONG_KEY_COLUMN 1167 -#define ER_WRONG_MRG_TABLE 1168 -#define ER_DUP_UNIQUE 1169 -#define ER_BLOB_KEY_WITHOUT_LENGTH 1170 -#define ER_PRIMARY_CANT_HAVE_NULL 1171 -#define ER_TOO_MANY_ROWS 1172 -#define ER_REQUIRES_PRIMARY_KEY 1173 -#define ER_NO_RAID_COMPILED 1174 -#define ER_UPDATE_WITHOUT_KEY_IN_SAFE_MODE 1175 -#define ER_KEY_DOES_NOT_EXITS 1176 -#define ER_CHECK_NO_SUCH_TABLE 1177 -#define ER_CHECK_NOT_IMPLEMENTED 1178 -#define ER_CANT_DO_THIS_DURING_AN_TRANSACTION 1179 -#define ER_ERROR_DURING_COMMIT 1180 -#define ER_ERROR_DURING_ROLLBACK 1181 -#define ER_ERROR_DURING_FLUSH_LOGS 1182 -#define ER_ERROR_DURING_CHECKPOINT 1183 -#define ER_NEW_ABORTING_CONNECTION 1184 -#define ER_DUMP_NOT_IMPLEMENTED 1185 -#define ER_FLUSH_MASTER_BINLOG_CLOSED 1186 -#define ER_INDEX_REBUILD 1187 -#define ER_MASTER 1188 -#define ER_MASTER_NET_READ 1189 -#define ER_MASTER_NET_WRITE 1190 -#define ER_FT_MATCHING_KEY_NOT_FOUND 1191 -#define ER_LOCK_OR_ACTIVE_TRANSACTION 1192 -#define ER_UNKNOWN_SYSTEM_VARIABLE 1193 -#define ER_CRASHED_ON_USAGE 1194 -#define ER_CRASHED_ON_REPAIR 1195 -#define ER_WARNING_NOT_COMPLETE_ROLLBACK 1196 -#define ER_TRANS_CACHE_FULL 1197 -#define ER_SLAVE_MUST_STOP 1198 -#define ER_SLAVE_NOT_RUNNING 1199 -#define ER_BAD_SLAVE 1200 -#define ER_MASTER_INFO 1201 -#define ER_SLAVE_THREAD 1202 -#define ER_TOO_MANY_USER_CONNECTIONS 1203 -#define ER_SET_CONSTANTS_ONLY 1204 -#define ER_LOCK_WAIT_TIMEOUT 1205 -#define ER_LOCK_TABLE_FULL 1206 -#define ER_READ_ONLY_TRANSACTION 1207 -#define ER_DROP_DB_WITH_READ_LOCK 1208 -#define ER_CREATE_DB_WITH_READ_LOCK 1209 -#define ER_WRONG_ARGUMENTS 1210 -#define ER_NO_PERMISSION_TO_CREATE_USER 1211 -#define ER_UNION_TABLES_IN_DIFFERENT_DIR 1212 -#define ER_LOCK_DEADLOCK 1213 -#define ER_TABLE_CANT_HANDLE_FT 1214 -#define ER_CANNOT_ADD_FOREIGN 1215 -#define ER_NO_REFERENCED_ROW 1216 -#define ER_ROW_IS_REFERENCED 1217 -#define ER_CONNECT_TO_MASTER 1218 -#define ER_QUERY_ON_MASTER 1219 -#define ER_ERROR_WHEN_EXECUTING_COMMAND 1220 -#define ER_WRONG_USAGE 1221 -#define ER_WRONG_NUMBER_OF_COLUMNS_IN_SELECT 1222 -#define ER_CANT_UPDATE_WITH_READLOCK 1223 -#define ER_MIXING_NOT_ALLOWED 1224 -#define ER_DUP_ARGUMENT 1225 -#define ER_USER_LIMIT_REACHED 1226 -#define ER_SPECIFIC_ACCESS_DENIED_ERROR 1227 -#define ER_LOCAL_VARIABLE 1228 -#define ER_GLOBAL_VARIABLE 1229 -#define ER_NO_DEFAULT 1230 -#define ER_WRONG_VALUE_FOR_VAR 1231 -#define ER_WRONG_TYPE_FOR_VAR 1232 -#define ER_VAR_CANT_BE_READ 1233 -#define ER_CANT_USE_OPTION_HERE 1234 -#define ER_NOT_SUPPORTED_YET 1235 -#define ER_MASTER_FATAL_ERROR_READING_BINLOG 1236 -#define ER_SLAVE_IGNORED_TABLE 1237 -#define ER_INCORRECT_GLOBAL_LOCAL_VAR 1238 -#define ER_WRONG_FK_DEF 1239 -#define ER_KEY_REF_DO_NOT_MATCH_TABLE_REF 1240 -#define ER_OPERAND_COLUMNS 1241 -#define ER_SUBQUERY_NO_1_ROW 1242 -#define ER_UNKNOWN_STMT_HANDLER 1243 -#define ER_CORRUPT_HELP_DB 1244 -#define ER_CYCLIC_REFERENCE 1245 -#define ER_AUTO_CONVERT 1246 -#define ER_ILLEGAL_REFERENCE 1247 -#define ER_DERIVED_MUST_HAVE_ALIAS 1248 -#define ER_SELECT_REDUCED 1249 -#define ER_TABLENAME_NOT_ALLOWED_HERE 1250 -#define ER_NOT_SUPPORTED_AUTH_MODE 1251 -#define ER_SPATIAL_CANT_HAVE_NULL 1252 -#define ER_COLLATION_CHARSET_MISMATCH 1253 -#define ER_SLAVE_WAS_RUNNING 1254 -#define ER_SLAVE_WAS_NOT_RUNNING 1255 -#define ER_TOO_BIG_FOR_UNCOMPRESS 1256 -#define ER_ZLIB_Z_MEM_ERROR 1257 -#define ER_ZLIB_Z_BUF_ERROR 1258 -#define ER_ZLIB_Z_DATA_ERROR 1259 -#define ER_CUT_VALUE_GROUP_CONCAT 1260 -#define ER_WARN_TOO_FEW_RECORDS 1261 -#define ER_WARN_TOO_MANY_RECORDS 1262 -#define ER_WARN_NULL_TO_NOTNULL 1263 -#define ER_WARN_DATA_OUT_OF_RANGE 1264 -#define WARN_DATA_TRUNCATED 1265 -#define ER_WARN_USING_OTHER_HANDLER 1266 -#define ER_CANT_AGGREGATE_2COLLATIONS 1267 -#define ER_DROP_USER 1268 -#define ER_REVOKE_GRANTS 1269 -#define ER_CANT_AGGREGATE_3COLLATIONS 1270 -#define ER_CANT_AGGREGATE_NCOLLATIONS 1271 -#define ER_VARIABLE_IS_NOT_STRUCT 1272 -#define ER_UNKNOWN_COLLATION 1273 -#define ER_SLAVE_IGNORED_SSL_PARAMS 1274 -#define ER_SERVER_IS_IN_SECURE_AUTH_MODE 1275 -#define ER_WARN_FIELD_RESOLVED 1276 -#define ER_BAD_SLAVE_UNTIL_COND 1277 -#define ER_MISSING_SKIP_SLAVE 1278 -#define ER_UNTIL_COND_IGNORED 1279 -#define ER_WRONG_NAME_FOR_INDEX 1280 -#define ER_WRONG_NAME_FOR_CATALOG 1281 -#define ER_WARN_QC_RESIZE 1282 -#define ER_BAD_FT_COLUMN 1283 -#define ER_UNKNOWN_KEY_CACHE 1284 -#define ER_WARN_HOSTNAME_WONT_WORK 1285 -#define ER_UNKNOWN_STORAGE_ENGINE 1286 -#define ER_WARN_DEPRECATED_SYNTAX 1287 -#define ER_NON_UPDATABLE_TABLE 1288 -#define ER_FEATURE_DISABLED 1289 -#define ER_OPTION_PREVENTS_STATEMENT 1290 -#define ER_DUPLICATED_VALUE_IN_TYPE 1291 -#define ER_TRUNCATED_WRONG_VALUE 1292 -#define ER_TOO_MUCH_AUTO_TIMESTAMP_COLS 1293 -#define ER_INVALID_ON_UPDATE 1294 -#define ER_UNSUPPORTED_PS 1295 -#define ER_GET_ERRMSG 1296 -#define ER_GET_TEMPORARY_ERRMSG 1297 -#define ER_UNKNOWN_TIME_ZONE 1298 -#define ER_WARN_INVALID_TIMESTAMP 1299 -#define ER_INVALID_CHARACTER_STRING 1300 -#define ER_WARN_ALLOWED_PACKET_OVERFLOWED 1301 -#define ER_CONFLICTING_DECLARATIONS 1302 -#define ER_SP_NO_RECURSIVE_CREATE 1303 -#define ER_SP_ALREADY_EXISTS 1304 -#define ER_SP_DOES_NOT_EXIST 1305 -#define ER_SP_DROP_FAILED 1306 -#define ER_SP_STORE_FAILED 1307 -#define ER_SP_LILABEL_MISMATCH 1308 -#define ER_SP_LABEL_REDEFINE 1309 -#define ER_SP_LABEL_MISMATCH 1310 -#define ER_SP_UNINIT_VAR 1311 -#define ER_SP_BADSELECT 1312 -#define ER_SP_BADRETURN 1313 -#define ER_SP_BADSTATEMENT 1314 -#define ER_UPDATE_LOG_DEPRECATED_IGNORED 1315 -#define ER_UPDATE_LOG_DEPRECATED_TRANSLATED 1316 -#define ER_QUERY_INTERRUPTED 1317 -#define ER_SP_WRONG_NO_OF_ARGS 1318 -#define ER_SP_COND_MISMATCH 1319 -#define ER_SP_NORETURN 1320 -#define ER_SP_NORETURNEND 1321 -#define ER_SP_BAD_CURSOR_QUERY 1322 -#define ER_SP_BAD_CURSOR_SELECT 1323 -#define ER_SP_CURSOR_MISMATCH 1324 -#define ER_SP_CURSOR_ALREADY_OPEN 1325 -#define ER_SP_CURSOR_NOT_OPEN 1326 -#define ER_SP_UNDECLARED_VAR 1327 -#define ER_SP_WRONG_NO_OF_FETCH_ARGS 1328 -#define ER_SP_FETCH_NO_DATA 1329 -#define ER_SP_DUP_PARAM 1330 -#define ER_SP_DUP_VAR 1331 -#define ER_SP_DUP_COND 1332 -#define ER_SP_DUP_CURS 1333 -#define ER_SP_CANT_ALTER 1334 -#define ER_SP_SUBSELECT_NYI 1335 -#define ER_STMT_NOT_ALLOWED_IN_SF_OR_TRG 1336 -#define ER_SP_VARCOND_AFTER_CURSHNDLR 1337 -#define ER_SP_CURSOR_AFTER_HANDLER 1338 -#define ER_SP_CASE_NOT_FOUND 1339 -#define ER_FPARSER_TOO_BIG_FILE 1340 -#define ER_FPARSER_BAD_HEADER 1341 -#define ER_FPARSER_EOF_IN_COMMENT 1342 -#define ER_FPARSER_ERROR_IN_PARAMETER 1343 -#define ER_FPARSER_EOF_IN_UNKNOWN_PARAMETER 1344 -#define ER_VIEW_NO_EXPLAIN 1345 -#define ER_FRM_UNKNOWN_TYPE 1346 -#define ER_WRONG_OBJECT 1347 -#define ER_NONUPDATEABLE_COLUMN 1348 -#define ER_VIEW_SELECT_DERIVED 1349 -#define ER_VIEW_SELECT_CLAUSE 1350 -#define ER_VIEW_SELECT_VARIABLE 1351 -#define ER_VIEW_SELECT_TMPTABLE 1352 -#define ER_VIEW_WRONG_LIST 1353 -#define ER_WARN_VIEW_MERGE 1354 -#define ER_WARN_VIEW_WITHOUT_KEY 1355 -#define ER_VIEW_INVALID 1356 -#define ER_SP_NO_DROP_SP 1357 -#define ER_SP_GOTO_IN_HNDLR 1358 -#define ER_TRG_ALREADY_EXISTS 1359 -#define ER_TRG_DOES_NOT_EXIST 1360 -#define ER_TRG_ON_VIEW_OR_TEMP_TABLE 1361 -#define ER_TRG_CANT_CHANGE_ROW 1362 -#define ER_TRG_NO_SUCH_ROW_IN_TRG 1363 -#define ER_NO_DEFAULT_FOR_FIELD 1364 -#define ER_DIVISION_BY_ZERO 1365 -#define ER_TRUNCATED_WRONG_VALUE_FOR_FIELD 1366 -#define ER_ILLEGAL_VALUE_FOR_TYPE 1367 -#define ER_VIEW_NONUPD_CHECK 1368 -#define ER_VIEW_CHECK_FAILED 1369 -#define ER_PROCACCESS_DENIED_ERROR 1370 -#define ER_RELAY_LOG_FAIL 1371 -#define ER_PASSWD_LENGTH 1372 -#define ER_UNKNOWN_TARGET_BINLOG 1373 -#define ER_IO_ERR_LOG_INDEX_READ 1374 -#define ER_BINLOG_PURGE_PROHIBITED 1375 -#define ER_FSEEK_FAIL 1376 -#define ER_BINLOG_PURGE_FATAL_ERR 1377 -#define ER_LOG_IN_USE 1378 -#define ER_LOG_PURGE_UNKNOWN_ERR 1379 -#define ER_RELAY_LOG_INIT 1380 -#define ER_NO_BINARY_LOGGING 1381 -#define ER_RESERVED_SYNTAX 1382 -#define ER_WSAS_FAILED 1383 -#define ER_DIFF_GROUPS_PROC 1384 -#define ER_NO_GROUP_FOR_PROC 1385 -#define ER_ORDER_WITH_PROC 1386 -#define ER_LOGGING_PROHIBIT_CHANGING_OF 1387 -#define ER_NO_FILE_MAPPING 1388 -#define ER_WRONG_MAGIC 1389 -#define ER_PS_MANY_PARAM 1390 -#define ER_KEY_PART_0 1391 -#define ER_VIEW_CHECKSUM 1392 -#define ER_VIEW_MULTIUPDATE 1393 -#define ER_VIEW_NO_INSERT_FIELD_LIST 1394 -#define ER_VIEW_DELETE_MERGE_VIEW 1395 -#define ER_CANNOT_USER 1396 -#define ER_XAER_NOTA 1397 -#define ER_XAER_INVAL 1398 -#define ER_XAER_RMFAIL 1399 -#define ER_XAER_OUTSIDE 1400 -#define ER_XAER_RMERR 1401 -#define ER_XA_RBROLLBACK 1402 -#define ER_NONEXISTING_PROC_GRANT 1403 -#define ER_PROC_AUTO_GRANT_FAIL 1404 -#define ER_PROC_AUTO_REVOKE_FAIL 1405 -#define ER_DATA_TOO_LONG 1406 -#define ER_SP_BAD_SQLSTATE 1407 -#define ER_STARTUP 1408 -#define ER_LOAD_FROM_FIXED_SIZE_ROWS_TO_VAR 1409 -#define ER_CANT_CREATE_USER_WITH_GRANT 1410 -#define ER_WRONG_VALUE_FOR_TYPE 1411 -#define ER_TABLE_DEF_CHANGED 1412 -#define ER_SP_DUP_HANDLER 1413 -#define ER_SP_NOT_VAR_ARG 1414 -#define ER_SP_NO_RETSET 1415 -#define ER_CANT_CREATE_GEOMETRY_OBJECT 1416 -#define ER_FAILED_ROUTINE_BREAK_BINLOG 1417 -#define ER_BINLOG_UNSAFE_ROUTINE 1418 -#define ER_BINLOG_CREATE_ROUTINE_NEED_SUPER 1419 -#define ER_EXEC_STMT_WITH_OPEN_CURSOR 1420 -#define ER_STMT_HAS_NO_OPEN_CURSOR 1421 -#define ER_COMMIT_NOT_ALLOWED_IN_SF_OR_TRG 1422 -#define ER_NO_DEFAULT_FOR_VIEW_FIELD 1423 -#define ER_SP_NO_RECURSION 1424 -#define ER_TOO_BIG_SCALE 1425 -#define ER_TOO_BIG_PRECISION 1426 -#define ER_M_BIGGER_THAN_D 1427 -#define ER_WRONG_LOCK_OF_SYSTEM_TABLE 1428 -#define ER_CONNECT_TO_FOREIGN_DATA_SOURCE 1429 -#define ER_QUERY_ON_FOREIGN_DATA_SOURCE 1430 -#define ER_FOREIGN_DATA_SOURCE_DOESNT_EXIST 1431 -#define ER_FOREIGN_DATA_STRING_INVALID_CANT_CREATE 1432 -#define ER_FOREIGN_DATA_STRING_INVALID 1433 -#define ER_CANT_CREATE_FEDERATED_TABLE 1434 -#define ER_TRG_IN_WRONG_SCHEMA 1435 -#define ER_STACK_OVERRUN_NEED_MORE 1436 -#define ER_TOO_LONG_BODY 1437 -#define ER_WARN_CANT_DROP_DEFAULT_KEYCACHE 1438 -#define ER_TOO_BIG_DISPLAYWIDTH 1439 -#define ER_XAER_DUPID 1440 -#define ER_DATETIME_FUNCTION_OVERFLOW 1441 -#define ER_CANT_UPDATE_USED_TABLE_IN_SF_OR_TRG 1442 -#define ER_VIEW_PREVENT_UPDATE 1443 -#define ER_PS_NO_RECURSION 1444 -#define ER_SP_CANT_SET_AUTOCOMMIT 1445 -#define ER_MALFORMED_DEFINER 1446 -#define ER_VIEW_FRM_NO_USER 1447 -#define ER_VIEW_OTHER_USER 1448 -#define ER_NO_SUCH_USER 1449 -#define ER_FORBID_SCHEMA_CHANGE 1450 -#define ER_ROW_IS_REFERENCED_2 1451 -#define ER_NO_REFERENCED_ROW_2 1452 -#define ER_SP_BAD_VAR_SHADOW 1453 -#define ER_TRG_NO_DEFINER 1454 -#define ER_OLD_FILE_FORMAT 1455 -#define ER_SP_RECURSION_LIMIT 1456 -#define ER_SP_PROC_TABLE_CORRUPT 1457 -#define ER_SP_WRONG_NAME 1458 -#define ER_TABLE_NEEDS_UPGRADE 1459 -#define ER_SP_NO_AGGREGATE 1460 -#define ER_MAX_PREPARED_STMT_COUNT_REACHED 1461 -#define ER_VIEW_RECURSIVE 1462 -#define ER_NON_GROUPING_FIELD_USED 1463 -#define ER_TABLE_CANT_HANDLE_SPKEYS 1464 -#define ER_NO_TRIGGERS_ON_SYSTEM_SCHEMA 1465 -#define ER_REMOVED_SPACES 1466 -#define ER_AUTOINC_READ_FAILED 1467 -#define ER_USERNAME 1468 -#define ER_HOSTNAME 1469 -#define ER_WRONG_STRING_LENGTH 1470 -#define ER_NON_INSERTABLE_TABLE 1471 -#define ER_ADMIN_WRONG_MRG_TABLE 1472 -#define ER_TOO_HIGH_LEVEL_OF_NESTING_FOR_SELECT 1473 -#define ER_NAME_BECOMES_EMPTY 1474 -#define ER_AMBIGUOUS_FIELD_TERM 1475 -#define ER_FOREIGN_SERVER_EXISTS 1476 -#define ER_FOREIGN_SERVER_DOESNT_EXIST 1477 -#define ER_ILLEGAL_HA_CREATE_OPTION 1478 -#define ER_PARTITION_REQUIRES_VALUES_ERROR 1479 -#define ER_PARTITION_WRONG_VALUES_ERROR 1480 -#define ER_PARTITION_MAXVALUE_ERROR 1481 -#define ER_PARTITION_SUBPARTITION_ERROR 1482 -#define ER_PARTITION_SUBPART_MIX_ERROR 1483 -#define ER_PARTITION_WRONG_NO_PART_ERROR 1484 -#define ER_PARTITION_WRONG_NO_SUBPART_ERROR 1485 -#define ER_WRONG_EXPR_IN_PARTITION_FUNC_ERROR 1486 -#define ER_NO_CONST_EXPR_IN_RANGE_OR_LIST_ERROR 1487 -#define ER_FIELD_NOT_FOUND_PART_ERROR 1488 -#define ER_LIST_OF_FIELDS_ONLY_IN_HASH_ERROR 1489 -#define ER_INCONSISTENT_PARTITION_INFO_ERROR 1490 -#define ER_PARTITION_FUNC_NOT_ALLOWED_ERROR 1491 -#define ER_PARTITIONS_MUST_BE_DEFINED_ERROR 1492 -#define ER_RANGE_NOT_INCREASING_ERROR 1493 -#define ER_INCONSISTENT_TYPE_OF_FUNCTIONS_ERROR 1494 -#define ER_MULTIPLE_DEF_CONST_IN_LIST_PART_ERROR 1495 -#define ER_PARTITION_ENTRY_ERROR 1496 -#define ER_MIX_HANDLER_ERROR 1497 -#define ER_PARTITION_NOT_DEFINED_ERROR 1498 -#define ER_TOO_MANY_PARTITIONS_ERROR 1499 -#define ER_SUBPARTITION_ERROR 1500 -#define ER_CANT_CREATE_HANDLER_FILE 1501 -#define ER_BLOB_FIELD_IN_PART_FUNC_ERROR 1502 -#define ER_UNIQUE_KEY_NEED_ALL_FIELDS_IN_PF 1503 -#define ER_NO_PARTS_ERROR 1504 -#define ER_PARTITION_MGMT_ON_NONPARTITIONED 1505 -#define ER_FOREIGN_KEY_ON_PARTITIONED 1506 -#define ER_DROP_PARTITION_NON_EXISTENT 1507 -#define ER_DROP_LAST_PARTITION 1508 -#define ER_COALESCE_ONLY_ON_HASH_PARTITION 1509 -#define ER_REORG_HASH_ONLY_ON_SAME_NO 1510 -#define ER_REORG_NO_PARAM_ERROR 1511 -#define ER_ONLY_ON_RANGE_LIST_PARTITION 1512 -#define ER_ADD_PARTITION_SUBPART_ERROR 1513 -#define ER_ADD_PARTITION_NO_NEW_PARTITION 1514 -#define ER_COALESCE_PARTITION_NO_PARTITION 1515 -#define ER_REORG_PARTITION_NOT_EXIST 1516 -#define ER_SAME_NAME_PARTITION 1517 -#define ER_NO_BINLOG_ERROR 1518 -#define ER_CONSECUTIVE_REORG_PARTITIONS 1519 -#define ER_REORG_OUTSIDE_RANGE 1520 -#define ER_PARTITION_FUNCTION_FAILURE 1521 -#define ER_PART_STATE_ERROR 1522 -#define ER_LIMITED_PART_RANGE 1523 -#define ER_PLUGIN_IS_NOT_LOADED 1524 -#define ER_WRONG_VALUE 1525 -#define ER_NO_PARTITION_FOR_GIVEN_VALUE 1526 -#define ER_FILEGROUP_OPTION_ONLY_ONCE 1527 -#define ER_CREATE_FILEGROUP_FAILED 1528 -#define ER_DROP_FILEGROUP_FAILED 1529 -#define ER_TABLESPACE_AUTO_EXTEND_ERROR 1530 -#define ER_WRONG_SIZE_NUMBER 1531 -#define ER_SIZE_OVERFLOW_ERROR 1532 -#define ER_ALTER_FILEGROUP_FAILED 1533 -#define ER_BINLOG_ROW_LOGGING_FAILED 1534 -#define ER_BINLOG_ROW_WRONG_TABLE_DEF 1535 -#define ER_BINLOG_ROW_RBR_TO_SBR 1536 -#define ER_EVENT_ALREADY_EXISTS 1537 -#define ER_EVENT_STORE_FAILED 1538 -#define ER_EVENT_DOES_NOT_EXIST 1539 -#define ER_EVENT_CANT_ALTER 1540 -#define ER_EVENT_DROP_FAILED 1541 -#define ER_EVENT_INTERVAL_NOT_POSITIVE_OR_TOO_BIG 1542 -#define ER_EVENT_ENDS_BEFORE_STARTS 1543 -#define ER_EVENT_EXEC_TIME_IN_THE_PAST 1544 -#define ER_EVENT_OPEN_TABLE_FAILED 1545 -#define ER_EVENT_NEITHER_M_EXPR_NOR_M_AT 1546 -#define ER_COL_COUNT_DOESNT_MATCH_CORRUPTED 1547 -#define ER_CANNOT_LOAD_FROM_TABLE 1548 -#define ER_EVENT_CANNOT_DELETE 1549 -#define ER_EVENT_COMPILE_ERROR 1550 -#define ER_EVENT_SAME_NAME 1551 -#define ER_EVENT_DATA_TOO_LONG 1552 -#define ER_DROP_INDEX_FK 1553 -#define ER_WARN_DEPRECATED_SYNTAX_WITH_VER 1554 -#define ER_CANT_WRITE_LOCK_LOG_TABLE 1555 -#define ER_CANT_LOCK_LOG_TABLE 1556 -#define ER_FOREIGN_DUPLICATE_KEY 1557 -#define ER_COL_COUNT_DOESNT_MATCH_PLEASE_UPDATE 1558 -#define ER_TEMP_TABLE_PREVENTS_SWITCH_OUT_OF_RBR 1559 -#define ER_STORED_FUNCTION_PREVENTS_SWITCH_BINLOG_FORMAT 1560 -#define ER_NDB_CANT_SWITCH_BINLOG_FORMAT 1561 -#define ER_PARTITION_NO_TEMPORARY 1562 -#define ER_PARTITION_CONST_DOMAIN_ERROR 1563 -#define ER_PARTITION_FUNCTION_IS_NOT_ALLOWED 1564 -#define ER_DDL_LOG_ERROR 1565 -#define ER_NULL_IN_VALUES_LESS_THAN 1566 -#define ER_WRONG_PARTITION_NAME 1567 -#define ER_CANT_CHANGE_TX_ISOLATION 1568 -#define ER_DUP_ENTRY_AUTOINCREMENT_CASE 1569 -#define ER_EVENT_MODIFY_QUEUE_ERROR 1570 -#define ER_EVENT_SET_VAR_ERROR 1571 -#define ER_PARTITION_MERGE_ERROR 1572 -#define ER_CANT_ACTIVATE_LOG 1573 -#define ER_RBR_NOT_AVAILABLE 1574 -#define ER_BASE64_DECODE_ERROR 1575 -#define ER_EVENT_RECURSION_FORBIDDEN 1576 -#define ER_EVENTS_DB_ERROR 1577 -#define ER_ONLY_INTEGERS_ALLOWED 1578 -#define ER_UNSUPORTED_LOG_ENGINE 1579 -#define ER_BAD_LOG_STATEMENT 1580 -#define ER_CANT_RENAME_LOG_TABLE 1581 -#define ER_WRONG_PARAMCOUNT_TO_NATIVE_FCT 1582 -#define ER_WRONG_PARAMETERS_TO_NATIVE_FCT 1583 -#define ER_WRONG_PARAMETERS_TO_STORED_FCT 1584 -#define ER_NATIVE_FCT_NAME_COLLISION 1585 -#define ER_DUP_ENTRY_WITH_KEY_NAME 1586 -#define ER_BINLOG_PURGE_EMFILE 1587 -#define ER_EVENT_CANNOT_CREATE_IN_THE_PAST 1588 -#define ER_EVENT_CANNOT_ALTER_IN_THE_PAST 1589 -#define ER_SLAVE_INCIDENT 1590 -#define ER_NO_PARTITION_FOR_GIVEN_VALUE_SILENT 1591 -#define ER_BINLOG_UNSAFE_STATEMENT 1592 -#define ER_SLAVE_FATAL_ERROR 1593 -#define ER_SLAVE_RELAY_LOG_READ_FAILURE 1594 -#define ER_SLAVE_RELAY_LOG_WRITE_FAILURE 1595 -#define ER_SLAVE_CREATE_EVENT_FAILURE 1596 -#define ER_SLAVE_MASTER_COM_FAILURE 1597 -#define ER_BINLOG_LOGGING_IMPOSSIBLE 1598 -#define ER_VIEW_NO_CREATION_CTX 1599 -#define ER_VIEW_INVALID_CREATION_CTX 1600 -#define ER_SR_INVALID_CREATION_CTX 1601 -#define ER_TRG_CORRUPTED_FILE 1602 -#define ER_TRG_NO_CREATION_CTX 1603 -#define ER_TRG_INVALID_CREATION_CTX 1604 -#define ER_EVENT_INVALID_CREATION_CTX 1605 -#define ER_TRG_CANT_OPEN_TABLE 1606 -#define ER_CANT_CREATE_SROUTINE 1607 -#define ER_NEVER_USED 1608 -#define ER_NO_FORMAT_DESCRIPTION_EVENT_BEFORE_BINLOG_STATEMENT 1609 -#define ER_SLAVE_CORRUPT_EVENT 1610 -#define ER_LOAD_DATA_INVALID_COLUMN 1611 -#define ER_LOG_PURGE_NO_FILE 1612 -#define ER_XA_RBTIMEOUT 1613 -#define ER_XA_RBDEADLOCK 1614 -#define ER_NEED_REPREPARE 1615 -#define ER_DELAYED_NOT_SUPPORTED 1616 -#define WARN_NO_MASTER_INFO 1617 -#define WARN_OPTION_IGNORED 1618 -#define WARN_PLUGIN_DELETE_BUILTIN 1619 -#define WARN_PLUGIN_BUSY 1620 -#define ER_VARIABLE_IS_READONLY 1621 -#define ER_WARN_ENGINE_TRANSACTION_ROLLBACK 1622 -#define ER_SLAVE_HEARTBEAT_FAILURE 1623 -#define ER_SLAVE_HEARTBEAT_VALUE_OUT_OF_RANGE 1624 -#define ER_NDB_REPLICATION_SCHEMA_ERROR 1625 -#define ER_CONFLICT_FN_PARSE_ERROR 1626 -#define ER_EXCEPTIONS_WRITE_ERROR 1627 -#define ER_TOO_LONG_TABLE_COMMENT 1628 -#define ER_TOO_LONG_FIELD_COMMENT 1629 -#define ER_FUNC_INEXISTENT_NAME_COLLISION 1630 -#define ER_DATABASE_NAME 1631 -#define ER_TABLE_NAME 1632 -#define ER_PARTITION_NAME 1633 -#define ER_SUBPARTITION_NAME 1634 -#define ER_TEMPORARY_NAME 1635 -#define ER_RENAMED_NAME 1636 -#define ER_TOO_MANY_CONCURRENT_TRXS 1637 -#define WARN_NON_ASCII_SEPARATOR_NOT_IMPLEMENTED 1638 -#define ER_DEBUG_SYNC_TIMEOUT 1639 -#define ER_DEBUG_SYNC_HIT_LIMIT 1640 -#define ER_DUP_SIGNAL_SET 1641 -#define ER_SIGNAL_WARN 1642 -#define ER_SIGNAL_NOT_FOUND 1643 -#define ER_SIGNAL_EXCEPTION 1644 -#define ER_RESIGNAL_WITHOUT_ACTIVE_HANDLER 1645 -#define ER_SIGNAL_BAD_CONDITION_TYPE 1646 -#define WARN_COND_ITEM_TRUNCATED 1647 -#define ER_COND_ITEM_TOO_LONG 1648 -#define ER_UNKNOWN_LOCALE 1649 -#define ER_SLAVE_IGNORE_SERVER_IDS 1650 -#define ER_QUERY_CACHE_DISABLED 1651 -#define ER_SAME_NAME_PARTITION_FIELD 1652 -#define ER_PARTITION_COLUMN_LIST_ERROR 1653 -#define ER_WRONG_TYPE_COLUMN_VALUE_ERROR 1654 -#define ER_TOO_MANY_PARTITION_FUNC_FIELDS_ERROR 1655 -#define ER_MAXVALUE_IN_VALUES_IN 1656 -#define ER_TOO_MANY_VALUES_ERROR 1657 -#define ER_ROW_SINGLE_PARTITION_FIELD_ERROR 1658 -#define ER_FIELD_TYPE_NOT_ALLOWED_AS_PARTITION_FIELD 1659 -#define ER_PARTITION_FIELDS_TOO_LONG 1660 -#define ER_BINLOG_ROW_ENGINE_AND_STMT_ENGINE 1661 -#define ER_BINLOG_ROW_MODE_AND_STMT_ENGINE 1662 -#define ER_BINLOG_UNSAFE_AND_STMT_ENGINE 1663 -#define ER_BINLOG_ROW_INJECTION_AND_STMT_ENGINE 1664 -#define ER_BINLOG_STMT_MODE_AND_ROW_ENGINE 1665 -#define ER_BINLOG_ROW_INJECTION_AND_STMT_MODE 1666 -#define ER_BINLOG_MULTIPLE_ENGINES_AND_SELF_LOGGING_ENGINE 1667 -#define ER_BINLOG_UNSAFE_LIMIT 1668 -#define ER_BINLOG_UNSAFE_INSERT_DELAYED 1669 -#define ER_BINLOG_UNSAFE_SYSTEM_TABLE 1670 -#define ER_BINLOG_UNSAFE_AUTOINC_COLUMNS 1671 -#define ER_BINLOG_UNSAFE_UDF 1672 -#define ER_BINLOG_UNSAFE_SYSTEM_VARIABLE 1673 -#define ER_BINLOG_UNSAFE_SYSTEM_FUNCTION 1674 -#define ER_BINLOG_UNSAFE_NONTRANS_AFTER_TRANS 1675 -#define ER_MESSAGE_AND_STATEMENT 1676 -#define ER_SLAVE_CONVERSION_FAILED 1677 -#define ER_SLAVE_CANT_CREATE_CONVERSION 1678 -#define ER_INSIDE_TRANSACTION_PREVENTS_SWITCH_BINLOG_FORMAT 1679 -#define ER_PATH_LENGTH 1680 -#define ER_WARN_DEPRECATED_SYNTAX_NO_REPLACEMENT 1681 -#define ER_WRONG_NATIVE_TABLE_STRUCTURE 1682 -#define ER_WRONG_PERFSCHEMA_USAGE 1683 -#define ER_WARN_I_S_SKIPPED_TABLE 1684 -#define ER_INSIDE_TRANSACTION_PREVENTS_SWITCH_BINLOG_DIRECT 1685 -#define ER_STORED_FUNCTION_PREVENTS_SWITCH_BINLOG_DIRECT 1686 -#define ER_SPATIAL_MUST_HAVE_GEOM_COL 1687 -#define ER_TOO_LONG_INDEX_COMMENT 1688 -#define ER_LOCK_ABORTED 1689 -#define ER_DATA_OUT_OF_RANGE 1690 -#define ER_WRONG_SPVAR_TYPE_IN_LIMIT 1691 -#define ER_BINLOG_UNSAFE_MULTIPLE_ENGINES_AND_SELF_LOGGING_ENGINE 1692 -#define ER_BINLOG_UNSAFE_MIXED_STATEMENT 1693 -#define ER_INSIDE_TRANSACTION_PREVENTS_SWITCH_SQL_LOG_BIN 1694 -#define ER_STORED_FUNCTION_PREVENTS_SWITCH_SQL_LOG_BIN 1695 -#define ER_FAILED_READ_FROM_PAR_FILE 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_STMT_CACHE_FULL 1705 -#define ER_ERROR_LAST 1705 diff --git a/dep/mysqllite/include/plugin.h b/dep/mysqllite/include/plugin.h deleted file mode 100644 index 7ec68ff5040..00000000000 --- a/dep/mysqllite/include/plugin.h +++ /dev/null @@ -1,633 +0,0 @@ -/* Copyright (C) 2005 MySQL AB, 2009 Sun Microsystems, Inc. - - 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 */ - -#ifndef _my_plugin_h -#define _my_plugin_h - -/* - On Windows, exports from DLL need to be declared - Also, plugin needs to be declared as extern "C" because MSVC - unlike other compilers, uses C++ mangling for variables not only - for functions. -*/ -#if defined(_MSC_VER) -#if defined(MYSQL_DYNAMIC_PLUGIN) - #ifdef __cplusplus - #define MYSQL_PLUGIN_EXPORT extern "C" __declspec(dllexport) - #else - #define MYSQL_PLUGIN_EXPORT __declspec(dllexport) - #endif -#else /* MYSQL_DYNAMIC_PLUGIN */ - #ifdef __cplusplus - #define MYSQL_PLUGIN_EXPORT extern "C" - #else - #define MYSQL_PLUGIN_EXPORT - #endif -#endif /*MYSQL_DYNAMIC_PLUGIN */ -#else /*_MSC_VER */ -#define MYSQL_PLUGIN_EXPORT -#endif - -#ifdef __cplusplus -class THD; -class Item; -#define MYSQL_THD THD* -#else -#define MYSQL_THD void* -#endif - -#include <mysql/services.h> - -#define MYSQL_XIDDATASIZE 128 -/** - struct st_mysql_xid is binary compatible with the XID structure as - in the X/Open CAE Specification, Distributed Transaction Processing: - The XA Specification, X/Open Company Ltd., 1991. - http://www.opengroup.org/bookstore/catalog/c193.htm - - @see XID in sql/handler.h -*/ -struct st_mysql_xid { - long formatID; - long gtrid_length; - long bqual_length; - char data[MYSQL_XIDDATASIZE]; /* Not \0-terminated */ -}; -typedef struct st_mysql_xid MYSQL_XID; - -/************************************************************************* - Plugin API. Common for all plugin types. -*/ - -#define MYSQL_PLUGIN_INTERFACE_VERSION 0x0102 - -/* - The allowable types of plugins -*/ -#define MYSQL_UDF_PLUGIN 0 /* User-defined function */ -#define MYSQL_STORAGE_ENGINE_PLUGIN 1 /* Storage Engine */ -#define MYSQL_FTPARSER_PLUGIN 2 /* Full-text parser plugin */ -#define MYSQL_DAEMON_PLUGIN 3 /* The daemon/raw plugin type */ -#define MYSQL_INFORMATION_SCHEMA_PLUGIN 4 /* The I_S plugin type */ -#define MYSQL_AUDIT_PLUGIN 5 /* The Audit plugin type */ -#define MYSQL_REPLICATION_PLUGIN 6 /* The replication plugin type */ -#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 */ -#define PLUGIN_LICENSE_PROPRIETARY 0 -#define PLUGIN_LICENSE_GPL 1 -#define PLUGIN_LICENSE_BSD 2 - -#define PLUGIN_LICENSE_PROPRIETARY_STRING "PROPRIETARY" -#define PLUGIN_LICENSE_GPL_STRING "GPL" -#define PLUGIN_LICENSE_BSD_STRING "BSD" - -/* - Macros for beginning and ending plugin declarations. Between - mysql_declare_plugin and mysql_declare_plugin_end there should - be a st_mysql_plugin struct for each plugin to be declared. -*/ - - -#ifndef MYSQL_DYNAMIC_PLUGIN -#define __MYSQL_DECLARE_PLUGIN(NAME, VERSION, PSIZE, DECLS) \ -MYSQL_PLUGIN_EXPORT int VERSION= MYSQL_PLUGIN_INTERFACE_VERSION; \ -MYSQL_PLUGIN_EXPORT int PSIZE= sizeof(struct st_mysql_plugin); \ -MYSQL_PLUGIN_EXPORT struct st_mysql_plugin DECLS[]= { -#else -#define __MYSQL_DECLARE_PLUGIN(NAME, VERSION, PSIZE, DECLS) \ -MYSQL_PLUGIN_EXPORT int _mysql_plugin_interface_version_= MYSQL_PLUGIN_INTERFACE_VERSION; \ -MYSQL_PLUGIN_EXPORT int _mysql_sizeof_struct_st_plugin_= sizeof(struct st_mysql_plugin); \ -MYSQL_PLUGIN_EXPORT struct st_mysql_plugin _mysql_plugin_declarations_[]= { -#endif - -#define mysql_declare_plugin(NAME) \ -__MYSQL_DECLARE_PLUGIN(NAME, \ - builtin_ ## NAME ## _plugin_interface_version, \ - builtin_ ## NAME ## _sizeof_struct_st_plugin, \ - builtin_ ## NAME ## _plugin) - -#define mysql_declare_plugin_end ,{0,0,0,0,0,0,0,0,0,0,0,0}} - -/* - declarations for SHOW STATUS support in plugins -*/ -enum enum_mysql_show_type -{ - SHOW_UNDEF, SHOW_BOOL, SHOW_INT, SHOW_LONG, - SHOW_LONGLONG, SHOW_CHAR, SHOW_CHAR_PTR, - SHOW_ARRAY, SHOW_FUNC, SHOW_DOUBLE, - SHOW_always_last -}; - -struct st_mysql_show_var { - const char *name; - char *value; - enum enum_mysql_show_type type; -}; - -#define SHOW_VAR_FUNC_BUFF_SIZE 1024 -typedef int (*mysql_show_var_func)(MYSQL_THD, struct st_mysql_show_var*, char *); - - -/* - declarations for server variables and command line options -*/ - - -#define PLUGIN_VAR_BOOL 0x0001 -#define PLUGIN_VAR_INT 0x0002 -#define PLUGIN_VAR_LONG 0x0003 -#define PLUGIN_VAR_LONGLONG 0x0004 -#define PLUGIN_VAR_STR 0x0005 -#define PLUGIN_VAR_ENUM 0x0006 -#define PLUGIN_VAR_SET 0x0007 -#define PLUGIN_VAR_UNSIGNED 0x0080 -#define PLUGIN_VAR_THDLOCAL 0x0100 /* Variable is per-connection */ -#define PLUGIN_VAR_READONLY 0x0200 /* Server variable is read only */ -#define PLUGIN_VAR_NOSYSVAR 0x0400 /* Not a server variable */ -#define PLUGIN_VAR_NOCMDOPT 0x0800 /* Not a command line option */ -#define PLUGIN_VAR_NOCMDARG 0x1000 /* No argument for cmd line */ -#define PLUGIN_VAR_RQCMDARG 0x0000 /* Argument required for cmd line */ -#define PLUGIN_VAR_OPCMDARG 0x2000 /* Argument optional for cmd line */ -#define PLUGIN_VAR_MEMALLOC 0x8000 /* String needs memory allocated */ - -struct st_mysql_sys_var; -struct st_mysql_value; - -/* - SYNOPSIS - (*mysql_var_check_func)() - thd thread handle - var dynamic variable being altered - save pointer to temporary storage - value user provided value - RETURN - 0 user provided value is OK and the update func may be called. - any other value indicates error. - - This function should parse the user provided value and store in the - provided temporary storage any data as required by the update func. - There is sufficient space in the temporary storage to store a double. - Note that the update func may not be called if any other error occurs - so any memory allocated should be thread-local so that it may be freed - automatically at the end of the statement. -*/ - -typedef int (*mysql_var_check_func)(MYSQL_THD thd, - struct st_mysql_sys_var *var, - void *save, struct st_mysql_value *value); - -/* - SYNOPSIS - (*mysql_var_update_func)() - thd thread handle - var dynamic variable being altered - var_ptr pointer to dynamic variable - save pointer to temporary storage - RETURN - NONE - - This function should use the validated value stored in the temporary store - and persist it in the provided pointer to the dynamic variable. - For example, strings may require memory to be allocated. -*/ -typedef void (*mysql_var_update_func)(MYSQL_THD thd, - struct st_mysql_sys_var *var, - void *var_ptr, const void *save); - - -/* the following declarations are for internal use only */ - - -#define PLUGIN_VAR_MASK \ - (PLUGIN_VAR_READONLY | PLUGIN_VAR_NOSYSVAR | \ - PLUGIN_VAR_NOCMDOPT | PLUGIN_VAR_NOCMDARG | \ - PLUGIN_VAR_OPCMDARG | PLUGIN_VAR_RQCMDARG | PLUGIN_VAR_MEMALLOC) - -#define MYSQL_PLUGIN_VAR_HEADER \ - int flags; \ - const char *name; \ - const char *comment; \ - mysql_var_check_func check; \ - mysql_var_update_func update - -#define MYSQL_SYSVAR_NAME(name) mysql_sysvar_ ## name -#define MYSQL_SYSVAR(name) \ - ((struct st_mysql_sys_var *)&(MYSQL_SYSVAR_NAME(name))) - -/* - for global variables, the value pointer is the first - element after the header, the default value is the second. - for thread variables, the value offset is the first - element after the header, the default value is the second. -*/ - - -#define DECLARE_MYSQL_SYSVAR_BASIC(name, type) struct { \ - MYSQL_PLUGIN_VAR_HEADER; \ - type *value; \ - const type def_val; \ -} MYSQL_SYSVAR_NAME(name) - -#define DECLARE_MYSQL_SYSVAR_SIMPLE(name, type) struct { \ - MYSQL_PLUGIN_VAR_HEADER; \ - type *value; type def_val; \ - type min_val; type max_val; \ - type blk_sz; \ -} MYSQL_SYSVAR_NAME(name) - -#define DECLARE_MYSQL_SYSVAR_TYPELIB(name, type) struct { \ - MYSQL_PLUGIN_VAR_HEADER; \ - type *value; type def_val; \ - TYPELIB *typelib; \ -} MYSQL_SYSVAR_NAME(name) - -#define DECLARE_THDVAR_FUNC(type) \ - type *(*resolve)(MYSQL_THD thd, int offset) - -#define DECLARE_MYSQL_THDVAR_BASIC(name, type) struct { \ - MYSQL_PLUGIN_VAR_HEADER; \ - int offset; \ - const type def_val; \ - DECLARE_THDVAR_FUNC(type); \ -} MYSQL_SYSVAR_NAME(name) - -#define DECLARE_MYSQL_THDVAR_SIMPLE(name, type) struct { \ - MYSQL_PLUGIN_VAR_HEADER; \ - int offset; \ - type def_val; type min_val; \ - type max_val; type blk_sz; \ - DECLARE_THDVAR_FUNC(type); \ -} MYSQL_SYSVAR_NAME(name) - -#define DECLARE_MYSQL_THDVAR_TYPELIB(name, type) struct { \ - MYSQL_PLUGIN_VAR_HEADER; \ - int offset; \ - type def_val; \ - DECLARE_THDVAR_FUNC(type); \ - TYPELIB *typelib; \ -} MYSQL_SYSVAR_NAME(name) - - -/* - the following declarations are for use by plugin implementors -*/ - -#define MYSQL_SYSVAR_BOOL(name, varname, opt, comment, check, update, def) \ -DECLARE_MYSQL_SYSVAR_BASIC(name, char) = { \ - PLUGIN_VAR_BOOL | ((opt) & PLUGIN_VAR_MASK), \ - #name, comment, check, update, &varname, def} - -#define MYSQL_SYSVAR_STR(name, varname, opt, comment, check, update, def) \ -DECLARE_MYSQL_SYSVAR_BASIC(name, char *) = { \ - PLUGIN_VAR_STR | ((opt) & PLUGIN_VAR_MASK), \ - #name, comment, check, update, &varname, def} - -#define MYSQL_SYSVAR_INT(name, varname, opt, comment, check, update, def, min, max, blk) \ -DECLARE_MYSQL_SYSVAR_SIMPLE(name, int) = { \ - PLUGIN_VAR_INT | ((opt) & PLUGIN_VAR_MASK), \ - #name, comment, check, update, &varname, def, min, max, blk } - -#define MYSQL_SYSVAR_UINT(name, varname, opt, comment, check, update, def, min, max, blk) \ -DECLARE_MYSQL_SYSVAR_SIMPLE(name, unsigned int) = { \ - PLUGIN_VAR_INT | PLUGIN_VAR_UNSIGNED | ((opt) & PLUGIN_VAR_MASK), \ - #name, comment, check, update, &varname, def, min, max, blk } - -#define MYSQL_SYSVAR_LONG(name, varname, opt, comment, check, update, def, min, max, blk) \ -DECLARE_MYSQL_SYSVAR_SIMPLE(name, long) = { \ - PLUGIN_VAR_LONG | ((opt) & PLUGIN_VAR_MASK), \ - #name, comment, check, update, &varname, def, min, max, blk } - -#define MYSQL_SYSVAR_ULONG(name, varname, opt, comment, check, update, def, min, max, blk) \ -DECLARE_MYSQL_SYSVAR_SIMPLE(name, unsigned long) = { \ - PLUGIN_VAR_LONG | PLUGIN_VAR_UNSIGNED | ((opt) & PLUGIN_VAR_MASK), \ - #name, comment, check, update, &varname, def, min, max, blk } - -#define MYSQL_SYSVAR_LONGLONG(name, varname, opt, comment, check, update, def, min, max, blk) \ -DECLARE_MYSQL_SYSVAR_SIMPLE(name, long long) = { \ - PLUGIN_VAR_LONGLONG | ((opt) & PLUGIN_VAR_MASK), \ - #name, comment, check, update, &varname, def, min, max, blk } - -#define MYSQL_SYSVAR_ULONGLONG(name, varname, opt, comment, check, update, def, min, max, blk) \ -DECLARE_MYSQL_SYSVAR_SIMPLE(name, unsigned long long) = { \ - PLUGIN_VAR_LONGLONG | PLUGIN_VAR_UNSIGNED | ((opt) & PLUGIN_VAR_MASK), \ - #name, comment, check, update, &varname, def, min, max, blk } - -#define MYSQL_SYSVAR_ENUM(name, varname, opt, comment, check, update, def, typelib) \ -DECLARE_MYSQL_SYSVAR_TYPELIB(name, unsigned long) = { \ - PLUGIN_VAR_ENUM | ((opt) & PLUGIN_VAR_MASK), \ - #name, comment, check, update, &varname, def, typelib } - -#define MYSQL_SYSVAR_SET(name, varname, opt, comment, check, update, def, typelib) \ -DECLARE_MYSQL_SYSVAR_TYPELIB(name, unsigned long long) = { \ - PLUGIN_VAR_SET | ((opt) & PLUGIN_VAR_MASK), \ - #name, comment, check, update, &varname, def, typelib } - -#define MYSQL_THDVAR_BOOL(name, opt, comment, check, update, def) \ -DECLARE_MYSQL_THDVAR_BASIC(name, char) = { \ - PLUGIN_VAR_BOOL | PLUGIN_VAR_THDLOCAL | ((opt) & PLUGIN_VAR_MASK), \ - #name, comment, check, update, -1, def, NULL} - -#define MYSQL_THDVAR_STR(name, opt, comment, check, update, def) \ -DECLARE_MYSQL_THDVAR_BASIC(name, char *) = { \ - PLUGIN_VAR_STR | PLUGIN_VAR_THDLOCAL | ((opt) & PLUGIN_VAR_MASK), \ - #name, comment, check, update, -1, def, NULL} - -#define MYSQL_THDVAR_INT(name, opt, comment, check, update, def, min, max, blk) \ -DECLARE_MYSQL_THDVAR_SIMPLE(name, int) = { \ - PLUGIN_VAR_INT | PLUGIN_VAR_THDLOCAL | ((opt) & PLUGIN_VAR_MASK), \ - #name, comment, check, update, -1, def, min, max, blk, NULL } - -#define MYSQL_THDVAR_UINT(name, opt, comment, check, update, def, min, max, blk) \ -DECLARE_MYSQL_THDVAR_SIMPLE(name, unsigned int) = { \ - PLUGIN_VAR_INT | PLUGIN_VAR_THDLOCAL | PLUGIN_VAR_UNSIGNED | ((opt) & PLUGIN_VAR_MASK), \ - #name, comment, check, update, -1, def, min, max, blk, NULL } - -#define MYSQL_THDVAR_LONG(name, opt, comment, check, update, def, min, max, blk) \ -DECLARE_MYSQL_THDVAR_SIMPLE(name, long) = { \ - PLUGIN_VAR_LONG | PLUGIN_VAR_THDLOCAL | ((opt) & PLUGIN_VAR_MASK), \ - #name, comment, check, update, -1, def, min, max, blk, NULL } - -#define MYSQL_THDVAR_ULONG(name, opt, comment, check, update, def, min, max, blk) \ -DECLARE_MYSQL_THDVAR_SIMPLE(name, unsigned long) = { \ - PLUGIN_VAR_LONG | PLUGIN_VAR_THDLOCAL | PLUGIN_VAR_UNSIGNED | ((opt) & PLUGIN_VAR_MASK), \ - #name, comment, check, update, -1, def, min, max, blk, NULL } - -#define MYSQL_THDVAR_LONGLONG(name, opt, comment, check, update, def, min, max, blk) \ -DECLARE_MYSQL_THDVAR_SIMPLE(name, long long) = { \ - PLUGIN_VAR_LONGLONG | PLUGIN_VAR_THDLOCAL | ((opt) & PLUGIN_VAR_MASK), \ - #name, comment, check, update, -1, def, min, max, blk, NULL } - -#define MYSQL_THDVAR_ULONGLONG(name, opt, comment, check, update, def, min, max, blk) \ -DECLARE_MYSQL_THDVAR_SIMPLE(name, unsigned long long) = { \ - PLUGIN_VAR_LONGLONG | PLUGIN_VAR_THDLOCAL | PLUGIN_VAR_UNSIGNED | ((opt) & PLUGIN_VAR_MASK), \ - #name, comment, check, update, -1, def, min, max, blk, NULL } - -#define MYSQL_THDVAR_ENUM(name, opt, comment, check, update, def, typelib) \ -DECLARE_MYSQL_THDVAR_TYPELIB(name, unsigned long) = { \ - PLUGIN_VAR_ENUM | PLUGIN_VAR_THDLOCAL | ((opt) & PLUGIN_VAR_MASK), \ - #name, comment, check, update, -1, def, NULL, typelib } - -#define MYSQL_THDVAR_SET(name, opt, comment, check, update, def, typelib) \ -DECLARE_MYSQL_THDVAR_TYPELIB(name, unsigned long long) = { \ - PLUGIN_VAR_SET | PLUGIN_VAR_THDLOCAL | ((opt) & PLUGIN_VAR_MASK), \ - #name, comment, check, update, -1, def, NULL, typelib } - -/* accessor macros */ - -#define SYSVAR(name) \ - (*(MYSQL_SYSVAR_NAME(name).value)) - -/* when thd == null, result points to global value */ -#define THDVAR(thd, name) \ - (*(MYSQL_SYSVAR_NAME(name).resolve(thd, MYSQL_SYSVAR_NAME(name).offset))) - - -/* - Plugin description structure. -*/ - -struct st_mysql_plugin -{ - int type; /* the plugin type (a MYSQL_XXX_PLUGIN value) */ - void *info; /* pointer to type-specific plugin descriptor */ - const char *name; /* plugin name */ - const char *author; /* plugin author (for I_S.PLUGINS) */ - const char *descr; /* general descriptive text (for I_S.PLUGINS) */ - int license; /* the plugin license (PLUGIN_LICENSE_XXX) */ - int (*init)(void *); /* the function to invoke when plugin is loaded */ - int (*deinit)(void *);/* the function to invoke when plugin is unloaded */ - unsigned int version; /* plugin version (for I_S.PLUGINS) */ - struct st_mysql_show_var *status_vars; - struct st_mysql_sys_var **system_vars; - void * __reserved1; /* reserved for dependency checking */ -}; - -/************************************************************************* - API for Full-text parser plugin. (MYSQL_FTPARSER_PLUGIN) -*/ -#include "plugin_ftparser.h" - -/************************************************************************* - API for Storage Engine plugin. (MYSQL_DAEMON_PLUGIN) -*/ - -/* handlertons of different MySQL releases are incompatible */ -#define MYSQL_DAEMON_INTERFACE_VERSION (MYSQL_VERSION_ID << 8) - -/* - Here we define only the descriptor structure, that is referred from - st_mysql_plugin. -*/ - -struct st_mysql_daemon -{ - int interface_version; -}; - - -/************************************************************************* - API for I_S plugin. (MYSQL_INFORMATION_SCHEMA_PLUGIN) -*/ - -/* handlertons of different MySQL releases are incompatible */ -#define MYSQL_INFORMATION_SCHEMA_INTERFACE_VERSION (MYSQL_VERSION_ID << 8) - -/* - Here we define only the descriptor structure, that is referred from - st_mysql_plugin. -*/ - -struct st_mysql_information_schema -{ - int interface_version; -}; - - -/************************************************************************* - API for Storage Engine plugin. (MYSQL_STORAGE_ENGINE_PLUGIN) -*/ - -/* handlertons of different MySQL releases are incompatible */ -#define MYSQL_HANDLERTON_INTERFACE_VERSION (MYSQL_VERSION_ID << 8) - -/* - The real API is in the sql/handler.h - Here we define only the descriptor structure, that is referred from - st_mysql_plugin. -*/ - -struct st_mysql_storage_engine -{ - int interface_version; -}; - -struct handlerton; - - -/* - API for Replication plugin. (MYSQL_REPLICATION_PLUGIN) -*/ - #define MYSQL_REPLICATION_INTERFACE_VERSION 0x0100 - - /** - Replication plugin descriptor - */ - struct Mysql_replication { - int interface_version; - }; - -/************************************************************************* - st_mysql_value struct for reading values from mysqld. - Used by server variables framework to parse user-provided values. - Will be used for arguments when implementing UDFs. - - Note that val_str() returns a string in temporary memory - that will be freed at the end of statement. Copy the string - if you need it to persist. -*/ - -#define MYSQL_VALUE_TYPE_STRING 0 -#define MYSQL_VALUE_TYPE_REAL 1 -#define MYSQL_VALUE_TYPE_INT 2 - -struct st_mysql_value -{ - int (*value_type)(struct st_mysql_value *); - const char *(*val_str)(struct st_mysql_value *, char *buffer, int *length); - int (*val_real)(struct st_mysql_value *, double *realbuf); - int (*val_int)(struct st_mysql_value *, long long *intbuf); - int (*is_unsigned)(struct st_mysql_value *); -}; - - -/************************************************************************* - Miscellaneous functions for plugin implementors -*/ - -#ifdef __cplusplus -extern "C" { -#endif - -int thd_in_lock_tables(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); -int thd_sql_command(const MYSQL_THD thd); -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_storage_lock_wait(MYSQL_THD thd, long long value); -int thd_tx_isolation(const MYSQL_THD thd); -char *thd_security_context(MYSQL_THD thd, char *buffer, unsigned int length, - unsigned int max_query_len); -/* Increments the row counter, see THD::row_count */ -void thd_inc_row_count(MYSQL_THD thd); - -/** - Create a temporary file. - - @details - The temporary file is created in a location specified by the mysql - server configuration (--tmpdir option). The caller does not need to - delete the file, it will be deleted automatically. - - @param prefix prefix for temporary file name - @retval -1 error - @retval >= 0 a file handle that can be passed to dup or my_close -*/ -int mysql_tmpfile(const char *prefix); - -/** - Check the killed state of a connection - - @details - In MySQL support for the KILL statement is cooperative. The KILL - statement only sets a "killed" flag. This function returns the value - of that flag. A thread should check it often, especially inside - time-consuming loops, and gracefully abort the operation if it is - non-zero. - - @param thd user thread connection handle - @retval 0 the connection is active - @retval 1 the connection has been killed -*/ -int thd_killed(const MYSQL_THD thd); - - -/** - Return the thread id of a user thread - - @param thd user thread connection handle - @return thread id -*/ -unsigned long thd_get_thread_id(const MYSQL_THD thd); - -/** - Get the XID for this connection's transaction - - @param thd user thread connection handle - @param xid location where identifier is stored -*/ -void thd_get_xid(const MYSQL_THD thd, MYSQL_XID *xid); - -/** - Invalidate the query cache for a given table. - - @param thd user thread connection handle - @param key databasename\\0tablename\\0 - @param key_length length of key in bytes, including the NUL bytes - @param using_trx flag: TRUE if using transactions, FALSE otherwise -*/ -void mysql_query_cache_invalidate4(MYSQL_THD thd, - const char *key, unsigned int key_length, - int using_trx); - - -/** - Provide a handler data getter to simplify coding -*/ -void *thd_get_ha_data(const MYSQL_THD thd, const struct handlerton *hton); - - -/** - Provide a handler data setter to simplify coding - - @details - Set ha_data pointer (storage engine per-connection information). - - To avoid unclean deactivation (uninstall) of storage engine plugin - in the middle of transaction, additional storage engine plugin - lock is acquired. - - If ha_data is not null and storage engine plugin was not locked - by thd_set_ha_data() in this connection before, storage engine - plugin gets locked. - - If ha_data is null and storage engine plugin was locked by - thd_set_ha_data() in this connection before, storage engine - plugin lock gets released. - - If handlerton::close_connection() didn't reset ha_data, server does - it immediately after calling handlerton::close_connection(). -*/ -void thd_set_ha_data(MYSQL_THD thd, const struct handlerton *hton, - const void *ha_data); -#ifdef __cplusplus -} -#endif - -#endif - diff --git a/dep/mysqllite/include/plugin_audit.h b/dep/mysqllite/include/plugin_audit.h deleted file mode 100644 index 8811c832949..00000000000 --- a/dep/mysqllite/include/plugin_audit.h +++ /dev/null @@ -1,138 +0,0 @@ -/* Copyright (C) 2007 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 */ - -#ifndef _my_audit_h -#define _my_audit_h - -/************************************************************************* - API for Audit plugin. (MYSQL_AUDIT_PLUGIN) -*/ - -#include "plugin.h" - -#define MYSQL_AUDIT_CLASS_MASK_SIZE 1 - -#define MYSQL_AUDIT_INTERFACE_VERSION 0x0200 - -/* - The first word in every event class struct indicates the specific - class of the event. -*/ -struct mysql_event -{ - unsigned int event_class; -}; - - -/************************************************************************* - AUDIT CLASS : GENERAL - - LOG events occurs before emitting to the general query log. - ERROR events occur before transmitting errors to the user. - RESULT events occur after transmitting a resultset to the user. - STATUS events occur after transmitting a resultset or errors - to the user. -*/ - -#define MYSQL_AUDIT_GENERAL_CLASS 0 -#define MYSQL_AUDIT_GENERAL_CLASSMASK (1 << MYSQL_AUDIT_GENERAL_CLASS) -#define MYSQL_AUDIT_GENERAL_LOG 0 -#define MYSQL_AUDIT_GENERAL_ERROR 1 -#define MYSQL_AUDIT_GENERAL_RESULT 2 -#define MYSQL_AUDIT_GENERAL_STATUS 3 - -struct mysql_event_general -{ - unsigned int event_class; - unsigned int event_subclass; - int general_error_code; - unsigned long general_thread_id; - const char *general_user; - unsigned int general_user_length; - const char *general_command; - unsigned int general_command_length; - const char *general_query; - unsigned int general_query_length; - struct charset_info_st *general_charset; - unsigned long long general_time; - unsigned long long general_rows; -}; - - -/* - AUDIT CLASS : CONNECTION - - CONNECT occurs after authentication phase is completed. - DISCONNECT occurs after connection is terminated. - CHANGE_USER occurs after COM_CHANGE_USER RPC is completed. -*/ - -#define MYSQL_AUDIT_CONNECTION_CLASS 1 -#define MYSQL_AUDIT_CONNECTION_CLASSMASK (1 << MYSQL_AUDIT_CONNECTION_CLASS) -#define MYSQL_AUDIT_CONNECTION_CONNECT 0 -#define MYSQL_AUDIT_CONNECTION_DISCONNECT 1 -#define MYSQL_AUDIT_CONNECTION_CHANGE_USER 2 - -struct mysql_event_connection -{ - unsigned int event_class; - unsigned int event_subclass; - int status; - unsigned long thread_id; - const char *user; - unsigned int user_length; - const char *priv_user; - unsigned int priv_user_length; - const char *external_user; - unsigned int external_user_length; - const char *proxy_user; - unsigned int proxy_user_length; - const char *host; - unsigned int host_length; - const char *ip; - unsigned int ip_length; - const char *database; - unsigned int database_length; -}; - - -/************************************************************************* - Here we define the descriptor structure, that is referred from - st_mysql_plugin. - - release_thd() event occurs when the event class consumer is to be - disassociated from the specified THD. This would typically occur - before some operation which may require sleeping - such as when - waiting for the next query from the client. - - event_notify() is invoked whenever an event occurs which is of any - class for which the plugin has interest. The first word of the - mysql_event argument indicates the specific event class and the - remainder of the structure is as required for that class. - - class_mask is an array of bits used to indicate what event classes - that this plugin wants to receive. -*/ - -struct st_mysql_audit -{ - int interface_version; - void (*release_thd)(MYSQL_THD); - void (*event_notify)(MYSQL_THD, const struct mysql_event *); - unsigned long class_mask[MYSQL_AUDIT_CLASS_MASK_SIZE]; -}; - - -#endif diff --git a/dep/mysqllite/include/plugin_ftparser.h b/dep/mysqllite/include/plugin_ftparser.h deleted file mode 100644 index 7f9bde3a6a0..00000000000 --- a/dep/mysqllite/include/plugin_ftparser.h +++ /dev/null @@ -1,211 +0,0 @@ -/* Copyright (C) 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ - -#ifndef _my_plugin_ftparser_h -#define _my_plugin_ftparser_h -#include "plugin.h" - -/************************************************************************* - API for Full-text parser plugin. (MYSQL_FTPARSER_PLUGIN) -*/ - -#define MYSQL_FTPARSER_INTERFACE_VERSION 0x0100 - -/* Parsing modes. Set in MYSQL_FTPARSER_PARAM::mode */ -enum enum_ftparser_mode -{ -/* - Fast and simple mode. This mode is used for indexing, and natural - language queries. - - The parser is expected to return only those words that go into the - index. Stopwords or too short/long words should not be returned. The - 'boolean_info' argument of mysql_add_word() does not have to be set. -*/ - MYSQL_FTPARSER_SIMPLE_MODE= 0, - -/* - Parse with stopwords mode. This mode is used in boolean searches for - "phrase matching." - - The parser is not allowed to ignore words in this mode. Every word - should be returned, including stopwords and words that are too short - or long. The 'boolean_info' argument of mysql_add_word() does not - have to be set. -*/ - MYSQL_FTPARSER_WITH_STOPWORDS= 1, - -/* - Parse in boolean mode. This mode is used to parse a boolean query string. - - The parser should provide a valid MYSQL_FTPARSER_BOOLEAN_INFO - structure in the 'boolean_info' argument to mysql_add_word(). - Usually that means that the parser should recognize boolean operators - in the parsing stream and set appropriate fields in - MYSQL_FTPARSER_BOOLEAN_INFO structure accordingly. As for - MYSQL_FTPARSER_WITH_STOPWORDS mode, no word should be ignored. - Instead, use FT_TOKEN_STOPWORD for the token type of such a word. -*/ - MYSQL_FTPARSER_FULL_BOOLEAN_INFO= 2 -}; - -/* - Token types for boolean mode searching (used for the type member of - MYSQL_FTPARSER_BOOLEAN_INFO struct) - - FT_TOKEN_EOF: End of data. - FT_TOKEN_WORD: Regular word. - FT_TOKEN_LEFT_PAREN: Left parenthesis (start of group/sub-expression). - FT_TOKEN_RIGHT_PAREN: Right parenthesis (end of group/sub-expression). - FT_TOKEN_STOPWORD: Stopword. -*/ - -enum enum_ft_token_type -{ - FT_TOKEN_EOF= 0, - FT_TOKEN_WORD= 1, - FT_TOKEN_LEFT_PAREN= 2, - FT_TOKEN_RIGHT_PAREN= 3, - FT_TOKEN_STOPWORD= 4 -}; - -/* - This structure is used in boolean search mode only. It conveys - boolean-mode metadata to the MySQL search engine for every word in - the search query. A valid instance of this structure must be filled - in by the plugin parser and passed as an argument in the call to - mysql_add_word (the callback function in the MYSQL_FTPARSER_PARAM - structure) when a query is parsed in boolean mode. - - type: The token type. Should be one of the enum_ft_token_type values. - - yesno: Whether the word must be present for a match to occur: - >0 Must be present - <0 Must not be present - 0 Neither; the word is optional but its presence increases the relevance - With the default settings of the ft_boolean_syntax system variable, - >0 corresponds to the '+' operator, <0 corrresponds to the '-' operator, - and 0 means neither operator was used. - - weight_adjust: A weighting factor that determines how much a match - for the word counts. Positive values increase, negative - decrease the - relative word's importance in the query. - - wasign: The sign of the word's weight in the query. If it's non-negative - the match for the word will increase document relevance, if it's - negative - decrease (the word becomes a "noise word", the less of it the - better). - - trunc: Corresponds to the '*' operator in the default setting of the - ft_boolean_syntax system variable. -*/ - -typedef struct st_mysql_ftparser_boolean_info -{ - enum enum_ft_token_type type; - int yesno; - int weight_adjust; - char wasign; - char trunc; - /* These are parser state and must be removed. */ - char prev; - char *quot; -} MYSQL_FTPARSER_BOOLEAN_INFO; - -/* - The following flag means that buffer with a string (document, word) - may be overwritten by the caller before the end of the parsing (that is - before st_mysql_ftparser::deinit() call). If one needs the string - to survive between two successive calls of the parsing function, she - needs to save a copy of it. The flag may be set by MySQL before calling - st_mysql_ftparser::parse(), or it may be set by a plugin before calling - st_mysql_ftparser_param::mysql_parse() or - st_mysql_ftparser_param::mysql_add_word(). -*/ -#define MYSQL_FTFLAGS_NEED_COPY 1 - -/* - An argument of the full-text parser plugin. This structure is - filled in by MySQL server and passed to the parsing function of the - plugin as an in/out parameter. - - mysql_parse: A pointer to the built-in parser implementation of the - server. It's set by the server and can be used by the parser plugin - to invoke the MySQL default parser. If plugin's role is to extract - textual data from .doc, .pdf or .xml content, it might extract - plaintext from the content, and then pass the text to the default - MySQL parser to be parsed. - - mysql_add_word: A server callback to add a new word. When parsing - a document, the server sets this to point at a function that adds - the word to MySQL full-text index. When parsing a search query, - this function will add the new word to the list of words to search - for. The boolean_info argument can be NULL for all cases except - when mode is MYSQL_FTPARSER_FULL_BOOLEAN_INFO. - - ftparser_state: A generic pointer. The plugin can set it to point - to information to be used internally for its own purposes. - - mysql_ftparam: This is set by the server. It is used by MySQL functions - called via mysql_parse() and mysql_add_word() callback. The plugin - should not modify it. - - cs: Information about the character set of the document or query string. - - doc: A pointer to the document or query string to be parsed. - - length: Length of the document or query string, in bytes. - - flags: See MYSQL_FTFLAGS_* constants above. - - mode: The parsing mode. With boolean operators, with stopwords, or - nothing. See enum_ftparser_mode above. -*/ - -typedef struct st_mysql_ftparser_param -{ - int (*mysql_parse)(struct st_mysql_ftparser_param *, - char *doc, int doc_len); - int (*mysql_add_word)(struct st_mysql_ftparser_param *, - char *word, int word_len, - MYSQL_FTPARSER_BOOLEAN_INFO *boolean_info); - void *ftparser_state; - void *mysql_ftparam; - struct charset_info_st *cs; - char *doc; - int length; - int flags; - enum enum_ftparser_mode mode; -} MYSQL_FTPARSER_PARAM; - -/* - Full-text parser descriptor. - - interface_version is, e.g., MYSQL_FTPARSER_INTERFACE_VERSION. - The parsing, initialization, and deinitialization functions are - invoked per SQL statement for which the parser is used. -*/ - -struct st_mysql_ftparser -{ - int interface_version; - int (*parse)(MYSQL_FTPARSER_PARAM *param); - int (*init)(MYSQL_FTPARSER_PARAM *param); - int (*deinit)(MYSQL_FTPARSER_PARAM *param); -}; - - -#endif - diff --git a/dep/mysqllite/include/sql_common.h b/dep/mysqllite/include/sql_common.h deleted file mode 100644 index a9a3168b691..00000000000 --- a/dep/mysqllite/include/sql_common.h +++ /dev/null @@ -1,113 +0,0 @@ -#ifndef SQL_COMMON_INCLUDED -#define SQL_COMMON_INCLUDED - -/* Copyright (C) 2003-2004, 2006 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 */ - -#define SQL_COMMON_INCLUDED - -#ifdef __cplusplus -extern "C" { -#endif - -#include <mysql.h> - -extern const char *unknown_sqlstate; -extern const char *cant_connect_sqlstate; -extern const char *not_error_sqlstate; - -struct st_mysql_options_extention { - 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 -} 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; -MYSQL_FIELD *unpack_fields(MYSQL_DATA *data,MEM_ROOT *alloc,uint fields, - my_bool default_value, uint server_capabilities); -void free_rows(MYSQL_DATA *cur); -void free_old_query(MYSQL *mysql); -void end_server(MYSQL *mysql); -my_bool mysql_reconnect(MYSQL *mysql); -void mysql_read_default_options(struct st_mysql_options *options, - const char *filename,const char *group); -my_bool -cli_advanced_command(MYSQL *mysql, enum enum_server_command command, - const unsigned char *header, ulong header_length, - const unsigned char *arg, ulong arg_length, - my_bool skip_check, MYSQL_STMT *stmt); -unsigned long cli_safe_read(MYSQL *mysql); -void net_clear_error(NET *net); -void set_stmt_errmsg(MYSQL_STMT *stmt, NET *net); -void set_stmt_error(MYSQL_STMT *stmt, int errcode, const char *sqlstate, - const char *err); -void set_mysql_error(MYSQL *mysql, int errcode, const char *sqlstate); -void set_mysql_extended_error(MYSQL *mysql, int errcode, const char *sqlstate, - 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 -} -#endif - -#define protocol_41(A) ((A)->server_capabilities & CLIENT_PROTOCOL_41) - -#endif /* SQL_COMMON_INCLUDED */ diff --git a/dep/mysqllite/include/sql_state.h b/dep/mysqllite/include/sql_state.h deleted file mode 100644 index edd6f694bd9..00000000000 --- a/dep/mysqllite/include/sql_state.h +++ /dev/null @@ -1,220 +0,0 @@ -/* Autogenerated file, please don't edit */ - -{ ER_DUP_KEY ,"23000", "" }, -{ ER_OUTOFMEMORY ,"HY001", "S1001" }, -{ ER_OUT_OF_SORTMEMORY ,"HY001", "S1001" }, -{ ER_CON_COUNT_ERROR ,"08004", "" }, -{ ER_BAD_HOST_ERROR ,"08S01", "" }, -{ ER_HANDSHAKE_ERROR ,"08S01", "" }, -{ ER_DBACCESS_DENIED_ERROR ,"42000", "" }, -{ ER_ACCESS_DENIED_ERROR ,"28000", "" }, -{ ER_NO_DB_ERROR ,"3D000", "" }, -{ ER_UNKNOWN_COM_ERROR ,"08S01", "" }, -{ ER_BAD_NULL_ERROR ,"23000", "" }, -{ ER_BAD_DB_ERROR ,"42000", "" }, -{ ER_TABLE_EXISTS_ERROR ,"42S01", "" }, -{ ER_BAD_TABLE_ERROR ,"42S02", "" }, -{ ER_NON_UNIQ_ERROR ,"23000", "" }, -{ ER_SERVER_SHUTDOWN ,"08S01", "" }, -{ ER_BAD_FIELD_ERROR ,"42S22", "S0022" }, -{ ER_WRONG_FIELD_WITH_GROUP ,"42000", "S1009" }, -{ ER_WRONG_GROUP_FIELD ,"42000", "S1009" }, -{ ER_WRONG_SUM_SELECT ,"42000", "S1009" }, -{ ER_WRONG_VALUE_COUNT ,"21S01", "" }, -{ ER_TOO_LONG_IDENT ,"42000", "S1009" }, -{ ER_DUP_FIELDNAME ,"42S21", "S1009" }, -{ ER_DUP_KEYNAME ,"42000", "S1009" }, -{ ER_DUP_ENTRY ,"23000", "S1009" }, -{ ER_WRONG_FIELD_SPEC ,"42000", "S1009" }, -{ ER_PARSE_ERROR ,"42000", "s1009" }, -{ ER_EMPTY_QUERY ,"42000", "" }, -{ ER_NONUNIQ_TABLE ,"42000", "S1009" }, -{ ER_INVALID_DEFAULT ,"42000", "S1009" }, -{ ER_MULTIPLE_PRI_KEY ,"42000", "S1009" }, -{ ER_TOO_MANY_KEYS ,"42000", "S1009" }, -{ ER_TOO_MANY_KEY_PARTS ,"42000", "S1009" }, -{ ER_TOO_LONG_KEY ,"42000", "S1009" }, -{ ER_KEY_COLUMN_DOES_NOT_EXITS ,"42000", "S1009" }, -{ ER_BLOB_USED_AS_KEY ,"42000", "S1009" }, -{ ER_TOO_BIG_FIELDLENGTH ,"42000", "S1009" }, -{ ER_WRONG_AUTO_KEY ,"42000", "S1009" }, -{ ER_FORCING_CLOSE ,"08S01", "" }, -{ ER_IPSOCK_ERROR ,"08S01", "" }, -{ ER_NO_SUCH_INDEX ,"42S12", "S1009" }, -{ ER_WRONG_FIELD_TERMINATORS ,"42000", "S1009" }, -{ ER_BLOBS_AND_NO_TERMINATED ,"42000", "S1009" }, -{ ER_CANT_REMOVE_ALL_FIELDS ,"42000", "" }, -{ ER_CANT_DROP_FIELD_OR_KEY ,"42000", "" }, -{ ER_BLOB_CANT_HAVE_DEFAULT ,"42000", "" }, -{ ER_WRONG_DB_NAME ,"42000", "" }, -{ ER_WRONG_TABLE_NAME ,"42000", "" }, -{ ER_TOO_BIG_SELECT ,"42000", "" }, -{ ER_UNKNOWN_PROCEDURE ,"42000", "" }, -{ ER_WRONG_PARAMCOUNT_TO_PROCEDURE ,"42000", "" }, -{ ER_UNKNOWN_TABLE ,"42S02", "" }, -{ ER_FIELD_SPECIFIED_TWICE ,"42000", "" }, -{ ER_UNSUPPORTED_EXTENSION ,"42000", "" }, -{ ER_TABLE_MUST_HAVE_COLUMNS ,"42000", "" }, -{ ER_UNKNOWN_CHARACTER_SET ,"42000", "" }, -{ ER_TOO_BIG_ROWSIZE ,"42000", "" }, -{ ER_WRONG_OUTER_JOIN ,"42000", "" }, -{ ER_NULL_COLUMN_IN_INDEX ,"42000", "" }, -{ ER_PASSWORD_ANONYMOUS_USER ,"42000", "" }, -{ ER_PASSWORD_NOT_ALLOWED ,"42000", "" }, -{ ER_PASSWORD_NO_MATCH ,"42000", "" }, -{ ER_WRONG_VALUE_COUNT_ON_ROW ,"21S01", "" }, -{ ER_INVALID_USE_OF_NULL ,"22004", "" }, -{ ER_REGEXP_ERROR ,"42000", "" }, -{ ER_MIX_OF_GROUP_FUNC_AND_FIELDS ,"42000", "" }, -{ ER_NONEXISTING_GRANT ,"42000", "" }, -{ ER_TABLEACCESS_DENIED_ERROR ,"42000", "" }, -{ ER_COLUMNACCESS_DENIED_ERROR ,"42000", "" }, -{ ER_ILLEGAL_GRANT_FOR_TABLE ,"42000", "" }, -{ ER_GRANT_WRONG_HOST_OR_USER ,"42000", "" }, -{ ER_NO_SUCH_TABLE ,"42S02", "" }, -{ ER_NONEXISTING_TABLE_GRANT ,"42000", "" }, -{ ER_NOT_ALLOWED_COMMAND ,"42000", "" }, -{ ER_SYNTAX_ERROR ,"42000", "" }, -{ ER_ABORTING_CONNECTION ,"08S01", "" }, -{ ER_NET_PACKET_TOO_LARGE ,"08S01", "" }, -{ ER_NET_READ_ERROR_FROM_PIPE ,"08S01", "" }, -{ ER_NET_FCNTL_ERROR ,"08S01", "" }, -{ ER_NET_PACKETS_OUT_OF_ORDER ,"08S01", "" }, -{ ER_NET_UNCOMPRESS_ERROR ,"08S01", "" }, -{ ER_NET_READ_ERROR ,"08S01", "" }, -{ ER_NET_READ_INTERRUPTED ,"08S01", "" }, -{ ER_NET_ERROR_ON_WRITE ,"08S01", "" }, -{ ER_NET_WRITE_INTERRUPTED ,"08S01", "" }, -{ ER_TOO_LONG_STRING ,"42000", "" }, -{ ER_TABLE_CANT_HANDLE_BLOB ,"42000", "" }, -{ ER_TABLE_CANT_HANDLE_AUTO_INCREMENT ,"42000", "" }, -{ ER_WRONG_COLUMN_NAME ,"42000", "" }, -{ ER_WRONG_KEY_COLUMN ,"42000", "" }, -{ ER_DUP_UNIQUE ,"23000", "" }, -{ ER_BLOB_KEY_WITHOUT_LENGTH ,"42000", "" }, -{ ER_PRIMARY_CANT_HAVE_NULL ,"42000", "" }, -{ ER_TOO_MANY_ROWS ,"42000", "" }, -{ ER_REQUIRES_PRIMARY_KEY ,"42000", "" }, -{ ER_KEY_DOES_NOT_EXITS ,"42000", "S1009" }, -{ ER_CHECK_NO_SUCH_TABLE ,"42000", "" }, -{ ER_CHECK_NOT_IMPLEMENTED ,"42000", "" }, -{ ER_CANT_DO_THIS_DURING_AN_TRANSACTION ,"25000", "" }, -{ ER_NEW_ABORTING_CONNECTION ,"08S01", "" }, -{ ER_MASTER_NET_READ ,"08S01", "" }, -{ ER_MASTER_NET_WRITE ,"08S01", "" }, -{ ER_TOO_MANY_USER_CONNECTIONS ,"42000", "" }, -{ ER_READ_ONLY_TRANSACTION ,"25000", "" }, -{ ER_NO_PERMISSION_TO_CREATE_USER ,"42000", "" }, -{ ER_LOCK_DEADLOCK ,"40001", "" }, -{ ER_NO_REFERENCED_ROW ,"23000", "" }, -{ ER_ROW_IS_REFERENCED ,"23000", "" }, -{ ER_CONNECT_TO_MASTER ,"08S01", "" }, -{ ER_WRONG_NUMBER_OF_COLUMNS_IN_SELECT ,"21000", "" }, -{ ER_USER_LIMIT_REACHED ,"42000", "" }, -{ ER_SPECIFIC_ACCESS_DENIED_ERROR ,"42000", "" }, -{ ER_NO_DEFAULT ,"42000", "" }, -{ ER_WRONG_VALUE_FOR_VAR ,"42000", "" }, -{ ER_WRONG_TYPE_FOR_VAR ,"42000", "" }, -{ ER_CANT_USE_OPTION_HERE ,"42000", "" }, -{ ER_NOT_SUPPORTED_YET ,"42000", "" }, -{ ER_WRONG_FK_DEF ,"42000", "" }, -{ ER_OPERAND_COLUMNS ,"21000", "" }, -{ ER_SUBQUERY_NO_1_ROW ,"21000", "" }, -{ ER_ILLEGAL_REFERENCE ,"42S22", "" }, -{ ER_DERIVED_MUST_HAVE_ALIAS ,"42000", "" }, -{ ER_SELECT_REDUCED ,"01000", "" }, -{ ER_TABLENAME_NOT_ALLOWED_HERE ,"42000", "" }, -{ ER_NOT_SUPPORTED_AUTH_MODE ,"08004", "" }, -{ ER_SPATIAL_CANT_HAVE_NULL ,"42000", "" }, -{ ER_COLLATION_CHARSET_MISMATCH ,"42000", "" }, -{ ER_WARN_TOO_FEW_RECORDS ,"01000", "" }, -{ ER_WARN_TOO_MANY_RECORDS ,"01000", "" }, -{ ER_WARN_NULL_TO_NOTNULL ,"22004", "" }, -{ ER_WARN_DATA_OUT_OF_RANGE ,"22003", "" }, -{ WARN_DATA_TRUNCATED ,"01000", "" }, -{ ER_WRONG_NAME_FOR_INDEX ,"42000", "" }, -{ ER_WRONG_NAME_FOR_CATALOG ,"42000", "" }, -{ ER_UNKNOWN_STORAGE_ENGINE ,"42000", "" }, -{ ER_TRUNCATED_WRONG_VALUE ,"22007", "" }, -{ ER_SP_NO_RECURSIVE_CREATE ,"2F003", "" }, -{ ER_SP_ALREADY_EXISTS ,"42000", "" }, -{ ER_SP_DOES_NOT_EXIST ,"42000", "" }, -{ ER_SP_LILABEL_MISMATCH ,"42000", "" }, -{ ER_SP_LABEL_REDEFINE ,"42000", "" }, -{ ER_SP_LABEL_MISMATCH ,"42000", "" }, -{ ER_SP_UNINIT_VAR ,"01000", "" }, -{ ER_SP_BADSELECT ,"0A000", "" }, -{ ER_SP_BADRETURN ,"42000", "" }, -{ ER_SP_BADSTATEMENT ,"0A000", "" }, -{ ER_UPDATE_LOG_DEPRECATED_IGNORED ,"42000", "" }, -{ ER_UPDATE_LOG_DEPRECATED_TRANSLATED ,"42000", "" }, -{ ER_QUERY_INTERRUPTED ,"70100", "" }, -{ ER_SP_WRONG_NO_OF_ARGS ,"42000", "" }, -{ ER_SP_COND_MISMATCH ,"42000", "" }, -{ ER_SP_NORETURN ,"42000", "" }, -{ ER_SP_NORETURNEND ,"2F005", "" }, -{ ER_SP_BAD_CURSOR_QUERY ,"42000", "" }, -{ ER_SP_BAD_CURSOR_SELECT ,"42000", "" }, -{ ER_SP_CURSOR_MISMATCH ,"42000", "" }, -{ ER_SP_CURSOR_ALREADY_OPEN ,"24000", "" }, -{ ER_SP_CURSOR_NOT_OPEN ,"24000", "" }, -{ ER_SP_UNDECLARED_VAR ,"42000", "" }, -{ ER_SP_FETCH_NO_DATA ,"02000", "" }, -{ ER_SP_DUP_PARAM ,"42000", "" }, -{ ER_SP_DUP_VAR ,"42000", "" }, -{ ER_SP_DUP_COND ,"42000", "" }, -{ ER_SP_DUP_CURS ,"42000", "" }, -{ ER_SP_SUBSELECT_NYI ,"0A000", "" }, -{ ER_STMT_NOT_ALLOWED_IN_SF_OR_TRG ,"0A000", "" }, -{ ER_SP_VARCOND_AFTER_CURSHNDLR ,"42000", "" }, -{ ER_SP_CURSOR_AFTER_HANDLER ,"42000", "" }, -{ ER_SP_CASE_NOT_FOUND ,"20000", "" }, -{ ER_DIVISION_BY_ZERO ,"22012", "" }, -{ ER_ILLEGAL_VALUE_FOR_TYPE ,"22007", "" }, -{ ER_PROCACCESS_DENIED_ERROR ,"42000", "" }, -{ ER_XAER_NOTA ,"XAE04", "" }, -{ ER_XAER_INVAL ,"XAE05", "" }, -{ ER_XAER_RMFAIL ,"XAE07", "" }, -{ ER_XAER_OUTSIDE ,"XAE09", "" }, -{ ER_XAER_RMERR ,"XAE03", "" }, -{ ER_XA_RBROLLBACK ,"XA100", "" }, -{ ER_NONEXISTING_PROC_GRANT ,"42000", "" }, -{ ER_DATA_TOO_LONG ,"22001", "" }, -{ ER_SP_BAD_SQLSTATE ,"42000", "" }, -{ ER_CANT_CREATE_USER_WITH_GRANT ,"42000", "" }, -{ ER_SP_DUP_HANDLER ,"42000", "" }, -{ ER_SP_NOT_VAR_ARG ,"42000", "" }, -{ ER_SP_NO_RETSET ,"0A000", "" }, -{ ER_CANT_CREATE_GEOMETRY_OBJECT ,"22003", "" }, -{ ER_TOO_BIG_SCALE ,"42000", "S1009" }, -{ ER_TOO_BIG_PRECISION ,"42000", "S1009" }, -{ ER_M_BIGGER_THAN_D ,"42000", "S1009" }, -{ ER_TOO_LONG_BODY ,"42000", "S1009" }, -{ ER_TOO_BIG_DISPLAYWIDTH ,"42000", "S1009" }, -{ ER_XAER_DUPID ,"XAE08", "" }, -{ ER_DATETIME_FUNCTION_OVERFLOW ,"22008", "" }, -{ ER_ROW_IS_REFERENCED_2 ,"23000", "" }, -{ ER_NO_REFERENCED_ROW_2 ,"23000", "" }, -{ ER_SP_BAD_VAR_SHADOW ,"42000", "" }, -{ ER_SP_WRONG_NAME ,"42000", "" }, -{ ER_SP_NO_AGGREGATE ,"42000", "" }, -{ ER_MAX_PREPARED_STMT_COUNT_REACHED ,"42000", "" }, -{ ER_NON_GROUPING_FIELD_USED ,"42000", "" }, -{ ER_FOREIGN_DUPLICATE_KEY ,"23000", "S1009" }, -{ ER_CANT_CHANGE_TX_ISOLATION ,"25001", "" }, -{ ER_WRONG_PARAMCOUNT_TO_NATIVE_FCT ,"42000", "" }, -{ ER_WRONG_PARAMETERS_TO_NATIVE_FCT ,"42000", "" }, -{ ER_WRONG_PARAMETERS_TO_STORED_FCT ,"42000", "" }, -{ ER_DUP_ENTRY_WITH_KEY_NAME ,"23000", "S1009" }, -{ ER_XA_RBTIMEOUT ,"XA106", "" }, -{ ER_XA_RBDEADLOCK ,"XA102", "" }, -{ ER_FUNC_INEXISTENT_NAME_COLLISION ,"42000", "" }, -{ ER_DUP_SIGNAL_SET ,"42000", "" }, -{ ER_SIGNAL_WARN ,"01000", "" }, -{ ER_SIGNAL_NOT_FOUND ,"02000", "" }, -{ ER_SIGNAL_EXCEPTION ,"HY000", "" }, -{ ER_RESIGNAL_WITHOUT_ACTIVE_HANDLER ,"0K000", "" }, -{ ER_SPATIAL_MUST_HAVE_GEOM_COL ,"42000", "" }, -{ ER_DATA_OUT_OF_RANGE ,"22003", "" }, -{ ER_ACCESS_DENIED_NO_PASSWORD_ERROR ,"28000", "" }, -{ ER_TRUNCATE_ILLEGAL_FK ,"42000", "" }, diff --git a/dep/mysqllite/include/sslopt-case.h b/dep/mysqllite/include/sslopt-case.h deleted file mode 100644 index 3b64a225fe2..00000000000 --- a/dep/mysqllite/include/sslopt-case.h +++ /dev/null @@ -1,32 +0,0 @@ -#ifndef SSLOPT_CASE_INCLUDED -#define SSLOPT_CASE_INCLUDED - -/* 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 */ - -#if defined(HAVE_OPENSSL) && !defined(EMBEDDED_LIBRARY) - case OPT_SSL_KEY: - case OPT_SSL_CERT: - case OPT_SSL_CA: - case OPT_SSL_CAPATH: - case OPT_SSL_CIPHER: - /* - Enable use of SSL if we are using any ssl option - One can disable SSL later by using --skip-ssl or --ssl=0 - */ - opt_use_ssl= 1; - break; -#endif -#endif /* SSLOPT_CASE_INCLUDED */ diff --git a/dep/mysqllite/include/sslopt-longopts.h b/dep/mysqllite/include/sslopt-longopts.h deleted file mode 100644 index 5315b2e12b1..00000000000 --- a/dep/mysqllite/include/sslopt-longopts.h +++ /dev/null @@ -1,49 +0,0 @@ -#ifndef SSLOPT_LONGOPTS_INCLUDED -#define SSLOPT_LONGOPTS_INCLUDED - -/* 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 */ - -#if defined(HAVE_OPENSSL) && !defined(EMBEDDED_LIBRARY) - - {"ssl", OPT_SSL_SSL, - "Enable SSL for connection (automatically enabled with other flags).", - &opt_use_ssl, &opt_use_ssl, 0, GET_BOOL, OPT_ARG, 0, 0, 0, 0, 0, 0}, - {"ssl-ca", OPT_SSL_CA, - "CA file in PEM format (check OpenSSL docs, implies --ssl).", - &opt_ssl_ca, &opt_ssl_ca, 0, GET_STR, REQUIRED_ARG, - 0, 0, 0, 0, 0, 0}, - {"ssl-capath", OPT_SSL_CAPATH, - "CA directory (check OpenSSL docs, implies --ssl).", - &opt_ssl_capath, &opt_ssl_capath, 0, GET_STR, REQUIRED_ARG, - 0, 0, 0, 0, 0, 0}, - {"ssl-cert", OPT_SSL_CERT, "X509 cert in PEM format (implies --ssl).", - &opt_ssl_cert, &opt_ssl_cert, 0, GET_STR, REQUIRED_ARG, - 0, 0, 0, 0, 0, 0}, - {"ssl-cipher", OPT_SSL_CIPHER, "SSL cipher to use (implies --ssl).", - &opt_ssl_cipher, &opt_ssl_cipher, 0, GET_STR, REQUIRED_ARG, - 0, 0, 0, 0, 0, 0}, - {"ssl-key", OPT_SSL_KEY, "X509 key in PEM format (implies --ssl).", - &opt_ssl_key, &opt_ssl_key, 0, GET_STR, REQUIRED_ARG, - 0, 0, 0, 0, 0, 0}, -#ifdef MYSQL_CLIENT - {"ssl-verify-server-cert", OPT_SSL_VERIFY_SERVER_CERT, - "Verify server's \"Common Name\" in its cert against hostname used " - "when connecting. This option is disabled by default.", - &opt_ssl_verify_server_cert, &opt_ssl_verify_server_cert, - 0, GET_BOOL, OPT_ARG, 0, 0, 0, 0, 0, 0}, -#endif -#endif /* HAVE_OPENSSL */ -#endif /* SSLOPT_LONGOPTS_INCLUDED */ diff --git a/dep/mysqllite/include/sslopt-vars.h b/dep/mysqllite/include/sslopt-vars.h deleted file mode 100644 index d0eec3b6d74..00000000000 --- a/dep/mysqllite/include/sslopt-vars.h +++ /dev/null @@ -1,35 +0,0 @@ -#ifndef SSLOPT_VARS_INCLUDED -#define SSLOPT_VARS_INCLUDED - -/* 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 */ - -#if defined(HAVE_OPENSSL) && !defined(EMBEDDED_LIBRARY) -#ifdef SSL_VARS_NOT_STATIC -#define SSL_STATIC -#else -#define SSL_STATIC static -#endif -SSL_STATIC my_bool opt_use_ssl = 0; -SSL_STATIC char *opt_ssl_ca = 0; -SSL_STATIC char *opt_ssl_capath = 0; -SSL_STATIC char *opt_ssl_cert = 0; -SSL_STATIC char *opt_ssl_cipher = 0; -SSL_STATIC char *opt_ssl_key = 0; -#ifdef MYSQL_CLIENT -SSL_STATIC my_bool opt_ssl_verify_server_cert= 0; -#endif -#endif -#endif /* SSLOPT_VARS_INCLUDED */ diff --git a/dep/mysqllite/include/typelib.h b/dep/mysqllite/include/typelib.h deleted file mode 100644 index 3badb14c96e..00000000000 --- a/dep/mysqllite/include/typelib.h +++ /dev/null @@ -1,44 +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 */ - - -#ifndef _typelib_h -#define _typelib_h - -#include "my_alloc.h" - -typedef struct st_typelib { /* Different types saved here */ - unsigned int count; /* How many types */ - const char *name; /* Name of typelib */ - const char **type_names; - unsigned int *type_lengths; -} TYPELIB; - -extern my_ulonglong find_typeset(char *x, TYPELIB *typelib,int *error_position); -extern int find_type_or_exit(const char *x, TYPELIB *typelib, - const char *option); -extern int find_type(char *x, const TYPELIB *typelib, unsigned int full_name); -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, unsigned int default_name, - my_ulonglong cur_set, my_ulonglong default_set, - const char *str, unsigned int length, - char **err_pos, unsigned int *err_len); - -#endif /* _typelib_h */ |
