summaryrefslogtreecommitdiff
path: root/include/mysql
diff options
context:
space:
mode:
authorunknown <antony@ppcg5.local>2007-03-23 10:14:46 -0700
committerunknown <antony@ppcg5.local>2007-03-23 10:14:46 -0700
commiteac12b6587c53d34f0241c404fb0ce8c5ee0da93 (patch)
tree384dc75bd4d0435e142953d66f1fb9c5824fd8e0 /include/mysql
parent1fc7f2117bddfcf91e1220f22714beb86d26c544 (diff)
downloadmariadb-git-eac12b6587c53d34f0241c404fb0ce8c5ee0da93.tar.gz
WL#2936
"Server variables for plugins" Post review fixes. client/mysql.cc: wl2936 "Plugin server variables" post review fixes compile fix. app_type is now a void* and it isn't actually used here. include/my_getopt.h: wl2936 "Plugin server variables" post review fixes make app_type into a void*. This also required changes to client/mysql.cc and storage/ndb/src/mgmsrv/InitConfigFileParser.cpp in order to compile. include/my_global.h: wl2936 "Plugin server variables" post-review fixes declare compile_time_assert() macro. (provided by serg) include/mysql/plugin.h: wl2936 "Plugin server variables" post review fixes Add comments mysys/array.c: wl2936 "Plugin server variables" post review fixes mysys/typelib.c: wl2936 "Plugin server variables" post review fixes find_typeset() should not alter string sql/set_var.cc: wl2936 "Plugin server variables" post review fixes remove unnecessary code. sql/sql_class.cc: wl2936 "Plugin server variables" post review fixes explicitly declare export style for functions. sql/sql_lex.cc: wl2936 "Plugin server variables" post review fixes enforce that lex::plugins_static_buffer is declared immediately after lex::plugins. sql/sql_plugin.cc: wl2936 "Plugin Server variables" post review fixes sys_var_pluginvar does not need st_plugin_int at construction. remove debug code which was accidentially committed. add comments. fix mutex lock order. sql/sql_plugin.h: wl2936 "Plugin server variables" post review fixes add comment and macro to compare plugin_refs sql/table.cc: wl2936 "plugin server variables" post review fixes remove unneccessary unlock and variable. add checks for legacy type validity storage/ndb/src/mgmsrv/InitConfigFileParser.cpp: wl2936 "plugin server variables" post review fixes fix compile failure now that my_option::app_type is a void*
Diffstat (limited to 'include/mysql')
-rw-r--r--include/mysql/plugin.h38
1 files changed, 38 insertions, 0 deletions
diff --git a/include/mysql/plugin.h b/include/mysql/plugin.h
index 6c75ca75a54..200b23cc93d 100644
--- a/include/mysql/plugin.h
+++ b/include/mysql/plugin.h
@@ -122,9 +122,43 @@ typedef int (*mysql_show_var_func)(MYSQL_THD, struct st_mysql_show_var*, char *)
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);
@@ -582,6 +616,10 @@ struct st_mysql_information_schema
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