14
14
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
16
16
#include "mysql_priv.h"
17
#include <my_pthread.h>
18
#include <my_getopt.h>
17
#include <mysys/my_pthread.h>
18
#include <mysys/my_getopt.h>
19
19
#define REPORT_TO_LOG 1
20
20
#define REPORT_TO_USER 2
152
152
static void *operator new(size_t size, MEM_ROOT *mem_root)
153
153
{ return (void*) alloc_root(mem_root, (uint) size); }
154
static void operator delete(void *ptr_arg __attribute__((__unused__)),
155
size_t size __attribute__((__unused__)))
154
static void operator delete(void *ptr_arg __attribute__((unused)),
155
size_t size __attribute__((unused)))
156
156
{ TRASH(ptr_arg, size); }
158
158
sys_var_pluginvar(const char *name_arg,
168
168
TYPELIB* plugin_var_typelib(void);
169
169
uchar* value_ptr(THD *thd, enum_var_type type, LEX_STRING *base);
170
170
bool check(THD *thd, set_var *var);
171
bool check_default(enum_var_type type __attribute__((__unused__)))
171
bool check_default(enum_var_type type __attribute__((unused)))
172
172
{ return is_readonly(); }
173
173
void set_default(THD *thd,
174
enum_var_type type __attribute__((__unused__)));
174
enum_var_type type __attribute__((unused)));
175
175
bool update(THD *thd, set_var *var);
334
334
tmp->ref_count++;
337
bzero(&plugin_dl, sizeof(plugin_dl));
337
memset(&plugin_dl, 0, sizeof(plugin_dl));
338
338
/* Compile dll path */
340
340
strxnmov(dlpath, sizeof(dlpath) - 1, opt_plugin_dir, "/", dl->str, NullS) -
569
569
/* Clear the whole struct to catch future extensions. */
570
bzero((char*) &tmp, sizeof(tmp));
570
memset((char*) &tmp, 0, sizeof(tmp));
571
571
if (! (tmp.plugin_dl= plugin_dl_add(dl, report)))
573
573
/* Find plugin by name */
908
908
for (plugin= *builtins; plugin->name; plugin++)
910
bzero(&tmp, sizeof(tmp));
910
memset(&tmp, 0, sizeof(tmp));
911
911
tmp.plugin= plugin;
912
912
tmp.name.str= (char *)plugin->name;
913
913
tmp.name.length= strlen(plugin->name);
1320
1320
default variable data check and update functions
1321
1321
****************************************************************************/
1323
static int check_func_bool(THD *thd __attribute__((__unused__)),
1323
static int check_func_bool(THD *thd __attribute__((unused)),
1324
1324
struct st_mysql_sys_var *var,
1325
1325
void *save, st_mysql_value *value)
1422
1422
static int check_func_str(THD *thd,
1423
struct st_mysql_sys_var *var __attribute__((__unused__)),
1423
struct st_mysql_sys_var *var __attribute__((unused)),
1424
1424
void *save, st_mysql_value *value)
1426
1426
char buff[STRING_BUFFER_USUAL_SIZE];
1438
static int check_func_enum(THD *thd __attribute__((__unused__)),
1438
static int check_func_enum(THD *thd __attribute__((unused)),
1439
1439
struct st_mysql_sys_var *var,
1440
1440
void *save, st_mysql_value *value)
1485
static int check_func_set(THD *thd __attribute__((__unused__)),
1485
static int check_func_set(THD *thd __attribute__((unused)),
1486
1486
struct st_mysql_sys_var *var,
1487
1487
void *save, st_mysql_value *value)
1536
static void update_func_bool(THD *thd __attribute__((__unused__)),
1537
struct st_mysql_sys_var *var __attribute__((__unused__)),
1536
static void update_func_bool(THD *thd __attribute__((unused)),
1537
struct st_mysql_sys_var *var __attribute__((unused)),
1538
1538
void *tgt, const void *save)
1540
1540
*(bool *) tgt= *(int *) save ? 1 : 0;
1544
static void update_func_int(THD *thd __attribute__((__unused__)),
1545
struct st_mysql_sys_var *var __attribute__((__unused__)),
1544
static void update_func_int(THD *thd __attribute__((unused)),
1545
struct st_mysql_sys_var *var __attribute__((unused)),
1546
1546
void *tgt, const void *save)
1548
1548
*(int *)tgt= *(int *) save;
1552
static void update_func_long(THD *thd __attribute__((__unused__)),
1553
struct st_mysql_sys_var *var __attribute__((__unused__)),
1552
static void update_func_long(THD *thd __attribute__((unused)),
1553
struct st_mysql_sys_var *var __attribute__((unused)),
1554
1554
void *tgt, const void *save)
1556
1556
*(long *)tgt= *(long *) save;
1560
static void update_func_int64_t(THD *thd __attribute__((__unused__)),
1561
struct st_mysql_sys_var *var __attribute__((__unused__)),
1560
static void update_func_int64_t(THD *thd __attribute__((unused)),
1561
struct st_mysql_sys_var *var __attribute__((unused)),
1562
1562
void *tgt, const void *save)
1564
1564
*(int64_t *)tgt= *(uint64_t *) save;
1568
static void update_func_str(THD *thd __attribute__((__unused__)), struct st_mysql_sys_var *var,
1568
static void update_func_str(THD *thd __attribute__((unused)), struct st_mysql_sys_var *var,
1569
1569
void *tgt, const void *save)
1571
1571
char *old= *(char **) tgt;
1732
1732
variables. If their value is non-NULL, it must point to a valid
1735
bzero(global_system_variables.dynamic_variables_ptr +
1736
global_variables_dynamic_size,
1737
new_size - global_variables_dynamic_size);
1738
bzero(max_system_variables.dynamic_variables_ptr +
1739
global_variables_dynamic_size,
1740
new_size - global_variables_dynamic_size);
1735
memset(global_system_variables.dynamic_variables_ptr +
1736
global_variables_dynamic_size, 0,
1737
new_size - global_variables_dynamic_size);
1738
memset(max_system_variables.dynamic_variables_ptr +
1739
global_variables_dynamic_size, 0,
1740
new_size - global_variables_dynamic_size);
1741
1741
global_variables_dynamic_size= new_size;
1909
1909
Unlocks all system variables which hold a reference
1911
static void unlock_variables(THD *thd __attribute__((__unused__)),
1911
static void unlock_variables(THD *thd __attribute__((unused)),
1912
1912
struct system_variables *vars)
1914
1914
intern_plugin_unlock(NULL, vars->table_plugin);
2344
2344
bool get_one_plugin_option(int optid __attribute__((unused)),
2345
const struct my_option *opt __attribute__((__unused__)),
2346
char *argument __attribute__((__unused__)))
2345
const struct my_option *opt __attribute__((unused)),
2346
char *argument __attribute__((unused)))
2576
2576
if (!(opts= (my_option*) alloc_root(mem_root, sizeof(my_option) * count)))
2579
bzero(opts, sizeof(my_option) * count);
2579
memset(opts, 0, sizeof(my_option) * count);
2581
2581
if ((my_strcasecmp(&my_charset_latin1, p->name.str, "MyISAM") == 0))
2582
2582
can_disable= false;
2641
2641
sql_print_error("Out of memory for plugin '%s'.", tmp->name.str);
2644
bzero(opts, sizeof(my_option) * count);
2644
memset(opts, 0, sizeof(my_option) * count);
2646
2646
if (construct_options(tmp_root, tmp, opts, can_disable))