mirror of
https://github.com/MariaDB/server.git
synced 2025-07-30 16:24:05 +03:00
WL#4738 streamline/simplify @@variable creation process
Bug#16565 mysqld --help --verbose does not order variablesBug#20413 sql_slave_skip_counter is not shown in show variables Bug#20415 Output of mysqld --help --verbose is incomplete Bug#25430 variable not found in SELECT @@global.ft_max_word_len; Bug#32902 plugin variables don't know their names Bug#34599 MySQLD Option and Variable Reference need to be consistent in formatting! Bug#34829 No default value for variable and setting default does not raise error Bug#34834 ? Is accepted as a valid sql mode Bug#34878 Few variables have default value according to documentation but error occurs Bug#34883 ft_boolean_syntax cant be assigned from user variable to global var. Bug#37187 `INFORMATION_SCHEMA`.`GLOBAL_VARIABLES`: inconsistent status Bug#40988 log_output_basic.test succeeded though syntactically false. Bug#41010 enum-style command-line options are not honoured (maria.maria-recover fails) Bug#42103 Setting key_buffer_size to a negative value may lead to very large allocations Bug#44691 Some plugins configured as MYSQL_PLUGIN_MANDATORY in can be disabled Bug#44797 plugins w/o command-line options have no disabling option in --help Bug#46314 string system variables don't support expressions Bug#46470 sys_vars.max_binlog_cache_size_basic_32 is broken Bug#46586 When using the plugin interface the type "set" for options caused a crash. Bug#47212 Crash in DBUG_PRINT in mysqltest.cc when trying to print octal number Bug#48758 mysqltest crashes on sys_vars.collation_server_basic in gcov builds Bug#49417 some complaints about mysqld --help --verbose output Bug#49540 DEFAULT value of binlog_format isn't the default value Bug#49640 ambiguous option '--skip-skip-myisam' (double skip prefix) Bug#49644 init_connect and \0 Bug#49645 init_slave and multi-byte characters Bug#49646 mysql --show-warnings crashes when server dies
This commit is contained in:
@ -296,7 +296,7 @@ void **thd_ha_data(const THD *thd, const struct handlerton *hton)
|
||||
extern "C"
|
||||
long long thd_test_options(const THD *thd, long long test_options)
|
||||
{
|
||||
return thd->options & test_options;
|
||||
return thd->variables.option_bits & test_options;
|
||||
}
|
||||
|
||||
extern "C"
|
||||
@ -684,7 +684,7 @@ void THD::raise_note(uint sql_errno)
|
||||
{
|
||||
DBUG_ENTER("THD::raise_note");
|
||||
DBUG_PRINT("enter", ("code: %d", sql_errno));
|
||||
if (!(this->options & OPTION_SQL_NOTES))
|
||||
if (!(variables.option_bits & OPTION_SQL_NOTES))
|
||||
DBUG_VOID_RETURN;
|
||||
const char* msg= ER(sql_errno);
|
||||
(void) raise_condition(sql_errno,
|
||||
@ -700,7 +700,7 @@ void THD::raise_note_printf(uint sql_errno, ...)
|
||||
char ebuff[MYSQL_ERRMSG_SIZE];
|
||||
DBUG_ENTER("THD::raise_note_printf");
|
||||
DBUG_PRINT("enter",("code: %u", sql_errno));
|
||||
if (!(this->options & OPTION_SQL_NOTES))
|
||||
if (!(variables.option_bits & OPTION_SQL_NOTES))
|
||||
DBUG_VOID_RETURN;
|
||||
const char* format= ER(sql_errno);
|
||||
va_start(args, sql_errno);
|
||||
@ -721,7 +721,7 @@ MYSQL_ERROR* THD::raise_condition(uint sql_errno,
|
||||
MYSQL_ERROR *cond= NULL;
|
||||
DBUG_ENTER("THD::raise_condition");
|
||||
|
||||
if (!(this->options & OPTION_SQL_NOTES) &&
|
||||
if (!(variables.option_bits & OPTION_SQL_NOTES) &&
|
||||
(level == MYSQL_ERROR::WARN_LEVEL_NOTE))
|
||||
DBUG_RETURN(NULL);
|
||||
|
||||
@ -887,12 +887,6 @@ void THD::init(void)
|
||||
{
|
||||
pthread_mutex_lock(&LOCK_global_system_variables);
|
||||
plugin_thdvar_init(this);
|
||||
variables.time_format= date_time_format_copy((THD*) 0,
|
||||
variables.time_format);
|
||||
variables.date_format= date_time_format_copy((THD*) 0,
|
||||
variables.date_format);
|
||||
variables.datetime_format= date_time_format_copy((THD*) 0,
|
||||
variables.datetime_format);
|
||||
/*
|
||||
variables= global_system_variables above has reset
|
||||
variables.pseudo_thread_id to 0. We need to correct it here to
|
||||
@ -903,12 +897,6 @@ void THD::init(void)
|
||||
server_status= SERVER_STATUS_AUTOCOMMIT;
|
||||
if (variables.sql_mode & MODE_NO_BACKSLASH_ESCAPES)
|
||||
server_status|= SERVER_STATUS_NO_BACKSLASH_ESCAPES;
|
||||
options= thd_startup_options;
|
||||
|
||||
if (variables.max_join_size == HA_POS_ERROR)
|
||||
options |= OPTION_BIG_SELECTS;
|
||||
else
|
||||
options &= ~OPTION_BIG_SELECTS;
|
||||
|
||||
transaction.all.modified_non_trans_table= transaction.stmt.modified_non_trans_table= FALSE;
|
||||
open_options=ha_open_options;
|
||||
@ -919,7 +907,7 @@ void THD::init(void)
|
||||
update_charset();
|
||||
reset_current_stmt_binlog_row_based();
|
||||
bzero((char *) &status_var, sizeof(status_var));
|
||||
sql_log_bin_toplevel= options & OPTION_BIN_LOG;
|
||||
sql_log_bin_toplevel= variables.option_bits & OPTION_BIN_LOG;
|
||||
|
||||
#if defined(ENABLED_DEBUG_SYNC)
|
||||
/* Initialize the Debug Sync Facility. See debug_sync.cc. */
|
||||
@ -1012,10 +1000,6 @@ void THD::cleanup(void)
|
||||
delete_dynamic(&user_var_events);
|
||||
my_hash_free(&user_vars);
|
||||
close_temporary_tables(this);
|
||||
my_free((char*) variables.time_format, MYF(MY_ALLOW_ZERO_PTR));
|
||||
my_free((char*) variables.date_format, MYF(MY_ALLOW_ZERO_PTR));
|
||||
my_free((char*) variables.datetime_format, MYF(MY_ALLOW_ZERO_PTR));
|
||||
|
||||
sp_cache_clear(&sp_proc_cache);
|
||||
sp_cache_clear(&sp_func_cache);
|
||||
|
||||
@ -1384,15 +1368,21 @@ bool THD::convert_string(String *s, CHARSET_INFO *from_cs, CHARSET_INFO *to_cs)
|
||||
void THD::update_charset()
|
||||
{
|
||||
uint32 not_used;
|
||||
charset_is_system_charset= !String::needs_conversion(0,charset(),
|
||||
system_charset_info,
|
||||
¬_used);
|
||||
charset_is_system_charset=
|
||||
!String::needs_conversion(0,
|
||||
variables.character_set_client,
|
||||
system_charset_info,
|
||||
¬_used);
|
||||
charset_is_collation_connection=
|
||||
!String::needs_conversion(0,charset(),variables.collation_connection,
|
||||
!String::needs_conversion(0,
|
||||
variables.character_set_client,
|
||||
variables.collation_connection,
|
||||
¬_used);
|
||||
charset_is_character_set_filesystem=
|
||||
!String::needs_conversion(0, charset(),
|
||||
variables.character_set_filesystem, ¬_used);
|
||||
!String::needs_conversion(0,
|
||||
variables.character_set_client,
|
||||
variables.character_set_filesystem,
|
||||
¬_used);
|
||||
}
|
||||
|
||||
|
||||
@ -1415,8 +1405,8 @@ void THD::add_changed_table(TABLE *table)
|
||||
{
|
||||
DBUG_ENTER("THD::add_changed_table(table)");
|
||||
|
||||
DBUG_ASSERT((options & (OPTION_NOT_AUTOCOMMIT | OPTION_BEGIN)) &&
|
||||
table->file->has_transactions());
|
||||
DBUG_ASSERT(variables.option_bits & (OPTION_NOT_AUTOCOMMIT | OPTION_BEGIN));
|
||||
DBUG_ASSERT(table->file->has_transactions());
|
||||
add_changed_table(table->s->table_cache_key.str,
|
||||
(long) table->s->table_cache_key.length);
|
||||
DBUG_VOID_RETURN;
|
||||
@ -3100,7 +3090,7 @@ extern "C" int thd_non_transactional_update(const MYSQL_THD thd)
|
||||
|
||||
extern "C" int thd_binlog_format(const MYSQL_THD thd)
|
||||
{
|
||||
if (mysql_bin_log.is_open() && (thd->options & OPTION_BIN_LOG))
|
||||
if (mysql_bin_log.is_open() && (thd->variables.option_bits & OPTION_BIN_LOG))
|
||||
return (int) thd->variables.binlog_format;
|
||||
else
|
||||
return BINLOG_FORMAT_UNSPEC;
|
||||
@ -3161,7 +3151,7 @@ void THD::reset_sub_statement_state(Sub_statement_state *backup,
|
||||
}
|
||||
#endif
|
||||
|
||||
backup->options= options;
|
||||
backup->option_bits= variables.option_bits;
|
||||
backup->in_sub_stmt= in_sub_stmt;
|
||||
backup->enable_slow_log= enable_slow_log;
|
||||
backup->limit_found_rows= limit_found_rows;
|
||||
@ -3178,10 +3168,10 @@ void THD::reset_sub_statement_state(Sub_statement_state *backup,
|
||||
if ((!lex->requires_prelocking() || is_update_query(lex->sql_command)) &&
|
||||
!current_stmt_binlog_row_based)
|
||||
{
|
||||
options&= ~OPTION_BIN_LOG;
|
||||
variables.option_bits&= ~OPTION_BIN_LOG;
|
||||
}
|
||||
|
||||
if ((backup->options & OPTION_BIN_LOG) && is_update_query(lex->sql_command)&&
|
||||
if ((backup->option_bits & OPTION_BIN_LOG) && is_update_query(lex->sql_command)&&
|
||||
!current_stmt_binlog_row_based)
|
||||
mysql_bin_log.start_union_events(this, this->query_id);
|
||||
|
||||
@ -3225,7 +3215,7 @@ void THD::restore_sub_statement_state(Sub_statement_state *backup)
|
||||
(void)ha_release_savepoint(this, sv);
|
||||
}
|
||||
transaction.savepoints= backup->savepoints;
|
||||
options= backup->options;
|
||||
variables.option_bits= backup->option_bits;
|
||||
in_sub_stmt= backup->in_sub_stmt;
|
||||
enable_slow_log= backup->enable_slow_log;
|
||||
first_successful_insert_id_in_prev_stmt=
|
||||
@ -3243,7 +3233,7 @@ void THD::restore_sub_statement_state(Sub_statement_state *backup)
|
||||
if (!in_sub_stmt)
|
||||
is_fatal_sub_stmt_error= FALSE;
|
||||
|
||||
if ((options & OPTION_BIN_LOG) && is_update_query(lex->sql_command) &&
|
||||
if ((variables.option_bits & OPTION_BIN_LOG) && is_update_query(lex->sql_command) &&
|
||||
!current_stmt_binlog_row_based)
|
||||
mysql_bin_log.stop_union_events(this);
|
||||
|
||||
|
Reference in New Issue
Block a user