630
unsigned char *sys_var_session_uint32_t::value_ptr(Session *session, sql_var_t type, const lex_string_t *)
630
unsigned char *sys_var_session_uint32_t::value_ptr(Session *session, sql_var_t type)
632
632
return type == OPT_GLOBAL
633
633
? (unsigned char*) &(global_system_variables.*offset)
680
unsigned char *sys_var_session_ha_rows::value_ptr(Session *session, sql_var_t type, const lex_string_t *)
680
unsigned char *sys_var_session_ha_rows::value_ptr(Session *session, sql_var_t type)
682
682
return type == OPT_GLOBAL
683
683
? (unsigned char*) &(global_system_variables.*offset)
736
unsigned char *sys_var_session_uint64_t::value_ptr(Session *session, sql_var_t type, const lex_string_t *)
736
unsigned char *sys_var_session_uint64_t::value_ptr(Session *session, sql_var_t type)
738
738
return type == OPT_GLOBAL
739
739
? (unsigned char*) &(global_system_variables.*offset)
789
unsigned char *sys_var_session_size_t::value_ptr(Session *session, sql_var_t type, const lex_string_t *)
789
unsigned char *sys_var_session_size_t::value_ptr(Session *session, sql_var_t type)
791
791
return type == OPT_GLOBAL
792
792
? (unsigned char*) &(global_system_variables.*offset)
821
unsigned char *sys_var_session_bool::value_ptr(Session *session, sql_var_t type, const lex_string_t *)
821
unsigned char *sys_var_session_bool::value_ptr(Session *session, sql_var_t type)
823
823
return type == OPT_GLOBAL
824
824
? (unsigned char*) &(global_system_variables.*offset)
876
876
If type is not given, return local value if exists, else global.
879
Item *sys_var::item(Session *session, sql_var_t var_type, const lex_string_t *base)
879
Item *sys_var::item(Session *session, sql_var_t var_type, const lex_string_t*)
881
881
if (check_type(var_type))
897
uint32_t value= *(uint*) value_ptr(session, var_type, base);
897
uint32_t value= *(uint*) value_ptr(session, var_type);
898
898
return new Item_uint((uint64_t) value);
900
900
case SHOW_LONGLONG:
902
int64_t value= *(int64_t*) value_ptr(session, var_type, base);
902
int64_t value= *(int64_t*) value_ptr(session, var_type);
903
903
return new Item_int(value);
905
905
case SHOW_DOUBLE:
907
double value= *(double*) value_ptr(session, var_type, base);
907
double value= *(double*) value_ptr(session, var_type);
908
908
/* 6, as this is for now only used with microseconds */
909
909
return new Item_float(value, 6);
911
911
case SHOW_HA_ROWS:
913
ha_rows value= *(ha_rows*) value_ptr(session, var_type, base);
913
ha_rows value= *(ha_rows*) value_ptr(session, var_type);
914
914
return new Item_int((uint64_t) value);
918
size_t value= *(size_t*) value_ptr(session, var_type, base);
918
size_t value= *(size_t*) value_ptr(session, var_type);
919
919
return new Item_int((uint64_t) value);
921
921
case SHOW_MY_BOOL:
923
int32_t value= *(bool*) value_ptr(session, var_type, base);
923
int32_t value= *(bool*) value_ptr(session, var_type);
924
924
return new Item_int(value, 1);
926
926
case SHOW_CHAR_PTR:
928
if (const char *str= *(char**) value_ptr(session, var_type, base))
928
if (const char *str= *(char**) value_ptr(session, var_type))
930
930
uint32_t length= strlen(str);
931
931
return new Item_string(session->mem.strdup(str, length), length, system_charset_info, DERIVATION_SYSCONST);
939
if (const char* str= (char*) value_ptr(session, var_type, base))
939
if (const char* str= (char*) value_ptr(session, var_type))
940
940
return new Item_string(str_ref(str), system_charset_info, DERIVATION_SYSCONST);
941
941
Item* tmp= new Item_null();
942
942
tmp->collation.set(system_charset_info, DERIVATION_SYSCONST);
971
unsigned char *sys_var_session_enum::value_ptr(Session *session, sql_var_t type, const lex_string_t *)
971
unsigned char *sys_var_session_enum::value_ptr(Session *session, sql_var_t type)
973
973
uint32_t tmp= type == OPT_GLOBAL ? global_system_variables.*offset : session->variables.*offset;
974
974
return (unsigned char*) enum_names->type_names[tmp];
988
unsigned char *sys_var_session_bit::value_ptr(Session *session, sql_var_t, const lex_string_t *)
988
unsigned char *sys_var_session_bit::value_ptr(Session *session, sql_var_t)
991
991
If reverse is 0 (default) return 1 if bit is set.
1051
unsigned char *sys_var_collation_sv::value_ptr(Session *session, sql_var_t type, const lex_string_t *)
1051
unsigned char *sys_var_collation_sv::value_ptr(Session *session, sql_var_t type)
1053
1053
const charset_info_st *cs= type == OPT_GLOBAL ? global_system_variables.*offset : session->variables.*offset;
1054
1054
return cs ? (unsigned char*) cs->name : (unsigned char*) "NULL";
1072
unsigned char *sys_var_timestamp::value_ptr(Session *session, sql_var_t, const lex_string_t *)
1072
unsigned char *sys_var_timestamp::value_ptr(Session *session, sql_var_t)
1074
1074
session->sys_var_tmp.int32_t_value= (int32_t) session->times.getCurrentTimestampEpoch();
1075
1075
return (unsigned char*) &session->sys_var_tmp.int32_t_value;
1086
unsigned char *sys_var_last_insert_id::value_ptr(Session *session, sql_var_t, const lex_string_t *)
1086
unsigned char *sys_var_last_insert_id::value_ptr(Session *session, sql_var_t)
1089
1089
this tmp var makes it robust againt change of type of
1137
unsigned char *sys_var_session_lc_time_names::value_ptr(Session *session, sql_var_t type, const lex_string_t *)
1137
unsigned char *sys_var_session_lc_time_names::value_ptr(Session *session, sql_var_t type)
1139
1139
return type == OPT_GLOBAL
1140
1140
? (unsigned char *) global_system_variables.lc_time_names->name
1502
1502
Functions to handle table_type
1503
1503
****************************************************************************/
1505
unsigned char *sys_var_session_storage_engine::value_ptr(Session *session, sql_var_t type, const lex_string_t *)
1505
unsigned char *sys_var_session_storage_engine::value_ptr(Session *session, sql_var_t type)
1507
1507
plugin::StorageEngine *engine= type == OPT_GLOBAL
1508
1508
? global_system_variables.*offset