Commit 89a0364f authored by Sergei Golubchik's avatar Sergei Golubchik

MDEV-27304 SHOW ... result columns are right-aligned

--version=value was setting sys_var::CONFIG (meaning, the value
came from the config file), but the filename was left as NULL.
parent 55bb933a
......@@ -2,3 +2,19 @@ SELECT @@version;
@@version
my_favorite_version
1
select * from information_schema.system_variables where variable_name='version';
VARIABLE_NAME VERSION
SESSION_VALUE NULL
GLOBAL_VALUE my_favorite_version
GLOBAL_VALUE_ORIGIN COMMAND-LINE
DEFAULT_VALUE NULL
VARIABLE_SCOPE GLOBAL
VARIABLE_TYPE VARCHAR
VARIABLE_COMMENT Server version number. It may also include a suffix with configuration or build information. -debug indicates debugging support was enabled on the server, and -log indicates at least one of the binary log, general log or slow query log are enabled, for example 10.1.1-MariaDB-mariadb1precise-log.
NUMERIC_MIN_VALUE NULL
NUMERIC_MAX_VALUE NULL
NUMERIC_BLOCK_SIZE NULL
ENUM_VALUE_LIST NULL
READ_ONLY YES
COMMAND_LINE_ARGUMENT NULL
GLOBAL_VALUE_PATH NULL
......@@ -4,3 +4,4 @@ perl;
grep /my_favorite_version/, `$ENV{MYSQL} -e status`;
print "$cnt\n";
EOF
query_vertical select * from information_schema.system_variables where variable_name='version';
......@@ -7967,7 +7967,8 @@ mysqld_get_one_option(const struct my_option *opt, const char *argument,
if (argument)
{
strmake(server_version, argument, sizeof(server_version) - 1);
set_sys_var_value_origin(&server_version_ptr, sys_var::CONFIG);
set_sys_var_value_origin(&server_version_ptr,
*filename ? sys_var::CONFIG : sys_var::COMMAND_LINE, filename);
using_custom_server_version= true;
}
#ifndef EMBEDDED_LIBRARY
......
......@@ -1278,7 +1278,8 @@ int fill_sysvars(THD *thd, TABLE_LIST *tables, COND *cond)
and update it directly.
*/
void set_sys_var_value_origin(void *ptr, enum sys_var::where here)
void set_sys_var_value_origin(void *ptr, enum sys_var::where here,
const char *filename)
{
bool found __attribute__((unused))= false;
DBUG_ASSERT(!mysqld_server_started); // only to be used during startup
......@@ -1289,6 +1290,7 @@ void set_sys_var_value_origin(void *ptr, enum sys_var::where here)
if (var->option.value == ptr)
{
found= true;
var->origin_filename= filename;
var->value_origin= here;
/* don't break early, search for all matches */
}
......
......@@ -450,7 +450,8 @@ int sql_set_variables(THD *thd, List<set_var_base> *var_list, bool free);
} \
} while(0)
void set_sys_var_value_origin(void *ptr, enum sys_var::where here);
void set_sys_var_value_origin(void *ptr, enum sys_var::where here,
const char *filename= NULL);
enum sys_var::where get_sys_var_value_origin(void *ptr);
inline bool IS_SYSVAR_AUTOSIZE(void *ptr)
......
......@@ -51,7 +51,7 @@ void sql_print_warning(const char *format, ...)
}
class sys_var { public: enum where { AUTO }; };
void set_sys_var_value_origin(void *ptr, enum sys_var::where here)
void set_sys_var_value_origin(void *, enum sys_var::where, const char *)
{
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment