"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*
This commit is contained in:
unknown
2007-03-23 10:14:46 -07:00
parent 1fc7f2117b
commit eac12b6587
13 changed files with 156 additions and 69 deletions

View File

@ -20,6 +20,8 @@
#include <m_ctype.h>
static const char field_separator=',';
/*
Search after a string in a list of strings. Endspace in x is not compared.
@ -31,6 +33,7 @@
If & 1 accept only whole names
If & 2 don't expand if half field
If & 4 allow #number# as type
If & 8 use ',' as string terminator
NOTES
If part, uniq field is found and full_name == 0 then x is expanded
@ -60,16 +63,18 @@ int find_type(my_string x, TYPELIB *typelib, uint full_name)
for (pos=0 ; (j=typelib->type_names[pos]) ; pos++)
{
for (i=x ;
*i && my_toupper(&my_charset_latin1,*i) ==
*i && (!(full_name & 8) || *i != field_separator) &&
my_toupper(&my_charset_latin1,*i) ==
my_toupper(&my_charset_latin1,*j) ; i++, j++) ;
if (! *j)
{
while (*i == ' ')
i++; /* skip_end_space */
if (! *i)
if (! *i || ((full_name & 8) && *i == field_separator))
DBUG_RETURN(pos+1);
}
if (! *i && (!*j || !(full_name & 1)))
if ((!*i && (!(full_name & 8) || *i != field_separator)) &&
(!*j || !(full_name & 1)))
{
find++;
findpos=pos;
@ -120,8 +125,6 @@ const char *get_type(TYPELIB *typelib, uint nr)
}
static const char field_separator=',';
/*
Create an integer value to represent the supplied comma-seperated
string where each string in the TYPELIB denotes a bit position.
@ -157,9 +160,7 @@ my_ulonglong find_typeset(my_string x, TYPELIB *lib, int *err)
(*err)++;
i= x;
while (*x && *x != field_separator) x++;
if (*x)
*x++= 0;
if ((find= find_type(i, lib, 2) - 1) < 0)
if ((find= find_type(i, lib, 2 | 8) - 1) < 0)
DBUG_RETURN(0);
result|= (ULL(1) << find);
}