mySQL 5.0.11 sources for tomato
[tomato.git] / release / src / router / mysql / storage / innodb_plugin / include / trx0sys.h
blob4d2801c4d9212e9365f190117c9ea1938ff8e0e9
1 /*****************************************************************************
3 Copyright (c) 1996, 2011, Oracle and/or its affiliates. All Rights Reserved.
5 This program is free software; you can redistribute it and/or modify it under
6 the terms of the GNU General Public License as published by the Free Software
7 Foundation; version 2 of the License.
9 This program is distributed in the hope that it will be useful, but WITHOUT
10 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
11 FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
13 You should have received a copy of the GNU General Public License along with
14 this program; if not, write to the Free Software Foundation, Inc.,
15 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
17 *****************************************************************************/
19 /**************************************************//**
20 @file include/trx0sys.h
21 Transaction system
23 Created 3/26/1996 Heikki Tuuri
24 *******************************************************/
26 #ifndef trx0sys_h
27 #define trx0sys_h
29 #include "univ.i"
31 #include "trx0types.h"
32 #include "fsp0types.h"
33 #include "fil0fil.h"
34 #include "buf0buf.h"
35 #ifndef UNIV_HOTBACKUP
36 #include "mtr0mtr.h"
37 #include "ut0byte.h"
38 #include "mem0mem.h"
39 #include "sync0sync.h"
40 #include "ut0lst.h"
41 #include "read0types.h"
42 #include "page0types.h"
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 /* @} */
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 /* @} */
65 /** The transaction system */
66 extern trx_sys_t* trx_sys;
68 /** Doublewrite system */
69 extern trx_doublewrite_t* trx_doublewrite;
70 /** The following is set to TRUE when we are upgrading from pre-4.1
71 format data files to the multiple tablespaces format data files */
72 extern ibool trx_doublewrite_must_reset_space_ids;
73 /** Set to TRUE when the doublewrite buffer is being created */
74 extern ibool trx_doublewrite_buf_is_being_created;
75 /** The following is TRUE when we are using the database in the
76 post-4.1 format, i.e., we have successfully upgraded, or have created
77 a new database installation */
78 extern ibool trx_sys_multiple_tablespace_format;
80 /****************************************************************//**
81 Creates the doublewrite buffer to a new InnoDB installation. The header of the
82 doublewrite buffer is placed on the trx system header page. */
83 UNIV_INTERN
84 void
85 trx_sys_create_doublewrite_buf(void);
86 /*================================*/
87 /****************************************************************//**
88 At a database startup initializes the doublewrite buffer memory structure if
89 we already have a doublewrite buffer created in the data files. If we are
90 upgrading to an InnoDB version which supports multiple tablespaces, then this
91 function performs the necessary update operations. If we are in a crash
92 recovery, this function uses a possible doublewrite buffer to restore
93 half-written pages in the data files. */
94 UNIV_INTERN
95 void
96 trx_sys_doublewrite_init_or_restore_pages(
97 /*======================================*/
98 ibool restore_corrupt_pages); /*!< in: TRUE=restore pages */
99 /****************************************************************//**
100 Marks the trx sys header when we have successfully upgraded to the >= 4.1.x
101 multiple tablespace format. */
102 UNIV_INTERN
103 void
104 trx_sys_mark_upgraded_to_multiple_tablespaces(void);
105 /*===============================================*/
106 /****************************************************************//**
107 Determines if a page number is located inside the doublewrite buffer.
108 @return TRUE if the location is inside the two blocks of the
109 doublewrite buffer */
110 UNIV_INTERN
111 ibool
112 trx_doublewrite_page_inside(
113 /*========================*/
114 ulint page_no); /*!< in: page number */
115 /***************************************************************//**
116 Checks if a page address is the trx sys header page.
117 @return TRUE if trx sys header page */
118 UNIV_INLINE
119 ibool
120 trx_sys_hdr_page(
121 /*=============*/
122 ulint space, /*!< in: space */
123 ulint page_no);/*!< in: page number */
124 /*****************************************************************//**
125 Creates and initializes the central memory structures for the transaction
126 system. This is called when the database is started. */
127 UNIV_INTERN
128 void
129 trx_sys_init_at_db_start(void);
130 /*==========================*/
131 /*****************************************************************//**
132 Creates and initializes the transaction system at the database creation. */
133 UNIV_INTERN
134 void
135 trx_sys_create(void);
136 /*================*/
137 /****************************************************************//**
138 Looks for a free slot for a rollback segment in the trx system file copy.
139 @return slot index or ULINT_UNDEFINED if not found */
140 UNIV_INTERN
141 ulint
142 trx_sysf_rseg_find_free(
143 /*====================*/
144 mtr_t* mtr); /*!< in: mtr */
145 /***************************************************************//**
146 Gets the pointer in the nth slot of the rseg array.
147 @return pointer to rseg object, NULL if slot not in use */
148 UNIV_INLINE
149 trx_rseg_t*
150 trx_sys_get_nth_rseg(
151 /*=================*/
152 trx_sys_t* sys, /*!< in: trx system */
153 ulint n); /*!< in: index of slot */
154 /***************************************************************//**
155 Sets the pointer in the nth slot of the rseg array. */
156 UNIV_INLINE
157 void
158 trx_sys_set_nth_rseg(
159 /*=================*/
160 trx_sys_t* sys, /*!< in: trx system */
161 ulint n, /*!< in: index of slot */
162 trx_rseg_t* rseg); /*!< in: pointer to rseg object, NULL if slot
163 not in use */
164 /**********************************************************************//**
165 Gets a pointer to the transaction system file copy and x-locks its page.
166 @return pointer to system file copy, page x-locked */
167 UNIV_INLINE
168 trx_sysf_t*
169 trx_sysf_get(
170 /*=========*/
171 mtr_t* mtr); /*!< in: mtr */
172 /*****************************************************************//**
173 Gets the space of the nth rollback segment slot in the trx system
174 file copy.
175 @return space id */
176 UNIV_INLINE
177 ulint
178 trx_sysf_rseg_get_space(
179 /*====================*/
180 trx_sysf_t* sys_header, /*!< in: trx sys file copy */
181 ulint i, /*!< in: slot index == rseg id */
182 mtr_t* mtr); /*!< in: mtr */
183 /*****************************************************************//**
184 Gets the page number of the nth rollback segment slot in the trx system
185 file copy.
186 @return page number, FIL_NULL if slot unused */
187 UNIV_INLINE
188 ulint
189 trx_sysf_rseg_get_page_no(
190 /*======================*/
191 trx_sysf_t* sys_header, /*!< in: trx sys file copy */
192 ulint i, /*!< in: slot index == rseg id */
193 mtr_t* mtr); /*!< in: mtr */
194 /*****************************************************************//**
195 Sets the space id of the nth rollback segment slot in the trx system
196 file copy. */
197 UNIV_INLINE
198 void
199 trx_sysf_rseg_set_space(
200 /*====================*/
201 trx_sysf_t* sys_header, /*!< in: trx sys file copy */
202 ulint i, /*!< in: slot index == rseg id */
203 ulint space, /*!< in: space id */
204 mtr_t* mtr); /*!< in: mtr */
205 /*****************************************************************//**
206 Sets the page number of the nth rollback segment slot in the trx system
207 file copy. */
208 UNIV_INLINE
209 void
210 trx_sysf_rseg_set_page_no(
211 /*======================*/
212 trx_sysf_t* sys_header, /*!< in: trx sys file copy */
213 ulint i, /*!< in: slot index == rseg id */
214 ulint page_no, /*!< in: page number, FIL_NULL if
215 the slot is reset to unused */
216 mtr_t* mtr); /*!< in: mtr */
217 /*****************************************************************//**
218 Allocates a new transaction id.
219 @return new, allocated trx id */
220 UNIV_INLINE
221 trx_id_t
222 trx_sys_get_new_trx_id(void);
223 /*========================*/
224 /*****************************************************************//**
225 Allocates a new transaction number.
226 @return new, allocated trx number */
227 UNIV_INLINE
228 trx_id_t
229 trx_sys_get_new_trx_no(void);
230 /*========================*/
231 #endif /* !UNIV_HOTBACKUP */
233 #ifdef UNIV_DEBUG
234 /* Flag to control TRX_RSEG_N_SLOTS behavior debugging. */
235 extern uint trx_rseg_n_slots_debug;
236 #endif
238 /*****************************************************************//**
239 Writes a trx id to an index page. In case that the id size changes in
240 some future version, this function should be used instead of
241 mach_write_... */
242 UNIV_INLINE
243 void
244 trx_write_trx_id(
245 /*=============*/
246 byte* ptr, /*!< in: pointer to memory where written */
247 trx_id_t id); /*!< in: id */
248 #ifndef UNIV_HOTBACKUP
249 /*****************************************************************//**
250 Reads a trx id from an index page. In case that the id size changes in
251 some future version, this function should be used instead of
252 mach_read_...
253 @return id */
254 UNIV_INLINE
255 trx_id_t
256 trx_read_trx_id(
257 /*============*/
258 const byte* ptr); /*!< in: pointer to memory from where to read */
259 /****************************************************************//**
260 Looks for the trx handle with the given id in trx_list.
261 @return the trx handle or NULL if not found */
262 UNIV_INLINE
263 trx_t*
264 trx_get_on_id(
265 /*==========*/
266 trx_id_t trx_id);/*!< in: trx id to search for */
267 /****************************************************************//**
268 Returns the minumum trx id in trx list. This is the smallest id for which
269 the trx can possibly be active. (But, you must look at the trx->conc_state to
270 find out if the minimum trx id transaction itself is active, or already
271 committed.)
272 @return the minimum trx id, or trx_sys->max_trx_id if the trx list is empty */
273 UNIV_INLINE
274 trx_id_t
275 trx_list_get_min_trx_id(void);
276 /*=========================*/
277 /****************************************************************//**
278 Checks if a transaction with the given id is active.
279 @return TRUE if active */
280 UNIV_INLINE
281 ibool
282 trx_is_active(
283 /*==========*/
284 trx_id_t trx_id);/*!< in: trx id of the transaction */
285 /****************************************************************//**
286 Checks that trx is in the trx list.
287 @return TRUE if is in */
288 UNIV_INTERN
289 ibool
290 trx_in_trx_list(
291 /*============*/
292 trx_t* in_trx);/*!< in: trx */
293 #if defined UNIV_DEBUG || defined UNIV_BLOB_LIGHT_DEBUG
294 /***********************************************************//**
295 Assert that a transaction has been recovered.
296 @return TRUE */
297 UNIV_INLINE
298 ibool
299 trx_assert_recovered(
300 /*=================*/
301 trx_id_t trx_id) /*!< in: transaction identifier */
302 __attribute__((warn_unused_result));
303 #endif /* UNIV_DEBUG || UNIV_BLOB_LIGHT_DEBUG */
304 /*****************************************************************//**
305 Updates the offset information about the end of the MySQL binlog entry
306 which corresponds to the transaction just being committed. In a MySQL
307 replication slave updates the latest master binlog position up to which
308 replication has proceeded. */
309 UNIV_INTERN
310 void
311 trx_sys_update_mysql_binlog_offset(
312 /*===============================*/
313 const char* file_name,/*!< in: MySQL log file name */
314 ib_int64_t offset, /*!< in: position in that log file */
315 ulint field, /*!< in: offset of the MySQL log info field in
316 the trx sys header */
317 mtr_t* mtr); /*!< in: mtr */
318 /*****************************************************************//**
319 Prints to stderr the MySQL binlog offset info in the trx system header if
320 the magic number shows it valid. */
321 UNIV_INTERN
322 void
323 trx_sys_print_mysql_binlog_offset(void);
324 /*===================================*/
325 /*****************************************************************//**
326 Prints to stderr the MySQL master log offset info in the trx system header if
327 the magic number shows it valid. */
328 UNIV_INTERN
329 void
330 trx_sys_print_mysql_master_log_pos(void);
331 /*====================================*/
332 /*****************************************************************//**
333 Initializes the tablespace tag system. */
334 UNIV_INTERN
335 void
336 trx_sys_file_format_init(void);
337 /*==========================*/
338 /*****************************************************************//**
339 Closes the tablespace tag system. */
340 UNIV_INTERN
341 void
342 trx_sys_file_format_close(void);
343 /*===========================*/
344 /********************************************************************//**
345 Tags the system table space with minimum format id if it has not been
346 tagged yet.
347 WARNING: This function is only called during the startup and AFTER the
348 redo log application during recovery has finished. */
349 UNIV_INTERN
350 void
351 trx_sys_file_format_tag_init(void);
352 /*==============================*/
353 #ifndef UNIV_HOTBACKUP
354 /*****************************************************************//**
355 Shutdown/Close the transaction system. */
356 UNIV_INTERN
357 void
358 trx_sys_close(void);
359 /*===============*/
360 #endif /* !UNIV_HOTBACKUP */
361 /*****************************************************************//**
362 Get the name representation of the file format from its id.
363 @return pointer to the name */
364 UNIV_INTERN
365 const char*
366 trx_sys_file_format_id_to_name(
367 /*===========================*/
368 const ulint id); /*!< in: id of the file format */
369 /*****************************************************************//**
370 Set the file format id unconditionally except if it's already the
371 same value.
372 @return TRUE if value updated */
373 UNIV_INTERN
374 ibool
375 trx_sys_file_format_max_set(
376 /*========================*/
377 ulint format_id, /*!< in: file format id */
378 const char** name); /*!< out: max file format name or
379 NULL if not needed. */
380 /*****************************************************************//**
381 Get the name representation of the file format from its id.
382 @return pointer to the max format name */
383 UNIV_INTERN
384 const char*
385 trx_sys_file_format_max_get(void);
386 /*=============================*/
387 /*****************************************************************//**
388 Check for the max file format tag stored on disk.
389 @return DB_SUCCESS or error code */
390 UNIV_INTERN
391 ulint
392 trx_sys_file_format_max_check(
393 /*==========================*/
394 ulint max_format_id); /*!< in: the max format id to check */
395 /********************************************************************//**
396 Update the file format tag in the system tablespace only if the given
397 format id is greater than the known max id.
398 @return TRUE if format_id was bigger than the known max id */
399 UNIV_INTERN
400 ibool
401 trx_sys_file_format_max_upgrade(
402 /*============================*/
403 const char** name, /*!< out: max file format name */
404 ulint format_id); /*!< in: file format identifier */
405 #else /* !UNIV_HOTBACKUP */
406 /*****************************************************************//**
407 Prints to stderr the MySQL binlog info in the system header if the
408 magic number shows it valid. */
409 UNIV_INTERN
410 void
411 trx_sys_print_mysql_binlog_offset_from_page(
412 /*========================================*/
413 const byte* page); /*!< in: buffer containing the trx
414 system header page, i.e., page number
415 TRX_SYS_PAGE_NO in the tablespace */
416 /*****************************************************************//**
417 Reads the file format id from the first system table space file.
418 Even if the call succeeds and returns TRUE, the returned format id
419 may be ULINT_UNDEFINED signalling that the format id was not present
420 in the data file.
421 @return TRUE if call succeeds */
422 UNIV_INTERN
423 ibool
424 trx_sys_read_file_format_id(
425 /*========================*/
426 const char *pathname, /*!< in: pathname of the first system
427 table space file */
428 ulint *format_id); /*!< out: file format of the system table
429 space */
430 /*****************************************************************//**
431 Reads the file format id from the given per-table data file.
432 @return TRUE if call succeeds */
433 UNIV_INTERN
434 ibool
435 trx_sys_read_pertable_file_format_id(
436 /*=================================*/
437 const char *pathname, /*!< in: pathname of a per-table
438 datafile */
439 ulint *format_id); /*!< out: file format of the per-table
440 data file */
441 /*****************************************************************//**
442 Get the name representation of the file format from its id.
443 @return pointer to the name */
444 UNIV_INTERN
445 const char*
446 trx_sys_file_format_id_to_name(
447 /*===========================*/
448 const ulint id); /*!< in: id of the file format */
450 #endif /* !UNIV_HOTBACKUP */
451 /* The automatically created system rollback segment has this id */
452 #define TRX_SYS_SYSTEM_RSEG_ID 0
454 /* Space id and page no where the trx system file copy resides */
455 #define TRX_SYS_SPACE 0 /* the SYSTEM tablespace */
456 #include "fsp0fsp.h"
457 #define TRX_SYS_PAGE_NO FSP_TRX_SYS_PAGE_NO
459 /* The offset of the transaction system header on the page */
460 #define TRX_SYS FSEG_PAGE_DATA
462 /** Transaction system header */
463 /*------------------------------------------------------------- @{ */
464 #define TRX_SYS_TRX_ID_STORE 0 /*!< the maximum trx id or trx
465 number modulo
466 TRX_SYS_TRX_ID_UPDATE_MARGIN
467 written to a file page by any
468 transaction; the assignment of
469 transaction ids continues from
470 this number rounded up by
471 TRX_SYS_TRX_ID_UPDATE_MARGIN
472 plus
473 TRX_SYS_TRX_ID_UPDATE_MARGIN
474 when the database is
475 started */
476 #define TRX_SYS_FSEG_HEADER 8 /*!< segment header for the
477 tablespace segment the trx
478 system is created into */
479 #define TRX_SYS_RSEGS (8 + FSEG_HEADER_SIZE)
480 /*!< the start of the array of
481 rollback segment specification
482 slots */
483 /*------------------------------------------------------------- @} */
485 /** Maximum number of rollback segments: the number of segment
486 specification slots in the transaction system array; rollback segment
487 id must fit in one byte, therefore 256; each slot is currently 8 bytes
488 in size */
489 #define TRX_SYS_N_RSEGS 256
491 /** Maximum length of MySQL binlog file name, in bytes.
492 @see trx_sys_mysql_master_log_name
493 @see trx_sys_mysql_bin_log_name */
494 #define TRX_SYS_MYSQL_LOG_NAME_LEN 512
495 /** Contents of TRX_SYS_MYSQL_LOG_MAGIC_N_FLD */
496 #define TRX_SYS_MYSQL_LOG_MAGIC_N 873422344
498 #if UNIV_PAGE_SIZE < 4096
499 # error "UNIV_PAGE_SIZE < 4096"
500 #endif
501 /** The offset of the MySQL replication info in the trx system header;
502 this contains the same fields as TRX_SYS_MYSQL_LOG_INFO below */
503 #define TRX_SYS_MYSQL_MASTER_LOG_INFO (UNIV_PAGE_SIZE - 2000)
505 /** The offset of the MySQL binlog offset info in the trx system header */
506 #define TRX_SYS_MYSQL_LOG_INFO (UNIV_PAGE_SIZE - 1000)
507 #define TRX_SYS_MYSQL_LOG_MAGIC_N_FLD 0 /*!< magic number which is
508 TRX_SYS_MYSQL_LOG_MAGIC_N
509 if we have valid data in the
510 MySQL binlog info */
511 #define TRX_SYS_MYSQL_LOG_OFFSET_HIGH 4 /*!< high 4 bytes of the offset
512 within that file */
513 #define TRX_SYS_MYSQL_LOG_OFFSET_LOW 8 /*!< low 4 bytes of the offset
514 within that file */
515 #define TRX_SYS_MYSQL_LOG_NAME 12 /*!< MySQL log file name */
517 /** Doublewrite buffer */
518 /* @{ */
519 /** The offset of the doublewrite buffer header on the trx system header page */
520 #define TRX_SYS_DOUBLEWRITE (UNIV_PAGE_SIZE - 200)
521 /*-------------------------------------------------------------*/
522 #define TRX_SYS_DOUBLEWRITE_FSEG 0 /*!< fseg header of the fseg
523 containing the doublewrite
524 buffer */
525 #define TRX_SYS_DOUBLEWRITE_MAGIC FSEG_HEADER_SIZE
526 /*!< 4-byte magic number which
527 shows if we already have
528 created the doublewrite
529 buffer */
530 #define TRX_SYS_DOUBLEWRITE_BLOCK1 (4 + FSEG_HEADER_SIZE)
531 /*!< page number of the
532 first page in the first
533 sequence of 64
534 (= FSP_EXTENT_SIZE) consecutive
535 pages in the doublewrite
536 buffer */
537 #define TRX_SYS_DOUBLEWRITE_BLOCK2 (8 + FSEG_HEADER_SIZE)
538 /*!< page number of the
539 first page in the second
540 sequence of 64 consecutive
541 pages in the doublewrite
542 buffer */
543 #define TRX_SYS_DOUBLEWRITE_REPEAT 12 /*!< we repeat
544 TRX_SYS_DOUBLEWRITE_MAGIC,
545 TRX_SYS_DOUBLEWRITE_BLOCK1,
546 TRX_SYS_DOUBLEWRITE_BLOCK2
547 so that if the trx sys
548 header is half-written
549 to disk, we still may
550 be able to recover the
551 information */
552 /** If this is not yet set to TRX_SYS_DOUBLEWRITE_SPACE_ID_STORED_N,
553 we must reset the doublewrite buffer, because starting from 4.1.x the
554 space id of a data page is stored into
555 FIL_PAGE_ARCH_LOG_NO_OR_SPACE_NO. */
556 #define TRX_SYS_DOUBLEWRITE_SPACE_ID_STORED (24 + FSEG_HEADER_SIZE)
558 /*-------------------------------------------------------------*/
559 /** Contents of TRX_SYS_DOUBLEWRITE_MAGIC */
560 #define TRX_SYS_DOUBLEWRITE_MAGIC_N 536853855
561 /** Contents of TRX_SYS_DOUBLEWRITE_SPACE_ID_STORED */
562 #define TRX_SYS_DOUBLEWRITE_SPACE_ID_STORED_N 1783657386
564 /** Size of the doublewrite block in pages */
565 #define TRX_SYS_DOUBLEWRITE_BLOCK_SIZE FSP_EXTENT_SIZE
566 /* @} */
568 #ifndef UNIV_HOTBACKUP
569 /** File format tag */
570 /* @{ */
571 /** The offset of the file format tag on the trx system header page
572 (TRX_SYS_PAGE_NO of TRX_SYS_SPACE) */
573 #define TRX_SYS_FILE_FORMAT_TAG (UNIV_PAGE_SIZE - 16)
575 /** Contents of TRX_SYS_FILE_FORMAT_TAG when valid. The file format
576 identifier is added to this constant. */
577 #define TRX_SYS_FILE_FORMAT_TAG_MAGIC_N_LOW 3645922177UL
578 /** Contents of TRX_SYS_FILE_FORMAT_TAG+4 when valid */
579 #define TRX_SYS_FILE_FORMAT_TAG_MAGIC_N_HIGH 2745987765UL
580 /* @} */
582 /** Doublewrite control struct */
583 struct trx_doublewrite_struct{
584 mutex_t mutex; /*!< mutex protecting the first_free field and
585 write_buf */
586 ulint block1; /*!< the page number of the first
587 doublewrite block (64 pages) */
588 ulint block2; /*!< page number of the second block */
589 ulint first_free; /*!< first free position in write_buf measured
590 in units of UNIV_PAGE_SIZE */
591 byte* write_buf; /*!< write buffer used in writing to the
592 doublewrite buffer, aligned to an
593 address divisible by UNIV_PAGE_SIZE
594 (which is required by Windows aio) */
595 byte* write_buf_unaligned;
596 /*!< pointer to write_buf, but unaligned */
597 buf_page_t**
598 buf_block_arr; /*!< array to store pointers to the buffer
599 blocks which have been cached to write_buf */
602 /** The transaction system central memory data structure; protected by the
603 kernel mutex */
604 struct trx_sys_struct{
605 trx_id_t max_trx_id; /*!< The smallest number not yet
606 assigned as a transaction id or
607 transaction number */
608 UT_LIST_BASE_NODE_T(trx_t) trx_list;
609 /*!< List of active and committed in
610 memory transactions, sorted on trx id,
611 biggest first */
612 UT_LIST_BASE_NODE_T(trx_t) mysql_trx_list;
613 /*!< List of transactions created
614 for MySQL */
615 UT_LIST_BASE_NODE_T(trx_rseg_t) rseg_list;
616 /*!< List of rollback segment
617 objects */
618 trx_rseg_t* latest_rseg; /*!< Latest rollback segment in the
619 round-robin assignment of rollback
620 segments to transactions */
621 trx_rseg_t* rseg_array[TRX_SYS_N_RSEGS];
622 /*!< Pointer array to rollback
623 segments; NULL if slot not in use */
624 ulint rseg_history_len;/*!< Length of the TRX_RSEG_HISTORY
625 list (update undo logs for committed
626 transactions), protected by
627 rseg->mutex */
628 UT_LIST_BASE_NODE_T(read_view_t) view_list;
629 /*!< List of read views sorted
630 on trx no, biggest first */
633 /** When a trx id which is zero modulo this number (which must be a power of
634 two) is assigned, the field TRX_SYS_TRX_ID_STORE on the transaction system
635 page is updated */
636 #define TRX_SYS_TRX_ID_WRITE_MARGIN 256
637 #endif /* !UNIV_HOTBACKUP */
639 #ifndef UNIV_NONINL
640 #include "trx0sys.ic"
641 #endif
643 #endif