2016-04-20 15:25:55 +02:00
|
|
|
/* Copyright (c) 2006, 2016, Oracle and/or its affiliates.
|
2020-01-26 17:27:13 +01:00
|
|
|
Copyright (c) 2010, 2020, MariaDB Corporation.
|
2010-03-31 16:05:33 +02:00
|
|
|
|
|
|
|
This program is free software; you can redistribute it and/or modify
|
|
|
|
it under the terms of the GNU General Public License as published by
|
|
|
|
the Free Software Foundation; version 2 of the License.
|
|
|
|
|
|
|
|
This program is distributed in the hope that it will be useful,
|
|
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
GNU General Public License for more details.
|
|
|
|
|
|
|
|
You should have received a copy of the GNU General Public License
|
|
|
|
along with this program; if not, write to the Free Software
|
2019-05-11 20:29:06 +02:00
|
|
|
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1335 USA */
|
2010-03-31 16:05:33 +02:00
|
|
|
|
|
|
|
#ifndef MYSQLD_INCLUDED
|
|
|
|
#define MYSQLD_INCLUDED
|
|
|
|
|
2016-10-02 15:39:40 +02:00
|
|
|
#include "sql_basic_types.h" /* query_id_t */
|
2019-08-26 13:28:32 +02:00
|
|
|
#include "sql_mode.h" /* Sql_mode_dependency */
|
2017-03-20 11:55:24 +01:00
|
|
|
#include "sql_plugin.h"
|
2010-03-31 16:05:33 +02:00
|
|
|
#include "sql_bitmap.h" /* Bitmap */
|
|
|
|
#include "my_decimal.h" /* my_decimal */
|
|
|
|
#include "mysql_com.h" /* SERVER_VERSION_LENGTH */
|
2018-12-28 15:51:13 +01:00
|
|
|
#include "my_counter.h"
|
2010-03-31 16:05:33 +02:00
|
|
|
#include "mysql/psi/mysql_file.h" /* MYSQL_FILE */
|
2018-09-25 17:06:32 +02:00
|
|
|
#include "mysql/psi/mysql_socket.h" /* MYSQL_SOCKET */
|
2010-03-31 16:05:33 +02:00
|
|
|
#include "sql_list.h" /* I_List */
|
2012-08-14 16:23:34 +02:00
|
|
|
#include "sql_cmd.h"
|
2013-03-25 23:03:13 +01:00
|
|
|
#include <my_rnd.h>
|
2014-08-06 14:39:15 +02:00
|
|
|
#include "my_pthread.h"
|
2015-03-07 20:47:28 +01:00
|
|
|
#include "my_rdtsc.h"
|
2010-03-31 16:05:33 +02:00
|
|
|
|
|
|
|
class THD;
|
2016-02-01 11:45:39 +01:00
|
|
|
class CONNECT;
|
2010-04-12 15:17:37 +02:00
|
|
|
struct handlerton;
|
2010-03-31 16:05:33 +02:00
|
|
|
class Time_zone;
|
|
|
|
|
2010-08-17 07:46:53 +02:00
|
|
|
struct scheduler_functions;
|
2010-03-31 16:05:33 +02:00
|
|
|
|
|
|
|
typedef struct st_mysql_show_var SHOW_VAR;
|
|
|
|
|
2019-05-09 17:38:22 +02:00
|
|
|
/* Bits from testflag */
|
2017-03-01 07:27:39 +01:00
|
|
|
#define TEST_PRINT_CACHED_TABLES 1U
|
|
|
|
#define TEST_NO_KEY_GROUP 2U
|
|
|
|
#define TEST_MIT_THREAD 4U
|
|
|
|
#define TEST_BLOCKING 8U
|
|
|
|
#define TEST_KEEP_TMP_TABLES 16U
|
|
|
|
#define TEST_READCHECK 64U /**< Force use of readcheck */
|
|
|
|
#define TEST_NO_EXTRA 128U
|
|
|
|
#define TEST_CORE_ON_SIGNAL 256U /**< Give core if signal */
|
|
|
|
#define TEST_SIGINT 1024U /**< Allow sigint on threads */
|
|
|
|
#define TEST_SYNCHRONIZATION 2048U /**< get server to do sleep in
|
2010-03-31 16:05:33 +02:00
|
|
|
some places */
|
2015-02-01 14:24:22 +01:00
|
|
|
|
|
|
|
/* Keep things compatible */
|
|
|
|
#define OPT_DEFAULT SHOW_OPT_DEFAULT
|
|
|
|
#define OPT_SESSION SHOW_OPT_SESSION
|
|
|
|
#define OPT_GLOBAL SHOW_OPT_GLOBAL
|
|
|
|
|
2019-05-06 21:30:35 +02:00
|
|
|
extern MYSQL_PLUGIN_IMPORT MY_TIMER_INFO sys_timer_info;
|
2015-03-07 20:47:28 +01:00
|
|
|
|
2015-02-01 21:39:59 +01:00
|
|
|
/*
|
2015-02-06 10:02:02 +01:00
|
|
|
Values for --slave-parallel-mode
|
|
|
|
Must match order in slave_parallel_mode_typelib in sys_vars.cc.
|
2015-02-01 21:39:59 +01:00
|
|
|
*/
|
2015-02-06 10:02:02 +01:00
|
|
|
enum enum_slave_parallel_mode {
|
|
|
|
SLAVE_PARALLEL_NONE,
|
|
|
|
SLAVE_PARALLEL_MINIMAL,
|
|
|
|
SLAVE_PARALLEL_CONSERVATIVE,
|
|
|
|
SLAVE_PARALLEL_OPTIMISTIC,
|
|
|
|
SLAVE_PARALLEL_AGGRESSIVE
|
|
|
|
};
|
2015-02-01 21:39:59 +01:00
|
|
|
|
2010-03-31 16:05:33 +02:00
|
|
|
/* Function prototypes */
|
2019-01-25 11:24:35 +01:00
|
|
|
void kill_mysql(THD *thd);
|
2010-12-15 23:59:21 +01:00
|
|
|
void close_connection(THD *thd, uint sql_errno= 0);
|
2016-02-01 11:45:39 +01:00
|
|
|
void handle_connection_in_main_thread(CONNECT *thd);
|
|
|
|
void create_thread_to_handle_connection(CONNECT *connect);
|
2010-03-31 16:05:33 +02:00
|
|
|
void unlink_thd(THD *thd);
|
|
|
|
void refresh_status(THD *thd);
|
2010-05-07 18:17:55 +02:00
|
|
|
bool is_secure_file_path(char *path);
|
2016-02-01 11:45:39 +01:00
|
|
|
extern void init_net_server_extension(THD *thd);
|
2018-09-25 17:06:32 +02:00
|
|
|
extern void handle_accepted_socket(MYSQL_SOCKET new_sock, MYSQL_SOCKET sock);
|
|
|
|
extern void create_new_thread(CONNECT *connect);
|
2010-03-31 16:05:33 +02:00
|
|
|
|
2018-12-11 18:23:54 +01:00
|
|
|
extern void ssl_acceptor_stats_update(int sslaccept_ret);
|
|
|
|
extern int reinit_ssl();
|
|
|
|
|
2011-03-18 07:37:08 +01:00
|
|
|
extern "C" MYSQL_PLUGIN_IMPORT CHARSET_INFO *system_charset_info;
|
2010-03-31 16:05:33 +02:00
|
|
|
extern MYSQL_PLUGIN_IMPORT CHARSET_INFO *files_charset_info ;
|
|
|
|
extern MYSQL_PLUGIN_IMPORT CHARSET_INFO *national_charset_info;
|
|
|
|
extern MYSQL_PLUGIN_IMPORT CHARSET_INFO *table_alias_charset;
|
|
|
|
|
|
|
|
/**
|
|
|
|
Character set of the buildin error messages loaded from errmsg.sys.
|
|
|
|
*/
|
|
|
|
extern CHARSET_INFO *error_message_charset_info;
|
|
|
|
|
|
|
|
extern CHARSET_INFO *character_set_filesystem;
|
|
|
|
|
|
|
|
extern MY_BITMAP temp_pool;
|
2016-08-29 19:28:06 +02:00
|
|
|
extern bool opt_large_files;
|
2016-10-08 06:07:26 +02:00
|
|
|
extern bool opt_update_log, opt_bin_log, opt_error_log, opt_bin_log_compress;
|
|
|
|
extern uint opt_bin_log_compress_min_len;
|
2014-08-03 14:26:47 +02:00
|
|
|
extern my_bool opt_log, opt_bootstrap;
|
2010-03-31 16:05:33 +02:00
|
|
|
extern my_bool opt_backup_history_log;
|
|
|
|
extern my_bool opt_backup_progress_log;
|
[MDEV-10570] Add Flashback support
==== Description ====
Flashback can rollback the instances/databases/tables to an old snapshot.
It's implement on Server-Level by full image format binary logs (--binlog-row-image=FULL), so it supports all engines.
Currently, it’s a feature inside mysqlbinlog tool (with --flashback arguments).
Because the flashback binlog events will store in the memory, you should check if there is enough memory in your machine.
==== New Arguments to mysqlbinlog ====
--flashback (-B)
It will let mysqlbinlog to work on FLASHBACK mode.
==== New Arguments to mysqld ====
--flashback
Setup the server to use flashback. This enables binary log in row mode
and will enable extra logging for DDL's needed by flashback feature
==== Example ====
I have a table "t" in database "test", we can compare the output with "--flashback" and without.
#client/mysqlbinlog /data/mysqldata_10.0/binlog/mysql-bin.000001 -vv -d test -T t --start-datetime="2013-03-27 14:54:00" > /tmp/1.sql
#client/mysqlbinlog /data/mysqldata_10.0/binlog/mysql-bin.000001 -vv -d test -T t --start-datetime="2013-03-27 14:54:00" -B > /tmp/2.sql
Then, importing the output flashback file (/tmp/2.log), it can flashback your database/table to the special time (--start-datetime).
And if you know the exact postion, "--start-postion" is also works, mysqlbinlog will output the flashback logs that can flashback to "--start-postion" position.
==== Implement ====
1. As we know, if binlog_format is ROW (binlog-row-image=FULL in 10.1 and later), all columns value are store in the row event, so we can get the data before mis-operation.
2. Just do following things:
2.1 Change Event Type, INSERT->DELETE, DELETE->INSERT.
For example:
INSERT INTO t VALUES (...) ---> DELETE FROM t WHERE ...
DELETE FROM t ... ---> INSERT INTO t VALUES (...)
2.2 For Update_Event, swapping the SET part and WHERE part.
For example:
UPDATE t SET cols1 = vals1 WHERE cols2 = vals2
--->
UPDATE t SET cols2 = vals2 WHERE cols1 = vals1
2.3 For Multi-Rows Event, reverse the rows sequence, from the last row to the first row.
For example:
DELETE FROM t WHERE id=1; DELETE FROM t WHERE id=2; ...; DELETE FROM t WHERE id=n;
--->
DELETE FROM t WHERE id=n; ...; DELETE FROM t WHERE id=2; DELETE FROM t WHERE id=1;
2.4 Output those events from the last one to the first one which mis-operation happened.
For example:
2017-01-20 14:33:28 +01:00
|
|
|
extern my_bool opt_support_flashback;
|
2010-03-31 16:05:33 +02:00
|
|
|
extern ulonglong log_output_options;
|
|
|
|
extern ulong log_backup_output_options;
|
|
|
|
extern bool opt_disable_networking, opt_skip_show_db;
|
2010-04-19 14:09:44 +02:00
|
|
|
extern bool opt_skip_name_resolve;
|
2010-03-31 16:05:33 +02:00
|
|
|
extern bool opt_ignore_builtin_innodb;
|
|
|
|
extern my_bool opt_character_set_client_handshake;
|
2016-03-22 20:51:59 +01:00
|
|
|
extern my_bool debug_assert_on_not_freed_memory;
|
MDEV-22214 mariadbd.exe calls function mysqld.exe, and crashes
Stop linking plugins to the server executable on Windows.
Instead, extract whole server functionality into a large DLL, called
server.dll. Link both plugins, and small server "stub" exe to it.
This eliminates plugin dependency on the name of the server executable.
It also reduces the size of the packages (since tiny mysqld.exe
and mariadbd.exe are now both linked to one big DLL)
Also, simplify the functionality of exporing all symbols from selected
static libraries. Rely on WINDOWS_EXPORT_ALL_SYMBOLS, rather than old
self-backed solution.
fix compile error
replace GetProcAddress(GetModuleHandle(NULL), "variable_name")
for server exported data with actual variable names.
Runtime loading was never required,was error prone
, since symbols could be missing at runtime, and now it actually failed,
because we do not export symbols from executable anymore, but from a shared
library
This did require a MYSQL_PLUGIN_IMPORT decoration for the plugin,
but made the code more straightforward, and avoids missing symbols at
runtime (as mentioned before).
The audit plugin is still doing some dynamic loading, as it aims to work
cross-version. Now it won't work cross-version on Windows, as it already
uses some symbols that are *not* dynamically loaded, e.g fn_format
and those symbols now exported from server.dll , when earlier they were
exported by mysqld.exe
Windows, fixes for storage engine plugin loading
after various rebranding stuff
Create server.dll containing functionality of the whole server
make mariadbd.exe/mysqld.exe a stub that is only calling mysqld_main()
fix build
2020-04-10 14:09:18 +02:00
|
|
|
extern MYSQL_PLUGIN_IMPORT bool volatile abort_loop;
|
2010-07-23 22:13:36 +02:00
|
|
|
extern my_bool opt_safe_user_create;
|
2010-03-31 16:05:33 +02:00
|
|
|
extern my_bool opt_safe_show_db, opt_local_infile, opt_myisam_use_mmap;
|
|
|
|
extern my_bool opt_slave_compressed_protocol, use_temp_pool;
|
2014-02-05 18:01:59 +01:00
|
|
|
extern ulong slave_exec_mode_options, slave_ddl_exec_mode_options;
|
2012-10-03 00:44:54 +02:00
|
|
|
extern ulong slave_retried_transactions;
|
2017-04-25 19:08:45 +02:00
|
|
|
extern ulong transactions_multi_engine;
|
|
|
|
extern ulong rpl_transactions_multi_engine;
|
|
|
|
extern ulong transactions_gtid_foreign_engine;
|
2014-03-19 10:00:56 +01:00
|
|
|
extern ulong slave_run_triggers_for_rbr;
|
2010-03-31 16:05:33 +02:00
|
|
|
extern ulonglong slave_type_conversions_options;
|
2010-12-07 18:08:54 +01:00
|
|
|
extern my_bool read_only, opt_readonly;
|
2017-05-17 21:09:58 +02:00
|
|
|
extern MYSQL_PLUGIN_IMPORT my_bool lower_case_file_system;
|
2010-03-31 16:05:33 +02:00
|
|
|
extern my_bool opt_enable_named_pipe, opt_sync_frm, opt_allow_suspicious_udfs;
|
|
|
|
extern my_bool opt_secure_auth;
|
2020-03-02 23:46:07 +01:00
|
|
|
extern my_bool opt_require_secure_transport;
|
2015-01-11 16:37:25 +01:00
|
|
|
extern const char *current_dbug_option;
|
2010-03-31 16:05:33 +02:00
|
|
|
extern char* opt_secure_file_priv;
|
|
|
|
extern char* opt_secure_backup_file_priv;
|
|
|
|
extern size_t opt_secure_backup_file_priv_len;
|
|
|
|
extern my_bool sp_automatic_privileges, opt_noacl;
|
2012-06-03 02:19:01 +02:00
|
|
|
extern ulong use_stat_tables;
|
2010-03-31 16:05:33 +02:00
|
|
|
extern my_bool opt_old_style_user_limits, trust_function_creators;
|
|
|
|
extern uint opt_crash_binlog_innodb;
|
2017-02-28 13:57:33 +01:00
|
|
|
extern const char *shared_memory_base_name;
|
MDEV-22214 mariadbd.exe calls function mysqld.exe, and crashes
Stop linking plugins to the server executable on Windows.
Instead, extract whole server functionality into a large DLL, called
server.dll. Link both plugins, and small server "stub" exe to it.
This eliminates plugin dependency on the name of the server executable.
It also reduces the size of the packages (since tiny mysqld.exe
and mariadbd.exe are now both linked to one big DLL)
Also, simplify the functionality of exporing all symbols from selected
static libraries. Rely on WINDOWS_EXPORT_ALL_SYMBOLS, rather than old
self-backed solution.
fix compile error
replace GetProcAddress(GetModuleHandle(NULL), "variable_name")
for server exported data with actual variable names.
Runtime loading was never required,was error prone
, since symbols could be missing at runtime, and now it actually failed,
because we do not export symbols from executable anymore, but from a shared
library
This did require a MYSQL_PLUGIN_IMPORT decoration for the plugin,
but made the code more straightforward, and avoids missing symbols at
runtime (as mentioned before).
The audit plugin is still doing some dynamic loading, as it aims to work
cross-version. Now it won't work cross-version on Windows, as it already
uses some symbols that are *not* dynamically loaded, e.g fn_format
and those symbols now exported from server.dll , when earlier they were
exported by mysqld.exe
Windows, fixes for storage engine plugin loading
after various rebranding stuff
Create server.dll containing functionality of the whole server
make mariadbd.exe/mysqld.exe a stub that is only calling mysqld_main()
fix build
2020-04-10 14:09:18 +02:00
|
|
|
extern MYSQL_PLUGIN_IMPORT char *mysqld_unix_port;
|
2010-03-31 16:05:33 +02:00
|
|
|
extern my_bool opt_enable_shared_memory;
|
2012-03-01 12:41:49 +01:00
|
|
|
extern ulong opt_replicate_events_marked_for_skip;
|
2010-03-31 16:05:33 +02:00
|
|
|
extern char *default_tz_name;
|
|
|
|
extern Time_zone *default_tz;
|
2017-10-30 04:37:25 +01:00
|
|
|
extern char *my_bind_addr_str;
|
2014-06-14 22:15:52 +02:00
|
|
|
extern char *default_storage_engine, *default_tmp_storage_engine;
|
2015-03-10 07:28:51 +01:00
|
|
|
extern char *enforced_storage_engine;
|
2017-03-20 11:55:24 +01:00
|
|
|
extern char *gtid_pos_auto_engines;
|
|
|
|
extern plugin_ref *opt_gtid_pos_auto_plugins;
|
2010-03-31 16:05:33 +02:00
|
|
|
extern bool opt_endinfo, using_udf_functions;
|
|
|
|
extern my_bool locked_in_memory;
|
|
|
|
extern bool opt_using_transactions;
|
|
|
|
extern ulong current_pid;
|
2021-05-07 09:27:20 +02:00
|
|
|
extern double expire_logs_days;
|
|
|
|
extern ulong binlog_expire_logs_seconds;
|
2010-03-31 16:05:33 +02:00
|
|
|
extern my_bool relay_log_recovery;
|
|
|
|
extern uint sync_binlog_period, sync_relaylog_period,
|
|
|
|
sync_relayloginfo_period, sync_masterinfo_period;
|
|
|
|
extern ulong opt_tc_log_size, tc_log_max_pages_used, tc_log_page_size;
|
|
|
|
extern ulong tc_log_page_waits;
|
|
|
|
extern my_bool relay_log_purge, opt_innodb_safe_binlog, opt_innodb;
|
|
|
|
extern my_bool relay_log_recovery;
|
2018-07-20 13:35:58 +02:00
|
|
|
extern uint select_errors,ha_open_options;
|
|
|
|
extern ulonglong test_flags;
|
MDEV-22214 mariadbd.exe calls function mysqld.exe, and crashes
Stop linking plugins to the server executable on Windows.
Instead, extract whole server functionality into a large DLL, called
server.dll. Link both plugins, and small server "stub" exe to it.
This eliminates plugin dependency on the name of the server executable.
It also reduces the size of the packages (since tiny mysqld.exe
and mariadbd.exe are now both linked to one big DLL)
Also, simplify the functionality of exporing all symbols from selected
static libraries. Rely on WINDOWS_EXPORT_ALL_SYMBOLS, rather than old
self-backed solution.
fix compile error
replace GetProcAddress(GetModuleHandle(NULL), "variable_name")
for server exported data with actual variable names.
Runtime loading was never required,was error prone
, since symbols could be missing at runtime, and now it actually failed,
because we do not export symbols from executable anymore, but from a shared
library
This did require a MYSQL_PLUGIN_IMPORT decoration for the plugin,
but made the code more straightforward, and avoids missing symbols at
runtime (as mentioned before).
The audit plugin is still doing some dynamic loading, as it aims to work
cross-version. Now it won't work cross-version on Windows, as it already
uses some symbols that are *not* dynamically loaded, e.g fn_format
and those symbols now exported from server.dll , when earlier they were
exported by mysqld.exe
Windows, fixes for storage engine plugin loading
after various rebranding stuff
Create server.dll containing functionality of the whole server
make mariadbd.exe/mysqld.exe a stub that is only calling mysqld_main()
fix build
2020-04-10 14:09:18 +02:00
|
|
|
extern uint protocol_version, dropping_tables;
|
|
|
|
extern MYSQL_PLUGIN_IMPORT uint mysqld_port;
|
2010-08-05 14:34:19 +02:00
|
|
|
extern ulong delay_key_write_options;
|
BUG#11745230: 12133: MASTER.INDEX FILE KEEPS MYSQLD FROM STARTING IF
BIN LOG HAS BEEN MOVED
When moving the binary/relay log files from one location to
another and restarting the server with a different log-bin or
relay-log paths, would cause the startup process to abort. The
root cause was that the server would not be able to find the log
files because it would consider old paths for entries in the
index file instead of the new location. What's even worse, the
relative paths would not be considered relative to the path
provided in log-bin and relay-log, but to mysql_data_dir.
We fix the cases where the server contains relative paths. When
the server is reading from the index file, it checks whether the
entry contains relative paths. If it does, we replace it with the
absolute path set in log-bin/relay-log option. Absolute paths
remain unchanged and the index must be manually edited to
consider the new log-bin and/or relay-log path (this should be
documented). This is a fix for a GA version, that does not break
behavior (that much).
For development versions, we should go with Zhenxing's approach
that removes paths altogether from index files.
mysql-test/include/begin_include_file.inc:
Added parameter to keep the begin_include_file.inc silent. Useful when
including scripts that contain platform dependent parameters, for example:
--let $rpl_server_parameters=--log-bin=$tmpdir/slave-bin --relay-log=$tmpdir/slave-relay-bin
--let $keep_include_silent=1
source include/rpl_start_server.inc;
--let $keep_include_silent=0
We want the paths ($tmpdir/slave-bin and $tmpdir/slave-relay-bin) not to be in the
result file.
mysql-test/suite/rpl/t/rpl_binlog_index.test:
Test case.
sql/log.cc:
When finding the corresponding log entry in the index file, we first
normalize the paths before doing the comparison. This will make relative
paths to be turned into absolute paths (based on the opt_bin_logname or
opt_relay_logname) and then compared against also, expanded paths entered,
through CHANGE MASTER for instance.
sql/log.h:
Added normalize_binlog_name, which turns relative paths, into absolute paths
given the parameter: is_relay_log ? opt_relay_logname : opt_bin_logname .
sql/mysqld.cc:
Exposing opt_bin_logname.
sql/mysqld.h:
Exposing opt_bin_logname.
2011-11-24 18:15:58 +01:00
|
|
|
extern char *opt_logname, *opt_slow_logname, *opt_bin_logname,
|
|
|
|
*opt_relay_logname;
|
2018-06-26 11:56:19 +02:00
|
|
|
extern char *opt_binlog_index_name;
|
2010-03-31 16:05:33 +02:00
|
|
|
extern char *opt_backup_history_logname, *opt_backup_progress_logname,
|
|
|
|
*opt_backup_settings_name;
|
|
|
|
extern const char *log_output_str;
|
|
|
|
extern const char *log_backup_output_str;
|
2017-03-30 11:57:31 +02:00
|
|
|
|
2017-07-21 16:52:47 +02:00
|
|
|
/* System Versioning begin */
|
2017-12-18 17:03:51 +01:00
|
|
|
enum vers_system_time_t
|
2017-03-30 11:57:31 +02:00
|
|
|
{
|
2017-12-18 17:03:51 +01:00
|
|
|
SYSTEM_TIME_UNSPECIFIED = 0,
|
|
|
|
SYSTEM_TIME_AS_OF,
|
|
|
|
SYSTEM_TIME_FROM_TO,
|
|
|
|
SYSTEM_TIME_BETWEEN,
|
2019-11-25 14:01:43 +01:00
|
|
|
SYSTEM_TIME_BEFORE, // used for DELETE HISTORY ... BEFORE
|
|
|
|
SYSTEM_TIME_HISTORY, // used for DELETE HISTORY
|
2018-01-10 08:33:23 +01:00
|
|
|
SYSTEM_TIME_ALL
|
2017-03-30 11:57:31 +02:00
|
|
|
};
|
|
|
|
|
2017-12-18 17:03:51 +01:00
|
|
|
struct vers_asof_timestamp_t
|
2017-07-21 16:52:47 +02:00
|
|
|
{
|
2017-10-22 19:23:16 +02:00
|
|
|
ulong type;
|
2017-03-30 11:57:31 +02:00
|
|
|
MYSQL_TIME ltime;
|
|
|
|
};
|
|
|
|
|
2017-09-01 11:41:46 +02:00
|
|
|
enum vers_alter_history_enum
|
|
|
|
{
|
2017-11-24 17:15:10 +01:00
|
|
|
VERS_ALTER_HISTORY_ERROR= 0,
|
2018-02-26 17:17:17 +01:00
|
|
|
VERS_ALTER_HISTORY_KEEP
|
2017-09-01 11:41:46 +02:00
|
|
|
};
|
2017-07-21 16:52:47 +02:00
|
|
|
/* System Versioning end */
|
|
|
|
|
2010-03-31 16:05:33 +02:00
|
|
|
extern char *mysql_home_ptr, *pidfile_name_ptr;
|
2013-12-22 17:06:50 +01:00
|
|
|
extern MYSQL_PLUGIN_IMPORT char glob_hostname[FN_REFLEN];
|
|
|
|
extern char mysql_home[FN_REFLEN];
|
2010-03-31 16:05:33 +02:00
|
|
|
extern char pidfile_name[FN_REFLEN], system_time_zone[30], *opt_init_file;
|
|
|
|
extern char default_logfile_name[FN_REFLEN];
|
2020-10-15 01:25:57 +02:00
|
|
|
extern char log_error_file[FN_REFLEN], *opt_tc_log_file, *opt_ddl_recovery_file;
|
2010-03-31 16:05:33 +02:00
|
|
|
extern const double log_10[309];
|
|
|
|
extern ulonglong keybuff_size;
|
|
|
|
extern ulonglong thd_startup_options;
|
2016-02-01 11:45:39 +01:00
|
|
|
extern my_thread_id global_thread_id;
|
2010-03-31 16:05:33 +02:00
|
|
|
extern ulong binlog_cache_use, binlog_cache_disk_use;
|
2010-11-05 18:42:37 +01:00
|
|
|
extern ulong binlog_stmt_cache_use, binlog_stmt_cache_disk_use;
|
2019-05-13 21:34:16 +02:00
|
|
|
extern ulong aborted_threads, aborted_connects, aborted_connects_preauth;
|
2010-03-31 16:05:33 +02:00
|
|
|
extern ulong delayed_insert_timeout;
|
|
|
|
extern ulong delayed_insert_limit, delayed_queue_size;
|
|
|
|
extern ulong delayed_insert_threads, delayed_insert_writes;
|
|
|
|
extern ulong delayed_rows_in_use,delayed_insert_errors;
|
2020-04-15 18:38:25 +02:00
|
|
|
extern Atomic_counter<uint32_t> slave_open_temp_tables;
|
2011-12-02 19:49:05 +01:00
|
|
|
extern ulonglong query_cache_size;
|
2013-07-16 14:44:38 +02:00
|
|
|
extern ulong query_cache_limit;
|
2011-12-02 19:49:05 +01:00
|
|
|
extern ulong query_cache_min_res_unit;
|
2010-03-31 16:05:33 +02:00
|
|
|
extern ulong slow_launch_threads, slow_launch_time;
|
|
|
|
extern MYSQL_PLUGIN_IMPORT ulong max_connections;
|
2015-06-01 21:31:31 +02:00
|
|
|
extern uint max_digest_length;
|
2010-03-31 16:05:33 +02:00
|
|
|
extern ulong max_connect_errors, connect_timeout;
|
2018-12-05 13:13:07 +01:00
|
|
|
extern uint max_password_errors;
|
2010-03-31 16:05:33 +02:00
|
|
|
extern my_bool slave_allow_batching;
|
|
|
|
extern my_bool allow_slave_start;
|
|
|
|
extern LEX_CSTRING reason_slave_blocked;
|
|
|
|
extern ulong slave_trans_retries;
|
2017-11-07 10:04:45 +01:00
|
|
|
extern ulong slave_trans_retry_interval;
|
2010-03-31 16:05:33 +02:00
|
|
|
extern uint slave_net_timeout;
|
2011-11-22 18:04:38 +01:00
|
|
|
extern int max_user_connections;
|
2010-03-31 16:05:33 +02:00
|
|
|
extern ulong what_to_log,flush_time;
|
2018-03-26 22:55:56 +02:00
|
|
|
extern uint max_prepared_stmt_count, prepared_stmt_count;
|
2018-04-16 20:09:14 +02:00
|
|
|
extern MYSQL_PLUGIN_IMPORT ulong open_files_limit;
|
2017-10-30 21:39:55 +01:00
|
|
|
extern ulonglong binlog_cache_size, binlog_stmt_cache_size, binlog_file_cache_size;
|
2011-12-02 19:49:05 +01:00
|
|
|
extern ulonglong max_binlog_cache_size, max_binlog_stmt_cache_size;
|
2012-10-01 01:30:44 +02:00
|
|
|
extern ulong max_binlog_size;
|
2012-06-12 09:29:56 +02:00
|
|
|
extern ulong slave_max_allowed_packet;
|
2010-03-31 16:05:33 +02:00
|
|
|
extern ulong opt_binlog_rows_event_max_size;
|
2019-09-01 09:55:16 +02:00
|
|
|
extern ulong binlog_row_metadata;
|
2019-03-01 19:36:29 +01:00
|
|
|
extern ulong thread_cache_size;
|
2012-01-25 10:59:30 +01:00
|
|
|
extern ulong stored_program_cache_size;
|
2013-06-24 10:50:25 +02:00
|
|
|
extern ulong opt_slave_parallel_threads;
|
MDEV-5657: Parallel replication.
Clean up and improve the parallel implementation code, mainly related to
scheduling of work to threads and handling of stop and errors.
Fix a lot of bugs in various corner cases that could lead to crashes or
corruption.
Fix that a single replication domain could easily grab all worker threads and
stall all other domains; now a configuration variable
--slave-domain-parallel-threads allows to limit the number of
workers.
Allow next event group to start as soon as previous group begins the commit
phase (as opposed to when it ends it); this allows multiple event groups on
the slave to participate in group commit, even when no other opportunities for
parallelism are available.
Various fixes:
- Fix some races in the rpl.rpl_parallel test case.
- Fix an old incorrect assertion in Log_event iocache read.
- Fix repeated malloc/free of wait_for_commit and rpl_group_info objects.
- Simplify wait_for_commit wakeup logic.
- Fix one case in queue_for_group_commit() where killing one thread would
fail to correctly signal the error to the next, causing loss of the
transaction after slave restart.
- Fix leaking of pthreads (and their allocated stack) due to missing
PTHREAD_CREATE_DETACHED attribute.
- Fix how one batch of group-committed transactions wait for the previous
batch before starting to execute themselves. The old code had a very
complex scheduling where the first transaction was handled differently,
with subtle bugs in corner cases. Now each event group is always scheduled
for a new worker (in a round-robin fashion amongst available workers).
Keep a count of how many transactions have started to commit, and wait for
that counter to reach the appropriate value.
- Fix slave stop to wait for all workers to actually complete processing;
before, the wait was for update of last_committed_sub_id, which happens a
bit earlier, and could leave worker threads potentially accessing bits of
the replication state that is no longer valid after slave stop.
- Fix a couple of places where the test suite would kill a thread waiting
inside enter_cond() in connection with debug_sync; debug_sync + kill can
crash in rare cases due to a race with mysys_var_current_mutex in this
case.
- Fix some corner cases where we had enter_cond() but no exit_cond().
- Fix that we could get failure in wait_for_prior_commit() but forget to flag
the error with my_error().
- Fix slave stop (both for normal stop and stop due to error). Now, at stop
we pick a specific safe point (in terms of event groups executed) and make
sure that all event groups before that point are executed to completion,
and that no event group after start executing; this ensures a safe place to
restart replication, even for non-transactional stuff/DDL. In error stop,
make sure that all prior event groups are allowed to execute to completion,
and that any later event groups that have started are rolled back, if
possible. The old code could leave eg. T1 and T3 committed but T2 not, or
it could even leave half a transaction not rolled back in some random
worker, which would cause big problems when that worker was later reused
after slave restart.
- Fix the accounting of amount of events queued for one worker. Before, the
amount was reduced immediately as soon as the events were dequeued (which
happens all at once); this allowed twice the amount of events to be queued
in memory for each single worker, which is not what users would expect.
- Fix that an error set during execution of one event was sometimes not
cleared before executing the next, causing problems with the error
reporting.
- Fix incorrect handling of thd->killed in worker threads.
2014-02-26 15:02:09 +01:00
|
|
|
extern ulong opt_slave_domain_parallel_threads;
|
2013-10-24 12:44:21 +02:00
|
|
|
extern ulong opt_slave_parallel_max_queued;
|
2015-02-06 10:02:02 +01:00
|
|
|
extern ulong opt_slave_parallel_mode;
|
2013-07-05 00:26:15 +02:00
|
|
|
extern ulong opt_binlog_commit_wait_count;
|
|
|
|
extern ulong opt_binlog_commit_wait_usec;
|
2014-03-09 10:27:38 +01:00
|
|
|
extern my_bool opt_gtid_ignore_duplicates;
|
2018-10-14 20:41:49 +02:00
|
|
|
extern uint opt_gtid_cleanup_batch_size;
|
2010-03-31 16:05:33 +02:00
|
|
|
extern ulong back_log;
|
2012-09-09 00:22:06 +02:00
|
|
|
extern ulong executed_events;
|
2010-03-31 16:05:33 +02:00
|
|
|
extern char language[FN_REFLEN];
|
2011-03-18 07:37:08 +01:00
|
|
|
extern "C" MYSQL_PLUGIN_IMPORT ulong server_id;
|
|
|
|
extern ulong concurrency;
|
2010-03-31 16:05:33 +02:00
|
|
|
extern time_t server_start_time, flush_status_time;
|
|
|
|
extern char *opt_mysql_tmpdir, mysql_charsets_dir[];
|
2018-02-06 13:55:58 +01:00
|
|
|
extern size_t mysql_unpacked_real_data_home_len;
|
2010-04-12 15:35:06 +02:00
|
|
|
extern MYSQL_PLUGIN_IMPORT MY_TMPDIR mysql_tmpdir_list;
|
2018-03-27 13:44:40 +02:00
|
|
|
extern const char *first_keyword, *delayed_user;
|
2010-03-31 16:05:33 +02:00
|
|
|
extern MYSQL_PLUGIN_IMPORT const char *my_localhost;
|
|
|
|
extern MYSQL_PLUGIN_IMPORT const char **errmesg; /* Error messages */
|
|
|
|
extern const char *myisam_recover_options_str;
|
2017-04-23 18:39:57 +02:00
|
|
|
extern const LEX_CSTRING in_left_expr_name, in_additional_cond, in_having_cond;
|
Reduce usage of strlen()
Changes:
- To detect automatic strlen() I removed the methods in String that
uses 'const char *' without a length:
- String::append(const char*)
- Binary_string(const char *str)
- String(const char *str, CHARSET_INFO *cs)
- append_for_single_quote(const char *)
All usage of append(const char*) is changed to either use
String::append(char), String::append(const char*, size_t length) or
String::append(LEX_CSTRING)
- Added STRING_WITH_LEN() around constant string arguments to
String::append()
- Added overflow argument to escape_string_for_mysql() and
escape_quotes_for_mysql() instead of returning (size_t) -1 on overflow.
This was needed as most usage of the above functions never tested the
result for -1 and would have given wrong results or crashes in case
of overflows.
- Added Item_func_or_sum::func_name_cstring(), which returns LEX_CSTRING.
Changed all Item_func::func_name()'s to func_name_cstring()'s.
The old Item_func_or_sum::func_name() is now an inline function that
returns func_name_cstring().str.
- Changed Item::mode_name() and Item::func_name_ext() to return
LEX_CSTRING.
- Changed for some functions the name argument from const char * to
to const LEX_CSTRING &:
- Item::Item_func_fix_attributes()
- Item::check_type_...()
- Type_std_attributes::agg_item_collations()
- Type_std_attributes::agg_item_set_converter()
- Type_std_attributes::agg_arg_charsets...()
- Type_handler_hybrid_field_type::aggregate_for_result()
- Type_handler_geometry::check_type_geom_or_binary()
- Type_handler::Item_func_or_sum_illegal_param()
- Predicant_to_list_comparator::add_value_skip_null()
- Predicant_to_list_comparator::add_value()
- cmp_item_row::prepare_comparators()
- cmp_item_row::aggregate_row_elements_for_comparison()
- Cursor_ref::print_func()
- Removes String_space() as it was only used in one cases and that
could be simplified to not use String_space(), thanks to the fixed
my_vsnprintf().
- Added some const LEX_CSTRING's for common strings:
- NULL_clex_str, DATA_clex_str, INDEX_clex_str.
- Changed primary_key_name to a LEX_CSTRING
- Renamed String::set_quick() to String::set_buffer_if_not_allocated() to
clarify what the function really does.
- Rename of protocol function:
bool store(const char *from, CHARSET_INFO *cs) to
bool store_string_or_null(const char *from, CHARSET_INFO *cs).
This was done to both clarify the difference between this 'store' function
and also to make it easier to find unoptimal usage of store() calls.
- Added Protocol::store(const LEX_CSTRING*, CHARSET_INFO*)
- Changed some 'const char*' arrays to instead be of type LEX_CSTRING.
- class Item_func_units now used LEX_CSTRING for name.
Other things:
- Fixed a bug in mysql.cc:construct_prompt() where a wrong escape character
in the prompt would cause some part of the prompt to be duplicated.
- Fixed a lot of instances where the length of the argument to
append is known or easily obtain but was not used.
- Removed some not needed 'virtual' definition for functions that was
inherited from the parent. I added override to these.
- Fixed Ordered_key::print() to preallocate needed buffer. Old code could
case memory overruns.
- Simplified some loops when adding char * to a String with delimiters.
2020-08-12 19:29:55 +02:00
|
|
|
extern const LEX_CSTRING NULL_clex_str;
|
|
|
|
extern const LEX_CSTRING error_clex_str;
|
2010-03-31 16:05:33 +02:00
|
|
|
extern SHOW_VAR status_vars[];
|
|
|
|
extern struct system_variables max_system_variables;
|
|
|
|
extern struct system_status_var global_status_var;
|
2010-11-25 18:17:28 +01:00
|
|
|
extern struct my_rnd_struct sql_rand;
|
2010-03-31 16:05:33 +02:00
|
|
|
extern const char *opt_date_time_formats[];
|
|
|
|
extern handlerton *partition_hton;
|
|
|
|
extern handlerton *myisam_hton;
|
|
|
|
extern handlerton *heap_hton;
|
|
|
|
extern const char *load_default_groups[];
|
|
|
|
extern struct my_option my_long_options[];
|
2013-08-01 14:09:26 +02:00
|
|
|
int handle_early_options();
|
MDEV-22214 mariadbd.exe calls function mysqld.exe, and crashes
Stop linking plugins to the server executable on Windows.
Instead, extract whole server functionality into a large DLL, called
server.dll. Link both plugins, and small server "stub" exe to it.
This eliminates plugin dependency on the name of the server executable.
It also reduces the size of the packages (since tiny mysqld.exe
and mariadbd.exe are now both linked to one big DLL)
Also, simplify the functionality of exporing all symbols from selected
static libraries. Rely on WINDOWS_EXPORT_ALL_SYMBOLS, rather than old
self-backed solution.
fix compile error
replace GetProcAddress(GetModuleHandle(NULL), "variable_name")
for server exported data with actual variable names.
Runtime loading was never required,was error prone
, since symbols could be missing at runtime, and now it actually failed,
because we do not export symbols from executable anymore, but from a shared
library
This did require a MYSQL_PLUGIN_IMPORT decoration for the plugin,
but made the code more straightforward, and avoids missing symbols at
runtime (as mentioned before).
The audit plugin is still doing some dynamic loading, as it aims to work
cross-version. Now it won't work cross-version on Windows, as it already
uses some symbols that are *not* dynamically loaded, e.g fn_format
and those symbols now exported from server.dll , when earlier they were
exported by mysqld.exe
Windows, fixes for storage engine plugin loading
after various rebranding stuff
Create server.dll containing functionality of the whole server
make mariadbd.exe/mysqld.exe a stub that is only calling mysqld_main()
fix build
2020-04-10 14:09:18 +02:00
|
|
|
extern int MYSQL_PLUGIN_IMPORT mysqld_server_started;
|
|
|
|
extern int mysqld_server_initialized;
|
2011-03-18 07:37:08 +01:00
|
|
|
extern "C" MYSQL_PLUGIN_IMPORT int orig_argc;
|
|
|
|
extern "C" MYSQL_PLUGIN_IMPORT char **orig_argv;
|
2010-03-31 16:05:33 +02:00
|
|
|
extern pthread_attr_t connection_attrib;
|
|
|
|
extern my_bool old_mode;
|
|
|
|
extern LEX_STRING opt_init_connect, opt_init_slave;
|
|
|
|
extern char err_shared_dir[];
|
2013-06-27 11:51:34 +02:00
|
|
|
extern ulong connection_errors_select;
|
|
|
|
extern ulong connection_errors_accept;
|
|
|
|
extern ulong connection_errors_tcpwrap;
|
|
|
|
extern ulong connection_errors_internal;
|
|
|
|
extern ulong connection_errors_max_connection;
|
|
|
|
extern ulong connection_errors_peer_addr;
|
2012-08-01 16:27:34 +02:00
|
|
|
extern ulong log_warnings;
|
2015-09-02 09:58:08 +02:00
|
|
|
extern my_bool encrypt_binlog;
|
2015-05-27 00:18:20 +02:00
|
|
|
extern my_bool encrypt_tmp_disk_tables, encrypt_tmp_files;
|
2014-12-22 15:53:17 +01:00
|
|
|
extern ulong encryption_algorithm;
|
|
|
|
extern const char *encryption_algorithm_names[];
|
2018-05-02 17:55:00 +02:00
|
|
|
extern long opt_secure_timestamp;
|
2019-02-18 23:47:08 +01:00
|
|
|
extern uint default_password_lifetime;
|
2019-01-16 18:44:30 +01:00
|
|
|
extern my_bool disconnect_on_expired_password;
|
2018-05-02 17:55:00 +02:00
|
|
|
|
|
|
|
enum secure_timestamp { SECTIME_NO, SECTIME_SUPER, SECTIME_REPL, SECTIME_YES };
|
2010-03-31 16:05:33 +02:00
|
|
|
|
|
|
|
#ifdef HAVE_MMAP
|
|
|
|
extern PSI_mutex_key key_PAGE_lock, key_LOCK_sync, key_LOCK_active,
|
2012-09-13 14:31:29 +02:00
|
|
|
key_LOCK_pool, key_LOCK_pending_checkpoint;
|
2010-03-31 16:05:33 +02:00
|
|
|
#endif /* HAVE_MMAP */
|
|
|
|
|
|
|
|
#ifdef HAVE_OPENSSL
|
|
|
|
extern PSI_mutex_key key_LOCK_des_key_file;
|
|
|
|
#endif
|
|
|
|
|
2012-06-22 11:46:28 +02:00
|
|
|
extern PSI_mutex_key key_BINLOG_LOCK_index, key_BINLOG_LOCK_xid_list,
|
2012-12-14 15:38:07 +01:00
|
|
|
key_BINLOG_LOCK_binlog_background_thread,
|
2017-10-26 16:20:20 +02:00
|
|
|
key_LOCK_binlog_end_pos,
|
2010-03-31 16:05:33 +02:00
|
|
|
key_delayed_insert_mutex, key_hash_filo_lock, key_LOCK_active_mi,
|
2019-05-19 15:00:31 +02:00
|
|
|
key_LOCK_crypt, key_LOCK_delayed_create,
|
2010-03-31 16:05:33 +02:00
|
|
|
key_LOCK_delayed_insert, key_LOCK_delayed_status, key_LOCK_error_log,
|
2010-11-11 18:11:05 +01:00
|
|
|
key_LOCK_gdl, key_LOCK_global_system_variables,
|
2010-07-27 16:32:42 +02:00
|
|
|
key_LOCK_logger, key_LOCK_manager,
|
2010-08-12 15:50:23 +02:00
|
|
|
key_LOCK_prepared_stmt_count,
|
2014-09-12 13:49:13 +02:00
|
|
|
key_LOCK_rpl_status, key_LOCK_server_started,
|
2019-01-24 19:26:34 +01:00
|
|
|
key_LOCK_status,
|
2017-08-05 18:26:10 +02:00
|
|
|
key_LOCK_thd_data, key_LOCK_thd_kill,
|
2011-07-13 21:10:18 +02:00
|
|
|
key_LOCK_user_conn, key_LOG_LOCK_log,
|
2010-03-31 16:05:33 +02:00
|
|
|
key_master_info_data_lock, key_master_info_run_lock,
|
2017-01-29 22:44:24 +01:00
|
|
|
key_master_info_sleep_lock, key_master_info_start_stop_lock,
|
2010-03-31 16:05:33 +02:00
|
|
|
key_mutex_slave_reporting_capability_err_lock, key_relay_log_info_data_lock,
|
|
|
|
key_relay_log_info_log_space_lock, key_relay_log_info_run_lock,
|
Fixes for parallel slave:
- Made slaves temporary table multi-thread slave safe by adding mutex around save_temporary_table usage.
- rli->save_temporary_tables is the active list of all used temporary tables
- This is copied to THD->temporary_tables when temporary tables are opened and updated when temporary tables are closed
- Added THD->lock_temporary_tables() and THD->unlock_temporary_tables() to simplify this.
- Relay_log_info->sql_thd renamed to Relay_log_info->sql_driver_thd to avoid wrong usage for merged code.
- Added is_part_of_group() to mark functions that are part of the next function. This replaces setting IN_STMT when events are executed.
- Added is_begin(), is_commit() and is_rollback() functions to Query_log_event to simplify code.
- If slave_skip_counter is set run things in single threaded mode. This simplifies code for skipping events.
- Updating state of relay log (IN_STMT and IN_TRANSACTION) is moved to one single function: update_state_of_relay_log()
We can't use OPTION_BEGIN to check for the state anymore as the sql_driver and sql execution threads may be different.
Clear IN_STMT and IN_TRANSACTION in init_relay_log_pos() and Relay_log_info::cleanup_context() to ensure the flags doesn't survive slave restarts
is_in_group() is now independent of state of executed transaction.
- Reset thd->transaction.all.modified_non_trans_table() if we did set it for single table row events.
This was mainly for keeping the flag as documented.
- Changed slave_open_temp_tables to uint32 to be able to use atomic operators on it.
- Relay_log_info::sleep_lock -> rpl_group_info::sleep_lock
- Relay_log_info::sleep_cond -> rpl_group_info::sleep_cond
- Changed some functions to take rpl_group_info instead of Relay_log_info to make them multi-slave safe and to simplify usage
- do_shall_skip()
- continue_group()
- sql_slave_killed()
- next_event()
- Simplifed arguments to io_salve_killed(), check_io_slave_killed() and sql_slave_killed(); No reason to supply THD as this is part of the given structure.
- set_thd_in_use_temporary_tables() removed as in_use is set on usage
- Added information to thd_proc_info() which thread is waiting for slave mutex to exit.
- In open_table() reuse code from find_temporary_table()
Other things:
- More DBUG statements
- Fixed the rpl_incident.test can be run with --debug
- More comments
- Disabled not used function rpl_connect_master()
mysql-test/suite/perfschema/r/all_instances.result:
Moved sleep_lock and sleep_cond to rpl_group_info
mysql-test/suite/rpl/r/rpl_incident.result:
Updated result
mysql-test/suite/rpl/t/rpl_incident-master.opt:
Not needed anymore
mysql-test/suite/rpl/t/rpl_incident.test:
Fixed that test can be run with --debug
sql/handler.cc:
More DBUG_PRINT
sql/log.cc:
More comments
sql/log_event.cc:
Added DBUG statements
do_shall_skip(), continue_group() now takes rpl_group_info param
Use is_begin(), is_commit() and is_rollback() functions instead of inspecting query string
We don't have set slaves temporary tables 'in_use' as this is now done when tables are opened.
Removed IN_STMT flag setting. This is now done in update_state_of_relay_log()
Use IN_TRANSACTION flag to test state of relay log.
In rows_event_stmt_cleanup() reset thd->transaction.all.modified_non_trans_table if we had set this before.
sql/log_event.h:
do_shall_skip(), continue_group() now takes rpl_group_info param
Added is_part_of_group() to mark events that are part of the next event. This replaces setting IN_STMT when events are executed.
Added is_begin(), is_commit() and is_rollback() functions to Query_log_event to simplify code.
sql/log_event_old.cc:
Removed IN_STMT flag setting. This is now done in update_state_of_relay_log()
do_shall_skip(), continue_group() now takes rpl_group_info param
sql/log_event_old.h:
Added is_part_of_group() to mark events that are part of the next event.
do_shall_skip(), continue_group() now takes rpl_group_info param
sql/mysqld.cc:
Changed slave_open_temp_tables to uint32 to be able to use atomic operators on it.
Relay_log_info::sleep_lock -> Rpl_group_info::sleep_lock
Relay_log_info::sleep_cond -> Rpl_group_info::sleep_cond
sql/mysqld.h:
Updated types and names
sql/rpl_gtid.cc:
More DBUG
sql/rpl_parallel.cc:
Updated TODO section
Set thd for event that is execution
Use new is_begin(), is_commit() and is_rollback() functions.
More comments
sql/rpl_rli.cc:
sql_thd -> sql_driver_thd
Relay_log_info::sleep_lock -> rpl_group_info::sleep_lock
Relay_log_info::sleep_cond -> rpl_group_info::sleep_cond
Clear IN_STMT and IN_TRANSACTION in init_relay_log_pos() and Relay_log_info::cleanup_context() to ensure the flags doesn't survive slave restarts.
Reset table->in_use for temporary tables as the table may have been used by another THD.
Use IN_TRANSACTION instead of OPTION_BEGIN to check state of relay log.
Removed IN_STMT flag setting. This is now done in update_state_of_relay_log()
sql/rpl_rli.h:
Changed relay log state flags to bit masks instead of bit positions (most other code we have uses bit masks)
Added IN_TRANSACTION to mark if we are in a BEGIN ... COMMIT section.
save_temporary_tables is now thread safe
Relay_log_info::sleep_lock -> rpl_group_info::sleep_lock
Relay_log_info::sleep_cond -> rpl_group_info::sleep_cond
Relay_log_info->sql_thd renamed to Relay_log_info->sql_driver_thd to avoid wrong usage for merged code
is_in_group() is now independent of state of executed transaction.
sql/slave.cc:
Simplifed arguments to io_salve_killed(), sql_slave_killed() and check_io_slave_killed(); No reason to supply THD as this is part of the given structure.
set_thd_in_use_temporary_tables() removed as in_use is set on usage in sql_base.cc
sql_thd -> sql_driver_thd
More DBUG
Added update_state_of_relay_log() which will calculate the IN_STMT and IN_TRANSACTION state of the relay log after the current element is executed.
If slave_skip_counter is set run things in single threaded mode.
Simplifed arguments to io_salve_killed(), check_io_slave_killed() and sql_slave_killed(); No reason to supply THD as this is part of the given structure.
Added information to thd_proc_info() which thread is waiting for slave mutex to exit.
Disabled not used function rpl_connect_master()
Updated argument to next_event()
sql/sql_base.cc:
Added mutex around usage of slave's temporary tables. The active list is always kept up to date in sql->rgi_slave->save_temporary_tables.
Clear thd->temporary_tables after query (safety)
More DBUG
When using temporary table, set table->in_use to current thd as the THD may be different for slave threads.
Some code is ifdef:ed with REMOVE_AFTER_MERGE_WITH_10 as the given code in 10.0 is not yet in this tree.
In open_table() reuse code from find_temporary_table()
sql/sql_binlog.cc:
rli->sql_thd -> rli->sql_driver_thd
Remove duplicate setting of rgi->rli
sql/sql_class.cc:
Added helper functions rgi_lock_temporary_tables() and rgi_unlock_temporary_tables()
Would have been nicer to have these inline, but there was no easy way to do that
sql/sql_class.h:
Added functions to protect slaves temporary tables
sql/sql_parse.cc:
Added DBUG_PRINT
sql/transaction.cc:
Added comment
2013-10-13 23:24:05 +02:00
|
|
|
key_rpl_group_info_sleep_lock,
|
2010-05-24 14:51:59 +02:00
|
|
|
key_structure_guard_mutex, key_TABLE_SHARE_LOCK_ha_data,
|
2017-05-29 15:08:11 +02:00
|
|
|
key_LOCK_start_thread,
|
2019-01-24 18:56:59 +01:00
|
|
|
key_LOCK_error_messages,
|
2019-01-19 23:32:35 +01:00
|
|
|
key_PARTITION_LOCK_auto_inc;
|
2011-03-01 17:39:28 +01:00
|
|
|
extern PSI_mutex_key key_RELAYLOG_LOCK_index;
|
2017-11-22 16:10:34 +01:00
|
|
|
extern PSI_mutex_key key_LOCK_relaylog_end_pos;
|
2013-06-24 10:50:25 +02:00
|
|
|
extern PSI_mutex_key key_LOCK_slave_state, key_LOCK_binlog_state,
|
2013-07-03 13:46:33 +02:00
|
|
|
key_LOCK_rpl_thread, key_LOCK_rpl_thread_pool, key_LOCK_parallel_entry;
|
2010-03-31 16:05:33 +02:00
|
|
|
|
2013-07-21 16:39:19 +02:00
|
|
|
extern PSI_mutex_key key_TABLE_SHARE_LOCK_share, key_LOCK_stats,
|
2011-04-25 17:22:25 +02:00
|
|
|
key_LOCK_global_user_client_stats, key_LOCK_global_table_stats,
|
2016-12-11 18:04:11 +01:00
|
|
|
key_LOCK_global_index_stats, key_LOCK_wakeup_ready, key_LOCK_wait_commit,
|
|
|
|
key_TABLE_SHARE_LOCK_rotation;
|
2014-02-07 19:15:28 +01:00
|
|
|
extern PSI_mutex_key key_LOCK_gtid_waiting;
|
2011-04-25 17:22:25 +02:00
|
|
|
|
2010-03-31 16:05:33 +02:00
|
|
|
extern PSI_rwlock_key key_rwlock_LOCK_grant, key_rwlock_LOCK_logger,
|
|
|
|
key_rwlock_LOCK_sys_init_connect, key_rwlock_LOCK_sys_init_slave,
|
2017-05-29 15:08:11 +02:00
|
|
|
key_rwlock_LOCK_system_variables_hash, key_rwlock_query_cache_query_lock,
|
2017-11-06 22:37:49 +01:00
|
|
|
key_LOCK_SEQUENCE,
|
2019-01-24 18:56:59 +01:00
|
|
|
key_rwlock_LOCK_vers_stats, key_rwlock_LOCK_stat_serial,
|
|
|
|
key_rwlock_THD_list;
|
2010-03-31 16:05:33 +02:00
|
|
|
|
|
|
|
#ifdef HAVE_MMAP
|
2011-10-25 12:53:40 +02:00
|
|
|
extern PSI_cond_key key_PAGE_cond, key_COND_active, key_COND_pool;
|
2010-03-31 16:05:33 +02:00
|
|
|
#endif /* HAVE_MMAP */
|
|
|
|
|
2012-06-22 11:46:28 +02:00
|
|
|
extern PSI_cond_key key_BINLOG_COND_xid_list, key_BINLOG_update_cond,
|
2012-12-14 15:38:07 +01:00
|
|
|
key_BINLOG_COND_binlog_background_thread,
|
|
|
|
key_BINLOG_COND_binlog_background_thread_end,
|
2010-11-11 18:11:05 +01:00
|
|
|
key_COND_cache_status_changed, key_COND_manager,
|
2010-07-27 15:34:58 +02:00
|
|
|
key_COND_rpl_status, key_COND_server_started,
|
2010-03-31 16:05:33 +02:00
|
|
|
key_delayed_insert_cond, key_delayed_insert_cond_client,
|
|
|
|
key_item_func_sleep_cond, key_master_info_data_cond,
|
|
|
|
key_master_info_start_cond, key_master_info_stop_cond,
|
2012-01-23 13:09:37 +01:00
|
|
|
key_master_info_sleep_cond,
|
2010-03-31 16:05:33 +02:00
|
|
|
key_relay_log_info_data_cond, key_relay_log_info_log_space_cond,
|
|
|
|
key_relay_log_info_start_cond, key_relay_log_info_stop_cond,
|
Fixes for parallel slave:
- Made slaves temporary table multi-thread slave safe by adding mutex around save_temporary_table usage.
- rli->save_temporary_tables is the active list of all used temporary tables
- This is copied to THD->temporary_tables when temporary tables are opened and updated when temporary tables are closed
- Added THD->lock_temporary_tables() and THD->unlock_temporary_tables() to simplify this.
- Relay_log_info->sql_thd renamed to Relay_log_info->sql_driver_thd to avoid wrong usage for merged code.
- Added is_part_of_group() to mark functions that are part of the next function. This replaces setting IN_STMT when events are executed.
- Added is_begin(), is_commit() and is_rollback() functions to Query_log_event to simplify code.
- If slave_skip_counter is set run things in single threaded mode. This simplifies code for skipping events.
- Updating state of relay log (IN_STMT and IN_TRANSACTION) is moved to one single function: update_state_of_relay_log()
We can't use OPTION_BEGIN to check for the state anymore as the sql_driver and sql execution threads may be different.
Clear IN_STMT and IN_TRANSACTION in init_relay_log_pos() and Relay_log_info::cleanup_context() to ensure the flags doesn't survive slave restarts
is_in_group() is now independent of state of executed transaction.
- Reset thd->transaction.all.modified_non_trans_table() if we did set it for single table row events.
This was mainly for keeping the flag as documented.
- Changed slave_open_temp_tables to uint32 to be able to use atomic operators on it.
- Relay_log_info::sleep_lock -> rpl_group_info::sleep_lock
- Relay_log_info::sleep_cond -> rpl_group_info::sleep_cond
- Changed some functions to take rpl_group_info instead of Relay_log_info to make them multi-slave safe and to simplify usage
- do_shall_skip()
- continue_group()
- sql_slave_killed()
- next_event()
- Simplifed arguments to io_salve_killed(), check_io_slave_killed() and sql_slave_killed(); No reason to supply THD as this is part of the given structure.
- set_thd_in_use_temporary_tables() removed as in_use is set on usage
- Added information to thd_proc_info() which thread is waiting for slave mutex to exit.
- In open_table() reuse code from find_temporary_table()
Other things:
- More DBUG statements
- Fixed the rpl_incident.test can be run with --debug
- More comments
- Disabled not used function rpl_connect_master()
mysql-test/suite/perfschema/r/all_instances.result:
Moved sleep_lock and sleep_cond to rpl_group_info
mysql-test/suite/rpl/r/rpl_incident.result:
Updated result
mysql-test/suite/rpl/t/rpl_incident-master.opt:
Not needed anymore
mysql-test/suite/rpl/t/rpl_incident.test:
Fixed that test can be run with --debug
sql/handler.cc:
More DBUG_PRINT
sql/log.cc:
More comments
sql/log_event.cc:
Added DBUG statements
do_shall_skip(), continue_group() now takes rpl_group_info param
Use is_begin(), is_commit() and is_rollback() functions instead of inspecting query string
We don't have set slaves temporary tables 'in_use' as this is now done when tables are opened.
Removed IN_STMT flag setting. This is now done in update_state_of_relay_log()
Use IN_TRANSACTION flag to test state of relay log.
In rows_event_stmt_cleanup() reset thd->transaction.all.modified_non_trans_table if we had set this before.
sql/log_event.h:
do_shall_skip(), continue_group() now takes rpl_group_info param
Added is_part_of_group() to mark events that are part of the next event. This replaces setting IN_STMT when events are executed.
Added is_begin(), is_commit() and is_rollback() functions to Query_log_event to simplify code.
sql/log_event_old.cc:
Removed IN_STMT flag setting. This is now done in update_state_of_relay_log()
do_shall_skip(), continue_group() now takes rpl_group_info param
sql/log_event_old.h:
Added is_part_of_group() to mark events that are part of the next event.
do_shall_skip(), continue_group() now takes rpl_group_info param
sql/mysqld.cc:
Changed slave_open_temp_tables to uint32 to be able to use atomic operators on it.
Relay_log_info::sleep_lock -> Rpl_group_info::sleep_lock
Relay_log_info::sleep_cond -> Rpl_group_info::sleep_cond
sql/mysqld.h:
Updated types and names
sql/rpl_gtid.cc:
More DBUG
sql/rpl_parallel.cc:
Updated TODO section
Set thd for event that is execution
Use new is_begin(), is_commit() and is_rollback() functions.
More comments
sql/rpl_rli.cc:
sql_thd -> sql_driver_thd
Relay_log_info::sleep_lock -> rpl_group_info::sleep_lock
Relay_log_info::sleep_cond -> rpl_group_info::sleep_cond
Clear IN_STMT and IN_TRANSACTION in init_relay_log_pos() and Relay_log_info::cleanup_context() to ensure the flags doesn't survive slave restarts.
Reset table->in_use for temporary tables as the table may have been used by another THD.
Use IN_TRANSACTION instead of OPTION_BEGIN to check state of relay log.
Removed IN_STMT flag setting. This is now done in update_state_of_relay_log()
sql/rpl_rli.h:
Changed relay log state flags to bit masks instead of bit positions (most other code we have uses bit masks)
Added IN_TRANSACTION to mark if we are in a BEGIN ... COMMIT section.
save_temporary_tables is now thread safe
Relay_log_info::sleep_lock -> rpl_group_info::sleep_lock
Relay_log_info::sleep_cond -> rpl_group_info::sleep_cond
Relay_log_info->sql_thd renamed to Relay_log_info->sql_driver_thd to avoid wrong usage for merged code
is_in_group() is now independent of state of executed transaction.
sql/slave.cc:
Simplifed arguments to io_salve_killed(), sql_slave_killed() and check_io_slave_killed(); No reason to supply THD as this is part of the given structure.
set_thd_in_use_temporary_tables() removed as in_use is set on usage in sql_base.cc
sql_thd -> sql_driver_thd
More DBUG
Added update_state_of_relay_log() which will calculate the IN_STMT and IN_TRANSACTION state of the relay log after the current element is executed.
If slave_skip_counter is set run things in single threaded mode.
Simplifed arguments to io_salve_killed(), check_io_slave_killed() and sql_slave_killed(); No reason to supply THD as this is part of the given structure.
Added information to thd_proc_info() which thread is waiting for slave mutex to exit.
Disabled not used function rpl_connect_master()
Updated argument to next_event()
sql/sql_base.cc:
Added mutex around usage of slave's temporary tables. The active list is always kept up to date in sql->rgi_slave->save_temporary_tables.
Clear thd->temporary_tables after query (safety)
More DBUG
When using temporary table, set table->in_use to current thd as the THD may be different for slave threads.
Some code is ifdef:ed with REMOVE_AFTER_MERGE_WITH_10 as the given code in 10.0 is not yet in this tree.
In open_table() reuse code from find_temporary_table()
sql/sql_binlog.cc:
rli->sql_thd -> rli->sql_driver_thd
Remove duplicate setting of rgi->rli
sql/sql_class.cc:
Added helper functions rgi_lock_temporary_tables() and rgi_unlock_temporary_tables()
Would have been nicer to have these inline, but there was no easy way to do that
sql/sql_class.h:
Added functions to protect slaves temporary tables
sql/sql_parse.cc:
Added DBUG_PRINT
sql/transaction.cc:
Added comment
2013-10-13 23:24:05 +02:00
|
|
|
key_rpl_group_info_sleep_cond,
|
2010-03-31 16:05:33 +02:00
|
|
|
key_TABLE_SHARE_cond, key_user_level_lock_cond,
|
2020-05-01 18:32:33 +02:00
|
|
|
key_COND_start_thread;
|
2017-10-26 16:20:20 +02:00
|
|
|
extern PSI_cond_key key_RELAYLOG_COND_relay_log_updated,
|
|
|
|
key_RELAYLOG_COND_bin_log_updated, key_COND_wakeup_ready,
|
2013-06-26 12:10:35 +02:00
|
|
|
key_COND_wait_commit;
|
2011-10-25 12:53:40 +02:00
|
|
|
extern PSI_cond_key key_RELAYLOG_COND_queue_busy;
|
|
|
|
extern PSI_cond_key key_TC_LOG_MMAP_COND_queue_busy;
|
MDEV-5657: Parallel replication.
Clean up and improve the parallel implementation code, mainly related to
scheduling of work to threads and handling of stop and errors.
Fix a lot of bugs in various corner cases that could lead to crashes or
corruption.
Fix that a single replication domain could easily grab all worker threads and
stall all other domains; now a configuration variable
--slave-domain-parallel-threads allows to limit the number of
workers.
Allow next event group to start as soon as previous group begins the commit
phase (as opposed to when it ends it); this allows multiple event groups on
the slave to participate in group commit, even when no other opportunities for
parallelism are available.
Various fixes:
- Fix some races in the rpl.rpl_parallel test case.
- Fix an old incorrect assertion in Log_event iocache read.
- Fix repeated malloc/free of wait_for_commit and rpl_group_info objects.
- Simplify wait_for_commit wakeup logic.
- Fix one case in queue_for_group_commit() where killing one thread would
fail to correctly signal the error to the next, causing loss of the
transaction after slave restart.
- Fix leaking of pthreads (and their allocated stack) due to missing
PTHREAD_CREATE_DETACHED attribute.
- Fix how one batch of group-committed transactions wait for the previous
batch before starting to execute themselves. The old code had a very
complex scheduling where the first transaction was handled differently,
with subtle bugs in corner cases. Now each event group is always scheduled
for a new worker (in a round-robin fashion amongst available workers).
Keep a count of how many transactions have started to commit, and wait for
that counter to reach the appropriate value.
- Fix slave stop to wait for all workers to actually complete processing;
before, the wait was for update of last_committed_sub_id, which happens a
bit earlier, and could leave worker threads potentially accessing bits of
the replication state that is no longer valid after slave stop.
- Fix a couple of places where the test suite would kill a thread waiting
inside enter_cond() in connection with debug_sync; debug_sync + kill can
crash in rare cases due to a race with mysys_var_current_mutex in this
case.
- Fix some corner cases where we had enter_cond() but no exit_cond().
- Fix that we could get failure in wait_for_prior_commit() but forget to flag
the error with my_error().
- Fix slave stop (both for normal stop and stop due to error). Now, at stop
we pick a specific safe point (in terms of event groups executed) and make
sure that all event groups before that point are executed to completion,
and that no event group after start executing; this ensures a safe place to
restart replication, even for non-transactional stuff/DDL. In error stop,
make sure that all prior event groups are allowed to execute to completion,
and that any later event groups that have started are rolled back, if
possible. The old code could leave eg. T1 and T3 committed but T2 not, or
it could even leave half a transaction not rolled back in some random
worker, which would cause big problems when that worker was later reused
after slave restart.
- Fix the accounting of amount of events queued for one worker. Before, the
amount was reduced immediately as soon as the events were dequeued (which
happens all at once); this allowed twice the amount of events to be queued
in memory for each single worker, which is not what users would expect.
- Fix that an error set during execution of one event was sometimes not
cleared before executing the next, causing problems with the error
reporting.
- Fix incorrect handling of thd->killed in worker threads.
2014-02-26 15:02:09 +01:00
|
|
|
extern PSI_cond_key key_COND_rpl_thread, key_COND_rpl_thread_queue,
|
2015-11-23 18:58:30 +01:00
|
|
|
key_COND_rpl_thread_stop, key_COND_rpl_thread_pool,
|
MDEV-5657: Parallel replication.
Clean up and improve the parallel implementation code, mainly related to
scheduling of work to threads and handling of stop and errors.
Fix a lot of bugs in various corner cases that could lead to crashes or
corruption.
Fix that a single replication domain could easily grab all worker threads and
stall all other domains; now a configuration variable
--slave-domain-parallel-threads allows to limit the number of
workers.
Allow next event group to start as soon as previous group begins the commit
phase (as opposed to when it ends it); this allows multiple event groups on
the slave to participate in group commit, even when no other opportunities for
parallelism are available.
Various fixes:
- Fix some races in the rpl.rpl_parallel test case.
- Fix an old incorrect assertion in Log_event iocache read.
- Fix repeated malloc/free of wait_for_commit and rpl_group_info objects.
- Simplify wait_for_commit wakeup logic.
- Fix one case in queue_for_group_commit() where killing one thread would
fail to correctly signal the error to the next, causing loss of the
transaction after slave restart.
- Fix leaking of pthreads (and their allocated stack) due to missing
PTHREAD_CREATE_DETACHED attribute.
- Fix how one batch of group-committed transactions wait for the previous
batch before starting to execute themselves. The old code had a very
complex scheduling where the first transaction was handled differently,
with subtle bugs in corner cases. Now each event group is always scheduled
for a new worker (in a round-robin fashion amongst available workers).
Keep a count of how many transactions have started to commit, and wait for
that counter to reach the appropriate value.
- Fix slave stop to wait for all workers to actually complete processing;
before, the wait was for update of last_committed_sub_id, which happens a
bit earlier, and could leave worker threads potentially accessing bits of
the replication state that is no longer valid after slave stop.
- Fix a couple of places where the test suite would kill a thread waiting
inside enter_cond() in connection with debug_sync; debug_sync + kill can
crash in rare cases due to a race with mysys_var_current_mutex in this
case.
- Fix some corner cases where we had enter_cond() but no exit_cond().
- Fix that we could get failure in wait_for_prior_commit() but forget to flag
the error with my_error().
- Fix slave stop (both for normal stop and stop due to error). Now, at stop
we pick a specific safe point (in terms of event groups executed) and make
sure that all event groups before that point are executed to completion,
and that no event group after start executing; this ensures a safe place to
restart replication, even for non-transactional stuff/DDL. In error stop,
make sure that all prior event groups are allowed to execute to completion,
and that any later event groups that have started are rolled back, if
possible. The old code could leave eg. T1 and T3 committed but T2 not, or
it could even leave half a transaction not rolled back in some random
worker, which would cause big problems when that worker was later reused
after slave restart.
- Fix the accounting of amount of events queued for one worker. Before, the
amount was reduced immediately as soon as the events were dequeued (which
happens all at once); this allowed twice the amount of events to be queued
in memory for each single worker, which is not what users would expect.
- Fix that an error set during execution of one event was sometimes not
cleared before executing the next, causing problems with the error
reporting.
- Fix incorrect handling of thd->killed in worker threads.
2014-02-26 15:02:09 +01:00
|
|
|
key_COND_parallel_entry, key_COND_group_commit_orderer;
|
2014-03-09 10:27:38 +01:00
|
|
|
extern PSI_cond_key key_COND_wait_gtid, key_COND_gtid_ignore_duplicates;
|
2016-12-11 18:04:11 +01:00
|
|
|
extern PSI_cond_key key_TABLE_SHARE_COND_rotation;
|
2010-03-31 16:05:33 +02:00
|
|
|
|
2019-02-12 20:07:51 +01:00
|
|
|
extern PSI_thread_key key_thread_delayed_insert,
|
2010-03-31 16:05:33 +02:00
|
|
|
key_thread_handle_manager, key_thread_kill_server, key_thread_main,
|
2016-09-08 15:25:40 +02:00
|
|
|
key_thread_one_connection, key_thread_signal_hand,
|
2020-02-27 10:28:49 +01:00
|
|
|
key_thread_slave_background, key_rpl_parallel_thread;
|
2010-03-31 16:05:33 +02:00
|
|
|
|
2020-02-14 16:25:02 +01:00
|
|
|
extern PSI_file_key key_file_binlog, key_file_binlog_cache,
|
|
|
|
key_file_binlog_index, key_file_binlog_index_cache, key_file_casetest,
|
2010-03-31 16:05:33 +02:00
|
|
|
key_file_dbopt, key_file_des_key_file, key_file_ERRMSG, key_select_to_file,
|
|
|
|
key_file_fileparser, key_file_frm, key_file_global_ddl_log, key_file_load,
|
|
|
|
key_file_loadfile, key_file_log_event_data, key_file_log_event_info,
|
2020-01-29 13:50:26 +01:00
|
|
|
key_file_master_info, key_file_misc, key_file_partition_ddl_log,
|
2010-03-31 16:05:33 +02:00
|
|
|
key_file_pid, key_file_relay_log_info, key_file_send_file, key_file_tclog,
|
2021-03-30 16:06:55 +02:00
|
|
|
key_file_trg, key_file_trn, key_file_init, key_file_log_ddl;
|
2010-11-12 07:23:26 +01:00
|
|
|
extern PSI_file_key key_file_query_log, key_file_slow_log;
|
2020-02-14 16:25:02 +01:00
|
|
|
extern PSI_file_key key_file_relaylog, key_file_relaylog_index,
|
|
|
|
key_file_relaylog_cache, key_file_relaylog_index_cache;
|
2012-08-14 16:23:34 +02:00
|
|
|
extern PSI_socket_key key_socket_tcpip, key_socket_unix,
|
|
|
|
key_socket_client_connection;
|
2012-11-07 14:18:10 +01:00
|
|
|
extern PSI_file_key key_file_binlog_state;
|
2010-03-31 16:05:33 +02:00
|
|
|
|
2020-02-15 18:25:57 +01:00
|
|
|
#ifdef HAVE_PSI_INTERFACE
|
2010-03-31 16:05:33 +02:00
|
|
|
void init_server_psi_keys();
|
|
|
|
#endif /* HAVE_PSI_INTERFACE */
|
|
|
|
|
2020-01-29 13:50:26 +01:00
|
|
|
extern PSI_memory_key key_memory_locked_table_list;
|
|
|
|
extern PSI_memory_key key_memory_locked_thread_list;
|
|
|
|
extern PSI_memory_key key_memory_thd_transactions;
|
|
|
|
extern PSI_memory_key key_memory_delegate;
|
|
|
|
extern PSI_memory_key key_memory_acl_mem;
|
|
|
|
extern PSI_memory_key key_memory_acl_memex;
|
|
|
|
extern PSI_memory_key key_memory_acl_cache;
|
|
|
|
extern PSI_memory_key key_memory_thd_main_mem_root;
|
|
|
|
extern PSI_memory_key key_memory_help;
|
|
|
|
extern PSI_memory_key key_memory_frm;
|
|
|
|
extern PSI_memory_key key_memory_table_share;
|
|
|
|
extern PSI_memory_key key_memory_gdl;
|
|
|
|
extern PSI_memory_key key_memory_table_triggers_list;
|
|
|
|
extern PSI_memory_key key_memory_prepared_statement_map;
|
|
|
|
extern PSI_memory_key key_memory_prepared_statement_main_mem_root;
|
|
|
|
extern PSI_memory_key key_memory_protocol_rset_root;
|
|
|
|
extern PSI_memory_key key_memory_warning_info_warn_root;
|
|
|
|
extern PSI_memory_key key_memory_sp_cache;
|
|
|
|
extern PSI_memory_key key_memory_sp_head_main_root;
|
|
|
|
extern PSI_memory_key key_memory_sp_head_execute_root;
|
|
|
|
extern PSI_memory_key key_memory_sp_head_call_root;
|
|
|
|
extern PSI_memory_key key_memory_table_mapping_root;
|
|
|
|
extern PSI_memory_key key_memory_quick_range_select_root;
|
|
|
|
extern PSI_memory_key key_memory_quick_index_merge_root;
|
|
|
|
extern PSI_memory_key key_memory_quick_ror_intersect_select_root;
|
|
|
|
extern PSI_memory_key key_memory_quick_ror_union_select_root;
|
|
|
|
extern PSI_memory_key key_memory_quick_group_min_max_select_root;
|
|
|
|
extern PSI_memory_key key_memory_test_quick_select_exec;
|
|
|
|
extern PSI_memory_key key_memory_prune_partitions_exec;
|
|
|
|
extern PSI_memory_key key_memory_binlog_recover_exec;
|
|
|
|
extern PSI_memory_key key_memory_blob_mem_storage;
|
|
|
|
|
|
|
|
extern PSI_memory_key key_memory_Sys_var_charptr_value;
|
|
|
|
extern PSI_memory_key key_memory_THD_db;
|
|
|
|
extern PSI_memory_key key_memory_user_var_entry;
|
|
|
|
extern PSI_memory_key key_memory_user_var_entry_value;
|
|
|
|
extern PSI_memory_key key_memory_Slave_job_group_group_relay_log_name;
|
|
|
|
extern PSI_memory_key key_memory_Relay_log_info_group_relay_log_name;
|
|
|
|
extern PSI_memory_key key_memory_binlog_cache_mngr;
|
|
|
|
extern PSI_memory_key key_memory_Row_data_memory_memory;
|
|
|
|
extern PSI_memory_key key_memory_errmsgs;
|
|
|
|
extern PSI_memory_key key_memory_Event_queue_element_for_exec_names;
|
|
|
|
extern PSI_memory_key key_memory_Event_scheduler_scheduler_param;
|
|
|
|
extern PSI_memory_key key_memory_Gis_read_stream_err_msg;
|
|
|
|
extern PSI_memory_key key_memory_Geometry_objects_data;
|
|
|
|
extern PSI_memory_key key_memory_host_cache_hostname;
|
|
|
|
extern PSI_memory_key key_memory_User_level_lock;
|
|
|
|
extern PSI_memory_key key_memory_Filesort_info_record_pointers;
|
|
|
|
extern PSI_memory_key key_memory_Sort_param_tmp_buffer;
|
|
|
|
extern PSI_memory_key key_memory_Filesort_info_merge;
|
|
|
|
extern PSI_memory_key key_memory_Filesort_buffer_sort_keys;
|
|
|
|
extern PSI_memory_key key_memory_handler_errmsgs;
|
|
|
|
extern PSI_memory_key key_memory_handlerton;
|
|
|
|
extern PSI_memory_key key_memory_XID;
|
|
|
|
extern PSI_memory_key key_memory_MYSQL_LOCK;
|
|
|
|
extern PSI_memory_key key_memory_MYSQL_LOG_name;
|
|
|
|
extern PSI_memory_key key_memory_TC_LOG_MMAP_pages;
|
|
|
|
extern PSI_memory_key key_memory_my_str_malloc;
|
|
|
|
extern PSI_memory_key key_memory_MYSQL_BIN_LOG_basename;
|
|
|
|
extern PSI_memory_key key_memory_MYSQL_BIN_LOG_index;
|
|
|
|
extern PSI_memory_key key_memory_MYSQL_RELAY_LOG_basename;
|
|
|
|
extern PSI_memory_key key_memory_MYSQL_RELAY_LOG_index;
|
|
|
|
extern PSI_memory_key key_memory_rpl_filter;
|
|
|
|
extern PSI_memory_key key_memory_Security_context;
|
|
|
|
extern PSI_memory_key key_memory_NET_buff;
|
|
|
|
extern PSI_memory_key key_memory_NET_compress_packet;
|
|
|
|
extern PSI_memory_key key_memory_my_bitmap_map;
|
|
|
|
extern PSI_memory_key key_memory_QUICK_RANGE_SELECT_mrr_buf_desc;
|
|
|
|
extern PSI_memory_key key_memory_TABLE_RULE_ENT;
|
|
|
|
extern PSI_memory_key key_memory_Mutex_cond_array_Mutex_cond;
|
|
|
|
extern PSI_memory_key key_memory_Owned_gtids_sidno_to_hash;
|
|
|
|
extern PSI_memory_key key_memory_Sid_map_Node;
|
|
|
|
extern PSI_memory_key key_memory_bison_stack;
|
|
|
|
extern PSI_memory_key key_memory_TABLE_sort_io_cache;
|
|
|
|
extern PSI_memory_key key_memory_DATE_TIME_FORMAT;
|
|
|
|
extern PSI_memory_key key_memory_DDL_LOG_MEMORY_ENTRY;
|
|
|
|
extern PSI_memory_key key_memory_ST_SCHEMA_TABLE;
|
|
|
|
extern PSI_memory_key key_memory_ignored_db;
|
|
|
|
extern PSI_memory_key key_memory_SLAVE_INFO;
|
|
|
|
extern PSI_memory_key key_memory_log_event_old;
|
|
|
|
extern PSI_memory_key key_memory_HASH_ROW_ENTRY;
|
|
|
|
extern PSI_memory_key key_memory_table_def_memory;
|
|
|
|
extern PSI_memory_key key_memory_MPVIO_EXT_auth_info;
|
|
|
|
extern PSI_memory_key key_memory_LOG_POS_COORD;
|
|
|
|
extern PSI_memory_key key_memory_XID_STATE;
|
|
|
|
extern PSI_memory_key key_memory_Rpl_info_file_buffer;
|
|
|
|
extern PSI_memory_key key_memory_Rpl_info_table;
|
|
|
|
extern PSI_memory_key key_memory_binlog_pos;
|
|
|
|
extern PSI_memory_key key_memory_db_worker_hash_entry;
|
|
|
|
extern PSI_memory_key key_memory_rpl_slave_command_buffer;
|
|
|
|
extern PSI_memory_key key_memory_binlog_ver_1_event;
|
|
|
|
extern PSI_memory_key key_memory_rpl_slave_check_temp_dir;
|
|
|
|
extern PSI_memory_key key_memory_TABLE;
|
|
|
|
extern PSI_memory_key key_memory_binlog_statement_buffer;
|
|
|
|
extern PSI_memory_key key_memory_user_conn;
|
|
|
|
extern PSI_memory_key key_memory_dboptions_hash;
|
2020-07-08 17:38:59 +02:00
|
|
|
extern PSI_memory_key key_memory_dbnames_cache;
|
2020-01-29 13:50:26 +01:00
|
|
|
extern PSI_memory_key key_memory_hash_index_key_buffer;
|
|
|
|
extern PSI_memory_key key_memory_THD_handler_tables_hash;
|
|
|
|
extern PSI_memory_key key_memory_JOIN_CACHE;
|
|
|
|
extern PSI_memory_key key_memory_READ_INFO;
|
|
|
|
extern PSI_memory_key key_memory_partition_syntax_buffer;
|
|
|
|
extern PSI_memory_key key_memory_global_system_variables;
|
|
|
|
extern PSI_memory_key key_memory_THD_variables;
|
|
|
|
extern PSI_memory_key key_memory_PROFILE;
|
|
|
|
extern PSI_memory_key key_memory_LOG_name;
|
|
|
|
extern PSI_memory_key key_memory_string_iterator;
|
|
|
|
extern PSI_memory_key key_memory_frm_extra_segment_buff;
|
|
|
|
extern PSI_memory_key key_memory_frm_form_pos;
|
|
|
|
extern PSI_memory_key key_memory_frm_string;
|
|
|
|
extern PSI_memory_key key_memory_Unique_sort_buffer;
|
|
|
|
extern PSI_memory_key key_memory_Unique_merge_buffer;
|
|
|
|
extern PSI_memory_key key_memory_shared_memory_name;
|
|
|
|
extern PSI_memory_key key_memory_opt_bin_logname;
|
|
|
|
extern PSI_memory_key key_memory_Query_cache;
|
|
|
|
extern PSI_memory_key key_memory_READ_RECORD_cache;
|
|
|
|
extern PSI_memory_key key_memory_Quick_ranges;
|
|
|
|
extern PSI_memory_key key_memory_File_query_log_name;
|
|
|
|
extern PSI_memory_key key_memory_Table_trigger_dispatcher;
|
|
|
|
extern PSI_memory_key key_memory_show_slave_status_io_gtid_set;
|
|
|
|
extern PSI_memory_key key_memory_write_set_extraction;
|
|
|
|
extern PSI_memory_key key_memory_thd_timer;
|
|
|
|
extern PSI_memory_key key_memory_THD_Session_tracker;
|
|
|
|
extern PSI_memory_key key_memory_THD_Session_sysvar_resource_manager;
|
|
|
|
extern PSI_memory_key key_memory_get_all_tables;
|
|
|
|
extern PSI_memory_key key_memory_fill_schema_schemata;
|
|
|
|
extern PSI_memory_key key_memory_native_functions;
|
|
|
|
extern PSI_memory_key key_memory_JSON;
|
|
|
|
|
2012-08-14 16:23:34 +02:00
|
|
|
/*
|
|
|
|
MAINTAINER: Please keep this list in order, to limit merge collisions.
|
|
|
|
Hint: grep PSI_stage_info | sort -u
|
|
|
|
*/
|
2014-08-06 14:39:15 +02:00
|
|
|
extern PSI_stage_info stage_apply_event;
|
2012-08-14 16:23:34 +02:00
|
|
|
extern PSI_stage_info stage_after_create;
|
2014-05-09 12:35:11 +02:00
|
|
|
extern PSI_stage_info stage_after_opening_tables;
|
|
|
|
extern PSI_stage_info stage_after_table_lock;
|
2012-08-14 16:23:34 +02:00
|
|
|
extern PSI_stage_info stage_allocating_local_table;
|
2013-06-15 17:32:08 +02:00
|
|
|
extern PSI_stage_info stage_alter_inplace_prepare;
|
|
|
|
extern PSI_stage_info stage_alter_inplace;
|
|
|
|
extern PSI_stage_info stage_alter_inplace_commit;
|
2014-08-06 14:39:15 +02:00
|
|
|
extern PSI_stage_info stage_after_apply_event;
|
2012-08-14 16:23:34 +02:00
|
|
|
extern PSI_stage_info stage_changing_master;
|
|
|
|
extern PSI_stage_info stage_checking_master_version;
|
|
|
|
extern PSI_stage_info stage_checking_permissions;
|
|
|
|
extern PSI_stage_info stage_checking_privileges_on_cached_query;
|
|
|
|
extern PSI_stage_info stage_checking_query_cache_for_query;
|
|
|
|
extern PSI_stage_info stage_cleaning_up;
|
|
|
|
extern PSI_stage_info stage_closing_tables;
|
|
|
|
extern PSI_stage_info stage_connecting_to_master;
|
|
|
|
extern PSI_stage_info stage_converting_heap_to_myisam;
|
|
|
|
extern PSI_stage_info stage_copying_to_group_table;
|
|
|
|
extern PSI_stage_info stage_copying_to_tmp_table;
|
|
|
|
extern PSI_stage_info stage_copy_to_tmp_table;
|
|
|
|
extern PSI_stage_info stage_creating_delayed_handler;
|
|
|
|
extern PSI_stage_info stage_creating_sort_index;
|
|
|
|
extern PSI_stage_info stage_creating_table;
|
|
|
|
extern PSI_stage_info stage_creating_tmp_table;
|
|
|
|
extern PSI_stage_info stage_deleting_from_main_table;
|
|
|
|
extern PSI_stage_info stage_deleting_from_reference_tables;
|
|
|
|
extern PSI_stage_info stage_discard_or_import_tablespace;
|
|
|
|
extern PSI_stage_info stage_end;
|
fixes for test failures
and small collateral changes
mysql-test/lib/My/Test.pm:
somehow with "print" we get truncated writes sometimes
mysql-test/suite/perfschema/r/digest_table_full.result:
md5 hashes of statement digests differ, because yacc token codes are different in mariadb
mysql-test/suite/perfschema/r/dml_handler.result:
host table is not ported over yet
mysql-test/suite/perfschema/r/information_schema.result:
host table is not ported over yet
mysql-test/suite/perfschema/r/nesting.result:
this differs, because we don't rewrite general log queries, and multi-statement
packets are logged as a one entry. this result file is identical to what mysql-5.6.5
produces with the --log-raw option.
mysql-test/suite/perfschema/r/relaylog.result:
MariaDB modifies the binlog index file directly, while MySQL 5.6 has a feature "crash-safe binlog index" and modifies a special "crash-safe" shadow copy of the index file and then moves it over. That's why this test shows "NONE" index file writes in MySQL and "MANY" in MariaDB.
mysql-test/suite/perfschema/r/server_init.result:
MariaDB initializes the "manager" resources from the "manager" thread, and starts this thread only when --flush-time is not 0. MySQL 5.6 initializes "manager" resources unconditionally on server startup.
mysql-test/suite/perfschema/r/stage_mdl_global.result:
this differs, because MariaDB disables query cache when query_cache_size=0. MySQL does not
do that, and this causes useless mutex locks and waits.
mysql-test/suite/perfschema/r/statement_digest.result:
md5 hashes of statement digests differ, because yacc token codes are different in mariadb
mysql-test/suite/perfschema/r/statement_digest_consumers.result:
md5 hashes of statement digests differ, because yacc token codes are different in mariadb
mysql-test/suite/perfschema/r/statement_digest_long_query.result:
md5 hashes of statement digests differ, because yacc token codes are different in mariadb
mysql-test/suite/rpl/r/rpl_mixed_drop_create_temp_table.result:
will be updated to match 5.6 when alfranio.correia@oracle.com-20110512172919-c1b5kmum4h52g0ni and anders.song@greatopensource.com-20110105052107-zoab0bsf5a6xxk2y are merged
mysql-test/suite/rpl/r/rpl_non_direct_mixed_mixing_engines.result:
will be updated to match 5.6 when anders.song@greatopensource.com-20110105052107-zoab0bsf5a6xxk2y is merged
2012-09-27 20:09:46 +02:00
|
|
|
extern PSI_stage_info stage_enabling_keys;
|
2012-08-14 16:23:34 +02:00
|
|
|
extern PSI_stage_info stage_executing;
|
|
|
|
extern PSI_stage_info stage_execution_of_init_command;
|
|
|
|
extern PSI_stage_info stage_explaining;
|
2014-05-09 12:35:11 +02:00
|
|
|
extern PSI_stage_info stage_finding_key_cache;
|
2012-08-14 16:23:34 +02:00
|
|
|
extern PSI_stage_info stage_finished_reading_one_binlog_switching_to_next_binlog;
|
|
|
|
extern PSI_stage_info stage_flushing_relay_log_and_master_info_repository;
|
|
|
|
extern PSI_stage_info stage_flushing_relay_log_info_file;
|
|
|
|
extern PSI_stage_info stage_freeing_items;
|
|
|
|
extern PSI_stage_info stage_fulltext_initialization;
|
|
|
|
extern PSI_stage_info stage_got_handler_lock;
|
|
|
|
extern PSI_stage_info stage_got_old_table;
|
|
|
|
extern PSI_stage_info stage_init;
|
2017-11-05 16:04:20 +01:00
|
|
|
extern PSI_stage_info stage_init_update;
|
2012-08-14 16:23:34 +02:00
|
|
|
extern PSI_stage_info stage_insert;
|
|
|
|
extern PSI_stage_info stage_invalidating_query_cache_entries_table;
|
|
|
|
extern PSI_stage_info stage_invalidating_query_cache_entries_table_list;
|
|
|
|
extern PSI_stage_info stage_killing_slave;
|
|
|
|
extern PSI_stage_info stage_logging_slow_query;
|
|
|
|
extern PSI_stage_info stage_making_temp_file_append_before_load_data;
|
|
|
|
extern PSI_stage_info stage_making_temp_file_create_before_load_data;
|
|
|
|
extern PSI_stage_info stage_manage_keys;
|
|
|
|
extern PSI_stage_info stage_master_has_sent_all_binlog_to_slave;
|
|
|
|
extern PSI_stage_info stage_opening_tables;
|
|
|
|
extern PSI_stage_info stage_optimizing;
|
|
|
|
extern PSI_stage_info stage_preparing;
|
|
|
|
extern PSI_stage_info stage_purging_old_relay_logs;
|
|
|
|
extern PSI_stage_info stage_query_end;
|
2017-11-05 16:04:20 +01:00
|
|
|
extern PSI_stage_info stage_starting_cleanup;
|
|
|
|
extern PSI_stage_info stage_rollback;
|
|
|
|
extern PSI_stage_info stage_rollback_implicit;
|
|
|
|
extern PSI_stage_info stage_commit;
|
|
|
|
extern PSI_stage_info stage_commit_implicit;
|
2012-08-14 16:23:34 +02:00
|
|
|
extern PSI_stage_info stage_queueing_master_event_to_the_relay_log;
|
|
|
|
extern PSI_stage_info stage_reading_event_from_the_relay_log;
|
2014-05-09 12:35:11 +02:00
|
|
|
extern PSI_stage_info stage_recreating_table;
|
2012-08-14 16:23:34 +02:00
|
|
|
extern PSI_stage_info stage_registering_slave_on_master;
|
|
|
|
extern PSI_stage_info stage_removing_duplicates;
|
|
|
|
extern PSI_stage_info stage_removing_tmp_table;
|
|
|
|
extern PSI_stage_info stage_rename;
|
|
|
|
extern PSI_stage_info stage_rename_result_table;
|
|
|
|
extern PSI_stage_info stage_requesting_binlog_dump;
|
|
|
|
extern PSI_stage_info stage_reschedule;
|
|
|
|
extern PSI_stage_info stage_searching_rows_for_update;
|
|
|
|
extern PSI_stage_info stage_sending_binlog_event_to_slave;
|
|
|
|
extern PSI_stage_info stage_sending_cached_result_to_client;
|
|
|
|
extern PSI_stage_info stage_sending_data;
|
|
|
|
extern PSI_stage_info stage_setup;
|
|
|
|
extern PSI_stage_info stage_slave_has_read_all_relay_log;
|
2012-10-19 20:38:59 +02:00
|
|
|
extern PSI_stage_info stage_show_explain;
|
fixes for test failures
and small collateral changes
mysql-test/lib/My/Test.pm:
somehow with "print" we get truncated writes sometimes
mysql-test/suite/perfschema/r/digest_table_full.result:
md5 hashes of statement digests differ, because yacc token codes are different in mariadb
mysql-test/suite/perfschema/r/dml_handler.result:
host table is not ported over yet
mysql-test/suite/perfschema/r/information_schema.result:
host table is not ported over yet
mysql-test/suite/perfschema/r/nesting.result:
this differs, because we don't rewrite general log queries, and multi-statement
packets are logged as a one entry. this result file is identical to what mysql-5.6.5
produces with the --log-raw option.
mysql-test/suite/perfschema/r/relaylog.result:
MariaDB modifies the binlog index file directly, while MySQL 5.6 has a feature "crash-safe binlog index" and modifies a special "crash-safe" shadow copy of the index file and then moves it over. That's why this test shows "NONE" index file writes in MySQL and "MANY" in MariaDB.
mysql-test/suite/perfschema/r/server_init.result:
MariaDB initializes the "manager" resources from the "manager" thread, and starts this thread only when --flush-time is not 0. MySQL 5.6 initializes "manager" resources unconditionally on server startup.
mysql-test/suite/perfschema/r/stage_mdl_global.result:
this differs, because MariaDB disables query cache when query_cache_size=0. MySQL does not
do that, and this causes useless mutex locks and waits.
mysql-test/suite/perfschema/r/statement_digest.result:
md5 hashes of statement digests differ, because yacc token codes are different in mariadb
mysql-test/suite/perfschema/r/statement_digest_consumers.result:
md5 hashes of statement digests differ, because yacc token codes are different in mariadb
mysql-test/suite/perfschema/r/statement_digest_long_query.result:
md5 hashes of statement digests differ, because yacc token codes are different in mariadb
mysql-test/suite/rpl/r/rpl_mixed_drop_create_temp_table.result:
will be updated to match 5.6 when alfranio.correia@oracle.com-20110512172919-c1b5kmum4h52g0ni and anders.song@greatopensource.com-20110105052107-zoab0bsf5a6xxk2y are merged
mysql-test/suite/rpl/r/rpl_non_direct_mixed_mixing_engines.result:
will be updated to match 5.6 when anders.song@greatopensource.com-20110105052107-zoab0bsf5a6xxk2y is merged
2012-09-27 20:09:46 +02:00
|
|
|
extern PSI_stage_info stage_sorting;
|
2012-08-14 16:23:34 +02:00
|
|
|
extern PSI_stage_info stage_sorting_for_group;
|
|
|
|
extern PSI_stage_info stage_sorting_for_order;
|
|
|
|
extern PSI_stage_info stage_sorting_result;
|
|
|
|
extern PSI_stage_info stage_sql_thd_waiting_until_delay;
|
|
|
|
extern PSI_stage_info stage_statistics;
|
|
|
|
extern PSI_stage_info stage_storing_result_in_query_cache;
|
|
|
|
extern PSI_stage_info stage_storing_row_into_queue;
|
|
|
|
extern PSI_stage_info stage_system_lock;
|
2014-08-06 14:39:15 +02:00
|
|
|
extern PSI_stage_info stage_unlocking_tables;
|
2015-01-18 12:39:59 +01:00
|
|
|
extern PSI_stage_info stage_table_lock;
|
|
|
|
extern PSI_stage_info stage_filling_schema_table;
|
2012-08-14 16:23:34 +02:00
|
|
|
extern PSI_stage_info stage_update;
|
|
|
|
extern PSI_stage_info stage_updating;
|
|
|
|
extern PSI_stage_info stage_updating_main_table;
|
|
|
|
extern PSI_stage_info stage_updating_reference_tables;
|
|
|
|
extern PSI_stage_info stage_upgrading_lock;
|
|
|
|
extern PSI_stage_info stage_user_lock;
|
|
|
|
extern PSI_stage_info stage_user_sleep;
|
|
|
|
extern PSI_stage_info stage_verifying_table;
|
|
|
|
extern PSI_stage_info stage_waiting_for_delay_list;
|
|
|
|
extern PSI_stage_info stage_waiting_for_gtid_to_be_written_to_binary_log;
|
|
|
|
extern PSI_stage_info stage_waiting_for_handler_insert;
|
|
|
|
extern PSI_stage_info stage_waiting_for_handler_lock;
|
|
|
|
extern PSI_stage_info stage_waiting_for_handler_open;
|
|
|
|
extern PSI_stage_info stage_waiting_for_insert;
|
|
|
|
extern PSI_stage_info stage_waiting_for_master_to_send_event;
|
|
|
|
extern PSI_stage_info stage_waiting_for_master_update;
|
|
|
|
extern PSI_stage_info stage_waiting_for_relay_log_space;
|
|
|
|
extern PSI_stage_info stage_waiting_for_slave_mutex_on_exit;
|
|
|
|
extern PSI_stage_info stage_waiting_for_slave_thread_to_start;
|
|
|
|
extern PSI_stage_info stage_waiting_for_query_cache_lock;
|
|
|
|
extern PSI_stage_info stage_waiting_for_table_flush;
|
|
|
|
extern PSI_stage_info stage_waiting_for_the_next_event_in_relay_log;
|
|
|
|
extern PSI_stage_info stage_waiting_for_the_slave_thread_to_advance_position;
|
|
|
|
extern PSI_stage_info stage_waiting_to_finalize_termination;
|
2012-12-18 15:01:58 +01:00
|
|
|
extern PSI_stage_info stage_binlog_waiting_background_tasks;
|
2017-11-05 16:04:20 +01:00
|
|
|
extern PSI_stage_info stage_binlog_write;
|
2012-12-18 15:01:58 +01:00
|
|
|
extern PSI_stage_info stage_binlog_processing_checkpoint_notify;
|
|
|
|
extern PSI_stage_info stage_binlog_stopping_background_thread;
|
2013-11-01 12:00:11 +01:00
|
|
|
extern PSI_stage_info stage_waiting_for_work_from_sql_thread;
|
2014-02-03 15:22:39 +01:00
|
|
|
extern PSI_stage_info stage_waiting_for_prior_transaction_to_commit;
|
2014-11-13 09:56:28 +01:00
|
|
|
extern PSI_stage_info stage_waiting_for_prior_transaction_to_start_commit;
|
2014-02-03 15:22:39 +01:00
|
|
|
extern PSI_stage_info stage_waiting_for_room_in_worker_thread;
|
2015-05-26 12:47:35 +02:00
|
|
|
extern PSI_stage_info stage_waiting_for_workers_idle;
|
2015-10-22 11:18:34 +02:00
|
|
|
extern PSI_stage_info stage_waiting_for_ftwrl;
|
|
|
|
extern PSI_stage_info stage_waiting_for_ftwrl_threads_to_pause;
|
|
|
|
extern PSI_stage_info stage_waiting_for_rpl_thread_pool;
|
2014-02-10 15:12:17 +01:00
|
|
|
extern PSI_stage_info stage_master_gtid_wait_primary;
|
|
|
|
extern PSI_stage_info stage_master_gtid_wait;
|
2014-03-12 00:14:49 +01:00
|
|
|
extern PSI_stage_info stage_gtid_wait_other_connection;
|
2016-09-08 15:25:40 +02:00
|
|
|
extern PSI_stage_info stage_slave_background_process_request;
|
|
|
|
extern PSI_stage_info stage_slave_background_wait_request;
|
|
|
|
extern PSI_stage_info stage_waiting_for_deadlock_kill;
|
2020-02-14 17:05:31 +01:00
|
|
|
extern PSI_stage_info stage_starting;
|
2014-02-03 15:22:39 +01:00
|
|
|
|
2012-08-14 16:23:34 +02:00
|
|
|
#ifdef HAVE_PSI_STATEMENT_INTERFACE
|
|
|
|
/**
|
|
|
|
Statement instrumentation keys (sql).
|
|
|
|
The last entry, at [SQLCOM_END], is for parsing errors.
|
|
|
|
*/
|
|
|
|
extern PSI_statement_info sql_statement_info[(uint) SQLCOM_END + 1];
|
|
|
|
|
|
|
|
/**
|
|
|
|
Statement instrumentation keys (com).
|
|
|
|
The last entry, at [COM_END], is for packet errors.
|
|
|
|
*/
|
|
|
|
extern PSI_statement_info com_statement_info[(uint) COM_END + 1];
|
|
|
|
|
2014-05-07 16:12:39 +02:00
|
|
|
/**
|
|
|
|
Statement instrumentation key for replication.
|
|
|
|
*/
|
|
|
|
extern PSI_statement_info stmt_info_rpl;
|
|
|
|
|
2012-08-14 16:23:34 +02:00
|
|
|
void init_sql_statement_info();
|
|
|
|
void init_com_statement_info();
|
|
|
|
#endif /* HAVE_PSI_STATEMENT_INTERFACE */
|
|
|
|
|
2010-03-31 16:05:33 +02:00
|
|
|
#ifndef __WIN__
|
|
|
|
extern pthread_t signal_thread;
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifdef HAVE_OPENSSL
|
|
|
|
extern struct st_VioSSLFd * ssl_acceptor_fd;
|
|
|
|
#endif /* HAVE_OPENSSL */
|
|
|
|
|
|
|
|
/*
|
|
|
|
The following variables were under INNODB_COMPABILITY_HOOKS
|
|
|
|
*/
|
|
|
|
extern my_bool opt_large_pages;
|
|
|
|
extern uint opt_large_page_size;
|
2021-05-14 21:25:46 +02:00
|
|
|
extern MYSQL_PLUGIN_IMPORT char lc_messages_dir[FN_REFLEN];
|
2010-03-31 16:05:33 +02:00
|
|
|
extern char *lc_messages_dir_ptr, *log_error_file_ptr;
|
|
|
|
extern MYSQL_PLUGIN_IMPORT char reg_ext[FN_EXTLEN];
|
|
|
|
extern MYSQL_PLUGIN_IMPORT uint reg_ext_length;
|
|
|
|
extern MYSQL_PLUGIN_IMPORT uint lower_case_table_names;
|
|
|
|
extern MYSQL_PLUGIN_IMPORT bool mysqld_embedded;
|
|
|
|
extern ulong specialflag;
|
|
|
|
extern uint mysql_data_home_len;
|
|
|
|
extern uint mysql_real_data_home_len;
|
|
|
|
extern const char *mysql_real_data_home_ptr;
|
2010-08-05 14:34:19 +02:00
|
|
|
extern ulong thread_handling;
|
2011-03-18 07:37:08 +01:00
|
|
|
extern "C" MYSQL_PLUGIN_IMPORT char server_version[SERVER_VERSION_LENGTH];
|
2015-11-24 16:55:52 +01:00
|
|
|
extern char *server_version_ptr;
|
2017-05-05 12:32:01 +02:00
|
|
|
extern bool using_custom_server_version;
|
2010-03-31 16:05:33 +02:00
|
|
|
extern MYSQL_PLUGIN_IMPORT char mysql_real_data_home[];
|
|
|
|
extern char mysql_unpacked_real_data_home[];
|
|
|
|
extern MYSQL_PLUGIN_IMPORT struct system_variables global_system_variables;
|
|
|
|
extern char default_logfile_name[FN_REFLEN];
|
2017-08-22 21:08:38 +02:00
|
|
|
extern char *my_proxy_protocol_networks;
|
2010-03-31 16:05:33 +02:00
|
|
|
|
|
|
|
#define mysql_tmpdir (my_tmpdir(&mysql_tmpdir_list))
|
|
|
|
|
|
|
|
extern MYSQL_PLUGIN_IMPORT const key_map key_map_empty;
|
|
|
|
extern MYSQL_PLUGIN_IMPORT key_map key_map_full; /* Should be threaded as const */
|
|
|
|
|
|
|
|
/*
|
|
|
|
Server mutex locks and condition variables.
|
|
|
|
*/
|
2010-08-12 15:50:23 +02:00
|
|
|
extern mysql_mutex_t
|
2019-01-24 19:26:34 +01:00
|
|
|
LOCK_item_func_sleep, LOCK_status,
|
2011-10-19 21:45:18 +02:00
|
|
|
LOCK_error_log, LOCK_delayed_insert, LOCK_short_uuid_generator,
|
2010-03-31 16:05:33 +02:00
|
|
|
LOCK_delayed_status, LOCK_delayed_create, LOCK_crypt, LOCK_timezone,
|
2019-05-29 21:17:00 +02:00
|
|
|
LOCK_active_mi, LOCK_manager, LOCK_user_conn,
|
2021-03-30 16:06:55 +02:00
|
|
|
LOCK_prepared_stmt_count, LOCK_error_messages, LOCK_backup_log;
|
2019-05-29 21:17:00 +02:00
|
|
|
extern MYSQL_PLUGIN_IMPORT mysql_mutex_t LOCK_global_system_variables;
|
2019-01-24 19:26:34 +01:00
|
|
|
extern mysql_rwlock_t LOCK_all_status_vars;
|
2016-02-01 11:45:39 +01:00
|
|
|
extern mysql_mutex_t LOCK_start_thread;
|
2010-03-31 16:05:33 +02:00
|
|
|
#ifdef HAVE_OPENSSL
|
2015-09-22 11:21:48 +02:00
|
|
|
extern char* des_key_file;
|
2010-03-31 16:05:33 +02:00
|
|
|
extern mysql_mutex_t LOCK_des_key_file;
|
|
|
|
#endif
|
MDEV-22214 mariadbd.exe calls function mysqld.exe, and crashes
Stop linking plugins to the server executable on Windows.
Instead, extract whole server functionality into a large DLL, called
server.dll. Link both plugins, and small server "stub" exe to it.
This eliminates plugin dependency on the name of the server executable.
It also reduces the size of the packages (since tiny mysqld.exe
and mariadbd.exe are now both linked to one big DLL)
Also, simplify the functionality of exporing all symbols from selected
static libraries. Rely on WINDOWS_EXPORT_ALL_SYMBOLS, rather than old
self-backed solution.
fix compile error
replace GetProcAddress(GetModuleHandle(NULL), "variable_name")
for server exported data with actual variable names.
Runtime loading was never required,was error prone
, since symbols could be missing at runtime, and now it actually failed,
because we do not export symbols from executable anymore, but from a shared
library
This did require a MYSQL_PLUGIN_IMPORT decoration for the plugin,
but made the code more straightforward, and avoids missing symbols at
runtime (as mentioned before).
The audit plugin is still doing some dynamic loading, as it aims to work
cross-version. Now it won't work cross-version on Windows, as it already
uses some symbols that are *not* dynamically loaded, e.g fn_format
and those symbols now exported from server.dll , when earlier they were
exported by mysqld.exe
Windows, fixes for storage engine plugin loading
after various rebranding stuff
Create server.dll containing functionality of the whole server
make mariadbd.exe/mysqld.exe a stub that is only calling mysqld_main()
fix build
2020-04-10 14:09:18 +02:00
|
|
|
extern MYSQL_PLUGIN_IMPORT mysql_mutex_t LOCK_server_started;
|
|
|
|
extern MYSQL_PLUGIN_IMPORT mysql_cond_t COND_server_started;
|
2010-03-31 16:05:33 +02:00
|
|
|
extern mysql_rwlock_t LOCK_grant, LOCK_sys_init_connect, LOCK_sys_init_slave;
|
2018-12-11 18:23:54 +01:00
|
|
|
extern mysql_rwlock_t LOCK_ssl_refresh;
|
2018-01-27 18:46:31 +01:00
|
|
|
extern mysql_prlock_t LOCK_system_variables_hash;
|
2019-02-26 19:44:38 +01:00
|
|
|
extern mysql_cond_t COND_start_thread;
|
2010-07-27 15:34:58 +02:00
|
|
|
extern mysql_cond_t COND_manager;
|
2019-01-22 19:45:26 +01:00
|
|
|
extern Atomic_counter<uint32_t> thread_count;
|
2010-03-31 16:05:33 +02:00
|
|
|
|
2020-03-02 23:46:07 +01:00
|
|
|
extern my_bool opt_use_ssl;
|
2010-03-31 16:05:33 +02:00
|
|
|
extern char *opt_ssl_ca, *opt_ssl_capath, *opt_ssl_cert, *opt_ssl_cipher,
|
2012-08-14 16:23:34 +02:00
|
|
|
*opt_ssl_key, *opt_ssl_crl, *opt_ssl_crlpath;
|
MDEV-14101 Provide an option to select TLS protocol version
Server and command line tools now support option --tls_version to specify the
TLS version between client and server. Valid values are TLSv1.0, TLSv1.1, TLSv1.2, TLSv1.3
or a combination of them. E.g.
--tls_version=TLSv1.3
--tls_version=TLSv1.2,TLSv1.3
In case there is a gap between versions, the lowest version will be used:
--tls_version=TLSv1.1,TLSv1.3 -> Only TLSv1.1 will be available.
If the used TLS library doesn't support the specified TLS version, it will use
the default configuration.
Limitations:
SSLv3 is not supported. The default configuration doesn't support TLSv1.0 anymore.
TLSv1.3 protocol currently is only supported by OpenSSL 1.1.0 (client and server) and
GnuTLS 3.6.5 (client only).
Overview of TLS implementations and protocols
Server:
+-----------+-----------------------------------------+
| Library | Supported TLS versions |
+-----------+-----------------------------------------+
| WolfSSL | TLSv1.1, TLSv1,2 |
+-----------+-----------------------------------------+
| OpenSSL | (TLSv1.0), TLSv1.1, TLSv1,2, TLSv1.3 |
+-----------+-----------------------------------------+
| LibreSSL | (TLSv1.0), TLSv1.1, TLSv1,2, TLSv1.3 |
+-----------+-----------------------------------------+
Client (MariaDB Connector/C)
+-----------+-----------------------------------------+
| Library | Supported TLS versions |
+-----------+-----------------------------------------+
| GnuTLS | (TLSv1.0), TLSv1.1, TLSv1.2, TLSv1.3 |
+-----------+-----------------------------------------+
| Schannel | (TLSv1.0), TLSv1.1, TLSv1.2 |
+-----------+-----------------------------------------+
| OpenSSL | (TLSv1.0), TLSv1.1, TLSv1,2, TLSv1.3 |
+-----------+-----------------------------------------+
| LibreSSL | (TLSv1.0), TLSv1.1, TLSv1,2, TLSv1.3 |
+-----------+-----------------------------------------+
2019-06-11 12:44:16 +02:00
|
|
|
extern ulonglong tls_version;
|
2010-03-31 16:05:33 +02:00
|
|
|
|
2011-04-25 17:22:25 +02:00
|
|
|
#ifdef MYSQL_SERVER
|
2011-07-02 22:12:12 +02:00
|
|
|
|
2010-03-31 16:05:33 +02:00
|
|
|
/**
|
|
|
|
only options that need special treatment in get_one_option() deserve
|
|
|
|
to be listed below
|
|
|
|
*/
|
|
|
|
enum options_mysqld
|
|
|
|
{
|
|
|
|
OPT_to_set_the_start_number=256,
|
|
|
|
OPT_BINLOG_DO_DB,
|
|
|
|
OPT_BINLOG_FORMAT,
|
|
|
|
OPT_BINLOG_IGNORE_DB,
|
|
|
|
OPT_BIN_LOG,
|
|
|
|
OPT_BOOTSTRAP,
|
2021-05-07 09:27:20 +02:00
|
|
|
OPT_EXPIRE_LOGS_DAYS,
|
|
|
|
OPT_BINLOG_EXPIRE_LOGS_SECONDS,
|
2010-03-31 16:05:33 +02:00
|
|
|
OPT_CONSOLE,
|
|
|
|
OPT_DEBUG_SYNC_TIMEOUT,
|
2020-01-19 18:13:01 +01:00
|
|
|
OPT_REMOVED_OPTION,
|
2012-10-18 23:33:06 +02:00
|
|
|
OPT_IGNORE_DB_DIRECTORY,
|
2010-03-31 16:05:33 +02:00
|
|
|
OPT_ISAM_LOG,
|
|
|
|
OPT_KEY_BUFFER_SIZE,
|
|
|
|
OPT_KEY_CACHE_AGE_THRESHOLD,
|
|
|
|
OPT_KEY_CACHE_BLOCK_SIZE,
|
|
|
|
OPT_KEY_CACHE_DIVISION_LIMIT,
|
2010-11-25 18:17:28 +01:00
|
|
|
OPT_KEY_CACHE_PARTITIONS,
|
2014-07-19 16:46:08 +02:00
|
|
|
OPT_KEY_CACHE_CHANGED_BLOCKS_HASH_SIZE,
|
2012-10-18 23:33:06 +02:00
|
|
|
OPT_LOG_BASENAME,
|
|
|
|
OPT_LOG_ERROR,
|
2010-03-31 16:05:33 +02:00
|
|
|
OPT_LOWER_CASE_TABLE_NAMES,
|
2012-12-15 18:24:11 +01:00
|
|
|
OPT_PLUGIN_LOAD,
|
|
|
|
OPT_PLUGIN_LOAD_ADD,
|
2012-11-03 12:28:51 +01:00
|
|
|
OPT_PFS_INSTRUMENT,
|
2010-03-31 16:05:33 +02:00
|
|
|
OPT_REPLICATE_DO_DB,
|
|
|
|
OPT_REPLICATE_DO_TABLE,
|
|
|
|
OPT_REPLICATE_IGNORE_DB,
|
|
|
|
OPT_REPLICATE_IGNORE_TABLE,
|
|
|
|
OPT_REPLICATE_REWRITE_DB,
|
|
|
|
OPT_REPLICATE_WILD_DO_TABLE,
|
|
|
|
OPT_REPLICATE_WILD_IGNORE_TABLE,
|
|
|
|
OPT_SAFE,
|
|
|
|
OPT_SERVER_ID,
|
2015-10-09 12:08:41 +02:00
|
|
|
OPT_SILENT,
|
2010-03-31 16:05:33 +02:00
|
|
|
OPT_SKIP_HOST_CACHE,
|
|
|
|
OPT_SKIP_RESOLVE,
|
2014-12-05 16:09:48 +01:00
|
|
|
OPT_SLAVE_PARALLEL_MODE,
|
2010-03-31 16:05:33 +02:00
|
|
|
OPT_SSL_CA,
|
|
|
|
OPT_SSL_CAPATH,
|
|
|
|
OPT_SSL_CERT,
|
|
|
|
OPT_SSL_CIPHER,
|
2012-11-03 12:28:51 +01:00
|
|
|
OPT_SSL_CRL,
|
|
|
|
OPT_SSL_CRLPATH,
|
2010-03-31 16:05:33 +02:00
|
|
|
OPT_SSL_KEY,
|
2014-07-02 11:22:52 +02:00
|
|
|
OPT_THREAD_CONCURRENCY,
|
2010-03-31 16:05:33 +02:00
|
|
|
OPT_WANT_CORE,
|
2016-06-28 00:30:07 +02:00
|
|
|
#ifdef WITH_WSREP
|
|
|
|
OPT_WSREP_CAUSAL_READS,
|
|
|
|
OPT_WSREP_SYNC_WAIT,
|
|
|
|
#endif /* WITH_WSREP */
|
2013-11-25 15:49:40 +01:00
|
|
|
OPT_MYSQL_COMPATIBILITY,
|
MDEV-14101 Provide an option to select TLS protocol version
Server and command line tools now support option --tls_version to specify the
TLS version between client and server. Valid values are TLSv1.0, TLSv1.1, TLSv1.2, TLSv1.3
or a combination of them. E.g.
--tls_version=TLSv1.3
--tls_version=TLSv1.2,TLSv1.3
In case there is a gap between versions, the lowest version will be used:
--tls_version=TLSv1.1,TLSv1.3 -> Only TLSv1.1 will be available.
If the used TLS library doesn't support the specified TLS version, it will use
the default configuration.
Limitations:
SSLv3 is not supported. The default configuration doesn't support TLSv1.0 anymore.
TLSv1.3 protocol currently is only supported by OpenSSL 1.1.0 (client and server) and
GnuTLS 3.6.5 (client only).
Overview of TLS implementations and protocols
Server:
+-----------+-----------------------------------------+
| Library | Supported TLS versions |
+-----------+-----------------------------------------+
| WolfSSL | TLSv1.1, TLSv1,2 |
+-----------+-----------------------------------------+
| OpenSSL | (TLSv1.0), TLSv1.1, TLSv1,2, TLSv1.3 |
+-----------+-----------------------------------------+
| LibreSSL | (TLSv1.0), TLSv1.1, TLSv1,2, TLSv1.3 |
+-----------+-----------------------------------------+
Client (MariaDB Connector/C)
+-----------+-----------------------------------------+
| Library | Supported TLS versions |
+-----------+-----------------------------------------+
| GnuTLS | (TLSv1.0), TLSv1.1, TLSv1.2, TLSv1.3 |
+-----------+-----------------------------------------+
| Schannel | (TLSv1.0), TLSv1.1, TLSv1.2 |
+-----------+-----------------------------------------+
| OpenSSL | (TLSv1.0), TLSv1.1, TLSv1,2, TLSv1.3 |
+-----------+-----------------------------------------+
| LibreSSL | (TLSv1.0), TLSv1.1, TLSv1,2, TLSv1.3 |
+-----------+-----------------------------------------+
2019-06-11 12:44:16 +02:00
|
|
|
OPT_TLS_VERSION,
|
2013-11-25 15:49:40 +01:00
|
|
|
OPT_MYSQL_TO_BE_IMPLEMENTED,
|
2012-10-18 23:33:06 +02:00
|
|
|
OPT_which_is_always_the_last
|
2010-03-31 16:05:33 +02:00
|
|
|
};
|
2011-04-25 17:22:25 +02:00
|
|
|
#endif
|
2010-03-31 16:05:33 +02:00
|
|
|
|
|
|
|
/**
|
2011-03-04 16:43:28 +01:00
|
|
|
Query type constants (usable as bitmap flags).
|
2010-03-31 16:05:33 +02:00
|
|
|
*/
|
|
|
|
enum enum_query_type
|
|
|
|
{
|
2011-03-04 16:43:28 +01:00
|
|
|
/// Nothing specific, ordinary SQL query.
|
|
|
|
QT_ORDINARY= 0,
|
|
|
|
/// In utf8.
|
|
|
|
QT_TO_SYSTEM_CHARSET= (1 << 0),
|
|
|
|
/// Without character set introducers.
|
2011-10-19 21:45:18 +02:00
|
|
|
QT_WITHOUT_INTRODUCERS= (1 << 1),
|
|
|
|
/// view internal representation (like QT_ORDINARY except ORDER BY clause)
|
2014-08-09 04:37:56 +02:00
|
|
|
QT_VIEW_INTERNAL= (1 << 2),
|
2016-11-07 17:17:40 +01:00
|
|
|
/// If identifiers should not include database names, where unambiguous
|
|
|
|
QT_ITEM_IDENT_SKIP_DB_NAMES= (1 << 3),
|
|
|
|
/// If identifiers should not include table names, where unambiguous
|
|
|
|
QT_ITEM_IDENT_SKIP_TABLE_NAMES= (1 << 4),
|
2015-09-10 12:04:52 +02:00
|
|
|
/// If Item_cache_wrapper should not print <expr_cache>
|
2016-11-07 17:17:40 +01:00
|
|
|
QT_ITEM_CACHE_WRAPPER_SKIP_DETAILS= (1 << 5),
|
2015-09-10 12:04:52 +02:00
|
|
|
/// If Item_subselect should print as just "(subquery#1)"
|
|
|
|
/// rather than display the subquery body
|
2016-11-07 17:17:40 +01:00
|
|
|
QT_ITEM_SUBSELECT_ID_ONLY= (1 << 6),
|
2015-09-10 13:01:44 +02:00
|
|
|
/// If NULLIF(a,b) should print itself as
|
|
|
|
/// CASE WHEN a_for_comparison=b THEN NULL ELSE a_for_return_value END
|
|
|
|
/// when "a" was replaced to two different items
|
2016-03-03 18:44:10 +01:00
|
|
|
/// (e.g. by equal fields propagation in optimize_cond())
|
|
|
|
/// or always as NULLIF(a, b).
|
|
|
|
/// The default behaviour is to use CASE syntax when
|
|
|
|
/// a_for_return_value is not the same as a_for_comparison.
|
|
|
|
/// SHOW CREATE {VIEW|PROCEDURE|FUNCTION} and other cases where the
|
|
|
|
/// original representation is required, should set this flag.
|
2016-11-07 17:17:40 +01:00
|
|
|
QT_ITEM_ORIGINAL_FUNC_NULLIF= (1 << 7),
|
2019-02-10 07:54:26 +01:00
|
|
|
/// good for parsing
|
|
|
|
QT_PARSABLE= (1 << 8),
|
2015-09-10 12:04:52 +02:00
|
|
|
|
2014-08-09 04:37:56 +02:00
|
|
|
/// This value means focus on readability, not on ability to parse back, etc.
|
2015-09-10 12:04:52 +02:00
|
|
|
QT_EXPLAIN= QT_TO_SYSTEM_CHARSET |
|
2016-11-07 17:17:40 +01:00
|
|
|
QT_ITEM_IDENT_SKIP_DB_NAMES |
|
2015-09-10 12:04:52 +02:00
|
|
|
QT_ITEM_CACHE_WRAPPER_SKIP_DETAILS |
|
|
|
|
QT_ITEM_SUBSELECT_ID_ONLY,
|
|
|
|
|
2017-03-14 11:52:00 +01:00
|
|
|
QT_SHOW_SELECT_NUMBER= (1<<10),
|
2020-08-14 13:45:36 +02:00
|
|
|
|
|
|
|
/// Do not print database name or table name in the identifiers (even if
|
|
|
|
/// this means the printout will be ambigous). It is assumed that the caller
|
|
|
|
/// passing this flag knows what they are doing.
|
|
|
|
QT_ITEM_IDENT_DISABLE_DB_TABLE_NAMES= (1 <<11),
|
|
|
|
|
2017-03-14 11:52:00 +01:00
|
|
|
/// This is used for EXPLAIN EXTENDED extra warnings / Be more detailed
|
2015-09-10 12:04:52 +02:00
|
|
|
/// Be more detailed than QT_EXPLAIN.
|
|
|
|
/// Perhaps we should eventually include QT_ITEM_IDENT_SKIP_CURRENT_DATABASE
|
|
|
|
/// here, as it would give better readable results
|
2017-03-14 11:52:00 +01:00
|
|
|
QT_EXPLAIN_EXTENDED= QT_TO_SYSTEM_CHARSET|
|
|
|
|
QT_SHOW_SELECT_NUMBER,
|
2016-05-04 15:23:26 +02:00
|
|
|
|
|
|
|
// If an expression is constant, print the expression, not the value
|
|
|
|
// it evaluates to. Should be used for error messages, so that they
|
|
|
|
// don't reveal values.
|
2016-01-07 12:53:18 +01:00
|
|
|
QT_NO_DATA_EXPANSION= (1 << 9),
|
2010-03-31 16:05:33 +02:00
|
|
|
};
|
|
|
|
|
2014-08-09 04:37:56 +02:00
|
|
|
|
2010-03-31 16:05:33 +02:00
|
|
|
/* query_id */
|
2020-03-21 16:46:49 +01:00
|
|
|
extern Atomic_counter<query_id_t> global_query_id;
|
2010-03-31 16:05:33 +02:00
|
|
|
|
|
|
|
/* increment query_id and return it. */
|
2014-01-13 07:34:16 +01:00
|
|
|
inline __attribute__((warn_unused_result)) query_id_t next_query_id()
|
2010-03-31 16:05:33 +02:00
|
|
|
{
|
2020-03-21 16:46:49 +01:00
|
|
|
return global_query_id++;
|
2010-03-31 16:05:33 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
inline query_id_t get_query_id()
|
|
|
|
{
|
2020-03-21 16:46:49 +01:00
|
|
|
return global_query_id;
|
2010-03-31 16:05:33 +02:00
|
|
|
}
|
|
|
|
|
2016-02-01 11:45:39 +01:00
|
|
|
/* increment global_thread_id and return it. */
|
2018-02-01 10:01:15 +01:00
|
|
|
extern __attribute__((warn_unused_result)) my_thread_id next_thread_id(void);
|
2010-03-31 16:05:33 +02:00
|
|
|
|
|
|
|
/*
|
|
|
|
TODO: Replace this with an inline function.
|
|
|
|
*/
|
|
|
|
#ifndef EMBEDDED_LIBRARY
|
|
|
|
extern "C" void unireg_abort(int exit_code) __attribute__((noreturn));
|
|
|
|
#else
|
|
|
|
extern "C" void unireg_clear(int exit_code);
|
|
|
|
#define unireg_abort(exit_code) do { unireg_clear(exit_code); DBUG_RETURN(exit_code); } while(0)
|
|
|
|
#endif
|
|
|
|
|
|
|
|
inline void table_case_convert(char * name, uint length)
|
|
|
|
{
|
|
|
|
if (lower_case_table_names)
|
2020-01-26 17:27:13 +01:00
|
|
|
files_charset_info->casedn(name, length, name, length);
|
2010-03-31 16:05:33 +02:00
|
|
|
}
|
|
|
|
|
2016-08-26 14:39:32 +02:00
|
|
|
extern void set_server_version(char *buf, size_t size);
|
2012-02-21 20:51:56 +01:00
|
|
|
|
2010-03-31 16:05:33 +02:00
|
|
|
#define current_thd _current_thd()
|
2020-04-30 19:06:26 +02:00
|
|
|
void set_current_thd(THD *thd);
|
2016-02-01 11:45:39 +01:00
|
|
|
|
2010-11-25 18:17:28 +01:00
|
|
|
/*
|
|
|
|
@todo remove, make it static in ha_maria.cc
|
|
|
|
currently it's needed for sql_select.cc
|
|
|
|
*/
|
|
|
|
extern handlerton *maria_hton;
|
|
|
|
|
2012-10-23 11:19:42 +02:00
|
|
|
extern uint64 global_gtid_counter;
|
2013-05-28 13:28:31 +02:00
|
|
|
extern my_bool opt_gtid_strict_mode;
|
2011-10-19 21:45:18 +02:00
|
|
|
extern my_bool opt_userstat_running, debug_assert_if_crashed_table;
|
2010-11-25 18:17:28 +01:00
|
|
|
extern uint mysqld_extra_port;
|
2011-10-19 21:45:18 +02:00
|
|
|
extern ulong opt_progress_report_time;
|
2010-11-25 18:17:28 +01:00
|
|
|
extern ulong extra_max_connections;
|
|
|
|
extern ulonglong denied_connections;
|
|
|
|
extern ulong thread_created;
|
2011-07-02 22:12:12 +02:00
|
|
|
extern scheduler_functions *thread_scheduler, *extra_thread_scheduler;
|
2011-10-19 21:45:18 +02:00
|
|
|
extern char *opt_log_basename;
|
|
|
|
extern my_bool opt_master_verify_checksum;
|
2015-10-09 12:08:41 +02:00
|
|
|
extern my_bool opt_stack_trace, disable_log_notes;
|
2012-02-21 20:51:56 +01:00
|
|
|
extern my_bool opt_expect_abort;
|
2011-10-19 21:45:18 +02:00
|
|
|
extern my_bool opt_slave_sql_verify_checksum;
|
2014-11-25 18:47:44 +01:00
|
|
|
extern my_bool opt_mysql56_temporal_format, strict_password_validation;
|
2015-09-22 12:01:54 +02:00
|
|
|
extern my_bool opt_explicit_defaults_for_timestamp;
|
2011-10-19 21:45:18 +02:00
|
|
|
extern ulong binlog_checksum_options;
|
2011-11-22 18:04:38 +01:00
|
|
|
extern bool max_user_connections_checking;
|
|
|
|
extern ulong opt_binlog_dbug_fsync_sleep;
|
|
|
|
|
2011-10-19 21:45:18 +02:00
|
|
|
extern uint volatile global_disable_checkpoint;
|
2011-12-12 23:58:40 +01:00
|
|
|
extern my_bool opt_help;
|
2011-10-19 21:45:18 +02:00
|
|
|
|
2020-07-04 18:24:40 +02:00
|
|
|
extern int mysqld_main(int argc, char **argv);
|
|
|
|
|
|
|
|
#ifdef _WIN32
|
|
|
|
extern HANDLE hEventShutdown;
|
|
|
|
extern void mysqld_win_initiate_shutdown();
|
|
|
|
extern void mysqld_win_set_startup_complete();
|
|
|
|
extern void mysqld_set_service_status_callback(void (*)(DWORD, DWORD, DWORD));
|
|
|
|
extern void mysqld_win_set_service_name(const char *name);
|
|
|
|
#endif
|
|
|
|
|
2010-03-31 16:05:33 +02:00
|
|
|
#endif /* MYSQLD_INCLUDED */
|