71
70
/********************************************************************
72
71
Marks the trx sys header when we have successfully upgraded to the >= 4.1.x
73
72
multiple tablespace format. */
76
75
trx_sys_mark_upgraded_to_multiple_tablespaces(void);
77
76
/*===============================================*/
78
77
/********************************************************************
79
78
Determines if a page number is located inside the doublewrite buffer. */
82
81
trx_doublewrite_page_inside(
83
82
/*========================*/
96
95
/*********************************************************************
97
96
Creates and initializes the central memory structures for the transaction
98
97
system. This is called when the database is started. */
101
100
trx_sys_init_at_db_start(void);
102
101
/*==========================*/
103
102
/*********************************************************************
104
103
Creates and initializes the transaction system at the database creation. */
107
106
trx_sys_create(void);
108
107
/*================*/
109
108
/********************************************************************
110
109
Looks for a free slot for a rollback segment in the trx system file copy. */
113
112
trx_sysf_rseg_find_free(
114
113
/*====================*/
263
262
which corresponds to the transaction just being committed. In a MySQL
264
263
replication slave updates the latest master binlog position up to which
265
264
replication has proceeded. */
268
267
trx_sys_update_mysql_binlog_offset(
269
268
/*===============================*/
270
269
const char* file_name,/* in: MySQL log file name */
271
ib_int64_t offset, /* in: position in that log file */
270
ib_longlong offset, /* in: position in that log file */
272
271
ulint field, /* in: offset of the MySQL log info field in
273
272
the trx sys header */
274
273
mtr_t* mtr); /* in: mtr */
275
274
/*********************************************************************
276
275
Prints to stderr the MySQL binlog offset info in the trx system header if
277
276
the magic number shows it valid. */
280
279
trx_sys_print_mysql_binlog_offset(void);
281
280
/*===================================*/
283
282
/*********************************************************************
284
283
Prints to stderr the MySQL binlog info in the system header if the
285
284
magic number shows it valid. */
288
287
trx_sys_print_mysql_binlog_offset_from_page(
289
288
/*========================================*/
290
const byte* page); /* in: buffer containing the trx
291
system header page, i.e., page number
292
TRX_SYS_PAGE_NO in the tablespace */
289
byte* page); /* in: buffer containing the trx system header page,
290
i.e., page number TRX_SYS_PAGE_NO in the tablespace */
293
291
#endif /* UNIV_HOTBACKUP */
294
292
/*********************************************************************
295
293
Prints to stderr the MySQL master log offset info in the trx system header if
296
294
the magic number shows it valid. */
299
297
trx_sys_print_mysql_master_log_pos(void);
300
298
/*====================================*/
301
/*********************************************************************
302
Initializes the tablespace tag system. */
305
trx_sys_file_format_init(void);
306
/*==========================*/
307
/*********************************************************************
308
Closes the tablespace tag system. */
311
trx_sys_file_format_close(void);
312
/*===========================*/
313
/*********************************************************************
314
Get the name representation of the file format from its id. */
317
trx_sys_file_format_id_to_name(
318
/*===========================*/
319
/* out: pointer to the name */
320
const uint id); /* in: id of the file format */
321
/*********************************************************************
322
Set the file format tag unconditonally. */
325
trx_sys_file_format_max_set(
326
/*===========================*/
327
/* out: TRUE if value updated */
328
ulint file_format, /* in: file format id */
329
char** name); /* out: max format name */
330
/*********************************************************************
331
Get the name representation of the file format from its id. */
334
trx_sys_file_format_max_get(void);
335
/*=============================*/
336
/* out: pointer to the max format name */
337
/*********************************************************************
338
Check for the max file format tag stored on disk. */
341
trx_sys_file_format_max_check(
342
/*==========================*/
343
/* out: DB_SUCCESS or error code */
344
ulint max_format_id); /* in: the max format id to check */
345
/************************************************************************
346
Update the file format tag in the tablespace to the max value. */
349
trx_sys_file_format_max_update(
350
/*===========================*/
351
/* out: TRUE if value updated */
352
uint flags, /* in: flags of the table */
353
char** name); /* out: max format name */
354
300
/* The automatically created system rollback segment has this id */
355
301
#define TRX_SYS_SYSTEM_RSEG_ID 0
384
330
therefore 256; each slot is currently 8 bytes in size */
385
331
#define TRX_SYS_N_RSEGS 256
387
#define TRX_SYS_MYSQL_LOG_NAME_LEN 512
388
#define TRX_SYS_MYSQL_LOG_MAGIC_N 873422344
333
#define TRX_SYS_DRIZZLE_LOG_NAME_LEN 512
334
#define TRX_SYS_DRIZZLE_LOG_MAGIC_N 873422344
390
#if UNIV_PAGE_SIZE < 4096
391
# error "UNIV_PAGE_SIZE < 4096"
393
336
/* The offset of the MySQL replication info in the trx system header;
394
this contains the same fields as TRX_SYS_MYSQL_LOG_INFO below */
395
#define TRX_SYS_MYSQL_MASTER_LOG_INFO (UNIV_PAGE_SIZE - 2000)
337
this contains the same fields as TRX_SYS_DRIZZLE_LOG_INFO below */
338
#define TRX_SYS_DRIZZLE_MASTER_LOG_INFO (UNIV_PAGE_SIZE - 2000)
397
340
/* The offset of the MySQL binlog offset info in the trx system header */
398
#define TRX_SYS_MYSQL_LOG_INFO (UNIV_PAGE_SIZE - 1000)
399
#define TRX_SYS_MYSQL_LOG_MAGIC_N_FLD 0 /* magic number which shows
341
#define TRX_SYS_DRIZZLE_LOG_INFO (UNIV_PAGE_SIZE - 1000)
342
#define TRX_SYS_DRIZZLE_LOG_MAGIC_N_FLD 0 /* magic number which shows
400
343
if we have valid data in the
401
344
MySQL binlog info; the value
402
345
is ..._MAGIC_N if yes */
403
#define TRX_SYS_MYSQL_LOG_OFFSET_HIGH 4 /* high 4 bytes of the offset
405
#define TRX_SYS_MYSQL_LOG_OFFSET_LOW 8 /* low 4 bytes of the offset
407
#define TRX_SYS_MYSQL_LOG_NAME 12 /* MySQL log file name */
346
#define TRX_SYS_DRIZZLE_LOG_OFFSET_HIGH 4 /* high 4 bytes of the offset
348
#define TRX_SYS_DRIZZLE_LOG_OFFSET_LOW 8 /* low 4 bytes of the offset
350
#define TRX_SYS_DRIZZLE_LOG_NAME 12 /* MySQL log file name */
409
352
/* The offset of the doublewrite buffer header on the trx system header page */
410
353
#define TRX_SYS_DOUBLEWRITE (UNIV_PAGE_SIZE - 200)
450
393
#define TRX_SYS_DOUBLEWRITE_BLOCK_SIZE FSP_EXTENT_SIZE
452
/* The offset of the file format tag on the trx system header page */
453
#define TRX_SYS_FILE_FORMAT_TAG (UNIV_PAGE_SIZE - 16)
455
/* We use these random constants to reduce the probability of reading
456
garbage (from previous versions) that maps to an actual format id. We
457
use these as bit masks at the time of reading and writing from/to disk. */
458
#define TRX_SYS_FILE_FORMAT_TAG_MAGIC_N_LOW 3645922177UL
459
#define TRX_SYS_FILE_FORMAT_TAG_MAGIC_N_HIGH 2745987765UL
461
395
/* Doublewrite control struct */
462
396
struct trx_doublewrite_struct{
463
397
mutex_t mutex; /* mutex protecting the first_free field and