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