diff options
author | Oleksandr Byelkin <sanja@mariadb.com> | 2015-08-10 21:45:11 +0200 |
---|---|---|
committer | Sergei Golubchik <serg@mariadb.org> | 2015-09-04 10:33:55 +0200 |
commit | 21daa7b9298d31ab1c6ddd1159dba29acea8d868 (patch) | |
tree | 7fcfa36605879c82f757ad3add0e6184f36487c3 /sql/set_var.cc | |
parent | b85a00161e91080cb82b99e812c18eafb6467737 (diff) | |
download | mariadb-git-21daa7b9298d31ab1c6ddd1159dba29acea8d868.tar.gz |
MDEV-6066: Merge new defaults from 5.6 and 5.7 (autoset)
--autoset- command line prefix added
Diffstat (limited to 'sql/set_var.cc')
-rw-r--r-- | sql/set_var.cc | 25 |
1 files changed, 22 insertions, 3 deletions
diff --git a/sql/set_var.cc b/sql/set_var.cc index 24e4e63e9cf..3756da562b9 100644 --- a/sql/set_var.cc +++ b/sql/set_var.cc @@ -178,6 +178,7 @@ sys_var::sys_var(sys_var_chain *chain, const char *name_arg, else chain->first= this; chain->last= this; + fix_auto_flag(); } bool sys_var::update(THD *thd, set_var *var) @@ -1086,7 +1087,8 @@ int fill_sysvars(THD *thd, TABLE_LIST *tables, COND *cond) { STRING_WITH_LEN("DOUBLE") }, // GET_DOUBLE 14 { STRING_WITH_LEN("FLAGSET") }, // GET_FLAGSET 15 }; - const LEX_CSTRING *type= types + (var->option.var_type & GET_TYPE_MASK); + const ulong vartype= (var->option.var_type & GET_TYPE_MASK); + const LEX_CSTRING *type= types + vartype; fields[6]->store(type->str, type->length, scs); // VARIABLE_COMMENT @@ -1097,7 +1099,7 @@ int fill_sysvars(THD *thd, TABLE_LIST *tables, COND *cond) // NUMERIC_MAX_VALUE // NUMERIC_BLOCK_SIZE bool is_unsigned= true; - switch (var->option.var_type) + switch (vartype) { case GET_INT: case GET_LONG: @@ -1179,7 +1181,7 @@ end: and update it directly. */ -void mark_sys_var_value_origin(void *ptr, enum sys_var::where here) +void set_sys_var_value_origin(void *ptr, enum sys_var::where here) { bool found __attribute__((unused))= false; DBUG_ASSERT(!mysqld_server_started); // only to be used during startup @@ -1198,3 +1200,20 @@ void mark_sys_var_value_origin(void *ptr, enum sys_var::where here) DBUG_ASSERT(found); // variable must have been found } +enum sys_var::where get_sys_var_value_origin(void *ptr) +{ + DBUG_ASSERT(!mysqld_server_started); // only to be used during startup + + for (uint i= 0; i < system_variable_hash.records; i++) + { + sys_var *var= (sys_var*) my_hash_element(&system_variable_hash, i); + if (var->option.value == ptr) + { + return var->value_origin; //first match + } + } + + DBUG_ASSERT(0); // variable must have been found + return sys_var::CONFIG; +} + |