~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to plugin/innobase/include/trx0sys.h

  • Committer: Olaf van der Spek
  • Date: 2011-03-28 14:32:36 UTC
  • mto: (2257.1.1 build) (2276.1.2 build)
  • mto: This revision was merged to the branch mainline in revision 2258.
  • Revision ID: olafvdspek@gmail.com-20110328143236-4ge1d793iqaktfq0
Common fwd

Show diffs side-by-side

added added

removed removed

Lines of Context:
23
23
Created 3/26/1996 Heikki Tuuri
24
24
*******************************************************/
25
25
 
 
26
#pragma once
26
27
#ifndef trx0sys_h
27
28
#define trx0sys_h
28
29
 
41
42
#include "read0types.h"
42
43
#include "page0types.h"
43
44
 
44
 
/** In a MySQL replication slave, in crash recovery we store the master log
45
 
file name and position here. */
46
 
/* @{ */
47
 
/** Master binlog file name */
48
 
extern char             trx_sys_mysql_master_log_name[];
49
 
/** Master binlog file position.  We have successfully got the updates
50
 
up to this position.  -1 means that no crash recovery was needed, or
51
 
there was no master log position info inside InnoDB.*/
52
 
extern ib_int64_t       trx_sys_mysql_master_log_pos;
53
 
/* @} */
 
45
#include <drizzled/atomics.h>
54
46
 
55
 
/** If this MySQL server uses binary logging, after InnoDB has been inited
56
 
and if it has done a crash recovery, we store the binlog file name and position
57
 
here. */
58
 
/* @{ */
59
 
/** Binlog file name */
60
 
extern char             trx_sys_mysql_bin_log_name[];
61
 
/** Binlog file position, or -1 if unknown */
62
 
extern ib_int64_t       trx_sys_mysql_bin_log_pos;
63
 
/* @} */
 
47
/** the highest commit identifier assigned in the system */
 
48
extern drizzled::atomic<uint64_t> trx_sys_commit_id; 
64
49
 
65
50
/** The transaction system */
66
51
extern trx_sys_t*       trx_sys;
285
270
/*============*/
286
271
        trx_t*  in_trx);/*!< in: trx */
287
272
/*****************************************************************//**
288
 
Updates the offset information about the end of the MySQL binlog entry
289
 
which corresponds to the transaction just being committed. In a MySQL
290
 
replication slave updates the latest master binlog position up to which
291
 
replication has proceeded. */
 
273
Writes to the sys header file the latest commit_id in the system */ 
292
274
UNIV_INTERN
293
275
void
294
 
trx_sys_update_mysql_binlog_offset(
295
 
/*===============================*/
296
 
        const char*     file_name,/*!< in: MySQL log file name */
297
 
        ib_int64_t      offset, /*!< in: position in that log file */
298
 
        ulint           field,  /*!< in: offset of the MySQL log info field in
299
 
                                the trx sys header */
300
 
        mtr_t*          mtr);   /*!< in: mtr */
 
276
trx_sys_flush_commit_id(uint64_t commit_id, ulint field, mtr_t* mtr);
301
277
/*****************************************************************//**
302
 
Prints to stderr the MySQL binlog offset info in the trx system header if
303
 
the magic number shows it valid. */
 
278
Reads the latest commit_id into trx_sys_commit_id */
304
279
UNIV_INTERN
305
280
void
306
 
trx_sys_print_mysql_binlog_offset(void);
307
 
/*===================================*/
 
281
trx_sys_read_commit_id(void);
308
282
/*****************************************************************//**
309
283
Prints to stderr the MySQL master log offset info in the trx system header if
310
284
the magic number shows it valid. */
387
361
        ulint           format_id);     /*!< in: file format identifier */
388
362
#else /* !UNIV_HOTBACKUP */
389
363
/*****************************************************************//**
390
 
Prints to stderr the MySQL binlog info in the system header if the
391
 
magic number shows it valid. */
392
 
UNIV_INTERN
393
 
void
394
 
trx_sys_print_mysql_binlog_offset_from_page(
395
 
/*========================================*/
396
 
        const byte*     page);  /*!< in: buffer containing the trx
397
 
                                system header page, i.e., page number
398
 
                                TRX_SYS_PAGE_NO in the tablespace */
399
 
/*****************************************************************//**
400
364
Reads the file format id from the first system table space file.
401
365
Even if the call succeeds and returns TRUE, the returned format id
402
366
may be ULINT_UNDEFINED signalling that the format id was not present
499
463
#define TRX_SYS_MYSQL_MASTER_LOG_INFO   (UNIV_PAGE_SIZE - 2000)
500
464
 
501
465
/** The offset of the MySQL binlog offset info in the trx system header */
502
 
#define TRX_SYS_MYSQL_LOG_INFO          (UNIV_PAGE_SIZE - 1000)
503
 
#define TRX_SYS_MYSQL_LOG_MAGIC_N_FLD   0       /*!< magic number which is
504
 
                                                TRX_SYS_MYSQL_LOG_MAGIC_N
505
 
                                                if we have valid data in the
506
 
                                                MySQL binlog info */
507
 
#define TRX_SYS_MYSQL_LOG_OFFSET_HIGH   4       /*!< high 4 bytes of the offset
508
 
                                                within that file */
509
 
#define TRX_SYS_MYSQL_LOG_OFFSET_LOW    8       /*!< low 4 bytes of the offset
510
 
                                                within that file */
511
 
#define TRX_SYS_MYSQL_LOG_NAME          12      /*!< MySQL log file name */
 
466
#define TRX_SYS_DRIZZLE_LOG_INFO        (UNIV_PAGE_SIZE - 1000)
 
467
#define TRX_SYS_DRIZZLE_MAX_COMMIT_ID   8       /*!< the maximum commit id
 
468
                                                assigned in the system */
 
469
#define TRX_SYS_DRIZZLE_LOG_NAME        12      /*!< Unused */
512
470
 
513
471
/** Doublewrite buffer */
514
472
/* @{ */
606
564
        trx_id_t        max_trx_id;     /*!< The smallest number not yet
607
565
                                        assigned as a transaction id or
608
566
                                        transaction number */
 
567
 
609
568
        UT_LIST_BASE_NODE_T(trx_t) trx_list;
610
569
                                        /*!< List of active and committed in
611
570
                                        memory transactions, sorted on trx id,