1 /* Copyright (C) 2006 MySQL AB & MySQL Finland AB & TCX DataKonsult AB 2 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. 6 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. 11 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA */ 15 16 /* 17 WL#3234 Maria control file 18 First version written by Guilhem Bichot on 2006-04-27. 19 */ 20 21 #ifndef _ma_control_file_h 22 #define _ma_control_file_h 23 24 #define CONTROL_FILE_BASE_NAME "aria_log_control" 25 /* 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. 29 */ 30 #define CONTROL_FILE_VERSION 1 31 32 /* Here is the interface of this module */ 33 34 /* 35 LSN of the last checkoint 36 (if last_checkpoint_lsn == LSN_IMPOSSIBLE then there was never a checkpoint) 37 */ 38 extern LSN last_checkpoint_lsn; 39 /* 40 Last log number (if last_logno == FILENO_IMPOSSIBLE then there is no log 41 file yet) 42 */ 43 extern uint32 last_logno; 44 45 extern TrID max_trid_in_control_file, max_long_trid; 46 47 extern uint8 recovery_failures; 48 49 extern my_bool maria_multi_threaded, maria_in_recovery; 50 51 typedef enum enum_control_file_error { 52 CONTROL_FILE_OK= 0, 53 CONTROL_FILE_TOO_SMALL, 54 CONTROL_FILE_TOO_BIG, 55 CONTROL_FILE_BAD_MAGIC_STRING, 56 CONTROL_FILE_BAD_VERSION, 57 CONTROL_FILE_BAD_CHECKSUM, 58 CONTROL_FILE_BAD_HEAD_CHECKSUM, 59 CONTROL_FILE_MISSING, 60 CONTROL_FILE_INCONSISTENT_INFORMATION, 61 CONTROL_FILE_WRONG_BLOCKSIZE, 62 CONTROL_FILE_UNKNOWN_ERROR /* any other error */ 63 } CONTROL_FILE_ERROR; 64 65 C_MODE_START 66 CONTROL_FILE_ERROR ma_control_file_open(my_bool create_if_missing, 67 my_bool print_error); 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); 73 C_MODE_END 74 #endif 75