1427
1427
typedef DECLARE_MYSQL_THDVAR_SIMPLE(thdvar_ulong_t, ulong);
1428
1428
typedef DECLARE_MYSQL_THDVAR_SIMPLE(thdvar_uint64_t_t, uint64_t);
1430
#define SET_PLUGIN_VAR_RESOLVE(opt)\
1431
*(mysql_sys_var_ptr_p*)&((opt)->resolve)= mysql_sys_var_ptr
1432
typedef uchar *(*mysql_sys_var_ptr_p)(void* a_thd, int offset);
1430
typedef bool *(*mysql_sys_var_ptr_p)(THD* a_thd, int offset);
1435
1433
/****************************************************************************
1963
1961
return (uchar*)thd->variables.dynamic_variables_ptr + offset;
1966
static uchar *mysql_sys_var_ptr(void* a_thd, int offset)
1968
return intern_sys_var_ptr((THD *)a_thd, offset, true);
1964
static bool *mysql_sys_var_ptr_bool(THD* a_thd, int offset)
1966
return (bool *)intern_sys_var_ptr(a_thd, offset, true);
1969
static int *mysql_sys_var_ptr_int(THD* a_thd, int offset)
1971
return (int *)intern_sys_var_ptr(a_thd, offset, true);
1974
static long *mysql_sys_var_ptr_long(THD* a_thd, int offset)
1976
return (long *)intern_sys_var_ptr(a_thd, offset, true);
1979
static int64_t *mysql_sys_var_ptr_int64_t(THD* a_thd, int offset)
1981
return (int64_t *)intern_sys_var_ptr(a_thd, offset, true);
1984
static char **mysql_sys_var_ptr_str(THD* a_thd, int offset)
1986
return (char **)intern_sys_var_ptr(a_thd, offset, true);
1989
static uint64_t *mysql_sys_var_ptr_set(THD* a_thd, int offset)
1991
return (uint64_t *)intern_sys_var_ptr(a_thd, offset, true);
1994
static unsigned long *mysql_sys_var_ptr_enum(THD* a_thd, int offset)
1996
return (unsigned long *)intern_sys_var_ptr(a_thd, offset, true);
2494
2522
switch (opt->flags & PLUGIN_VAR_TYPEMASK) {
2495
2523
case PLUGIN_VAR_BOOL:
2496
SET_PLUGIN_VAR_RESOLVE(((thdvar_bool_t *) opt));
2524
(((thdvar_bool_t *)opt)->resolve)= mysql_sys_var_ptr_bool;
2498
2526
case PLUGIN_VAR_INT:
2499
SET_PLUGIN_VAR_RESOLVE((thdvar_int_t *) opt);
2527
(((thdvar_int_t *)opt)->resolve)= mysql_sys_var_ptr_int;
2501
2529
case PLUGIN_VAR_LONG:
2502
SET_PLUGIN_VAR_RESOLVE((thdvar_long_t *) opt);
2530
(((thdvar_long_t *)opt)->resolve)= mysql_sys_var_ptr_long;
2504
2532
case PLUGIN_VAR_LONGLONG:
2505
SET_PLUGIN_VAR_RESOLVE((thdvar_int64_t_t *) opt);
2533
(((thdvar_int64_t_t *)opt)->resolve)= mysql_sys_var_ptr_int64_t;
2507
2535
case PLUGIN_VAR_STR:
2508
SET_PLUGIN_VAR_RESOLVE((thdvar_str_t *) opt);
2536
(((thdvar_str_t *)opt)->resolve)= mysql_sys_var_ptr_str;
2510
2538
case PLUGIN_VAR_ENUM:
2511
SET_PLUGIN_VAR_RESOLVE((thdvar_enum_t *) opt);
2539
(((thdvar_enum_t *)opt)->resolve)= mysql_sys_var_ptr_enum;
2513
2541
case PLUGIN_VAR_SET:
2514
SET_PLUGIN_VAR_RESOLVE((thdvar_set_t *) opt);
2542
(((thdvar_set_t *)opt)->resolve)= mysql_sys_var_ptr_set;
2517
2545
sql_print_error("Unknown variable type code 0x%x in plugin '%s'.",