1
/* Copyright (C) 2006 MySQL AB & MySQL Finland AB & TCX DataKonsult AB
3
This program is free software; you can redistribute it and/or modify
4
it under the terms of the GNU General Public License as published by
5
the Free Software Foundation; version 2 of the License.
7
This program is distributed in the hope that it will be useful,
8
but WITHOUT ANY WARRANTY; without even the implied warranty of
9
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10
GNU General Public License for more details.
12
You should have received a copy of the GNU General Public License
13
along with this program; if not, write to the Free Software
14
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
17
WL#3234 Maria control file
18
First version written by Guilhem Bichot on 2006-04-27.
21
#ifndef _ma_control_file_h
22
#define _ma_control_file_h
24
#define CONTROL_FILE_BASE_NAME "maria_log_control"
26
Major version for control file. Should only be changed when doing
27
big changes that made the new control file incompatible with all
28
older versions of Maria.
30
#define CONTROL_FILE_VERSION 1
32
/* Here is the interface of this module */
35
LSN of the last checkoint
36
(if last_checkpoint_lsn == LSN_IMPOSSIBLE then there was never a checkpoint)
38
extern LSN last_checkpoint_lsn;
40
Last log number (if last_logno == FILENO_IMPOSSIBLE then there is no log
43
extern uint32 last_logno;
45
extern TrID max_trid_in_control_file;
47
extern uint8 recovery_failures;
49
extern my_bool maria_multi_threaded, maria_in_recovery;
51
typedef enum enum_control_file_error {
53
CONTROL_FILE_TOO_SMALL,
55
CONTROL_FILE_BAD_MAGIC_STRING,
56
CONTROL_FILE_BAD_VERSION,
57
CONTROL_FILE_BAD_CHECKSUM,
58
CONTROL_FILE_BAD_HEAD_CHECKSUM,
60
CONTROL_FILE_INCONSISTENT_INFORMATION,
61
CONTROL_FILE_WRONG_BLOCKSIZE,
62
CONTROL_FILE_UNKNOWN_ERROR /* any other error */
66
CONTROL_FILE_ERROR ma_control_file_open(my_bool create_if_missing,
68
int ma_control_file_write_and_force(LSN last_checkpoint_lsn_arg,
69
uint32 last_logno_arg, TrID max_trid_arg,
70
uint8 recovery_failures_arg);
71
int ma_control_file_end(void);
72
my_bool ma_control_file_inited(void);