diff options
author | Sergei Golubchik <sergii@pisem.net> | 2012-10-19 20:38:59 +0200 |
---|---|---|
committer | Sergei Golubchik <sergii@pisem.net> | 2012-10-19 20:38:59 +0200 |
commit | e1f681c99b3e5462c033aaafa94ac295e626cde2 (patch) | |
tree | 2da5eff1a0d03831c2d85b32a7bc3df6ec37b522 /include | |
parent | 52c84d144d3b07966d9b3bab8694eb012eef69ce (diff) | |
parent | 807fef40fffbbb8e92564a52b902b504ba8cfcdc (diff) | |
download | mariadb-git-e1f681c99b3e5462c033aaafa94ac295e626cde2.tar.gz |
10.0-base -> 10.0-monty
Diffstat (limited to 'include')
-rw-r--r-- | include/CMakeLists.txt | 1 | ||||
-rw-r--r-- | include/atomic/nolock.h | 2 | ||||
-rw-r--r-- | include/handler_state.h | 21 | ||||
-rw-r--r-- | include/lf.h | 2 | ||||
-rw-r--r-- | include/m_string.h | 6 | ||||
-rw-r--r-- | include/my_getopt.h | 4 | ||||
-rw-r--r-- | include/my_global.h | 28 | ||||
-rw-r--r-- | include/my_net.h | 2 | ||||
-rw-r--r-- | include/my_pthread.h | 68 | ||||
-rw-r--r-- | include/my_sys.h | 6 | ||||
-rw-r--r-- | include/mysql/plugin.h | 2 | ||||
-rw-r--r-- | include/mysql/plugin_audit.h.pp | 2 | ||||
-rw-r--r-- | include/mysql/plugin_auth.h.pp | 2 | ||||
-rw-r--r-- | include/mysql/plugin_ftparser.h.pp | 2 | ||||
-rw-r--r-- | include/sql_common.h | 9 |
15 files changed, 47 insertions, 110 deletions
diff --git a/include/CMakeLists.txt b/include/CMakeLists.txt index 8ff613155d3..acb187aeb63 100644 --- a/include/CMakeLists.txt +++ b/include/CMakeLists.txt @@ -52,6 +52,7 @@ SET(HEADERS m_ctype.h my_attribute.h my_compiler.h + handler_state.h ) INSTALL(FILES ${HEADERS} DESTINATION ${INSTALL_INCLUDEDIR} COMPONENT Development) diff --git a/include/atomic/nolock.h b/include/atomic/nolock.h index 1da184158ab..56f37644f96 100644 --- a/include/atomic/nolock.h +++ b/include/atomic/nolock.h @@ -36,7 +36,7 @@ choose the Solaris implementation on Solaris (mainly for SunStudio compilers). */ -# if defined(_MSV_VER) +# if defined(_MSC_VER) # include "generic-msvc.h" # elif __GNUC__ # if defined(HAVE_SOLARIS_ATOMIC) diff --git a/include/handler_state.h b/include/handler_state.h new file mode 100644 index 00000000000..65604a672fb --- /dev/null +++ b/include/handler_state.h @@ -0,0 +1,21 @@ +/* + Map handler error message to sql states. Note that this list MUST be in + increasing order! + See sql_state.c for usage +*/ + +{ HA_ERR_KEY_NOT_FOUND, "02000", "" }, +{ HA_ERR_FOUND_DUPP_KEY, "23000", "" }, +{ HA_ERR_WRONG_COMMAND, "0A000", "" }, +{ HA_ERR_UNSUPPORTED, "0A000", "" }, +{ HA_WRONG_CREATE_OPTION, "0A000", "" }, +{ HA_ERR_FOUND_DUPP_UNIQUE, "23000", "" }, +{ HA_ERR_UNKNOWN_CHARSET, "0A000", "" }, +{ HA_ERR_READ_ONLY_TRANSACTION, "25000", "" }, +{ HA_ERR_LOCK_DEADLOCK, "40001", "" }, +{ HA_ERR_NO_REFERENCED_ROW, "23000", "" }, +{ HA_ERR_ROW_IS_REFERENCED, "23000", "" }, +{ HA_ERR_TABLE_EXIST, "42S01", "" }, +{ HA_ERR_FOREIGN_DUPLICATE_KEY, "23000", "" }, +{ HA_ERR_TABLE_READONLY, "25000", "" }, +{ HA_ERR_AUTOINC_ERANGE, "22003", "" }, diff --git a/include/lf.h b/include/lf.h index cdd24c07502..07769d10943 100644 --- a/include/lf.h +++ b/include/lf.h @@ -95,7 +95,7 @@ nolock_wrap(lf_dynarray_iterate, int, */ #define LF_PINBOX_PINS 4 -#define LF_PURGATORY_SIZE 10 +#define LF_PURGATORY_SIZE 100 typedef void lf_pinbox_free_func(void *, void *, void*); diff --git a/include/m_string.h b/include/m_string.h index 9fc6cda4764..9efa0376942 100644 --- a/include/m_string.h +++ b/include/m_string.h @@ -62,13 +62,9 @@ # define bmove_align(A,B,C) memcpy((A),(B),(C)) -#if !defined(HAVE_BCMP) # define bcmp(A,B,C) memcmp((A),(B),(C)) -#endif -#if !defined(bzero) && (!defined(HAVE_BZERO) || !HAVE_DECL_BZERO || defined(_AIX)) -/* See autoconf doku: "HAVE_DECL_symbol" will be defined after configure, to 0 or 1 */ -/* AIX has bzero() as a function, but the declaration prototype is strangely hidden */ +#if !defined(bzero) # define bzero(A,B) memset((A),0,(B)) #endif diff --git a/include/my_getopt.h b/include/my_getopt.h index 650f6300796..589d9c9880c 100644 --- a/include/my_getopt.h +++ b/include/my_getopt.h @@ -1,5 +1,5 @@ /* - Copyright (c) 2002, 2011, Oracle and/or its affiliates. + Copyright (c) 2002, 2012, Oracle and/or its affiliates. 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 @@ -79,7 +79,7 @@ struct my_option 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) */ + ulonglong 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 */ diff --git a/include/my_global.h b/include/my_global.h index a6d3a595d3e..ed9ac83cfe6 100644 --- a/include/my_global.h +++ b/include/my_global.h @@ -218,11 +218,6 @@ #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 */ @@ -295,18 +290,6 @@ inline double my_ulonglong2double(unsigned long long A) { return (double 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_INITGROUPS /* For AIX 4.3 */ #undef HAVE_INITGROUPS #endif @@ -812,18 +795,7 @@ inline unsigned long long my_double2ulonglong(double d) #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 diff --git a/include/my_net.h b/include/my_net.h index 8c62790bf51..60dcd1dead2 100644 --- a/include/my_net.h +++ b/include/my_net.h @@ -43,7 +43,7 @@ C_MODE_START #include <sys/ioctl.h> #endif -#if !defined(__WIN__) && !defined(HAVE_BROKEN_NETINET_INCLUDES) +#if !defined(__WIN__) #include <netinet/in_systm.h> #include <netinet/in.h> #include <netinet/ip.h> diff --git a/include/my_pthread.h b/include/my_pthread.h index d10dd283555..5872f7c5904 100644 --- a/include/my_pthread.h +++ b/include/my_pthread.h @@ -201,28 +201,13 @@ extern int my_pthread_create_detached; 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_noposix_init((a),(b)) -extern int my_pthread_mutex_noposix_init(pthread_mutex_t *mp, - const pthread_mutexattr_t *attr); -#endif /* SAFE_MUTEX */ -#define pthread_cond_init(a,b) my_pthread_cond_noposix_init((a),(b)) -extern int my_pthread_cond_noposix_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) +#if !defined(HAVE_SIGWAIT) && !defined(HAVE_rts_threads) && !defined(sigwait) && !defined(alpha_linux_port) && !defined(_AIX) int sigwait(sigset_t *setp, int *sigp); /* Use our implemention */ #endif @@ -248,24 +233,12 @@ int sigwait(sigset_t *setp, int *sigp); /* Use our implemention */ #define my_sigset(A,B) signal((A),(B)) #endif -#if !defined(HAVE_PTHREAD_ATTR_SETSCOPE) || defined(HAVE_DEC_3_2_THREADS) +#if !defined(HAVE_PTHREAD_ATTR_SETSCOPE) #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); @@ -286,34 +259,7 @@ struct tm *gmtime_r(const time_t *clock, struct tm *res); #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) +#if defined(HAVE_PTHREAD_ATTR_CREATE) && !defined(HAVE_SIGWAIT) /* 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) ?\ @@ -353,7 +299,7 @@ void my_pthread_attr_getstacksize(pthread_attr_t *attrib, size_t *size); int my_pthread_mutex_trylock(pthread_mutex_t *mutex); #endif -#if !defined(HAVE_PTHREAD_YIELD_ONE_ARG) && !defined(HAVE_PTHREAD_YIELD_ZERO_ARG) +#if !defined(HAVE_PTHREAD_YIELD_ZERO_ARG) /* no pthread_yield() available */ #ifdef HAVE_SCHED_YIELD #define pthread_yield() sched_yield() @@ -514,12 +460,6 @@ int my_pthread_fastmutex_lock(my_pthread_fastmutex_t *mp); /* 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 diff --git a/include/my_sys.h b/include/my_sys.h index f4f41b3b108..30513d17e0a 100644 --- a/include/my_sys.h +++ b/include/my_sys.h @@ -85,6 +85,7 @@ typedef struct my_aio_result { #define MY_THREADSAFE 2048 /* my_seek(): lock fd mutex */ #define MY_SYNC 4096 /* my_copy(): sync dst file */ #define MY_SYNC_DIR 32768 /* my_create/delete/rename: sync directory */ +#define MY_SYNC_FILESIZE 65536 /* my_sync(): safe sync when file is extended */ #define MY_CHECK_ERROR 1 /* Params to my_end; Check open-close */ #define MY_GIVE_INFO 2 /* Give time info about process*/ @@ -634,6 +635,7 @@ extern FILE *my_freopen(const char *path, const char *mode, FILE *stream); extern int my_fclose(FILE *fd,myf MyFlags); extern int my_vfprintf(FILE *stream, const char* format, va_list args); extern void my_strerror(char *buf, size_t len, int nr); +extern int my_fprintf(FILE *stream, const char* format, ...); extern File my_fileno(FILE *fd); extern int my_chsize(File fd,my_off_t newlength, int filler, myf MyFlags); extern int my_chmod(const char *name, mode_t mode, myf my_flags); @@ -682,6 +684,7 @@ 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_ext2(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); @@ -717,6 +720,7 @@ extern int flush_write_cache(RECORD_CACHE *info); extern void handle_recived_signals(void); extern sig_handler my_set_alarm_variable(int signo); +extern my_bool radixsort_is_appliccable(uint n_items, size_t size_of_element); 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[]); @@ -758,6 +762,8 @@ 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_write_backtick_quote(IO_CACHE *info, const char *str, + size_t len); 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, diff --git a/include/mysql/plugin.h b/include/mysql/plugin.h index b73f2d75193..b8e90f764bd 100644 --- a/include/mysql/plugin.h +++ b/include/mysql/plugin.h @@ -167,7 +167,7 @@ enum enum_mysql_show_type SHOW_UNDEF, SHOW_BOOL, SHOW_UINT, SHOW_ULONG, SHOW_ULONGLONG, SHOW_CHAR, SHOW_CHAR_PTR, SHOW_ARRAY, SHOW_FUNC, SHOW_DOUBLE, - SHOW_SINT, SHOW_SLONG, SHOW_SLONGLONG, + SHOW_SINT, SHOW_SLONG, SHOW_SLONGLONG, SHOW_SIMPLE_FUNC, SHOW_always_last }; diff --git a/include/mysql/plugin_audit.h.pp b/include/mysql/plugin_audit.h.pp index b987f690592..dea2446ac9c 100644 --- a/include/mysql/plugin_audit.h.pp +++ b/include/mysql/plugin_audit.h.pp @@ -94,7 +94,7 @@ enum enum_mysql_show_type SHOW_UNDEF, SHOW_BOOL, SHOW_UINT, SHOW_ULONG, SHOW_ULONGLONG, SHOW_CHAR, SHOW_CHAR_PTR, SHOW_ARRAY, SHOW_FUNC, SHOW_DOUBLE, - SHOW_SINT, SHOW_SLONG, SHOW_SLONGLONG, + SHOW_SINT, SHOW_SLONG, SHOW_SLONGLONG, SHOW_SIMPLE_FUNC, SHOW_always_last }; struct st_mysql_show_var { diff --git a/include/mysql/plugin_auth.h.pp b/include/mysql/plugin_auth.h.pp index 113aaf62d19..f1213a73bc6 100644 --- a/include/mysql/plugin_auth.h.pp +++ b/include/mysql/plugin_auth.h.pp @@ -94,7 +94,7 @@ enum enum_mysql_show_type SHOW_UNDEF, SHOW_BOOL, SHOW_UINT, SHOW_ULONG, SHOW_ULONGLONG, SHOW_CHAR, SHOW_CHAR_PTR, SHOW_ARRAY, SHOW_FUNC, SHOW_DOUBLE, - SHOW_SINT, SHOW_SLONG, SHOW_SLONGLONG, + SHOW_SINT, SHOW_SLONG, SHOW_SLONGLONG, SHOW_SIMPLE_FUNC, SHOW_always_last }; struct st_mysql_show_var { diff --git a/include/mysql/plugin_ftparser.h.pp b/include/mysql/plugin_ftparser.h.pp index 6011e7f7519..74b298098dd 100644 --- a/include/mysql/plugin_ftparser.h.pp +++ b/include/mysql/plugin_ftparser.h.pp @@ -94,7 +94,7 @@ enum enum_mysql_show_type SHOW_UNDEF, SHOW_BOOL, SHOW_UINT, SHOW_ULONG, SHOW_ULONGLONG, SHOW_CHAR, SHOW_CHAR_PTR, SHOW_ARRAY, SHOW_FUNC, SHOW_DOUBLE, - SHOW_SINT, SHOW_SLONG, SHOW_SLONGLONG, + SHOW_SINT, SHOW_SLONG, SHOW_SLONGLONG, SHOW_SIMPLE_FUNC, SHOW_always_last }; struct st_mysql_show_var { diff --git a/include/sql_common.h b/include/sql_common.h index 99abdb2bf72..406a87010fb 100644 --- a/include/sql_common.h +++ b/include/sql_common.h @@ -1,7 +1,7 @@ #ifndef SQL_COMMON_INCLUDED #define SQL_COMMON_INCLUDED -/* Copyright (c) 2003, 2010, Oracle and/or its affiliates. - Copyright (c) 2010, 2011, Monty Program Ab +/* Copyright (c) 2003, 2012, Oracle and/or its affiliates. + Copyright (c) 2010, 2012, Monty Program 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 @@ -82,8 +82,9 @@ typedef struct st_mysql_methods 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); +MYSQL_FIELD *unpack_fields(MYSQL *mysql, 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); |