~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to server/sql_plugin.cc

Merged from codestyle.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1427
1427
typedef DECLARE_MYSQL_THDVAR_SIMPLE(thdvar_ulong_t, ulong);
1428
1428
typedef DECLARE_MYSQL_THDVAR_SIMPLE(thdvar_uint64_t_t, uint64_t);
1429
1429
 
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);
1433
1431
 
1434
1432
 
1435
1433
/****************************************************************************
1963
1961
  return (uchar*)thd->variables.dynamic_variables_ptr + offset;
1964
1962
}
1965
1963
 
1966
 
static uchar *mysql_sys_var_ptr(void* a_thd, int offset)
1967
 
{
1968
 
  return intern_sys_var_ptr((THD *)a_thd, offset, true);
 
1964
static bool *mysql_sys_var_ptr_bool(THD* a_thd, int offset)
 
1965
{
 
1966
  return (bool *)intern_sys_var_ptr(a_thd, offset, true);
 
1967
}
 
1968
 
 
1969
static int *mysql_sys_var_ptr_int(THD* a_thd, int offset)
 
1970
{
 
1971
  return (int *)intern_sys_var_ptr(a_thd, offset, true);
 
1972
}
 
1973
 
 
1974
static long *mysql_sys_var_ptr_long(THD* a_thd, int offset)
 
1975
{
 
1976
  return (long *)intern_sys_var_ptr(a_thd, offset, true);
 
1977
}
 
1978
 
 
1979
static int64_t *mysql_sys_var_ptr_int64_t(THD* a_thd, int offset)
 
1980
{
 
1981
  return (int64_t *)intern_sys_var_ptr(a_thd, offset, true);
 
1982
}
 
1983
 
 
1984
static char **mysql_sys_var_ptr_str(THD* a_thd, int offset)
 
1985
{
 
1986
  return (char **)intern_sys_var_ptr(a_thd, offset, true);
 
1987
}
 
1988
 
 
1989
static uint64_t *mysql_sys_var_ptr_set(THD* a_thd, int offset)
 
1990
{
 
1991
  return (uint64_t *)intern_sys_var_ptr(a_thd, offset, true);
 
1992
}
 
1993
 
 
1994
static unsigned long *mysql_sys_var_ptr_enum(THD* a_thd, int offset)
 
1995
{
 
1996
  return (unsigned long *)intern_sys_var_ptr(a_thd, offset, true);
1969
1997
}
1970
1998
 
1971
1999
 
2493
2521
      continue;
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;
2497
2525
      break;
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;
2500
2528
      break;
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;
2503
2531
      break;
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;
2506
2534
      break;
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;
2509
2537
      break;
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;
2512
2540
      break;
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;
2515
2543
      break;
2516
2544
    default:
2517
2545
      sql_print_error("Unknown variable type code 0x%x in plugin '%s'.",