summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/config-netware.h2
-rw-r--r--include/config-win.h6
-rw-r--r--include/ft_global.h4
-rw-r--r--include/keycache.h8
-rw-r--r--include/m_string.h12
-rw-r--r--include/my_base.h11
-rw-r--r--include/my_getopt.h51
-rw-r--r--include/my_global.h39
-rw-r--r--include/my_pthread.h3
-rw-r--r--include/my_time.h6
-rw-r--r--include/myisam.h2
-rw-r--r--include/mysql.h.pp4
-rw-r--r--include/mysql/plugin.h1
-rw-r--r--include/mysql/plugin.h.pp1
-rw-r--r--include/mysql/service_my_snprintf.h2
-rw-r--r--include/sslopt-longopts.h6
-rw-r--r--include/typelib.h5
17 files changed, 107 insertions, 56 deletions
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 a6a36f32ca4..f1c42b0cda4 100644
--- a/include/m_string.h
+++ b/include/m_string.h
@@ -215,7 +215,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))
@@ -228,7 +228,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);
@@ -236,6 +236,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 */
@@ -260,6 +261,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_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 */