summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorunknown <serg@sergbook.mysql.com>2007-04-16 10:37:50 +0200
committerunknown <serg@sergbook.mysql.com>2007-04-16 10:37:50 +0200
commit7cb8a33b1af33dcd8806ec6021655a39f375d904 (patch)
treedf4c92bcf5668ec88685604378ad6dc60bfcf269 /include
parent2e73a53e033741b09a652646d9cfa0e76c33e6a1 (diff)
parentadd378761542ade65340b9477ed298e9a1677b10 (diff)
downloadmariadb-git-7cb8a33b1af33dcd8806ec6021655a39f375d904.tar.gz
Merge bk-internal.mysql.com:/home/bk/mysql-5.1
into sergbook.mysql.com:/usr/home/serg/Abk/mysql-5.1-wl2936 client/mysql.cc: Auto merged include/my_global.h: Auto merged include/my_sys.h: Auto merged include/mysql.h: Auto merged mysql-test/r/im_utils.result: Auto merged mysql-test/r/variables.result: Auto merged mysql-test/t/ndb_dd_basic.test: Auto merged mysql-test/t/partition_innodb.test: Auto merged mysql-test/t/variables.test: Auto merged mysys/array.c: Auto merged mysys/typelib.c: Auto merged sql/event_queue.cc: Auto merged sql/ha_partition.cc: Auto merged sql/ha_partition.h: Auto merged sql/handler.cc: Auto merged sql/handler.h: Auto merged sql/item_func.cc: Auto merged sql/item_sum.cc: Auto merged sql/log.cc: Auto merged sql/mysql_priv.h: Auto merged sql/set_var.h: Auto merged sql/sql_base.cc: Auto merged sql/sql_cache.cc: Auto merged sql/sql_class.h: Auto merged sql/sql_delete.cc: Auto merged sql/sql_insert.cc: Auto merged sql/sql_lex.cc: Auto merged sql/sql_lex.h: Auto merged sql/sql_parse.cc: Auto merged sql/sql_partition.cc: Auto merged sql/sql_plugin.cc: Auto merged sql/sql_repl.cc: Auto merged sql/sql_select.cc: Auto merged sql/sql_show.cc: Auto merged sql/sql_table.cc: Auto merged sql/table.cc: Auto merged sql/table.h: Auto merged storage/example/ha_example.cc: Auto merged storage/federated/ha_federated.cc: Auto merged storage/heap/ha_heap.cc: Auto merged storage/innobase/include/trx0trx.h: Auto merged storage/myisam/ha_myisam.cc: Auto merged storage/myisammrg/ha_myisammrg.cc: Auto merged storage/ndb/src/mgmsrv/InitConfigFileParser.cpp: Auto merged include/typelib.h: merged mysql-test/mysql-test-run.pl: merged mysql-test/r/flush2.result: merged mysql-test/r/ndb_dd_basic.result: merged mysql-test/r/partition_innodb.result: merged mysql-test/r/ps_1general.result: merged mysql-test/t/ps_1general.test: merged sql/ha_ndbcluster.cc: merged sql/item_create.cc: merged sql/mysqld.cc: merged sql/rpl_utility.h: merged sql/set_var.cc: merged sql/sql_class.cc: merged sql/sql_yacc.yy: merged storage/innobase/handler/ha_innodb.cc: merged storage/innobase/handler/ha_innodb.h: merged
Diffstat (limited to 'include')
-rw-r--r--include/hash.h3
-rw-r--r--include/my_getopt.h9
-rw-r--r--include/my_global.h8
-rw-r--r--include/my_sys.h11
-rw-r--r--include/mysql.h3
-rw-r--r--include/mysql/plugin.h318
-rw-r--r--include/mysys_err.h1
-rw-r--r--include/typelib.h4
8 files changed, 347 insertions, 10 deletions
diff --git a/include/hash.h b/include/hash.h
index 97e947d7c6a..78499a4f810 100644
--- a/include/hash.h
+++ b/include/hash.h
@@ -27,6 +27,9 @@ extern "C" {
*/
#define HASH_OVERHEAD (sizeof(char*)*2)
+/* flags for hash_init */
+#define HASH_UNIQUE 1 /* hash_insert fails on duplicate key */
+
typedef byte *(*hash_get_key)(const byte *,uint*,my_bool);
typedef void (*hash_free_key)(void *);
diff --git a/include/my_getopt.h b/include/my_getopt.h
index dcd6ad9d79b..a14507847be 100644
--- a/include/my_getopt.h
+++ b/include/my_getopt.h
@@ -29,12 +29,16 @@ C_MODE_START
#define GET_STR 9
#define GET_STR_ALLOC 10
#define GET_DISABLED 11
+#define GET_ENUM 12
+#define GET_SET 13
#define GET_ASK_ADDR 128
#define GET_TYPE_MASK 127
enum get_opt_arg_type { NO_ARG, OPT_ARG, REQUIRED_ARG };
+struct st_typelib;
+
struct my_option
{
const char *name; /* Name of the option */
@@ -42,7 +46,7 @@ struct my_option
const char *comment; /* option comment, for autom. --help */
gptr *value; /* The variable value */
gptr *u_max_value; /* The user def. max variable value */
- const char **str_values; /* Pointer to possible values */
+ struct st_typelib *typelib; /* Pointer to possible values */
ulong var_type;
enum get_opt_arg_type arg_type;
longlong def_value; /* Default value */
@@ -50,7 +54,7 @@ struct my_option
longlong max_value; /* Max allowed value */
longlong sub_size; /* Subtract this from given value */
long block_size; /* Value should be a mult. of this */
- int app_type; /* To be used by an application */
+ void *app_type; /* To be used by an application */
};
typedef my_bool (* my_get_one_option) (int, const struct my_option *, char * );
@@ -58,6 +62,7 @@ typedef void (* my_error_reporter) (enum loglevel level, const char *format, ...
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,
diff --git a/include/my_global.h b/include/my_global.h
index 8b35f995a48..c88cf4e6e4b 100644
--- a/include/my_global.h
+++ b/include/my_global.h
@@ -458,6 +458,14 @@ C_MODE_END
*/
#include <assert.h>
+/* an assert that works at compile-time. only for constant expression */
+#define compile_time_assert(X) \
+ do \
+ { \
+ char compile_time_assert[(X) ? 1 : -1] \
+ __attribute__ ((unused)); \
+ } while(0)
+
/* Go around some bugs in different OS and compilers */
#if defined (HPUX11) && defined(_LARGEFILE_SOURCE)
#define _LARGEFILE64_SOURCE
diff --git a/include/my_sys.h b/include/my_sys.h
index cff8c73c9ff..691233b9839 100644
--- a/include/my_sys.h
+++ b/include/my_sys.h
@@ -759,8 +759,15 @@ 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_array(A,B,C,D CALLER_INFO)
-#define my_init_dynamic_array_ci(A,B,C,D) init_dynamic_array(A,B,C,D ORIG_CALLER_INFO)
+#define my_init_dynamic_array(A,B,C,D) init_dynamic_array2(A,B,NULL,C,D CALLER_INFO)
+#define my_init_dynamic_array_ci(A,B,C,D) init_dynamic_array2(A,B,NULL,C,D ORIG_CALLER_INFO)
+#define my_init_dynamic_array2(A,B,C,D,E) init_dynamic_array2(A,B,C,D,E CALLER_INFO)
+#define my_init_dynamic_array2_ci(A,B,C,D,E) init_dynamic_array2(A,B,C,D,E ORIG_CALLER_INFO)
+extern my_bool init_dynamic_array2(DYNAMIC_ARRAY *array,uint element_size,
+ void *init_buffer, uint init_alloc,
+ uint alloc_increment
+ CALLER_INFO_PROTO);
+/* init_dynamic_array() function is deprecated */
extern my_bool init_dynamic_array(DYNAMIC_ARRAY *array,uint element_size,
uint init_alloc,uint alloc_increment
CALLER_INFO_PROTO);
diff --git a/include/mysql.h b/include/mysql.h
index 33bdf80ef73..f657e1ae64b 100644
--- a/include/mysql.h
+++ b/include/mysql.h
@@ -67,7 +67,6 @@ typedef int my_socket;
#include "mysql_version.h"
#include "mysql_com.h"
#include "mysql_time.h"
-#include "typelib.h"
#include "my_list.h" /* for LISTs used in 'MYSQL' and 'MYSQL_STMT' */
@@ -126,6 +125,8 @@ 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 */
diff --git a/include/mysql/plugin.h b/include/mysql/plugin.h
index 660ce49d7ee..751ce516a39 100644
--- a/include/mysql/plugin.h
+++ b/include/mysql/plugin.h
@@ -16,6 +16,15 @@
#ifndef _my_plugin_h
#define _my_plugin_h
+#ifdef __cplusplus
+class THD;
+class Item;
+#define MYSQL_THD THD*
+#else
+#define MYSQL_THD void*
+#endif
+
+
/*************************************************************************
Plugin API. Common for all plugin types.
*/
@@ -85,7 +94,261 @@ struct st_mysql_show_var {
};
#define SHOW_VAR_FUNC_BUFF_SIZE 1024
-typedef int (*mysql_show_var_func)(void *, struct st_mysql_show_var*, char *);
+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, 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; 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) struct { \
+ MYSQL_PLUGIN_VAR_HEADER; \
+ unsigned long *value, 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; \
+ 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) struct { \
+ MYSQL_PLUGIN_VAR_HEADER; \
+ int offset; \
+ unsigned long def_val; \
+ DECLARE_THDVAR_FUNC(unsigned long); \
+ 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, longlong) = { \
+ 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, ulonglong) = { \
+ 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) = { \
+ 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) = { \
+ 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, longlong) = { \
+ 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, ulonglong) = { \
+ 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) = { \
+ 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) = { \
+ 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.
@@ -103,8 +366,8 @@ struct st_mysql_plugin
int (*deinit)(void *);/* the function to invoke when plugin is unloaded */
unsigned int version; /* plugin version (for SHOW PLUGINS) */
struct st_mysql_show_var *status_vars;
- void * __reserved1; /* placeholder for system variables */
- void * __reserved2; /* placeholder for config options */
+ struct st_mysql_sys_var **system_vars;
+ void * __reserved1; /* reserved for dependency checking */
};
/*************************************************************************
@@ -328,6 +591,8 @@ struct st_mysql_storage_engine
int interface_version;
};
+struct handlerton;
+
/*
Here we define only the descriptor structure, that is referred from
st_mysql_plugin.
@@ -348,5 +613,52 @@ struct st_mysql_information_schema
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);
+};
+
+
+/*************************************************************************
+ 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);
+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);
+
+
+#ifdef __cplusplus
+};
+#endif
+
#endif
diff --git a/include/mysys_err.h b/include/mysys_err.h
index b92027a4e3c..09e77248c17 100644
--- a/include/mysys_err.h
+++ b/include/mysys_err.h
@@ -79,6 +79,7 @@ extern const char * NEAR globerrs[]; /* my_error_messages is here */
#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
diff --git a/include/typelib.h b/include/typelib.h
index e04ec20f2bc..3a63f1c7403 100644
--- a/include/typelib.h
+++ b/include/typelib.h
@@ -26,8 +26,8 @@ typedef struct st_typelib { /* Different types saved here */
unsigned int *type_lengths;
} TYPELIB;
-extern int find_type(char *x, const TYPELIB *typelib,
- unsigned int full_name);
+extern my_ulonglong find_typeset(char *x, TYPELIB *typelib,int *error_position);
+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);