diff options
author | Alexey Kopytov <Alexey.Kopytov@Sun.com> | 2009-12-28 15:54:16 +0300 |
---|---|---|
committer | Alexey Kopytov <Alexey.Kopytov@Sun.com> | 2009-12-28 15:54:16 +0300 |
commit | 6c716007d13ffd74bb5c3dd7c512d4d7026a23d8 (patch) | |
tree | 0bab5217d4ea83929d314c2ce29f962a949c95c8 /include | |
parent | c3eabe01fc30ee38f64b17fabfd58c6328751660 (diff) | |
parent | e7441f0b602735e2c40b0e0e7cfb01a2443aaa5a (diff) | |
download | mariadb-git-6c716007d13ffd74bb5c3dd7c512d4d7026a23d8.tar.gz |
Manual merge of WL#4738 from mysql-next-mr:
- backported code that handles %f/%g arguments in
my_vsnprintf.c from 6.0
- backported %f/%g tests in unittest/mysys/my_vsnprintf-t.c
from 6.0
- replaced snprintf("%g") in sql/set_var.cc with my_gcvt()
- removed unnecessary "--replace-result"s for Windows in
mysql-test/suite/sys_vars/t/long_query_time_basic.test
- some test results adjustments
Diffstat (limited to 'include')
-rw-r--r-- | include/atomic/nolock.h | 6 | ||||
-rw-r--r-- | include/atomic/solaris.h | 248 | ||||
-rw-r--r-- | include/config-netware.h | 2 | ||||
-rw-r--r-- | include/config-win.h | 6 | ||||
-rw-r--r-- | include/ft_global.h | 4 | ||||
-rw-r--r-- | include/keycache.h | 8 | ||||
-rw-r--r-- | include/m_string.h | 12 | ||||
-rw-r--r-- | include/my_atomic.h | 4 | ||||
-rw-r--r-- | include/my_base.h | 11 | ||||
-rw-r--r-- | include/my_getopt.h | 51 | ||||
-rw-r--r-- | include/my_global.h | 39 | ||||
-rw-r--r-- | include/my_pthread.h | 3 | ||||
-rw-r--r-- | include/my_time.h | 6 | ||||
-rw-r--r-- | include/myisam.h | 2 | ||||
-rw-r--r-- | include/mysql.h.pp | 4 | ||||
-rw-r--r-- | include/mysql/plugin.h | 1 | ||||
-rw-r--r-- | include/mysql/plugin.h.pp | 1 | ||||
-rw-r--r-- | include/mysql/service_my_snprintf.h | 2 | ||||
-rw-r--r-- | include/sslopt-longopts.h | 6 | ||||
-rw-r--r-- | include/typelib.h | 5 |
20 files changed, 139 insertions, 282 deletions
diff --git a/include/atomic/nolock.h b/include/atomic/nolock.h index 9ec5eb5a2fd..5a0c41d9078 100644 --- a/include/atomic/nolock.h +++ b/include/atomic/nolock.h @@ -50,11 +50,7 @@ # endif #endif -#if defined(make_atomic_cas_body) || defined(MY_ATOMICS_MADE) -/* - * We have atomics that require no locking - */ -#define MY_ATOMIC_NOLOCK +#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). diff --git a/include/atomic/solaris.h b/include/atomic/solaris.h index 34c0c6de0ed..fc9f369c707 100644 --- a/include/atomic/solaris.h +++ b/include/atomic/solaris.h @@ -13,242 +13,54 @@ 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" -/* - * This is defined to indicate we fully define the my_atomic_* (inline) - * functions here, so there is no need to "make" them in my_atomic.h - * using make_atomic_* and make_atomic_*_body. - */ -#define MY_ATOMICS_MADE - -STATIC_INLINE int -my_atomic_cas8(int8 volatile *a, int8 *cmp, int8 set) -{ - int ret; - int8 sav; - sav = (int8) atomic_cas_8((volatile uint8_t *)a, (uint8_t)*cmp, - (uint8_t)set); - if (! (ret = (sav == *cmp))) - *cmp = sav; - return ret; -} - -STATIC_INLINE int -my_atomic_cas16(int16 volatile *a, int16 *cmp, int16 set) -{ - int ret; - int16 sav; - sav = (int16) atomic_cas_16((volatile uint16_t *)a, (uint16_t)*cmp, - (uint16_t)set); - if (! (ret = (sav == *cmp))) - *cmp = sav; - return ret; -} - -STATIC_INLINE int -my_atomic_cas32(int32 volatile *a, int32 *cmp, int32 set) -{ - int ret; - int32 sav; - sav = (int32) atomic_cas_32((volatile uint32_t *)a, (uint32_t)*cmp, - (uint32_t)set); - if (! (ret = (sav == *cmp))) - *cmp = sav; - return ret; -} - -STATIC_INLINE int -my_atomic_cas64(int64 volatile *a, int64 *cmp, int64 set) -{ - int ret; - int64 sav; - sav = (int64) atomic_cas_64((volatile uint64_t *)a, (uint64_t)*cmp, - (uint64_t)set); - if (! (ret = (sav == *cmp))) - *cmp = sav; - return ret; -} - -STATIC_INLINE int -my_atomic_casptr(void * volatile *a, void **cmp, void *set) -{ - int ret; - void *sav; - sav = atomic_cas_ptr(a, *cmp, set); - if (! (ret = (sav == *cmp))) - *cmp = sav; - return ret; -} +#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) \ + uint ## S ## _t sav; \ + sav = atomic_cas_ ## S( \ + (volatile uint ## S ## _t *)a, \ + (uint ## S ## _t)*cmp, \ + (uint ## S ## _t)set); \ + if (! (ret= (sav == *cmp))) \ + *cmp= sav; -STATIC_INLINE int8 -my_atomic_add8(int8 volatile *a, int8 v) -{ - int8 nv; - nv = atomic_add_8_nv((volatile uint8_t *)a, v); - return (nv - v); -} - -STATIC_INLINE int16 -my_atomic_add16(int16 volatile *a, int16 v) -{ - int16 nv; - nv = atomic_add_16_nv((volatile uint16_t *)a, v); - return (nv - v); -} - -STATIC_INLINE int32 -my_atomic_add32(int32 volatile *a, int32 v) -{ - int32 nv; - nv = atomic_add_32_nv((volatile uint32_t *)a, v); - return (nv - v); -} - -STATIC_INLINE int64 -my_atomic_add64(int64 volatile *a, int64 v) -{ - int64 nv; - nv = atomic_add_64_nv((volatile uint64_t *)a, v); - return (nv - v); -} +#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 -STATIC_INLINE int8 -my_atomic_load8(int8 volatile *a) { return (*a); } - -STATIC_INLINE int16 -my_atomic_load16(int16 volatile *a) { return (*a); } - -STATIC_INLINE int32 -my_atomic_load32(int32 volatile *a) { return (*a); } - -STATIC_INLINE int64 -my_atomic_load64(int64 volatile *a) { return (*a); } - -STATIC_INLINE void * -my_atomic_loadptr(void * volatile *a) { return (*a); } - -/* ------------------------------------------------------------------------ */ - -STATIC_INLINE void -my_atomic_store8(int8 volatile *a, int8 v) { *a = v; } +#define make_atomic_load_body(S) ret= *a +#define make_atomic_store_body(S) *a= v -STATIC_INLINE void -my_atomic_store16(int16 volatile *a, int16 v) { *a = v; } - -STATIC_INLINE void -my_atomic_store32(int32 volatile *a, int32 v) { *a = v; } +#else /* MY_ATOMIC_MODE_DUMMY */ -STATIC_INLINE void -my_atomic_store64(int64 volatile *a, int64 v) { *a = v; } +#define make_atomic_load_body(S) \ + ret= atomic_or_ ## S ## _nv((volatile uint ## S ## _t *)a, 0) -STATIC_INLINE void -my_atomic_storeptr(void * volatile *a, void *v) { *a = v; } +#define make_atomic_store_body(S) \ + (void) atomic_swap_ ## S((volatile uint ## S ## _t *)a, (uint ## S ## _t)v) -/* ------------------------------------------------------------------------ */ - -#else /* MY_ATOMIC_MODE_DUMMY */ +#endif -STATIC_INLINE int8 -my_atomic_load8(int8 volatile *a) -{ - return ((int8) atomic_or_8_nv((volatile uint8_t *)a, 0)); -} - -STATIC_INLINE int16 -my_atomic_load16(int16 volatile *a) -{ - return ((int16) atomic_or_16_nv((volatile uint16_t *)a, 0)); -} - -STATIC_INLINE int32 -my_atomic_load32(int32 volatile *a) -{ - return ((int32) atomic_or_32_nv((volatile uint32_t *)a, 0)); -} - -STATIC_INLINE int64 -my_atomic_load64(int64 volatile *a) -{ - return ((int64) atomic_or_64_nv((volatile uint64_t *)a, 0)); -} - -STATIC_INLINE void * -my_atomic_loadptr(void * volatile *a) -{ - return ((void *) atomic_or_ulong_nv((volatile ulong_t *)a, 0)); -} +#define make_atomic_fas_body(S) \ + v= atomic_swap_ ## S((volatile uint ## S ## _t *)a, (uint ## S ## _t)v) -/* ------------------------------------------------------------------------ */ +#else /* cleanup */ -STATIC_INLINE void -my_atomic_store8(int8 volatile *a, int8 v) -{ - (void) atomic_swap_8((volatile uint8_t *)a, (uint8_t)v); -} - -STATIC_INLINE void -my_atomic_store16(int16 volatile *a, int16 v) -{ - (void) atomic_swap_16((volatile uint16_t *)a, (uint16_t)v); -} - -STATIC_INLINE void -my_atomic_store32(int32 volatile *a, int32 v) -{ - (void) atomic_swap_32((volatile uint32_t *)a, (uint32_t)v); -} - -STATIC_INLINE void -my_atomic_store64(int64 volatile *a, int64 v) -{ - (void) atomic_swap_64((volatile uint64_t *)a, (uint64_t)v); -} - -STATIC_INLINE void -my_atomic_storeptr(void * volatile *a, void *v) -{ - (void) atomic_swap_ptr(a, v); -} +#undef uintptr_t +#undef atomic_or_ptr_nv #endif -/* ------------------------------------------------------------------------ */ - -STATIC_INLINE int8 -my_atomic_fas8(int8 volatile *a, int8 v) -{ - return ((int8) atomic_swap_8((volatile uint8_t *)a, (uint8_t)v)); -} - -STATIC_INLINE int16 -my_atomic_fas16(int16 volatile *a, int16 v) -{ - return ((int16) atomic_swap_16((volatile uint16_t *)a, (uint16_t)v)); -} - -STATIC_INLINE int32 -my_atomic_fas32(int32 volatile *a, int32 v) -{ - return ((int32) atomic_swap_32((volatile uint32_t *)a, (uint32_t)v)); -} - -STATIC_INLINE int64 -my_atomic_fas64(int64 volatile *a, int64 v) -{ - return ((int64) atomic_swap_64((volatile uint64_t *)a, (uint64_t)v)); -} - -STATIC_INLINE void * -my_atomic_fasptr(void * volatile *a, void *v) -{ - return (atomic_swap_ptr(a, v)); -} diff --git a/include/config-netware.h b/include/config-netware.h index adde3c4fbd2..a4465ea177a 100644 --- a/include/config-netware.h +++ b/include/config-netware.h @@ -100,7 +100,7 @@ extern "C" { #define USE_OLD_FUNCTIONS 1 /* no case sensitivity */ -#define FN_NO_CASE_SENCE 1 +#define FN_NO_CASE_SENSE 1 /* the thread alarm is not used */ #define DONT_USE_THR_ALARM 1 diff --git a/include/config-win.h b/include/config-win.h index 68248c09bef..f8d51165bc2 100644 --- a/include/config-win.h +++ b/include/config-win.h @@ -318,10 +318,8 @@ inline ulonglong double2ulonglong(double d) #define strcasecmp stricmp #define strncasecmp strnicmp -#ifdef NOT_USED #define HAVE_SNPRINTF /* Gave link error */ -#define _snprintf snprintf -#endif +#define snprintf _snprintf #ifdef _MSC_VER #define HAVE_LDIV /* The optimizer breaks in zortech for ldiv */ @@ -360,7 +358,7 @@ inline ulonglong double2ulonglong(double d) #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 */ +#define FN_NO_CASE_SENSE /* Files are not case-sensitive */ #define OS_FILE_LIMIT UINT_MAX /* No limit*/ #define DO_NOT_REMOVE_THREAD_WRAPPERS diff --git a/include/ft_global.h b/include/ft_global.h index 752371d6bc6..ad56bce678b 100644 --- a/include/ft_global.h +++ b/include/ft_global.h @@ -28,6 +28,8 @@ extern "C" { #define HA_FT_MAXBYTELEN 254 #define HA_FT_MAXCHARLEN (HA_FT_MAXBYTELEN/3) +#define DEFAULT_FTB_SYNTAX "+ -><()~*:\"\"&|" + typedef struct st_ft_info FT_INFO; struct _ft_vft { @@ -51,7 +53,7 @@ extern const char *ft_precompiled_stopwords[]; extern ulong ft_min_word_len; extern ulong ft_max_word_len; extern ulong ft_query_expansion_limit; -extern char ft_boolean_syntax[15]; +extern const char *ft_boolean_syntax; extern struct st_mysql_ftparser ft_default_parser; int ft_init_stopwords(void); diff --git a/include/keycache.h b/include/keycache.h index 4e715dda88d..cd5c83e144e 100644 --- a/include/keycache.h +++ b/include/keycache.h @@ -87,10 +87,10 @@ typedef struct st_key_cache initializing the key cache. */ - ulonglong param_buff_size; /* size the memory allocated for the cache */ - ulong param_block_size; /* size of the blocks in the key cache */ - ulong param_division_limit; /* min. percentage of warm blocks */ - ulong param_age_threshold; /* determines when hot block is downgraded */ + 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 */ diff --git a/include/m_string.h b/include/m_string.h index 45801ff85b7..83622a5523e 100644 --- a/include/m_string.h +++ b/include/m_string.h @@ -246,7 +246,7 @@ 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 longlong2str(A,B,C) int2str((A),(B),(C),1) +#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)) @@ -259,7 +259,7 @@ longlong my_strtoll10(const char *nptr, char **endptr, int *error); #endif #else #ifdef HAVE_LONG_LONG -extern char *longlong2str(longlong val,char *dst,int radix); +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); @@ -267,6 +267,7 @@ extern ulonglong strtoull(const char *str, char **ptr, int base); #endif #endif #endif +#define longlong2str(A,B,C) ll2str((A),(B),(C),1) /* my_vsnprintf.c */ @@ -291,6 +292,13 @@ typedef struct st_mysql_lex_string LEX_STRING; #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 diff --git a/include/my_atomic.h b/include/my_atomic.h index 751afcb77db..b506aa7d3d1 100644 --- a/include/my_atomic.h +++ b/include/my_atomic.h @@ -68,12 +68,11 @@ #include "atomic/nolock.h" #endif -#ifndef MY_ATOMIC_NOLOCK +#ifndef make_atomic_cas_body /* nolock.h was not able to generate even a CAS function, fall back */ #include "atomic/rwlock.h" #endif -#ifndef MY_ATOMICS_MADE /* define missing functions by using the already generated ones */ #ifndef make_atomic_add_body #define make_atomic_add_body(S) \ @@ -287,7 +286,6 @@ make_atomic_store(ptr) #undef make_atomic_load_body #undef make_atomic_store_body #undef make_atomic_fas_body -#endif #undef intptr /* diff --git a/include/my_base.h b/include/my_base.h index 70bd9b5e073..226a6c44733 100644 --- a/include/my_base.h +++ b/include/my_base.h @@ -275,17 +275,6 @@ enum ha_base_keytype { #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 */ -#if MYSQL_VERSION_ID < 0x50200 -/* - Key has a part that can have end space. If this is an unique key - we have to handle it differently from other unique keys as we can find - many matching rows for one key (because end space are not compared) -*/ -#define HA_END_SPACE_KEY 0 /* was: 4096 */ -#else -#error HA_END_SPACE_KEY is obsolete, please remove it -#endif - /* These flags can be added to key-seg-flag */ diff --git a/include/my_getopt.h b/include/my_getopt.h index 7cbad607aac..32380efe289 100644 --- a/include/my_getopt.h +++ b/include/my_getopt.h @@ -32,6 +32,7 @@ C_MODE_START #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 @@ -42,24 +43,40 @@ struct st_typelib; struct my_option { - const char *name; /* Name of the option */ - int id; /* unique id or short option */ - const char *comment; /* option comment, for autom. --help */ - uchar **value; /* The variable value */ - uchar **u_max_value; /* The user def. max variable value */ - struct st_typelib *typelib; /* Pointer to possible values */ - ulong var_type; - enum get_opt_arg_type arg_type; - longlong def_value; /* Default value */ - longlong min_value; /* Min allowed value */ - longlong max_value; /* Max allowed value */ - longlong sub_size; /* Subtract this from given value */ - long block_size; /* Value should be a mult. of this */ - void *app_type; /* To be used by an application */ + 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. + */ + uchar **value; /**< A pointer to the variable value */ + uchar **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, ... ); +typedef my_bool (*my_get_one_option) (int, const struct my_option *, char * ); +typedef void (*my_error_reporter) (enum loglevel level, const char *format, ... ); extern char *disabled_my_option; extern my_bool my_getopt_print_errors; @@ -78,6 +95,8 @@ 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 diff --git a/include/my_global.h b/include/my_global.h index 255958e08b0..27fac096c19 100644 --- a/include/my_global.h +++ b/include/my_global.h @@ -93,11 +93,35 @@ #define HAVE_PSI_INTERFACE #endif /* WITH_PERFSCHEMA_STORAGE_ENGINE */ -/* Make it easier to add conditionl code for windows */ +/* Make it easier to add conditional code in _expressions_ */ #ifdef __WIN__ -#define IF_WIN(A,B) (A) +#define IF_WIN(A,B) A #else -#define IF_WIN(A,B) (B) +#define IF_WIN(A,B) B +#endif + +#ifdef __NETWARE__ +#define IF_NETWARE(A,B) A +#else +#define IF_NETWARE(A,B) B +#endif + +#ifndef DBUG_OFF +#define IF_DBUG(A,B) A +#else +#define IF_DBUG(A,B) B +#endif + +#ifdef HAVE_purify +#define IF_PURIFY(A,B) A +#else +#define IF_PURIFY(A,B) B +#endif + +#ifdef DISABLE_GRANT_OPTIONS +#define IF_DISABLE_GRANT_OPTIONS(A,B) A +#else +#define IF_DISABLE_GRANT_OPTIONS(A,B) B #endif #ifndef EMBEDDED_LIBRARY @@ -249,6 +273,8 @@ #define inline_test_2(X) inline_test_1(X) #if inline_test_2(inline) != 1 #define HAVE_INLINE +#else +#warning No "inline" support in C, all "static inline" functions will be instantiated in every .o file!!! #endif #undef inline_test_2 #undef inline_test_1 @@ -489,8 +515,7 @@ C_MODE_END #define compile_time_assert(X) \ do \ { \ - char compile_time_assert[(X) ? 1 : -1] \ - __attribute__ ((unused)); \ + typedef char compile_time_assert[(X) ? 1 : -1]; \ } while(0) #endif @@ -787,7 +812,7 @@ typedef SOCKET_SIZE_TYPE size_socket; #endif /* #define EXT_IN_LIBNAME */ -/* #define FN_NO_CASE_SENCE */ +/* #define FN_NO_CASE_SENSE */ /* #define FN_UPPER_CASE TRUE */ /* @@ -810,7 +835,7 @@ typedef SOCKET_SIZE_TYPE size_socket; /* Typical record cash */ #define RECORD_CACHE_SIZE (uint) (64*1024-MALLOC_OVERHEAD) /* Typical key cash */ -#define KEY_CACHE_SIZE (uint) (8*1024*1024-MALLOC_OVERHEAD) +#define KEY_CACHE_SIZE (uint) (8*1024*1024) /* Default size of a key cache block */ #define KEY_CACHE_BLOCK_SIZE (uint) 1024 diff --git a/include/my_pthread.h b/include/my_pthread.h index 2558f8d5986..343bff6ba72 100644 --- a/include/my_pthread.h +++ b/include/my_pthread.h @@ -154,8 +154,7 @@ int pthread_join(pthread_t thread, void **value_ptr); #define pthread_detach_this_thread() #define pthread_condattr_init(A) #define pthread_condattr_destroy(A) -/* per the platform's documentation */ -#define pthread_yield() Sleep(0) +#define pthread_yield() SwitchToThread() #else /* Normal threads */ diff --git a/include/my_time.h b/include/my_time.h index 58995f1bf62..829cb706bb6 100644 --- a/include/my_time.h +++ b/include/my_time.h @@ -74,12 +74,12 @@ typedef long my_time_t; TIME_MAX_MINUTE * 60L + TIME_MAX_SECOND) my_bool check_date(const MYSQL_TIME *ltime, my_bool not_zero_date, - ulong flags, int *was_cut); + ulonglong flags, int *was_cut); enum enum_mysql_timestamp_type str_to_datetime(const char *str, uint length, MYSQL_TIME *l_time, - uint flags, int *was_cut); + ulonglong flags, int *was_cut); longlong number_to_datetime(longlong nr, MYSQL_TIME *time_res, - uint flags, int *was_cut); + 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 *); diff --git a/include/myisam.h b/include/myisam.h index e6404cb5405..d590a29c1b3 100644 --- a/include/myisam.h +++ b/include/myisam.h @@ -251,7 +251,7 @@ typedef struct st_columndef /* column information */ extern char * myisam_log_filename; /* Name of logfile */ extern ulong myisam_block_size; -extern ulong myisam_concurrent_insert; +extern uint myisam_concurrent_insert; extern my_bool myisam_flush,myisam_delay_key_write,myisam_single_user; extern my_off_t myisam_max_temp_length; extern ulong myisam_bulk_insert_tree_size, myisam_data_pointer_size; diff --git a/include/mysql.h.pp b/include/mysql.h.pp index 0ea1d0974c2..4fef9e9ec0b 100644 --- a/include/mysql.h.pp +++ b/include/mysql.h.pp @@ -233,6 +233,10 @@ extern void make_type(char *to,unsigned int nr,TYPELIB *typelib); extern const char *get_type(TYPELIB *typelib,unsigned int nr); extern TYPELIB *copy_typelib(MEM_ROOT *root, TYPELIB *from); extern TYPELIB sql_protocol_typelib; +my_ulonglong find_set_from_flags(const TYPELIB *lib, uint default_name, + my_ulonglong cur_set, my_ulonglong default_set, + const char *str, uint length, + char **err_pos, uint *err_len); typedef struct st_mysql_rows { struct st_mysql_rows *next; MYSQL_ROW data; diff --git a/include/mysql/plugin.h b/include/mysql/plugin.h index f158dc20999..cd5b6f2fe2c 100644 --- a/include/mysql/plugin.h +++ b/include/mysql/plugin.h @@ -675,6 +675,7 @@ 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 *); }; diff --git a/include/mysql/plugin.h.pp b/include/mysql/plugin.h.pp index b7dd7bc0032..709430db3fb 100644 --- a/include/mysql/plugin.h.pp +++ b/include/mysql/plugin.h.pp @@ -144,6 +144,7 @@ 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 *); }; int thd_in_lock_tables(const void* thd); int thd_tablespace_op(const void* thd); diff --git a/include/mysql/service_my_snprintf.h b/include/mysql/service_my_snprintf.h index ad344864c34..9e5fe7f9c9f 100644 --- a/include/mysql/service_my_snprintf.h +++ b/include/mysql/service_my_snprintf.h @@ -53,7 +53,7 @@ <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', 'u', 'x', + "(null)"), 'b' (extension, see below), 'c', 'd', 'u', 'x', 'o', 'X', 'p' (works as 0x%x). Standard syntax for positional arguments $n is supported. diff --git a/include/sslopt-longopts.h b/include/sslopt-longopts.h index eae1424238b..b98e72e298e 100644 --- a/include/sslopt-longopts.h +++ b/include/sslopt-longopts.h @@ -19,8 +19,8 @@ #ifdef HAVE_OPENSSL {"ssl", OPT_SSL_SSL, - "Enable SSL for connection (automatically enabled with other flags). Disable with --skip-ssl.", - (uchar **) &opt_use_ssl, (uchar **) &opt_use_ssl, 0, GET_BOOL, NO_ARG, 0, 0, 0, + "Enable SSL for connection (automatically enabled with other flags).", + (uchar **) &opt_use_ssl, (uchar **) &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).", @@ -43,7 +43,7 @@ {"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.", (uchar **) &opt_ssl_verify_server_cert, (uchar **) &opt_ssl_verify_server_cert, - 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0}, + 0, GET_BOOL, OPT_ARG, 0, 0, 0, 0, 0, 0}, #endif #endif /* HAVE_OPENSSL */ #endif /* SSLOPT_LONGOPTS_INCLUDED */ diff --git a/include/typelib.h b/include/typelib.h index 46106d1bdab..c6a7f7a42e9 100644 --- a/include/typelib.h +++ b/include/typelib.h @@ -36,4 +36,9 @@ extern TYPELIB *copy_typelib(MEM_ROOT *root, TYPELIB *from); extern TYPELIB sql_protocol_typelib; +my_ulonglong find_set_from_flags(const TYPELIB *lib, uint default_name, + my_ulonglong cur_set, my_ulonglong default_set, + const char *str, uint length, + char **err_pos, uint *err_len); + #endif /* _typelib_h */ |