1#ifndef XTRABACKUP_BACKUP_MYSQL_H
2#define XTRABACKUP_BACKUP_MYSQL_H
3
4#include <mysql.h>
5
6/* mysql flavor and version */
7enum mysql_flavor_t { FLAVOR_UNKNOWN, FLAVOR_MYSQL,
8 FLAVOR_PERCONA_SERVER, FLAVOR_MARIADB };
9extern mysql_flavor_t server_flavor;
10extern unsigned long mysql_server_version;
11
12/* server capabilities */
13extern bool have_changed_page_bitmaps;
14extern bool have_backup_locks;
15extern bool have_lock_wait_timeout;
16extern bool have_galera_enabled;
17extern bool have_flush_engine_logs;
18extern bool have_multi_threaded_slave;
19extern bool have_gtid_slave;
20
21
22/* History on server */
23extern time_t history_start_time;
24extern time_t history_end_time;
25extern time_t history_lock_time;
26
27
28extern bool sql_thread_started;
29extern char *mysql_slave_position;
30extern char *mysql_binlog_position;
31extern char *buffer_pool_filename;
32
33/** connection to mysql server */
34extern MYSQL *mysql_connection;
35
36void
37capture_tool_command(int argc, char **argv);
38
39bool
40select_history();
41
42bool
43flush_changed_page_bitmaps();
44
45void
46backup_cleanup();
47
48bool
49get_mysql_vars(MYSQL *connection);
50
51bool
52detect_mysql_capabilities_for_backup();
53
54MYSQL *
55xb_mysql_connect();
56
57MYSQL_RES *
58xb_mysql_query(MYSQL *connection, const char *query, bool use_result,
59 bool die_on_error = true);
60
61void
62unlock_all(MYSQL *connection);
63
64bool
65write_current_binlog_file(MYSQL *connection);
66
67bool
68write_binlog_info(MYSQL *connection);
69
70bool
71write_xtrabackup_info(MYSQL *connection, const char * filename, bool history);
72
73bool
74write_backup_config_file();
75
76bool
77lock_binlog_maybe(MYSQL *connection);
78
79bool
80lock_tables(MYSQL *connection);
81
82bool
83wait_for_safe_slave(MYSQL *connection);
84
85bool
86write_galera_info(MYSQL *connection);
87
88bool
89write_slave_info(MYSQL *connection);
90
91
92#endif
93