2017-04-18 18:43:20 +00:00
|
|
|
#ifndef XTRABACKUP_BACKUP_MYSQL_H
|
|
|
|
#define XTRABACKUP_BACKUP_MYSQL_H
|
|
|
|
|
|
|
|
#include <mysql.h>
|
|
|
|
|
|
|
|
/* mysql flavor and version */
|
|
|
|
enum mysql_flavor_t { FLAVOR_UNKNOWN, FLAVOR_MYSQL,
|
|
|
|
FLAVOR_PERCONA_SERVER, FLAVOR_MARIADB };
|
|
|
|
extern mysql_flavor_t server_flavor;
|
|
|
|
extern unsigned long mysql_server_version;
|
|
|
|
|
|
|
|
/* server capabilities */
|
|
|
|
extern bool have_backup_locks;
|
|
|
|
extern bool have_lock_wait_timeout;
|
|
|
|
extern bool have_galera_enabled;
|
|
|
|
extern bool have_flush_engine_logs;
|
|
|
|
extern bool have_multi_threaded_slave;
|
|
|
|
extern bool have_gtid_slave;
|
|
|
|
|
|
|
|
|
|
|
|
/* History on server */
|
|
|
|
extern time_t history_start_time;
|
|
|
|
extern time_t history_end_time;
|
|
|
|
extern time_t history_lock_time;
|
|
|
|
|
|
|
|
|
|
|
|
extern bool sql_thread_started;
|
|
|
|
extern char *mysql_slave_position;
|
|
|
|
extern char *mysql_binlog_position;
|
2022-06-28 09:16:31 +02:00
|
|
|
extern char *buffer_pool_filename;
|
2017-04-18 18:43:20 +00:00
|
|
|
|
|
|
|
/** connection to mysql server */
|
|
|
|
extern MYSQL *mysql_connection;
|
|
|
|
|
|
|
|
void
|
|
|
|
capture_tool_command(int argc, char **argv);
|
|
|
|
|
|
|
|
bool
|
|
|
|
select_history();
|
|
|
|
|
|
|
|
void
|
|
|
|
backup_cleanup();
|
|
|
|
|
|
|
|
bool
|
|
|
|
get_mysql_vars(MYSQL *connection);
|
|
|
|
|
|
|
|
bool
|
|
|
|
detect_mysql_capabilities_for_backup();
|
|
|
|
|
|
|
|
MYSQL *
|
|
|
|
xb_mysql_connect();
|
|
|
|
|
|
|
|
MYSQL_RES *
|
|
|
|
xb_mysql_query(MYSQL *connection, const char *query, bool use_result,
|
|
|
|
bool die_on_error = true);
|
|
|
|
|
|
|
|
void
|
|
|
|
unlock_all(MYSQL *connection);
|
|
|
|
|
|
|
|
bool
|
2023-04-12 11:40:46 +04:00
|
|
|
write_current_binlog_file(ds_ctxt *datasink, MYSQL *connection);
|
2022-06-28 09:16:31 +02:00
|
|
|
|
|
|
|
bool
|
2023-04-12 11:40:46 +04:00
|
|
|
write_binlog_info(ds_ctxt *datasink, MYSQL *connection);
|
2017-04-18 18:43:20 +00:00
|
|
|
|
|
|
|
bool
|
2023-04-12 11:40:46 +04:00
|
|
|
write_xtrabackup_info(ds_ctxt *datasink,
|
|
|
|
MYSQL *connection, const char * filename, bool history,
|
|
|
|
bool stream);
|
2017-04-18 18:43:20 +00:00
|
|
|
|
|
|
|
bool
|
2023-04-12 11:40:46 +04:00
|
|
|
write_backup_config_file(ds_ctxt *datasink);
|
2017-04-18 18:43:20 +00:00
|
|
|
|
|
|
|
bool
|
|
|
|
lock_binlog_maybe(MYSQL *connection);
|
|
|
|
|
|
|
|
bool
|
|
|
|
lock_tables(MYSQL *connection);
|
|
|
|
|
|
|
|
bool
|
|
|
|
wait_for_safe_slave(MYSQL *connection);
|
|
|
|
|
|
|
|
bool
|
2023-04-12 11:40:46 +04:00
|
|
|
write_galera_info(ds_ctxt *datasink, MYSQL *connection);
|
2017-04-18 18:43:20 +00:00
|
|
|
|
|
|
|
bool
|
2023-04-12 11:40:46 +04:00
|
|
|
write_slave_info(ds_ctxt *datasink, MYSQL *connection);
|
2017-04-18 18:43:20 +00:00
|
|
|
|
|
|
|
|
|
|
|
#endif
|