Commit e9a3aa18 authored by marko's avatar marko

branches/zip: Introduce the logical type names trx_id_t, roll_ptr_t,

and undo_no_t. Each type is still defined as dulint.

This is an initial step towards replacing dulint with a 64-bit data type.
Because modern compilers have no trouble supporting 64-bit arithmetics
even on 32-bit targets, the dulint struct is a relic that should go.

The last remaining major use of dulint is dictionary IDs
(table, index, and row ids).

rb://114 approved by Sunny Bains
parent 4718ddd5
...@@ -948,7 +948,7 @@ btr_cur_ins_lock_and_undo( ...@@ -948,7 +948,7 @@ btr_cur_ins_lock_and_undo(
dict_index_t* index; dict_index_t* index;
ulint err; ulint err;
rec_t* rec; rec_t* rec;
dulint roll_ptr; roll_ptr_t roll_ptr;
/* Check if we have to wait for a lock: enqueue an explicit lock /* Check if we have to wait for a lock: enqueue an explicit lock
request if yes */ request if yes */
...@@ -1443,7 +1443,7 @@ btr_cur_upd_lock_and_undo( ...@@ -1443,7 +1443,7 @@ btr_cur_upd_lock_and_undo(
ulint cmpl_info,/* in: compiler info on secondary index ulint cmpl_info,/* in: compiler info on secondary index
updates */ updates */
que_thr_t* thr, /* in: query thread */ que_thr_t* thr, /* in: query thread */
dulint* roll_ptr)/* out: roll pointer */ roll_ptr_t* roll_ptr)/* out: roll pointer */
{ {
dict_index_t* index; dict_index_t* index;
rec_t* rec; rec_t* rec;
...@@ -1504,7 +1504,7 @@ btr_cur_update_in_place_log( ...@@ -1504,7 +1504,7 @@ btr_cur_update_in_place_log(
dict_index_t* index, /* in: index where cursor positioned */ dict_index_t* index, /* in: index where cursor positioned */
const upd_t* update, /* in: update vector */ const upd_t* update, /* in: update vector */
trx_t* trx, /* in: transaction */ trx_t* trx, /* in: transaction */
dulint roll_ptr, /* in: roll ptr */ roll_ptr_t roll_ptr, /* in: roll ptr */
mtr_t* mtr) /* in: mtr */ mtr_t* mtr) /* in: mtr */
{ {
byte* log_ptr; byte* log_ptr;
...@@ -1555,15 +1555,15 @@ btr_cur_parse_update_in_place( ...@@ -1555,15 +1555,15 @@ btr_cur_parse_update_in_place(
page_zip_des_t* page_zip,/* in/out: compressed page, or NULL */ page_zip_des_t* page_zip,/* in/out: compressed page, or NULL */
dict_index_t* index) /* in: index corresponding to page */ dict_index_t* index) /* in: index corresponding to page */
{ {
ulint flags; ulint flags;
rec_t* rec; rec_t* rec;
upd_t* update; upd_t* update;
ulint pos; ulint pos;
dulint trx_id; trx_id_t trx_id;
dulint roll_ptr; roll_ptr_t roll_ptr;
ulint rec_offset; ulint rec_offset;
mem_heap_t* heap; mem_heap_t* heap;
ulint* offsets; ulint* offsets;
if (end_ptr < ptr + 1) { if (end_ptr < ptr + 1) {
...@@ -1703,7 +1703,7 @@ btr_cur_update_in_place( ...@@ -1703,7 +1703,7 @@ btr_cur_update_in_place(
page_zip_des_t* page_zip; page_zip_des_t* page_zip;
ulint err; ulint err;
rec_t* rec; rec_t* rec;
dulint roll_ptr = ut_dulint_zero; roll_ptr_t roll_ptr = ut_dulint_zero;
trx_t* trx; trx_t* trx;
ulint was_delete_marked; ulint was_delete_marked;
mem_heap_t* heap = NULL; mem_heap_t* heap = NULL;
...@@ -1840,7 +1840,7 @@ btr_cur_optimistic_update( ...@@ -1840,7 +1840,7 @@ btr_cur_optimistic_update(
ulint new_rec_size; ulint new_rec_size;
ulint old_rec_size; ulint old_rec_size;
dtuple_t* new_entry; dtuple_t* new_entry;
dulint roll_ptr; roll_ptr_t roll_ptr;
trx_t* trx; trx_t* trx;
mem_heap_t* heap; mem_heap_t* heap;
ulint i; ulint i;
...@@ -2096,7 +2096,7 @@ btr_cur_pessimistic_update( ...@@ -2096,7 +2096,7 @@ btr_cur_pessimistic_update(
dtuple_t* new_entry; dtuple_t* new_entry;
ulint err; ulint err;
ulint optim_err; ulint optim_err;
dulint roll_ptr; roll_ptr_t roll_ptr;
trx_t* trx; trx_t* trx;
ibool was_first; ibool was_first;
ulint n_extents = 0; ulint n_extents = 0;
...@@ -2368,7 +2368,7 @@ btr_cur_del_mark_set_clust_rec_log( ...@@ -2368,7 +2368,7 @@ btr_cur_del_mark_set_clust_rec_log(
dict_index_t* index, /* in: index of the record */ dict_index_t* index, /* in: index of the record */
ibool val, /* in: value to set */ ibool val, /* in: value to set */
trx_t* trx, /* in: deleting transaction */ trx_t* trx, /* in: deleting transaction */
dulint roll_ptr,/* in: roll ptr to the undo log record */ roll_ptr_t roll_ptr,/* in: roll ptr to the undo log record */
mtr_t* mtr) /* in: mtr */ mtr_t* mtr) /* in: mtr */
{ {
byte* log_ptr; byte* log_ptr;
...@@ -2417,13 +2417,13 @@ btr_cur_parse_del_mark_set_clust_rec( ...@@ -2417,13 +2417,13 @@ btr_cur_parse_del_mark_set_clust_rec(
page_zip_des_t* page_zip,/* in/out: compressed page, or NULL */ page_zip_des_t* page_zip,/* in/out: compressed page, or NULL */
dict_index_t* index) /* in: index corresponding to page */ dict_index_t* index) /* in: index corresponding to page */
{ {
ulint flags; ulint flags;
ulint val; ulint val;
ulint pos; ulint pos;
dulint trx_id; trx_id_t trx_id;
dulint roll_ptr; roll_ptr_t roll_ptr;
ulint offset; ulint offset;
rec_t* rec; rec_t* rec;
ut_ad(!page ut_ad(!page
|| !!page_is_comp(page) == dict_table_is_comp(index->table)); || !!page_is_comp(page) == dict_table_is_comp(index->table));
...@@ -2503,7 +2503,7 @@ btr_cur_del_mark_set_clust_rec( ...@@ -2503,7 +2503,7 @@ btr_cur_del_mark_set_clust_rec(
{ {
dict_index_t* index; dict_index_t* index;
buf_block_t* block; buf_block_t* block;
dulint roll_ptr; roll_ptr_t roll_ptr;
ulint err; ulint err;
rec_t* rec; rec_t* rec;
page_zip_des_t* page_zip; page_zip_des_t* page_zip;
......
...@@ -3314,7 +3314,7 @@ loop: ...@@ -3314,7 +3314,7 @@ loop:
keep the latch to the rec page until the keep the latch to the rec page until the
insertion is finished! */ insertion is finished! */
dtuple_t* entry; dtuple_t* entry;
dulint max_trx_id; trx_id_t max_trx_id;
dict_index_t* dummy_index; dict_index_t* dummy_index;
max_trx_id = page_get_max_trx_id(page_align(rec)); max_trx_id = page_get_max_trx_id(page_align(rec));
......
...@@ -402,7 +402,7 @@ struct dict_table_struct{ ...@@ -402,7 +402,7 @@ struct dict_table_struct{
on the table: we cannot drop the table while on the table: we cannot drop the table while
there are foreign key checks running on there are foreign key checks running on
it! */ it! */
dulint query_cache_inv_trx_id; trx_id_t query_cache_inv_trx_id;
/* transactions whose trx id < than this /* transactions whose trx id < than this
number are not allowed to store to the MySQL number are not allowed to store to the MySQL
query cache or retrieve from it; when a trx query cache or retrieve from it; when a trx
......
...@@ -617,7 +617,7 @@ ibool ...@@ -617,7 +617,7 @@ ibool
lock_check_trx_id_sanity( lock_check_trx_id_sanity(
/*=====================*/ /*=====================*/
/* out: TRUE if ok */ /* out: TRUE if ok */
dulint trx_id, /* in: trx id */ trx_id_t trx_id, /* in: trx id */
const rec_t* rec, /* in: user record */ const rec_t* rec, /* in: user record */
dict_index_t* index, /* in: clustered index */ dict_index_t* index, /* in: clustered index */
const ulint* offsets, /* in: rec_get_offsets(rec, index) */ const ulint* offsets, /* in: rec_get_offsets(rec, index) */
......
...@@ -79,7 +79,7 @@ lock_clust_rec_some_has_impl( ...@@ -79,7 +79,7 @@ lock_clust_rec_some_has_impl(
dict_index_t* index, /* in: clustered index */ dict_index_t* index, /* in: clustered index */
const ulint* offsets)/* in: rec_get_offsets(rec, index) */ const ulint* offsets)/* in: rec_get_offsets(rec, index) */
{ {
dulint trx_id; trx_id_t trx_id;
ut_ad(mutex_own(&kernel_mutex)); ut_ad(mutex_own(&kernel_mutex));
ut_ad(dict_index_is_clust(index)); ut_ad(dict_index_is_clust(index));
......
...@@ -177,7 +177,7 @@ page_offset( ...@@ -177,7 +177,7 @@ page_offset(
/***************************************************************** /*****************************************************************
Returns the max trx id field value. */ Returns the max trx id field value. */
UNIV_INLINE UNIV_INLINE
dulint trx_id_t
page_get_max_trx_id( page_get_max_trx_id(
/*================*/ /*================*/
const page_t* page); /* in: page */ const page_t* page); /* in: page */
...@@ -189,7 +189,7 @@ page_set_max_trx_id( ...@@ -189,7 +189,7 @@ page_set_max_trx_id(
/*================*/ /*================*/
buf_block_t* block, /* in/out: page */ buf_block_t* block, /* in/out: page */
page_zip_des_t* page_zip,/* in/out: compressed page, or NULL */ page_zip_des_t* page_zip,/* in/out: compressed page, or NULL */
dulint trx_id);/* in: transaction id */ trx_id_t trx_id);/* in: transaction id */
/***************************************************************** /*****************************************************************
Sets the max trx id field value if trx_id is bigger than the previous Sets the max trx id field value if trx_id is bigger than the previous
value. */ value. */
...@@ -200,7 +200,7 @@ page_update_max_trx_id( ...@@ -200,7 +200,7 @@ page_update_max_trx_id(
buf_block_t* block, /* in/out: page */ buf_block_t* block, /* in/out: page */
page_zip_des_t* page_zip,/* in/out: compressed page whose page_zip_des_t* page_zip,/* in/out: compressed page whose
uncompressed part will be updated, or NULL */ uncompressed part will be updated, or NULL */
dulint trx_id);/* in: transaction id */ trx_id_t trx_id);/* in: transaction id */
/***************************************************************** /*****************************************************************
Reads the given header field. */ Reads the given header field. */
UNIV_INLINE UNIV_INLINE
......
...@@ -59,7 +59,7 @@ page_offset( ...@@ -59,7 +59,7 @@ page_offset(
/***************************************************************** /*****************************************************************
Returns the max trx id field value. */ Returns the max trx id field value. */
UNIV_INLINE UNIV_INLINE
dulint trx_id_t
page_get_max_trx_id( page_get_max_trx_id(
/*================*/ /*================*/
const page_t* page) /* in: page */ const page_t* page) /* in: page */
...@@ -79,7 +79,7 @@ page_update_max_trx_id( ...@@ -79,7 +79,7 @@ page_update_max_trx_id(
buf_block_t* block, /* in/out: page */ buf_block_t* block, /* in/out: page */
page_zip_des_t* page_zip,/* in/out: compressed page whose page_zip_des_t* page_zip,/* in/out: compressed page whose
uncompressed part will be updated, or NULL */ uncompressed part will be updated, or NULL */
dulint trx_id) /* in: transaction id */ trx_id_t trx_id) /* in: transaction id */
{ {
ut_ad(block); ut_ad(block);
......
...@@ -34,6 +34,7 @@ Created June 2005 by Marko Makela ...@@ -34,6 +34,7 @@ Created June 2005 by Marko Makela
#include "page0types.h" #include "page0types.h"
#include "buf0types.h" #include "buf0types.h"
#include "dict0types.h" #include "dict0types.h"
#include "trx0types.h"
#include "mem0mem.h" #include "mem0mem.h"
/************************************************************************** /**************************************************************************
...@@ -286,8 +287,8 @@ page_zip_write_trx_id_and_roll_ptr( ...@@ -286,8 +287,8 @@ page_zip_write_trx_id_and_roll_ptr(
byte* rec, /* in/out: record */ byte* rec, /* in/out: record */
const ulint* offsets,/* in: rec_get_offsets(rec, index) */ const ulint* offsets,/* in: rec_get_offsets(rec, index) */
ulint trx_id_col,/* in: column number of TRX_ID in rec */ ulint trx_id_col,/* in: column number of TRX_ID in rec */
dulint trx_id, /* in: transaction identifier */ trx_id_t trx_id, /* in: transaction identifier */
dulint roll_ptr)/* in: roll_ptr */ roll_ptr_t roll_ptr)/* in: roll_ptr */
__attribute__((nonnull)); __attribute__((nonnull));
/************************************************************************** /**************************************************************************
......
...@@ -41,9 +41,9 @@ read_view_t* ...@@ -41,9 +41,9 @@ read_view_t*
read_view_open_now( read_view_open_now(
/*===============*/ /*===============*/
/* out, own: read view struct */ /* out, own: read view struct */
dulint cr_trx_id, /* in: trx_id of creating trx_id_t cr_trx_id, /* in: trx_id of creating
transaction, or (0, 0) used in transaction, or ut_dulint_zero
purge */ used in purge */
mem_heap_t* heap); /* in: memory heap from which mem_heap_t* heap); /* in: memory heap from which
allocated */ allocated */
/************************************************************************* /*************************************************************************
...@@ -54,9 +54,9 @@ read_view_t* ...@@ -54,9 +54,9 @@ read_view_t*
read_view_oldest_copy_or_open_new( read_view_oldest_copy_or_open_new(
/*==============================*/ /*==============================*/
/* out, own: read view struct */ /* out, own: read view struct */
dulint cr_trx_id, /* in: trx_id of creating trx_id_t cr_trx_id, /* in: trx_id of creating
transaction, or (0, 0) used in transaction, or ut_dulint_zero
purge */ used in purge */
mem_heap_t* heap); /* in: memory heap from which mem_heap_t* heap); /* in: memory heap from which
allocated */ allocated */
/************************************************************************* /*************************************************************************
...@@ -80,16 +80,16 @@ UNIV_INLINE ...@@ -80,16 +80,16 @@ UNIV_INLINE
ibool ibool
read_view_sees_trx_id( read_view_sees_trx_id(
/*==================*/ /*==================*/
/* out: TRUE if sees */ /* out: TRUE if sees */
read_view_t* view, /* in: read view */ const read_view_t* view, /* in: read view */
dulint trx_id);/* in: trx id */ trx_id_t trx_id);/* in: trx id */
/************************************************************************* /*************************************************************************
Prints a read view to stderr. */ Prints a read view to stderr. */
UNIV_INTERN UNIV_INTERN
void void
read_view_print( read_view_print(
/*============*/ /*============*/
read_view_t* view); /* in: read view */ const read_view_t* view); /* in: read view */
/************************************************************************* /*************************************************************************
Create a consistent cursor view for mysql to be used in cursors. In this Create a consistent cursor view for mysql to be used in cursors. In this
consistent read view modifications done by the creating transaction or future consistent read view modifications done by the creating transaction or future
...@@ -123,24 +123,29 @@ read_cursor_set_for_mysql( ...@@ -123,24 +123,29 @@ read_cursor_set_for_mysql(
read should not see the modifications to the database. */ read should not see the modifications to the database. */
struct read_view_struct{ struct read_view_struct{
ulint type; /* VIEW_NORMAL, VIEW_HIGH_GRANULARITY */ ulint type; /* VIEW_NORMAL, VIEW_HIGH_GRANULARITY */
dulint undo_no; /* (0, 0) or if type is VIEW_HIGH_GRANULARITY undo_no_t undo_no;/* ut_dulint_zero or if type is
VIEW_HIGH_GRANULARITY
transaction undo_no when this high-granularity transaction undo_no when this high-granularity
consistent read view was created */ consistent read view was created */
dulint low_limit_no; /* The view does not need to see the undo trx_id_t low_limit_no;
/* The view does not need to see the undo
logs for transactions whose transaction number logs for transactions whose transaction number
is strictly smaller (<) than this value: they is strictly smaller (<) than this value: they
can be removed in purge if not needed by other can be removed in purge if not needed by other
views */ views */
dulint low_limit_id; /* The read should not see any transaction trx_id_t low_limit_id;
/* The read should not see any transaction
with trx id >= this value. In other words, with trx id >= this value. In other words,
this is the "high water mark". */ this is the "high water mark". */
dulint up_limit_id; /* The read should see all trx ids which trx_id_t up_limit_id;
/* The read should see all trx ids which
are strictly smaller (<) than this value. are strictly smaller (<) than this value.
In other words, In other words,
this is the "low water mark". */ this is the "low water mark". */
ulint n_trx_ids; /* Number of cells in the trx_ids array */ ulint n_trx_ids;
dulint* trx_ids; /* Additional trx ids which the read should /* Number of cells in the trx_ids array */
trx_id_t* trx_ids;/* Additional trx ids which the read should
not see: typically, these are the active not see: typically, these are the active
transactions at the time when the read is transactions at the time when the read is
serialized, except the reading transaction serialized, except the reading transaction
...@@ -148,8 +153,9 @@ struct read_view_struct{ ...@@ -148,8 +153,9 @@ struct read_view_struct{
descending order. These trx_ids should be descending order. These trx_ids should be
between the "low" and "high" water marks, between the "low" and "high" water marks,
that is, up_limit_id and low_limit_id. */ that is, up_limit_id and low_limit_id. */
dulint creator_trx_id; /* trx id of creating transaction, or trx_id_t creator_trx_id;
(0, 0) used in purge */ /* trx id of creating transaction, or
ut_dulint_zero used in purge */
UT_LIST_NODE_T(read_view_t) view_list; UT_LIST_NODE_T(read_view_t) view_list;
/* List of read views in trx_sys */ /* List of read views in trx_sys */
}; };
......
...@@ -25,12 +25,12 @@ Created 2/16/1997 Heikki Tuuri ...@@ -25,12 +25,12 @@ Created 2/16/1997 Heikki Tuuri
/************************************************************************* /*************************************************************************
Gets the nth trx id in a read view. */ Gets the nth trx id in a read view. */
UNIV_INLINE UNIV_INLINE
dulint trx_id_t
read_view_get_nth_trx_id( read_view_get_nth_trx_id(
/*=====================*/ /*=====================*/
/* out: trx id */ /* out: trx id */
read_view_t* view, /* in: read view */ const read_view_t* view, /* in: read view */
ulint n) /* in: position */ ulint n) /* in: position */
{ {
ut_ad(n < view->n_trx_ids); ut_ad(n < view->n_trx_ids);
...@@ -45,7 +45,7 @@ read_view_set_nth_trx_id( ...@@ -45,7 +45,7 @@ read_view_set_nth_trx_id(
/*=====================*/ /*=====================*/
read_view_t* view, /* in: read view */ read_view_t* view, /* in: read view */
ulint n, /* in: position */ ulint n, /* in: position */
dulint trx_id) /* in: trx id to set */ trx_id_t trx_id) /* in: trx id to set */
{ {
ut_ad(n < view->n_trx_ids); ut_ad(n < view->n_trx_ids);
...@@ -58,9 +58,9 @@ UNIV_INLINE ...@@ -58,9 +58,9 @@ UNIV_INLINE
ibool ibool
read_view_sees_trx_id( read_view_sees_trx_id(
/*==================*/ /*==================*/
/* out: TRUE if sees */ /* out: TRUE if sees */
read_view_t* view, /* in: read view */ const read_view_t* view, /* in: read view */
dulint trx_id) /* in: trx id */ trx_id_t trx_id) /* in: trx id */
{ {
ulint n_ids; ulint n_ids;
int cmp; int cmp;
......
...@@ -125,7 +125,7 @@ struct ins_node_struct{ ...@@ -125,7 +125,7 @@ struct ins_node_struct{
UT_LIST_BASE_NODE_T(dtuple_t) UT_LIST_BASE_NODE_T(dtuple_t)
entry_list;/* list of entries, one for each index */ entry_list;/* list of entries, one for each index */
byte* row_id_buf;/* buffer for the row id sys field in row */ byte* row_id_buf;/* buffer for the row id sys field in row */
dulint trx_id; /* trx id or the last trx which executed the trx_id_t trx_id; /* trx id or the last trx which executed the
node */ node */
byte* trx_id_buf;/* buffer for the trx id sys field in row */ byte* trx_id_buf;/* buffer for the trx id sys field in row */
mem_heap_t* entry_sys_heap; mem_heap_t* entry_sys_heap;
......
...@@ -59,11 +59,11 @@ struct purge_node_struct{ ...@@ -59,11 +59,11 @@ struct purge_node_struct{
que_common_t common; /* node type: QUE_NODE_PURGE */ que_common_t common; /* node type: QUE_NODE_PURGE */
/*----------------------*/ /*----------------------*/
/* Local storage for this graph node */ /* Local storage for this graph node */
dulint roll_ptr;/* roll pointer to undo log record */ roll_ptr_t roll_ptr;/* roll pointer to undo log record */
trx_undo_rec_t* undo_rec;/* undo log record */ trx_undo_rec_t* undo_rec;/* undo log record */
trx_undo_inf_t* reservation;/* reservation for the undo log record in trx_undo_inf_t* reservation;/* reservation for the undo log record in
the purge array */ the purge array */
dulint undo_no;/* undo number of the record */ undo_no_t undo_no;/* undo number of the record */
ulint rec_type;/* undo log record type: TRX_UNDO_INSERT_REC, ulint rec_type;/* undo log record type: TRX_UNDO_INSERT_REC,
... */ ... */
btr_pcur_t pcur; /* persistent cursor used in searching the btr_pcur_t pcur; /* persistent cursor used in searching the
......
...@@ -50,7 +50,7 @@ row_get_trx_id_offset( ...@@ -50,7 +50,7 @@ row_get_trx_id_offset(
/************************************************************************* /*************************************************************************
Reads the trx id field from a clustered index record. */ Reads the trx id field from a clustered index record. */
UNIV_INLINE UNIV_INLINE
dulint trx_id_t
row_get_rec_trx_id( row_get_rec_trx_id(
/*===============*/ /*===============*/
/* out: value of the field */ /* out: value of the field */
...@@ -60,7 +60,7 @@ row_get_rec_trx_id( ...@@ -60,7 +60,7 @@ row_get_rec_trx_id(
/************************************************************************* /*************************************************************************
Reads the roll pointer field from a clustered index record. */ Reads the roll pointer field from a clustered index record. */
UNIV_INLINE UNIV_INLINE
dulint roll_ptr_t
row_get_rec_roll_ptr( row_get_rec_roll_ptr(
/*=================*/ /*=================*/
/* out: value of the field */ /* out: value of the field */
......
...@@ -29,7 +29,7 @@ Created 4/20/1996 Heikki Tuuri ...@@ -29,7 +29,7 @@ Created 4/20/1996 Heikki Tuuri
/************************************************************************* /*************************************************************************
Reads the trx id field from a clustered index record. */ Reads the trx id field from a clustered index record. */
UNIV_INLINE UNIV_INLINE
dulint trx_id_t
row_get_rec_trx_id( row_get_rec_trx_id(
/*===============*/ /*===============*/
/* out: value of the field */ /* out: value of the field */
...@@ -54,7 +54,7 @@ row_get_rec_trx_id( ...@@ -54,7 +54,7 @@ row_get_rec_trx_id(
/************************************************************************* /*************************************************************************
Reads the roll pointer field from a clustered index record. */ Reads the roll pointer field from a clustered index record. */
UNIV_INLINE UNIV_INLINE
dulint roll_ptr_t
row_get_rec_roll_ptr( row_get_rec_roll_ptr(
/*=================*/ /*=================*/
/* out: value of the field */ /* out: value of the field */
......
...@@ -89,14 +89,14 @@ struct undo_node_struct{ ...@@ -89,14 +89,14 @@ struct undo_node_struct{
que_common_t common; /* node type: QUE_NODE_UNDO */ que_common_t common; /* node type: QUE_NODE_UNDO */
ulint state; /* node execution state */ ulint state; /* node execution state */
trx_t* trx; /* trx for which undo is done */ trx_t* trx; /* trx for which undo is done */
dulint roll_ptr;/* roll pointer to undo log record */ roll_ptr_t roll_ptr;/* roll pointer to undo log record */
trx_undo_rec_t* undo_rec;/* undo log record */ trx_undo_rec_t* undo_rec;/* undo log record */
dulint undo_no;/* undo number of the record */ undo_no_t undo_no;/* undo number of the record */
ulint rec_type;/* undo log record type: TRX_UNDO_INSERT_REC, ulint rec_type;/* undo log record type: TRX_UNDO_INSERT_REC,
... */ ... */
dulint new_roll_ptr; /* roll ptr to restore to clustered index roll_ptr_t new_roll_ptr; /* roll ptr to restore to clustered index
record */ record */
dulint new_trx_id; /* trx id to restore to clustered index trx_id_t new_trx_id; /* trx id to restore to clustered index
record */ record */
btr_pcur_t pcur; /* persistent cursor used in searching the btr_pcur_t pcur; /* persistent cursor used in searching the
clustered index record */ clustered index record */
......
...@@ -101,7 +101,7 @@ row_upd_write_sys_vals_to_log( ...@@ -101,7 +101,7 @@ row_upd_write_sys_vals_to_log(
/* out: new pointer to mlog */ /* out: new pointer to mlog */
dict_index_t* index, /* in: clustered index */ dict_index_t* index, /* in: clustered index */
trx_t* trx, /* in: transaction */ trx_t* trx, /* in: transaction */
dulint roll_ptr,/* in: roll ptr of the undo log record */ roll_ptr_t roll_ptr,/* in: roll ptr of the undo log record */
byte* log_ptr,/* pointer to a buffer of size > 20 opened byte* log_ptr,/* pointer to a buffer of size > 20 opened
in mlog */ in mlog */
mtr_t* mtr); /* in: mtr */ mtr_t* mtr); /* in: mtr */
...@@ -118,7 +118,7 @@ row_upd_rec_sys_fields( ...@@ -118,7 +118,7 @@ row_upd_rec_sys_fields(
dict_index_t* index, /* in: clustered index */ dict_index_t* index, /* in: clustered index */
const ulint* offsets,/* in: rec_get_offsets(rec, index) */ const ulint* offsets,/* in: rec_get_offsets(rec, index) */
trx_t* trx, /* in: transaction */ trx_t* trx, /* in: transaction */
dulint roll_ptr);/* in: roll ptr of the undo log record */ roll_ptr_t roll_ptr);/* in: roll ptr of the undo log record */
/************************************************************************* /*************************************************************************
Sets the trx id or roll ptr field of a clustered index entry. */ Sets the trx id or roll ptr field of a clustered index entry. */
UNIV_INTERN UNIV_INTERN
...@@ -320,12 +320,12 @@ UNIV_INTERN ...@@ -320,12 +320,12 @@ UNIV_INTERN
byte* byte*
row_upd_parse_sys_vals( row_upd_parse_sys_vals(
/*===================*/ /*===================*/
/* out: log data end or NULL */ /* out: log data end or NULL */
byte* ptr, /* in: buffer */ byte* ptr, /* in: buffer */
byte* end_ptr,/* in: buffer end */ byte* end_ptr,/* in: buffer end */
ulint* pos, /* out: TRX_ID position in record */ ulint* pos, /* out: TRX_ID position in record */
dulint* trx_id, /* out: trx id */ trx_id_t* trx_id, /* out: trx id */
dulint* roll_ptr);/* out: roll ptr */ roll_ptr_t* roll_ptr);/* out: roll ptr */
/************************************************************************* /*************************************************************************
Updates the trx id and roll ptr field in a clustered index record in database Updates the trx id and roll ptr field in a clustered index record in database
recovery. */ recovery. */
...@@ -337,8 +337,8 @@ row_upd_rec_sys_fields_in_recovery( ...@@ -337,8 +337,8 @@ row_upd_rec_sys_fields_in_recovery(
page_zip_des_t* page_zip,/* in/out: compressed page, or NULL */ page_zip_des_t* page_zip,/* in/out: compressed page, or NULL */
const ulint* offsets,/* in: array returned by rec_get_offsets() */ const ulint* offsets,/* in: array returned by rec_get_offsets() */
ulint pos, /* in: TRX_ID position in rec */ ulint pos, /* in: TRX_ID position in rec */
dulint trx_id, /* in: transaction id */ trx_id_t trx_id, /* in: transaction id */
dulint roll_ptr);/* in: roll ptr of the undo log record */ roll_ptr_t roll_ptr);/* in: roll ptr of the undo log record */
/************************************************************************* /*************************************************************************
Parses the log data written by row_upd_index_write_log. */ Parses the log data written by row_upd_index_write_log. */
UNIV_INTERN UNIV_INTERN
......
...@@ -152,7 +152,7 @@ row_upd_rec_sys_fields( ...@@ -152,7 +152,7 @@ row_upd_rec_sys_fields(
dict_index_t* index, /* in: clustered index */ dict_index_t* index, /* in: clustered index */
const ulint* offsets,/* in: rec_get_offsets(rec, index) */ const ulint* offsets,/* in: rec_get_offsets(rec, index) */
trx_t* trx, /* in: transaction */ trx_t* trx, /* in: transaction */
dulint roll_ptr)/* in: roll ptr of the undo log record */ roll_ptr_t roll_ptr)/* in: roll ptr of the undo log record */
{ {
ut_ad(dict_index_is_clust(index)); ut_ad(dict_index_is_clust(index));
ut_ad(rec_offs_validate(rec, index, offsets)); ut_ad(rec_offs_validate(rec, index, offsets));
......
...@@ -55,10 +55,12 @@ UNIV_INTERN ...@@ -55,10 +55,12 @@ UNIV_INTERN
ibool ibool
row_vers_must_preserve_del_marked( row_vers_must_preserve_del_marked(
/*==============================*/ /*==============================*/
/* out: TRUE if earlier version should be preserved */ /* out: TRUE if earlier version should
dulint trx_id, /* in: transaction id in the version */ be preserved */
mtr_t* mtr); /* in: mtr holding the latch on the clustered index trx_id_t trx_id, /* in: transaction id in the version */
record; it will also hold the latch on purge_view */ mtr_t* mtr); /* in: mtr holding the latch on the
clustered index record; it will also
hold the latch on purge_view */
/********************************************************************* /*********************************************************************
Finds out if a version of the record, where the version >= the current Finds out if a version of the record, where the version >= the current
purge view, should have ientry as its secondary index entry. We check purge view, should have ientry as its secondary index entry. We check
......
...@@ -58,10 +58,11 @@ UNIV_INTERN ...@@ -58,10 +58,11 @@ UNIV_INTERN
ibool ibool
trx_purge_update_undo_must_exist( trx_purge_update_undo_must_exist(
/*=============================*/ /*=============================*/
/* out: TRUE if is sure that it is preserved, also /* out: TRUE if is sure that it is
if the function returns FALSE, it is possible that preserved, also if the function
the undo log still exists in the system */ returns FALSE, it is possible that the
dulint trx_id);/* in: transaction id */ undo log still exists in the system */
trx_id_t trx_id);/* in: transaction id */
/************************************************************************ /************************************************************************
Creates the global purge system control structure and inits the history Creates the global purge system control structure and inits the history
mutex. */ mutex. */
...@@ -91,7 +92,7 @@ trx_purge_fetch_next_rec( ...@@ -91,7 +92,7 @@ trx_purge_fetch_next_rec(
pointer to the dummy undo log record pointer to the dummy undo log record
&trx_purge_dummy_rec if the whole undo log &trx_purge_dummy_rec if the whole undo log
can skipped in purge; NULL if none left */ can skipped in purge; NULL if none left */
dulint* roll_ptr,/* out: roll pointer to undo record */ roll_ptr_t* roll_ptr,/* out: roll pointer to undo record */
trx_undo_inf_t** cell, /* out: storage cell for the record in the trx_undo_inf_t** cell, /* out: storage cell for the record in the
purge array */ purge array */
mem_heap_t* heap); /* in: memory heap where copied */ mem_heap_t* heap); /* in: memory heap where copied */
...@@ -144,10 +145,10 @@ struct trx_purge_struct{ ...@@ -144,10 +145,10 @@ struct trx_purge_struct{
/* The following two fields form the 'purge pointer' which advances /* The following two fields form the 'purge pointer' which advances
during a purge, and which is used in history list truncation */ during a purge, and which is used in history list truncation */
dulint purge_trx_no; /* Purge has advanced past all trx_id_t purge_trx_no; /* Purge has advanced past all
transactions whose number is less transactions whose number is less
than this */ than this */
dulint purge_undo_no; /* Purge has advanced past all records undo_no_t purge_undo_no; /* Purge has advanced past all records
whose undo number is less than this */ whose undo number is less than this */
/*-----------------------------*/ /*-----------------------------*/
ibool next_stored; /* TRUE if the info of the next record ibool next_stored; /* TRUE if the info of the next record
......
...@@ -51,42 +51,46 @@ UNIV_INLINE ...@@ -51,42 +51,46 @@ UNIV_INLINE
ulint ulint
trx_undo_rec_get_type( trx_undo_rec_get_type(
/*==================*/ /*==================*/
/* out: record type */ /* out: record type */
trx_undo_rec_t* undo_rec); /* in: undo log record */ const trx_undo_rec_t* undo_rec); /* in: undo log record */
/************************************************************************** /**************************************************************************
Reads from an undo log record the record compiler info. */ Reads from an undo log record the record compiler info. */
UNIV_INLINE UNIV_INLINE
ulint ulint
trx_undo_rec_get_cmpl_info( trx_undo_rec_get_cmpl_info(
/*=======================*/ /*=======================*/
/* out: compiler info */ /* out: compiler info */
trx_undo_rec_t* undo_rec); /* in: undo log record */ const trx_undo_rec_t* undo_rec); /* in: undo log record */
/************************************************************************** /**************************************************************************
Returns TRUE if an undo log record contains an extern storage field. */ Returns TRUE if an undo log record contains an extern storage field. */
UNIV_INLINE UNIV_INLINE
ibool ibool
trx_undo_rec_get_extern_storage( trx_undo_rec_get_extern_storage(
/*============================*/ /*============================*/
/* out: TRUE if extern */ /* out: TRUE if extern */
trx_undo_rec_t* undo_rec); /* in: undo log record */ const trx_undo_rec_t* undo_rec); /* in: undo log record */
/************************************************************************** /**************************************************************************
Reads the undo log record number. */ Reads the undo log record number. */
UNIV_INLINE UNIV_INLINE
dulint undo_no_t
trx_undo_rec_get_undo_no( trx_undo_rec_get_undo_no(
/*=====================*/ /*=====================*/
/* out: undo no */ /* out: undo no */
trx_undo_rec_t* undo_rec); /* in: undo log record */ const trx_undo_rec_t* undo_rec); /* in: undo log record */
/************************************************************************** /**************************************************************************
* Returns the start of the undo record data area. */ Returns the start of the undo record data area. */
UNIV_INLINE UNIV_INLINE
byte* ulint
trx_undo_rec_get_ptr( trx_undo_rec_get_offset(
/*==================*/ /*====================*/
/* out: compiler info */ /* out: offset to the data area */
trx_undo_rec_t* undo_rec, /* in: undo log record */ undo_no_t undo_no) /* in: undo no read from node */
dulint undo_no); /* in: undo no read from node */ __attribute__((const));
/**************************************************************************
Returns the start of the undo record data area. */
#define trx_undo_rec_get_ptr(undo_rec, undo_no) \
((undo_rec) + trx_undo_rec_get_offset(undo_no))
/************************************************************************** /**************************************************************************
Reads from an undo log record the general parameters. */ Reads from an undo log record the general parameters. */
...@@ -103,7 +107,7 @@ trx_undo_rec_get_pars( ...@@ -103,7 +107,7 @@ trx_undo_rec_get_pars(
for update type records */ for update type records */
ibool* updated_extern, /* out: TRUE if we updated an ibool* updated_extern, /* out: TRUE if we updated an
externally stored fild */ externally stored fild */
dulint* undo_no, /* out: undo log record number */ undo_no_t* undo_no, /* out: undo log record number */
dulint* table_id); /* out: table id */ dulint* table_id); /* out: table id */
/*********************************************************************** /***********************************************************************
Builds a row reference from an undo log record. */ Builds a row reference from an undo log record. */
...@@ -141,14 +145,15 @@ UNIV_INTERN ...@@ -141,14 +145,15 @@ UNIV_INTERN
byte* byte*
trx_undo_update_rec_get_sys_cols( trx_undo_update_rec_get_sys_cols(
/*=============================*/ /*=============================*/
/* out: remaining part of undo log /* out: remaining part of undo
record after reading these values */ log record after reading these
byte* ptr, /* in: remaining part of undo log values */
record after reading general byte* ptr, /* in: remaining part of undo
parameters */ log record after reading
dulint* trx_id, /* out: trx id */ general parameters */
dulint* roll_ptr, /* out: roll ptr */ trx_id_t* trx_id, /* out: trx id */
ulint* info_bits); /* out: info bits state */ roll_ptr_t* roll_ptr, /* out: roll ptr */
ulint* info_bits); /* out: info bits state */
/*********************************************************************** /***********************************************************************
Builds an update vector based on a remaining part of an undo log record. */ Builds an update vector based on a remaining part of an undo log record. */
UNIV_INTERN UNIV_INTERN
...@@ -170,8 +175,8 @@ trx_undo_update_rec_get_update( ...@@ -170,8 +175,8 @@ trx_undo_update_rec_get_update(
TRX_UNDO_DEL_MARK_REC; in the last case, TRX_UNDO_DEL_MARK_REC; in the last case,
only trx id and roll ptr fields are added to only trx id and roll ptr fields are added to
the update vector */ the update vector */
dulint trx_id, /* in: transaction id from this undorecord */ trx_id_t trx_id, /* in: transaction id from this undorecord */
dulint roll_ptr,/* in: roll pointer from this undo record */ roll_ptr_t roll_ptr,/* in: roll pointer from this undo record */
ulint info_bits,/* in: info bits from this undo record */ ulint info_bits,/* in: info bits from this undo record */
trx_t* trx, /* in: transaction */ trx_t* trx, /* in: transaction */
mem_heap_t* heap, /* in: memory heap from which the memory mem_heap_t* heap, /* in: memory heap from which the memory
...@@ -226,7 +231,7 @@ trx_undo_report_row_operation( ...@@ -226,7 +231,7 @@ trx_undo_report_row_operation(
const rec_t* rec, /* in: case of an update or delete const rec_t* rec, /* in: case of an update or delete
marking, the record in the clustered marking, the record in the clustered
index, otherwise NULL */ index, otherwise NULL */
dulint* roll_ptr); /* out: rollback pointer to the roll_ptr_t* roll_ptr); /* out: rollback pointer to the
inserted undo log record, inserted undo log record,
ut_dulint_zero if BTR_NO_UNDO_LOG ut_dulint_zero if BTR_NO_UNDO_LOG
flag was specified */ flag was specified */
...@@ -238,7 +243,7 @@ trx_undo_rec_t* ...@@ -238,7 +243,7 @@ trx_undo_rec_t*
trx_undo_get_undo_rec_low( trx_undo_get_undo_rec_low(
/*======================*/ /*======================*/
/* out, own: copy of the record */ /* out, own: copy of the record */
dulint roll_ptr, /* in: roll pointer to record */ roll_ptr_t roll_ptr, /* in: roll pointer to record */
mem_heap_t* heap); /* in: memory heap where copied */ mem_heap_t* heap); /* in: memory heap where copied */
/********************************************************************** /**********************************************************************
Copies an undo record to heap. */ Copies an undo record to heap. */
...@@ -252,8 +257,8 @@ trx_undo_get_undo_rec( ...@@ -252,8 +257,8 @@ trx_undo_get_undo_rec(
fetch the old version; NOTE: the fetch the old version; NOTE: the
caller must have latches on the caller must have latches on the
clustered index page and purge_view */ clustered index page and purge_view */
dulint roll_ptr, /* in: roll pointer to record */ roll_ptr_t roll_ptr, /* in: roll pointer to record */
dulint trx_id, /* in: id of the trx that generated trx_id_t trx_id, /* in: id of the trx that generated
the roll pointer: it points to an the roll pointer: it points to an
undo log of this transaction */ undo log of this transaction */
trx_undo_rec_t** undo_rec, /* out, own: copy of the record */ trx_undo_rec_t** undo_rec, /* out, own: copy of the record */
......
...@@ -29,8 +29,8 @@ UNIV_INLINE ...@@ -29,8 +29,8 @@ UNIV_INLINE
ulint ulint
trx_undo_rec_get_type( trx_undo_rec_get_type(
/*==================*/ /*==================*/
/* out: record type */ /* out: record type */
trx_undo_rec_t* undo_rec) /* in: undo log record */ const trx_undo_rec_t* undo_rec) /* in: undo log record */
{ {
return(mach_read_from_1(undo_rec + 2) & (TRX_UNDO_CMPL_INFO_MULT - 1)); return(mach_read_from_1(undo_rec + 2) & (TRX_UNDO_CMPL_INFO_MULT - 1));
} }
...@@ -41,8 +41,8 @@ UNIV_INLINE ...@@ -41,8 +41,8 @@ UNIV_INLINE
ulint ulint
trx_undo_rec_get_cmpl_info( trx_undo_rec_get_cmpl_info(
/*=======================*/ /*=======================*/
/* out: compiler info */ /* out: compiler info */
trx_undo_rec_t* undo_rec) /* in: undo log record */ const trx_undo_rec_t* undo_rec) /* in: undo log record */
{ {
return(mach_read_from_1(undo_rec + 2) / TRX_UNDO_CMPL_INFO_MULT); return(mach_read_from_1(undo_rec + 2) / TRX_UNDO_CMPL_INFO_MULT);
} }
...@@ -53,8 +53,8 @@ UNIV_INLINE ...@@ -53,8 +53,8 @@ UNIV_INLINE
ibool ibool
trx_undo_rec_get_extern_storage( trx_undo_rec_get_extern_storage(
/*============================*/ /*============================*/
/* out: TRUE if extern */ /* out: TRUE if extern */
trx_undo_rec_t* undo_rec) /* in: undo log record */ const trx_undo_rec_t* undo_rec) /* in: undo log record */
{ {
if (mach_read_from_1(undo_rec + 2) & TRX_UNDO_UPD_EXTERN) { if (mach_read_from_1(undo_rec + 2) & TRX_UNDO_UPD_EXTERN) {
...@@ -67,13 +67,13 @@ trx_undo_rec_get_extern_storage( ...@@ -67,13 +67,13 @@ trx_undo_rec_get_extern_storage(
/************************************************************************** /**************************************************************************
Reads the undo log record number. */ Reads the undo log record number. */
UNIV_INLINE UNIV_INLINE
dulint undo_no_t
trx_undo_rec_get_undo_no( trx_undo_rec_get_undo_no(
/*=====================*/ /*=====================*/
/* out: undo no */ /* out: undo no */
trx_undo_rec_t* undo_rec) /* in: undo log record */ const trx_undo_rec_t* undo_rec) /* in: undo log record */
{ {
byte* ptr; const byte* ptr;
ptr = undo_rec + 3; ptr = undo_rec + 3;
...@@ -83,15 +83,13 @@ trx_undo_rec_get_undo_no( ...@@ -83,15 +83,13 @@ trx_undo_rec_get_undo_no(
/************************************************************************** /**************************************************************************
Returns the start of the undo record data area. */ Returns the start of the undo record data area. */
UNIV_INLINE UNIV_INLINE
byte* ulint
trx_undo_rec_get_ptr( trx_undo_rec_get_offset(
/*=================*/ /*====================*/
/* out: compiler info */ /* out: offset to the data area */
trx_undo_rec_t* undo_rec, /* in: undo log record */ undo_no_t undo_no) /* in: undo no read from node */
dulint undo_no) /* in: undo no read from node */
{ {
return (((byte*) undo_rec) + 3 return (3 + mach_dulint_get_much_compressed_size(undo_no));
+ mach_dulint_get_much_compressed_size(undo_no));
} }
/*************************************************************************** /***************************************************************************
...@@ -105,14 +103,9 @@ trx_undo_rec_copy( ...@@ -105,14 +103,9 @@ trx_undo_rec_copy(
mem_heap_t* heap) /* in: heap where copied */ mem_heap_t* heap) /* in: heap where copied */
{ {
ulint len; ulint len;
trx_undo_rec_t* rec_copy;
len = mach_read_from_2(undo_rec) len = mach_read_from_2(undo_rec)
- ut_align_offset(undo_rec, UNIV_PAGE_SIZE); - ut_align_offset(undo_rec, UNIV_PAGE_SIZE);
rec_copy = mem_heap_alloc(heap, len); return(mem_heap_dup(heap, undo_rec, len));
ut_memcpy(rec_copy, undo_rec, len);
return(rec_copy);
} }
#endif /* !UNIV_HOTBACKUP */ #endif /* !UNIV_HOTBACKUP */
...@@ -80,7 +80,7 @@ UNIV_INTERN ...@@ -80,7 +80,7 @@ UNIV_INTERN
void void
trx_roll_try_truncate( trx_roll_try_truncate(
/*==================*/ /*==================*/
trx_t* trx); /* in: transaction */ trx_t* trx); /* in/out: transaction */
/************************************************************************ /************************************************************************
Pops the topmost record when the two undo logs of a transaction are seen Pops the topmost record when the two undo logs of a transaction are seen
as a single stack of records ordered by their undo numbers. Inserts the as a single stack of records ordered by their undo numbers. Inserts the
...@@ -95,8 +95,8 @@ trx_roll_pop_top_rec_of_trx( ...@@ -95,8 +95,8 @@ trx_roll_pop_top_rec_of_trx(
if none left, or if the undo number of the if none left, or if the undo number of the
top record would be less than the limit */ top record would be less than the limit */
trx_t* trx, /* in: transaction */ trx_t* trx, /* in: transaction */
dulint limit, /* in: least undo number we need */ undo_no_t limit, /* in: least undo number we need */
dulint* roll_ptr,/* out: roll pointer to undo record */ roll_ptr_t* roll_ptr,/* out: roll pointer to undo record */
mem_heap_t* heap); /* in: memory heap where copied */ mem_heap_t* heap); /* in: memory heap where copied */
/************************************************************************ /************************************************************************
Reserves an undo log record for a query thread to undo. This should be Reserves an undo log record for a query thread to undo. This should be
...@@ -106,17 +106,17 @@ UNIV_INTERN ...@@ -106,17 +106,17 @@ UNIV_INTERN
ibool ibool
trx_undo_rec_reserve( trx_undo_rec_reserve(
/*=================*/ /*=================*/
/* out: TRUE if succeeded */ /* out: TRUE if succeeded */
trx_t* trx, /* in: transaction */ trx_t* trx, /* in/out: transaction */
dulint undo_no);/* in: undo number of the record */ undo_no_t undo_no);/* in: undo number of the record */
/*********************************************************************** /***********************************************************************
Releases a reserved undo record. */ Releases a reserved undo record. */
UNIV_INTERN UNIV_INTERN
void void
trx_undo_rec_release( trx_undo_rec_release(
/*=================*/ /*=================*/
trx_t* trx, /* in: transaction */ trx_t* trx, /* in/out: transaction */
dulint undo_no);/* in: undo number */ undo_no_t undo_no);/* in: undo number */
/************************************************************************* /*************************************************************************
Starts a rollback operation. */ Starts a rollback operation. */
UNIV_INTERN UNIV_INTERN
...@@ -289,10 +289,10 @@ trx_roll_savepoints_free( ...@@ -289,10 +289,10 @@ trx_roll_savepoints_free(
/* A cell in the array used during a rollback and a purge */ /* A cell in the array used during a rollback and a purge */
struct trx_undo_inf_struct{ struct trx_undo_inf_struct{
dulint trx_no; /* transaction number: not defined during trx_id_t trx_no; /* transaction number: not defined during
a rollback */ a rollback */
dulint undo_no; /* undo number of an undo record */ undo_no_t undo_no;/* undo number of an undo record */
ibool in_use; /* TRUE if the cell is in use */ ibool in_use; /* TRUE if the cell is in use */
}; };
/* During a rollback and a purge, undo numbers of undo records currently being /* During a rollback and a purge, undo numbers of undo records currently being
......
...@@ -174,7 +174,7 @@ struct trx_rseg_struct{ ...@@ -174,7 +174,7 @@ struct trx_rseg_struct{
FIL_NULL if all list purged */ FIL_NULL if all list purged */
ulint last_offset; /* Byte offset of the last not yet ulint last_offset; /* Byte offset of the last not yet
purged log header */ purged log header */
dulint last_trx_no; /* Transaction number of the last not trx_id_t last_trx_no; /* Transaction number of the last not
yet purged log */ yet purged log */
ibool last_del_marks; /* TRUE if the last not yet purged log ibool last_del_marks; /* TRUE if the last not yet purged log
needs purging */ needs purging */
......
...@@ -209,14 +209,14 @@ trx_sysf_rseg_set_page_no( ...@@ -209,14 +209,14 @@ trx_sysf_rseg_set_page_no(
/********************************************************************* /*********************************************************************
Allocates a new transaction id. */ Allocates a new transaction id. */
UNIV_INLINE UNIV_INLINE
dulint trx_id_t
trx_sys_get_new_trx_id(void); trx_sys_get_new_trx_id(void);
/*========================*/ /*========================*/
/* out: new, allocated trx id */ /* out: new, allocated trx id */
/********************************************************************* /*********************************************************************
Allocates a new transaction number. */ Allocates a new transaction number. */
UNIV_INLINE UNIV_INLINE
dulint trx_id_t
trx_sys_get_new_trx_no(void); trx_sys_get_new_trx_no(void);
/*========================*/ /*========================*/
/* out: new, allocated trx number */ /* out: new, allocated trx number */
...@@ -229,15 +229,15 @@ UNIV_INLINE ...@@ -229,15 +229,15 @@ UNIV_INLINE
void void
trx_write_trx_id( trx_write_trx_id(
/*=============*/ /*=============*/
byte* ptr, /* in: pointer to memory where written */ byte* ptr, /* in: pointer to memory where written */
dulint id); /* in: id */ trx_id_t id); /* in: id */
#ifndef UNIV_HOTBACKUP #ifndef UNIV_HOTBACKUP
/********************************************************************* /*********************************************************************
Reads a trx id from an index page. In case that the id size changes in Reads a trx id from an index page. In case that the id size changes in
some future version, this function should be used instead of some future version, this function should be used instead of
mach_read_... */ mach_read_... */
UNIV_INLINE UNIV_INLINE
dulint trx_id_t
trx_read_trx_id( trx_read_trx_id(
/*============*/ /*============*/
/* out: id */ /* out: id */
...@@ -248,15 +248,15 @@ UNIV_INLINE ...@@ -248,15 +248,15 @@ UNIV_INLINE
trx_t* trx_t*
trx_get_on_id( trx_get_on_id(
/*==========*/ /*==========*/
/* out: the trx handle or NULL if not found */ /* out: the trx handle or NULL if not found */
dulint trx_id); /* in: trx id to search for */ trx_id_t trx_id);/* in: trx id to search for */
/******************************************************************** /********************************************************************
Returns the minumum trx id in trx list. This is the smallest id for which Returns the minumum trx id in trx list. This is the smallest id for which
the trx can possibly be active. (But, you must look at the trx->conc_state to the trx can possibly be active. (But, you must look at the trx->conc_state to
find out if the minimum trx id transaction itself is active, or already find out if the minimum trx id transaction itself is active, or already
committed.) */ committed.) */
UNIV_INLINE UNIV_INLINE
dulint trx_id_t
trx_list_get_min_trx_id(void); trx_list_get_min_trx_id(void);
/*=========================*/ /*=========================*/
/* out: the minimum trx id, or trx_sys->max_trx_id /* out: the minimum trx id, or trx_sys->max_trx_id
...@@ -267,8 +267,8 @@ UNIV_INLINE ...@@ -267,8 +267,8 @@ UNIV_INLINE
ibool ibool
trx_is_active( trx_is_active(
/*==========*/ /*==========*/
/* out: TRUE if active */ /* out: TRUE if active */
dulint trx_id);/* in: trx id of the transaction */ trx_id_t trx_id);/* in: trx id of the transaction */
/******************************************************************** /********************************************************************
Checks that trx is in the trx list. */ Checks that trx is in the trx list. */
UNIV_INTERN UNIV_INTERN
...@@ -513,7 +513,7 @@ struct trx_doublewrite_struct{ ...@@ -513,7 +513,7 @@ struct trx_doublewrite_struct{
/* The transaction system central memory data structure; protected by the /* The transaction system central memory data structure; protected by the
kernel mutex */ kernel mutex */
struct trx_sys_struct{ struct trx_sys_struct{
dulint max_trx_id; /* The smallest number not yet trx_id_t max_trx_id; /* The smallest number not yet
assigned as a transaction id or assigned as a transaction id or
transaction number */ transaction number */
UT_LIST_BASE_NODE_T(trx_t) trx_list; UT_LIST_BASE_NODE_T(trx_t) trx_list;
......
...@@ -223,8 +223,8 @@ UNIV_INLINE ...@@ -223,8 +223,8 @@ UNIV_INLINE
void void
trx_write_trx_id( trx_write_trx_id(
/*=============*/ /*=============*/
byte* ptr, /* in: pointer to memory where written */ byte* ptr, /* in: pointer to memory where written */
dulint id) /* in: id */ trx_id_t id) /* in: id */
{ {
#if DATA_TRX_ID_LEN != 6 #if DATA_TRX_ID_LEN != 6
# error "DATA_TRX_ID_LEN != 6" # error "DATA_TRX_ID_LEN != 6"
...@@ -238,7 +238,7 @@ Reads a trx id from an index page. In case that the id size changes in ...@@ -238,7 +238,7 @@ Reads a trx id from an index page. In case that the id size changes in
some future version, this function should be used instead of some future version, this function should be used instead of
mach_read_... */ mach_read_... */
UNIV_INLINE UNIV_INLINE
dulint trx_id_t
trx_read_trx_id( trx_read_trx_id(
/*============*/ /*============*/
/* out: id */ /* out: id */
...@@ -256,8 +256,8 @@ UNIV_INLINE ...@@ -256,8 +256,8 @@ UNIV_INLINE
trx_t* trx_t*
trx_get_on_id( trx_get_on_id(
/*==========*/ /*==========*/
/* out: the trx handle or NULL if not found */ /* out: the trx handle or NULL if not found */
dulint trx_id) /* in: trx id to search for */ trx_id_t trx_id) /* in: trx id to search for */
{ {
trx_t* trx; trx_t* trx;
...@@ -283,7 +283,7 @@ the trx can possibly be active. (But, you must look at the trx->conc_state to ...@@ -283,7 +283,7 @@ the trx can possibly be active. (But, you must look at the trx->conc_state to
find out if the minimum trx id transaction itself is active, or already find out if the minimum trx id transaction itself is active, or already
committed.) */ committed.) */
UNIV_INLINE UNIV_INLINE
dulint trx_id_t
trx_list_get_min_trx_id(void) trx_list_get_min_trx_id(void)
/*=========================*/ /*=========================*/
/* out: the minimum trx id, or trx_sys->max_trx_id /* out: the minimum trx id, or trx_sys->max_trx_id
...@@ -309,8 +309,8 @@ UNIV_INLINE ...@@ -309,8 +309,8 @@ UNIV_INLINE
ibool ibool
trx_is_active( trx_is_active(
/*==========*/ /*==========*/
/* out: TRUE if active */ /* out: TRUE if active */
dulint trx_id) /* in: trx id of the transaction */ trx_id_t trx_id) /* in: trx id of the transaction */
{ {
trx_t* trx; trx_t* trx;
...@@ -344,12 +344,12 @@ trx_is_active( ...@@ -344,12 +344,12 @@ trx_is_active(
/********************************************************************* /*********************************************************************
Allocates a new transaction id. */ Allocates a new transaction id. */
UNIV_INLINE UNIV_INLINE
dulint trx_id_t
trx_sys_get_new_trx_id(void) trx_sys_get_new_trx_id(void)
/*========================*/ /*========================*/
/* out: new, allocated trx id */ /* out: new, allocated trx id */
{ {
dulint id; trx_id_t id;
ut_ad(mutex_own(&kernel_mutex)); ut_ad(mutex_own(&kernel_mutex));
...@@ -376,7 +376,7 @@ trx_sys_get_new_trx_id(void) ...@@ -376,7 +376,7 @@ trx_sys_get_new_trx_id(void)
/********************************************************************* /*********************************************************************
Allocates a new transaction number. */ Allocates a new transaction number. */
UNIV_INLINE UNIV_INLINE
dulint trx_id_t
trx_sys_get_new_trx_no(void) trx_sys_get_new_trx_no(void)
/*========================*/ /*========================*/
/* out: new, allocated trx number */ /* out: new, allocated trx number */
......
...@@ -528,15 +528,15 @@ struct trx_struct{ ...@@ -528,15 +528,15 @@ struct trx_struct{
time_t start_time; /* time the trx object was created time_t start_time; /* time the trx object was created
or the state last time became or the state last time became
TRX_ACTIVE */ TRX_ACTIVE */
dulint id; /* transaction id */ trx_id_t id; /* transaction id */
XID xid; /* X/Open XA transaction XID xid; /* X/Open XA transaction
identification to identify a identification to identify a
transaction branch */ transaction branch */
dulint no; /* transaction serialization number == trx_id_t no; /* transaction serialization number ==
max trx id when the transaction is max trx id when the transaction is
moved to COMMITTED_IN_MEMORY state */ moved to COMMITTED_IN_MEMORY state */
ib_uint64_t commit_lsn; /* lsn at the time of the commit */ ib_uint64_t commit_lsn; /* lsn at the time of the commit */
dulint table_id; /* Table to drop iff dict_operation trx_id_t table_id; /* Table to drop iff dict_operation
is TRUE, or ut_dulint_zero. */ is TRUE, or ut_dulint_zero. */
/*------------------------------*/ /*------------------------------*/
void* mysql_thd; /* MySQL thread handle corresponding void* mysql_thd; /* MySQL thread handle corresponding
...@@ -673,7 +673,7 @@ struct trx_struct{ ...@@ -673,7 +673,7 @@ struct trx_struct{
accessed only when we know that there accessed only when we know that there
cannot be any activity in the undo cannot be any activity in the undo
logs! */ logs! */
dulint undo_no; /* next undo log record number to undo_no_t undo_no; /* next undo log record number to
assign; since the undo log is assign; since the undo log is
private for a transaction, this private for a transaction, this
is a simple ascending sequence is a simple ascending sequence
...@@ -692,7 +692,7 @@ struct trx_struct{ ...@@ -692,7 +692,7 @@ struct trx_struct{
NULL if no inserts performed yet */ NULL if no inserts performed yet */
trx_undo_t* update_undo; /* pointer to the update undo log, or trx_undo_t* update_undo; /* pointer to the update undo log, or
NULL if no update performed yet */ NULL if no update performed yet */
dulint roll_limit; /* least undo number to undo during undo_no_t roll_limit; /* least undo number to undo during
a rollback */ a rollback */
ulint pages_undone; /* number of undo log pages undone ulint pages_undone; /* number of undo log pages undone
since the last undo log truncation */ since the last undo log truncation */
......
...@@ -59,10 +59,14 @@ enum trx_rb_ctx { ...@@ -59,10 +59,14 @@ enum trx_rb_ctx {
in crash recovery */ in crash recovery */
}; };
typedef dulint trx_id_t;
typedef dulint roll_ptr_t;
typedef dulint undo_no_t;
/* Transaction savepoint */ /* Transaction savepoint */
typedef struct trx_savept_struct trx_savept_t; typedef struct trx_savept_struct trx_savept_t;
struct trx_savept_struct{ struct trx_savept_struct{
dulint least_undo_no; /* least undo number to undo */ undo_no_t least_undo_no; /* least undo number to undo */
}; };
/* File objects */ /* File objects */
......
...@@ -34,9 +34,9 @@ Created 3/26/1996 Heikki Tuuri ...@@ -34,9 +34,9 @@ Created 3/26/1996 Heikki Tuuri
#ifndef UNIV_HOTBACKUP #ifndef UNIV_HOTBACKUP
/*************************************************************************** /***************************************************************************
Builds a roll pointer dulint. */ Builds a roll pointer. */
UNIV_INLINE UNIV_INLINE
dulint roll_ptr_t
trx_undo_build_roll_ptr( trx_undo_build_roll_ptr(
/*====================*/ /*====================*/
/* out: roll pointer */ /* out: roll pointer */
...@@ -45,24 +45,25 @@ trx_undo_build_roll_ptr( ...@@ -45,24 +45,25 @@ trx_undo_build_roll_ptr(
ulint page_no, /* in: page number */ ulint page_no, /* in: page number */
ulint offset); /* in: offset of the undo entry within page */ ulint offset); /* in: offset of the undo entry within page */
/*************************************************************************** /***************************************************************************
Decodes a roll pointer dulint. */ Decodes a roll pointer. */
UNIV_INLINE UNIV_INLINE
void void
trx_undo_decode_roll_ptr( trx_undo_decode_roll_ptr(
/*=====================*/ /*=====================*/
dulint roll_ptr, /* in: roll pointer */ roll_ptr_t roll_ptr, /* in: roll pointer */
ibool* is_insert, /* out: TRUE if insert undo log */ ibool* is_insert, /* out: TRUE if insert undo log */
ulint* rseg_id, /* out: rollback segment id */ ulint* rseg_id, /* out: rollback segment id */
ulint* page_no, /* out: page number */ ulint* page_no, /* out: page number */
ulint* offset); /* out: offset of the undo entry within page */ ulint* offset); /* out: offset of the undo
entry within page */
/*************************************************************************** /***************************************************************************
Returns TRUE if the roll pointer is of the insert type. */ Returns TRUE if the roll pointer is of the insert type. */
UNIV_INLINE UNIV_INLINE
ibool ibool
trx_undo_roll_ptr_is_insert( trx_undo_roll_ptr_is_insert(
/*========================*/ /*========================*/
/* out: TRUE if insert undo log */ /* out: TRUE if insert undo log */
dulint roll_ptr); /* in: roll pointer */ roll_ptr_t roll_ptr); /* in: roll pointer */
#endif /* !UNIV_HOTBACKUP */ #endif /* !UNIV_HOTBACKUP */
/********************************************************************* /*********************************************************************
Writes a roll ptr to an index page. In case that the size changes in Writes a roll ptr to an index page. In case that the size changes in
...@@ -72,14 +73,15 @@ UNIV_INLINE ...@@ -72,14 +73,15 @@ UNIV_INLINE
void void
trx_write_roll_ptr( trx_write_roll_ptr(
/*===============*/ /*===============*/
byte* ptr, /* in: pointer to memory where written */ byte* ptr, /* in: pointer to memory where
dulint roll_ptr); /* in: roll ptr */ written */
roll_ptr_t roll_ptr); /* in: roll ptr */
/********************************************************************* /*********************************************************************
Reads a roll ptr from an index page. In case that the roll ptr size Reads a roll ptr from an index page. In case that the roll ptr size
changes in some future version, this function should be used instead of changes in some future version, this function should be used instead of
mach_read_... */ mach_read_... */
UNIV_INLINE UNIV_INLINE
dulint roll_ptr_t
trx_read_roll_ptr( trx_read_roll_ptr(
/*==============*/ /*==============*/
/* out: roll ptr */ /* out: roll ptr */
...@@ -214,7 +216,7 @@ trx_undo_truncate_end( ...@@ -214,7 +216,7 @@ trx_undo_truncate_end(
/*==================*/ /*==================*/
trx_t* trx, /* in: transaction whose undo log it is */ trx_t* trx, /* in: transaction whose undo log it is */
trx_undo_t* undo, /* in: undo log */ trx_undo_t* undo, /* in: undo log */
dulint limit); /* in: all undo records with undo number undo_no_t limit); /* in: all undo records with undo number
>= this value should be truncated */ >= this value should be truncated */
/*************************************************************************** /***************************************************************************
Truncates an undo log from the start. This function is used during a purge Truncates an undo log from the start. This function is used during a purge
...@@ -223,15 +225,17 @@ UNIV_INTERN ...@@ -223,15 +225,17 @@ UNIV_INTERN
void void
trx_undo_truncate_start( trx_undo_truncate_start(
/*====================*/ /*====================*/
trx_rseg_t* rseg, /* in: rollback segment */ trx_rseg_t* rseg, /* in: rollback segment */
ulint space, /* in: space id of the log */ ulint space, /* in: space id of the log */
ulint hdr_page_no, /* in: header page number */ ulint hdr_page_no, /* in: header page number */
ulint hdr_offset, /* in: header offset on the page */ ulint hdr_offset, /* in: header offset on the page */
dulint limit); /* in: all undo pages with undo numbers < undo_no_t limit); /* in: all undo pages with
this value should be truncated; NOTE that undo numbers < this value
the function only frees whole pages; the should be truncated; NOTE that
header page is not freed, but emptied, if the function only frees whole
all the records there are < limit */ pages; the header page is not
freed, but emptied, if all the
records there are < limit */
/************************************************************************ /************************************************************************
Initializes the undo log lists for a rollback segment memory copy. Initializes the undo log lists for a rollback segment memory copy.
This function is only called when the database is started or a new This function is only called when the database is started or a new
...@@ -374,7 +378,7 @@ struct trx_undo_struct{ ...@@ -374,7 +378,7 @@ struct trx_undo_struct{
necessary; also TRUE if the transaction necessary; also TRUE if the transaction
has updated an externally stored has updated an externally stored
field */ field */
dulint trx_id; /* id of the trx assigned to the undo trx_id_t trx_id; /* id of the trx assigned to the undo
log */ log */
XID xid; /* X/Open XA transaction XID xid; /* X/Open XA transaction
identification */ identification */
...@@ -405,7 +409,7 @@ struct trx_undo_struct{ ...@@ -405,7 +409,7 @@ struct trx_undo_struct{
ulint top_offset; /* offset of the latest undo record, ulint top_offset; /* offset of the latest undo record,
i.e., the topmost element in the undo i.e., the topmost element in the undo
log if we think of it as a stack */ log if we think of it as a stack */
dulint top_undo_no; /* undo number of the latest record */ undo_no_t top_undo_no; /* undo number of the latest record */
buf_block_t* guess_block; /* guess for the buffer block where buf_block_t* guess_block; /* guess for the buffer block where
the top page might reside */ the top page might reside */
/*-----------------------------*/ /*-----------------------------*/
......
...@@ -27,9 +27,9 @@ Created 3/26/1996 Heikki Tuuri ...@@ -27,9 +27,9 @@ Created 3/26/1996 Heikki Tuuri
#ifndef UNIV_HOTBACKUP #ifndef UNIV_HOTBACKUP
/*************************************************************************** /***************************************************************************
Builds a roll pointer dulint. */ Builds a roll pointer. */
UNIV_INLINE UNIV_INLINE
dulint roll_ptr_t
trx_undo_build_roll_ptr( trx_undo_build_roll_ptr(
/*====================*/ /*====================*/
/* out: roll pointer */ /* out: roll pointer */
...@@ -51,16 +51,17 @@ trx_undo_build_roll_ptr( ...@@ -51,16 +51,17 @@ trx_undo_build_roll_ptr(
} }
/*************************************************************************** /***************************************************************************
Decodes a roll pointer dulint. */ Decodes a roll pointer. */
UNIV_INLINE UNIV_INLINE
void void
trx_undo_decode_roll_ptr( trx_undo_decode_roll_ptr(
/*=====================*/ /*=====================*/
dulint roll_ptr, /* in: roll pointer */ roll_ptr_t roll_ptr, /* in: roll pointer */
ibool* is_insert, /* out: TRUE if insert undo log */ ibool* is_insert, /* out: TRUE if insert undo log */
ulint* rseg_id, /* out: rollback segment id */ ulint* rseg_id, /* out: rollback segment id */
ulint* page_no, /* out: page number */ ulint* page_no, /* out: page number */
ulint* offset) /* out: offset of the undo entry within page */ ulint* offset) /* out: offset of the undo
entry within page */
{ {
ulint low; ulint low;
ulint high; ulint high;
...@@ -88,8 +89,8 @@ UNIV_INLINE ...@@ -88,8 +89,8 @@ UNIV_INLINE
ibool ibool
trx_undo_roll_ptr_is_insert( trx_undo_roll_ptr_is_insert(
/*========================*/ /*========================*/
/* out: TRUE if insert undo log */ /* out: TRUE if insert undo log */
dulint roll_ptr) /* in: roll pointer */ roll_ptr_t roll_ptr) /* in: roll pointer */
{ {
ulint high; ulint high;
#if DATA_ROLL_PTR_LEN != 7 #if DATA_ROLL_PTR_LEN != 7
...@@ -112,8 +113,9 @@ UNIV_INLINE ...@@ -112,8 +113,9 @@ UNIV_INLINE
void void
trx_write_roll_ptr( trx_write_roll_ptr(
/*===============*/ /*===============*/
byte* ptr, /* in: pointer to memory where written */ byte* ptr, /* in: pointer to memory where
dulint roll_ptr) /* in: roll ptr */ written */
roll_ptr_t roll_ptr) /* in: roll ptr */
{ {
#if DATA_ROLL_PTR_LEN != 7 #if DATA_ROLL_PTR_LEN != 7
# error "DATA_ROLL_PTR_LEN != 7" # error "DATA_ROLL_PTR_LEN != 7"
...@@ -126,7 +128,7 @@ Reads a roll ptr from an index page. In case that the roll ptr size ...@@ -126,7 +128,7 @@ Reads a roll ptr from an index page. In case that the roll ptr size
changes in some future version, this function should be used instead of changes in some future version, this function should be used instead of
mach_read_... */ mach_read_... */
UNIV_INLINE UNIV_INLINE
dulint roll_ptr_t
trx_read_roll_ptr( trx_read_roll_ptr(
/*==============*/ /*==============*/
/* out: roll ptr */ /* out: roll ptr */
......
...@@ -452,7 +452,7 @@ ibool ...@@ -452,7 +452,7 @@ ibool
lock_check_trx_id_sanity( lock_check_trx_id_sanity(
/*=====================*/ /*=====================*/
/* out: TRUE if ok */ /* out: TRUE if ok */
dulint trx_id, /* in: trx id */ trx_id_t trx_id, /* in: trx id */
const rec_t* rec, /* in: user record */ const rec_t* rec, /* in: user record */
dict_index_t* index, /* in: index */ dict_index_t* index, /* in: index */
const ulint* offsets, /* in: rec_get_offsets(rec, index) */ const ulint* offsets, /* in: rec_get_offsets(rec, index) */
...@@ -510,7 +510,7 @@ lock_clust_rec_cons_read_sees( ...@@ -510,7 +510,7 @@ lock_clust_rec_cons_read_sees(
const ulint* offsets,/* in: rec_get_offsets(rec, index) */ const ulint* offsets,/* in: rec_get_offsets(rec, index) */
read_view_t* view) /* in: consistent read view */ read_view_t* view) /* in: consistent read view */
{ {
dulint trx_id; trx_id_t trx_id;
ut_ad(dict_index_is_clust(index)); ut_ad(dict_index_is_clust(index));
ut_ad(page_rec_is_user_rec(rec)); ut_ad(page_rec_is_user_rec(rec));
...@@ -549,7 +549,7 @@ lock_sec_rec_cons_read_sees( ...@@ -549,7 +549,7 @@ lock_sec_rec_cons_read_sees(
by a read cursor */ by a read cursor */
const read_view_t* view) /* in: consistent read view */ const read_view_t* view) /* in: consistent read view */
{ {
dulint max_trx_id; trx_id_t max_trx_id;
ut_ad(page_rec_is_user_rec(rec)); ut_ad(page_rec_is_user_rec(rec));
......
...@@ -209,7 +209,7 @@ page_set_max_trx_id( ...@@ -209,7 +209,7 @@ page_set_max_trx_id(
/*================*/ /*================*/
buf_block_t* block, /* in/out: page */ buf_block_t* block, /* in/out: page */
page_zip_des_t* page_zip,/* in/out: compressed page, or NULL */ page_zip_des_t* page_zip,/* in/out: compressed page, or NULL */
dulint trx_id) /* in: transaction id */ trx_id_t trx_id) /* in: transaction id */
{ {
page_t* page = buf_block_get_frame(block); page_t* page = buf_block_get_frame(block);
#ifndef UNIV_HOTBACKUP #ifndef UNIV_HOTBACKUP
......
...@@ -3795,8 +3795,8 @@ page_zip_write_trx_id_and_roll_ptr( ...@@ -3795,8 +3795,8 @@ page_zip_write_trx_id_and_roll_ptr(
byte* rec, /* in/out: record */ byte* rec, /* in/out: record */
const ulint* offsets,/* in: rec_get_offsets(rec, index) */ const ulint* offsets,/* in: rec_get_offsets(rec, index) */
ulint trx_id_col,/* in: column number of TRX_ID in rec */ ulint trx_id_col,/* in: column number of TRX_ID in rec */
dulint trx_id, /* in: transaction identifier */ trx_id_t trx_id, /* in: transaction identifier */
dulint roll_ptr)/* in: roll_ptr */ roll_ptr_t roll_ptr)/* in: roll_ptr */
{ {
byte* field; byte* field;
byte* storage; byte* storage;
......
...@@ -151,7 +151,7 @@ read_view_create_low( ...@@ -151,7 +151,7 @@ read_view_create_low(
view = mem_heap_alloc(heap, sizeof(read_view_t)); view = mem_heap_alloc(heap, sizeof(read_view_t));
view->n_trx_ids = n; view->n_trx_ids = n;
view->trx_ids = mem_heap_alloc(heap, n * sizeof(dulint)); view->trx_ids = mem_heap_alloc(heap, n * sizeof *view->trx_ids);
return(view); return(view);
} }
...@@ -166,8 +166,9 @@ read_view_t* ...@@ -166,8 +166,9 @@ read_view_t*
read_view_oldest_copy_or_open_new( read_view_oldest_copy_or_open_new(
/*==============================*/ /*==============================*/
/* out, own: read view struct */ /* out, own: read view struct */
dulint cr_trx_id, /* in: trx_id of creating trx_id_t cr_trx_id, /* in: trx_id of creating
transaction, or (0, 0) used in purge*/ transaction, or ut_dulint_zero
used in purge */
mem_heap_t* heap) /* in: memory heap from which mem_heap_t* heap) /* in: memory heap from which
allocated */ allocated */
{ {
...@@ -249,9 +250,9 @@ read_view_t* ...@@ -249,9 +250,9 @@ read_view_t*
read_view_open_now( read_view_open_now(
/*===============*/ /*===============*/
/* out, own: read view struct */ /* out, own: read view struct */
dulint cr_trx_id, /* in: trx_id of creating trx_id_t cr_trx_id, /* in: trx_id of creating
transaction, or (0, 0) used in transaction, or ut_dulint_zero
purge */ used in purge */
mem_heap_t* heap) /* in: memory heap from which mem_heap_t* heap) /* in: memory heap from which
allocated */ allocated */
{ {
...@@ -358,7 +359,7 @@ UNIV_INTERN ...@@ -358,7 +359,7 @@ UNIV_INTERN
void void
read_view_print( read_view_print(
/*============*/ /*============*/
read_view_t* view) /* in: read view */ const read_view_t* view) /* in: read view */
{ {
ulint n_ids; ulint n_ids;
ulint i; ulint i;
......
...@@ -1463,7 +1463,7 @@ row_unlock_for_mysql( ...@@ -1463,7 +1463,7 @@ row_unlock_for_mysql(
const rec_t* rec; const rec_t* rec;
dict_index_t* index; dict_index_t* index;
dulint rec_trx_id; trx_id_t rec_trx_id;
mtr_t mtr; mtr_t mtr;
mtr_start(&mtr); mtr_start(&mtr);
......
...@@ -502,10 +502,10 @@ row_purge_parse_undo_rec( ...@@ -502,10 +502,10 @@ row_purge_parse_undo_rec(
dict_index_t* clust_index; dict_index_t* clust_index;
byte* ptr; byte* ptr;
trx_t* trx; trx_t* trx;
dulint undo_no; undo_no_t undo_no;
dulint table_id; dulint table_id;
dulint trx_id; trx_id_t trx_id;
dulint roll_ptr; roll_ptr_t roll_ptr;
ulint info_bits; ulint info_bits;
ulint type; ulint type;
ulint cmpl_info; ulint cmpl_info;
...@@ -601,10 +601,10 @@ row_purge( ...@@ -601,10 +601,10 @@ row_purge(
purge_node_t* node, /* in: row purge node */ purge_node_t* node, /* in: row purge node */
que_thr_t* thr) /* in: query thread */ que_thr_t* thr) /* in: query thread */
{ {
dulint roll_ptr; roll_ptr_t roll_ptr;
ibool purge_needed; ibool purge_needed;
ibool updated_extern; ibool updated_extern;
trx_t* trx; trx_t* trx;
ut_ad(node && thr); ut_ad(node && thr);
......
...@@ -248,7 +248,7 @@ row_undo_ins_parse_undo_rec( ...@@ -248,7 +248,7 @@ row_undo_ins_parse_undo_rec(
{ {
dict_index_t* clust_index; dict_index_t* clust_index;
byte* ptr; byte* ptr;
dulint undo_no; undo_no_t undo_no;
dulint table_id; dulint table_id;
ulint type; ulint type;
ulint dummy; ulint dummy;
......
...@@ -68,7 +68,7 @@ row_undo_mod_undo_also_prev_vers( ...@@ -68,7 +68,7 @@ row_undo_mod_undo_also_prev_vers(
/* out: TRUE if also previous modify or /* out: TRUE if also previous modify or
insert of this row should be undone */ insert of this row should be undone */
undo_node_t* node, /* in: row undo node */ undo_node_t* node, /* in: row undo node */
dulint* undo_no)/* out: the undo number */ undo_no_t* undo_no)/* out: the undo number */
{ {
trx_undo_rec_t* undo_rec; trx_undo_rec_t* undo_rec;
trx_t* trx; trx_t* trx;
...@@ -223,7 +223,7 @@ row_undo_mod_clust( ...@@ -223,7 +223,7 @@ row_undo_mod_clust(
ulint err; ulint err;
ibool success; ibool success;
ibool more_vers; ibool more_vers;
dulint new_undo_no; undo_no_t new_undo_no;
ut_ad(node && thr); ut_ad(node && thr);
...@@ -718,10 +718,10 @@ row_undo_mod_parse_undo_rec( ...@@ -718,10 +718,10 @@ row_undo_mod_parse_undo_rec(
{ {
dict_index_t* clust_index; dict_index_t* clust_index;
byte* ptr; byte* ptr;
dulint undo_no; undo_no_t undo_no;
dulint table_id; dulint table_id;
dulint trx_id; trx_id_t trx_id;
dulint roll_ptr; roll_ptr_t roll_ptr;
ulint info_bits; ulint info_bits;
ulint type; ulint type;
ulint cmpl_info; ulint cmpl_info;
......
...@@ -236,10 +236,10 @@ row_undo( ...@@ -236,10 +236,10 @@ row_undo(
undo_node_t* node, /* in: row undo node */ undo_node_t* node, /* in: row undo node */
que_thr_t* thr) /* in: query thread */ que_thr_t* thr) /* in: query thread */
{ {
ulint err; ulint err;
trx_t* trx; trx_t* trx;
dulint roll_ptr; roll_ptr_t roll_ptr;
ibool locked_data_dict; ibool locked_data_dict;
ut_ad(node && thr); ut_ad(node && thr);
......
...@@ -328,8 +328,8 @@ row_upd_rec_sys_fields_in_recovery( ...@@ -328,8 +328,8 @@ row_upd_rec_sys_fields_in_recovery(
page_zip_des_t* page_zip,/* in/out: compressed page, or NULL */ page_zip_des_t* page_zip,/* in/out: compressed page, or NULL */
const ulint* offsets,/* in: array returned by rec_get_offsets() */ const ulint* offsets,/* in: array returned by rec_get_offsets() */
ulint pos, /* in: TRX_ID position in rec */ ulint pos, /* in: TRX_ID position in rec */
dulint trx_id, /* in: transaction id */ trx_id_t trx_id, /* in: transaction id */
dulint roll_ptr)/* in: roll ptr of the undo log record */ roll_ptr_t roll_ptr)/* in: roll ptr of the undo log record */
{ {
ut_ad(rec_offs_validate(rec, NULL, offsets)); ut_ad(rec_offs_validate(rec, NULL, offsets));
...@@ -508,7 +508,7 @@ row_upd_write_sys_vals_to_log( ...@@ -508,7 +508,7 @@ row_upd_write_sys_vals_to_log(
/* out: new pointer to mlog */ /* out: new pointer to mlog */
dict_index_t* index, /* in: clustered index */ dict_index_t* index, /* in: clustered index */
trx_t* trx, /* in: transaction */ trx_t* trx, /* in: transaction */
dulint roll_ptr,/* in: roll ptr of the undo log record */ roll_ptr_t roll_ptr,/* in: roll ptr of the undo log record */
byte* log_ptr,/* pointer to a buffer of size > 20 opened byte* log_ptr,/* pointer to a buffer of size > 20 opened
in mlog */ in mlog */
mtr_t* mtr __attribute__((unused))) /* in: mtr */ mtr_t* mtr __attribute__((unused))) /* in: mtr */
...@@ -535,12 +535,12 @@ UNIV_INTERN ...@@ -535,12 +535,12 @@ UNIV_INTERN
byte* byte*
row_upd_parse_sys_vals( row_upd_parse_sys_vals(
/*===================*/ /*===================*/
/* out: log data end or NULL */ /* out: log data end or NULL */
byte* ptr, /* in: buffer */ byte* ptr, /* in: buffer */
byte* end_ptr,/* in: buffer end */ byte* end_ptr,/* in: buffer end */
ulint* pos, /* out: TRX_ID position in record */ ulint* pos, /* out: TRX_ID position in record */
dulint* trx_id, /* out: trx id */ trx_id_t* trx_id, /* out: trx id */
dulint* roll_ptr)/* out: roll ptr */ roll_ptr_t* roll_ptr)/* out: roll ptr */
{ {
ptr = mach_parse_compressed(ptr, end_ptr, pos); ptr = mach_parse_compressed(ptr, end_ptr, pos);
......
...@@ -64,7 +64,7 @@ row_vers_impl_x_locked_off_kernel( ...@@ -64,7 +64,7 @@ row_vers_impl_x_locked_off_kernel(
rec_t* clust_rec; rec_t* clust_rec;
ulint* clust_offsets; ulint* clust_offsets;
rec_t* version; rec_t* version;
dulint trx_id; trx_id_t trx_id;
mem_heap_t* heap; mem_heap_t* heap;
mem_heap_t* heap2; mem_heap_t* heap2;
dtuple_t* row; dtuple_t* row;
...@@ -157,7 +157,7 @@ row_vers_impl_x_locked_off_kernel( ...@@ -157,7 +157,7 @@ row_vers_impl_x_locked_off_kernel(
rec_t* prev_version; rec_t* prev_version;
ulint vers_del; ulint vers_del;
row_ext_t* ext; row_ext_t* ext;
dulint prev_trx_id; trx_id_t prev_trx_id;
mutex_exit(&kernel_mutex); mutex_exit(&kernel_mutex);
...@@ -305,10 +305,12 @@ UNIV_INTERN ...@@ -305,10 +305,12 @@ UNIV_INTERN
ibool ibool
row_vers_must_preserve_del_marked( row_vers_must_preserve_del_marked(
/*==============================*/ /*==============================*/
/* out: TRUE if earlier version should be preserved */ /* out: TRUE if earlier version should
dulint trx_id, /* in: transaction id in the version */ be preserved */
mtr_t* mtr) /* in: mtr holding the latch on the clustered index trx_id_t trx_id, /* in: transaction id in the version */
record; it will also hold the latch on purge_view */ mtr_t* mtr) /* in: mtr holding the latch on the
clustered index record; it will also
hold the latch on purge_view */
{ {
#ifdef UNIV_SYNC_DEBUG #ifdef UNIV_SYNC_DEBUG
ut_ad(!rw_lock_own(&(purge_sys->latch), RW_LOCK_SHARED)); ut_ad(!rw_lock_own(&(purge_sys->latch), RW_LOCK_SHARED));
...@@ -499,7 +501,7 @@ row_vers_build_for_consistent_read( ...@@ -499,7 +501,7 @@ row_vers_build_for_consistent_read(
{ {
const rec_t* version; const rec_t* version;
rec_t* prev_version; rec_t* prev_version;
dulint trx_id; trx_id_t trx_id;
mem_heap_t* heap = NULL; mem_heap_t* heap = NULL;
byte* buf; byte* buf;
ulint err; ulint err;
...@@ -523,8 +525,8 @@ row_vers_build_for_consistent_read( ...@@ -523,8 +525,8 @@ row_vers_build_for_consistent_read(
for (;;) { for (;;) {
mem_heap_t* heap2 = heap; mem_heap_t* heap2 = heap;
trx_undo_rec_t* undo_rec; trx_undo_rec_t* undo_rec;
dulint roll_ptr; roll_ptr_t roll_ptr;
dulint undo_no; undo_no_t undo_no;
heap = mem_heap_create(1024); heap = mem_heap_create(1024);
/* If we have high-granularity consistent read view and /* If we have high-granularity consistent read view and
...@@ -632,7 +634,7 @@ row_vers_build_for_semi_consistent_read( ...@@ -632,7 +634,7 @@ row_vers_build_for_semi_consistent_read(
mem_heap_t* heap = NULL; mem_heap_t* heap = NULL;
byte* buf; byte* buf;
ulint err; ulint err;
dulint rec_trx_id = ut_dulint_zero; trx_id_t rec_trx_id = ut_dulint_zero;
ut_ad(dict_index_is_clust(index)); ut_ad(dict_index_is_clust(index));
ut_ad(mtr_memo_contains_page(mtr, rec, MTR_MEMO_PAGE_X_FIX) ut_ad(mtr_memo_contains_page(mtr, rec, MTR_MEMO_PAGE_X_FIX)
...@@ -655,7 +657,7 @@ row_vers_build_for_semi_consistent_read( ...@@ -655,7 +657,7 @@ row_vers_build_for_semi_consistent_read(
trx_t* version_trx; trx_t* version_trx;
mem_heap_t* heap2; mem_heap_t* heap2;
rec_t* prev_version; rec_t* prev_version;
dulint version_trx_id; trx_id_t version_trx_id;
version_trx_id = row_get_rec_trx_id(version, index, *offsets); version_trx_id = row_get_rec_trx_id(version, index, *offsets);
if (rec == version) { if (rec == version) {
......
...@@ -56,10 +56,11 @@ UNIV_INTERN ...@@ -56,10 +56,11 @@ UNIV_INTERN
ibool ibool
trx_purge_update_undo_must_exist( trx_purge_update_undo_must_exist(
/*=============================*/ /*=============================*/
/* out: TRUE if is sure that it is preserved, also /* out: TRUE if is sure that it is
if the function returns FALSE, it is possible that preserved, also if the function
the undo log still exists in the system */ returns FALSE, it is possible that the
dulint trx_id) /* in: transaction id */ undo log still exists in the system */
trx_id_t trx_id) /* in: transaction id */
{ {
#ifdef UNIV_SYNC_DEBUG #ifdef UNIV_SYNC_DEBUG
ut_ad(rw_lock_own(&(purge_sys->latch), RW_LOCK_SHARED)); ut_ad(rw_lock_own(&(purge_sys->latch), RW_LOCK_SHARED));
...@@ -81,9 +82,9 @@ static ...@@ -81,9 +82,9 @@ static
trx_undo_inf_t* trx_undo_inf_t*
trx_purge_arr_store_info( trx_purge_arr_store_info(
/*=====================*/ /*=====================*/
/* out: pointer to the storage cell */ /* out: pointer to the storage cell */
dulint trx_no, /* in: transaction number */ trx_id_t trx_no, /* in: transaction number */
dulint undo_no)/* in: undo number */ undo_no_t undo_no)/* in: undo number */
{ {
trx_undo_inf_t* cell; trx_undo_inf_t* cell;
trx_undo_arr_t* arr; trx_undo_arr_t* arr;
...@@ -133,13 +134,13 @@ void ...@@ -133,13 +134,13 @@ void
trx_purge_arr_get_biggest( trx_purge_arr_get_biggest(
/*======================*/ /*======================*/
trx_undo_arr_t* arr, /* in: purge array */ trx_undo_arr_t* arr, /* in: purge array */
dulint* trx_no, /* out: transaction number: ut_dulint_zero trx_id_t* trx_no, /* out: transaction number: ut_dulint_zero
if array is empty */ if array is empty */
dulint* undo_no)/* out: undo number */ undo_no_t* undo_no)/* out: undo number */
{ {
trx_undo_inf_t* cell; trx_undo_inf_t* cell;
dulint pair_trx_no; trx_id_t pair_trx_no;
dulint pair_undo_no; undo_no_t pair_undo_no;
int trx_cmp; int trx_cmp;
ulint n_used; ulint n_used;
ulint i; ulint i;
...@@ -443,9 +444,9 @@ void ...@@ -443,9 +444,9 @@ void
trx_purge_truncate_rseg_history( trx_purge_truncate_rseg_history(
/*============================*/ /*============================*/
trx_rseg_t* rseg, /* in: rollback segment */ trx_rseg_t* rseg, /* in: rollback segment */
dulint limit_trx_no, /* in: remove update undo logs whose trx_id_t limit_trx_no, /* in: remove update undo logs whose
trx number is < limit_trx_no */ trx number is < limit_trx_no */
dulint limit_undo_no) /* in: if transaction number is equal undo_no_t limit_undo_no) /* in: if transaction number is equal
to limit_trx_no, truncate undo records to limit_trx_no, truncate undo records
with undo number < limit_undo_no */ with undo number < limit_undo_no */
{ {
...@@ -549,8 +550,8 @@ trx_purge_truncate_history(void) ...@@ -549,8 +550,8 @@ trx_purge_truncate_history(void)
/*============================*/ /*============================*/
{ {
trx_rseg_t* rseg; trx_rseg_t* rseg;
dulint limit_trx_no; trx_id_t limit_trx_no;
dulint limit_undo_no; undo_no_t limit_undo_no;
ut_ad(mutex_own(&(purge_sys->mutex))); ut_ad(mutex_own(&(purge_sys->mutex)));
...@@ -617,7 +618,7 @@ trx_purge_rseg_get_next_history_log( ...@@ -617,7 +618,7 @@ trx_purge_rseg_get_next_history_log(
trx_ulogf_t* log_hdr; trx_ulogf_t* log_hdr;
trx_usegf_t* seg_hdr; trx_usegf_t* seg_hdr;
fil_addr_t prev_log_addr; fil_addr_t prev_log_addr;
dulint trx_no; trx_id_t trx_no;
ibool del_marks; ibool del_marks;
mtr_t mtr; mtr_t mtr;
...@@ -718,7 +719,7 @@ trx_purge_choose_next_log(void) ...@@ -718,7 +719,7 @@ trx_purge_choose_next_log(void)
trx_undo_rec_t* rec; trx_undo_rec_t* rec;
trx_rseg_t* rseg; trx_rseg_t* rseg;
trx_rseg_t* min_rseg; trx_rseg_t* min_rseg;
dulint min_trx_no; trx_id_t min_trx_no;
ulint space = 0; /* remove warning (??? bug ???) */ ulint space = 0; /* remove warning (??? bug ???) */
ulint zip_size = 0; ulint zip_size = 0;
ulint page_no = 0; /* remove warning (??? bug ???) */ ulint page_no = 0; /* remove warning (??? bug ???) */
...@@ -938,7 +939,7 @@ trx_purge_fetch_next_rec( ...@@ -938,7 +939,7 @@ trx_purge_fetch_next_rec(
pointer to the dummy undo log record pointer to the dummy undo log record
&trx_purge_dummy_rec, if the whole undo log &trx_purge_dummy_rec, if the whole undo log
can skipped in purge; NULL if none left */ can skipped in purge; NULL if none left */
dulint* roll_ptr,/* out: roll pointer to undo record */ roll_ptr_t* roll_ptr,/* out: roll pointer to undo record */
trx_undo_inf_t** cell, /* out: storage cell for the record in the trx_undo_inf_t** cell, /* out: storage cell for the record in the
purge array */ purge array */
mem_heap_t* heap) /* in: memory heap where copied */ mem_heap_t* heap) /* in: memory heap where copied */
......
...@@ -290,7 +290,7 @@ trx_undo_rec_get_pars( ...@@ -290,7 +290,7 @@ trx_undo_rec_get_pars(
for update type records */ for update type records */
ibool* updated_extern, /* out: TRUE if we updated an ibool* updated_extern, /* out: TRUE if we updated an
externally stored fild */ externally stored fild */
dulint* undo_no, /* out: undo log record number */ undo_no_t* undo_no, /* out: undo log record number */
dulint* table_id) /* out: table id */ dulint* table_id) /* out: table id */
{ {
byte* ptr; byte* ptr;
...@@ -552,7 +552,7 @@ trx_undo_page_report_modify( ...@@ -552,7 +552,7 @@ trx_undo_page_report_modify(
ulint type_cmpl; ulint type_cmpl;
byte* type_cmpl_ptr; byte* type_cmpl_ptr;
ulint i; ulint i;
dulint trx_id; trx_id_t trx_id;
ibool ignore_prefix = FALSE; ibool ignore_prefix = FALSE;
byte ext_buf[REC_MAX_INDEX_COL_LEN byte ext_buf[REC_MAX_INDEX_COL_LEN
+ BTR_EXTERN_FIELD_REF_SIZE]; + BTR_EXTERN_FIELD_REF_SIZE];
...@@ -835,14 +835,14 @@ UNIV_INTERN ...@@ -835,14 +835,14 @@ UNIV_INTERN
byte* byte*
trx_undo_update_rec_get_sys_cols( trx_undo_update_rec_get_sys_cols(
/*=============================*/ /*=============================*/
/* out: remaining part of undo log /* out: remaining part of undo log
record after reading these values */ record after reading these values */
byte* ptr, /* in: remaining part of undo log byte* ptr, /* in: remaining part of undo
record after reading general log record after reading
parameters */ general parameters */
dulint* trx_id, /* out: trx id */ trx_id_t* trx_id, /* out: trx id */
dulint* roll_ptr, /* out: roll ptr */ roll_ptr_t* roll_ptr, /* out: roll ptr */
ulint* info_bits) /* out: info bits state */ ulint* info_bits) /* out: info bits state */
{ {
/* Read the state of the info bits */ /* Read the state of the info bits */
*info_bits = mach_read_from_1(ptr); *info_bits = mach_read_from_1(ptr);
...@@ -914,8 +914,8 @@ trx_undo_update_rec_get_update( ...@@ -914,8 +914,8 @@ trx_undo_update_rec_get_update(
TRX_UNDO_DEL_MARK_REC; in the last case, TRX_UNDO_DEL_MARK_REC; in the last case,
only trx id and roll ptr fields are added to only trx id and roll ptr fields are added to
the update vector */ the update vector */
dulint trx_id, /* in: transaction id from this undo record */ trx_id_t trx_id, /* in: transaction id from this undo record */
dulint roll_ptr,/* in: roll pointer from this undo record */ roll_ptr_t roll_ptr,/* in: roll pointer from this undo record */
ulint info_bits,/* in: info bits from this undo record */ ulint info_bits,/* in: info bits from this undo record */
trx_t* trx, /* in: transaction */ trx_t* trx, /* in: transaction */
mem_heap_t* heap, /* in: memory heap from which the memory mem_heap_t* heap, /* in: memory heap from which the memory
...@@ -1167,7 +1167,7 @@ trx_undo_report_row_operation( ...@@ -1167,7 +1167,7 @@ trx_undo_report_row_operation(
const rec_t* rec, /* in: in case of an update or delete const rec_t* rec, /* in: in case of an update or delete
marking, the record in the clustered marking, the record in the clustered
index, otherwise NULL */ index, otherwise NULL */
dulint* roll_ptr) /* out: rollback pointer to the roll_ptr_t* roll_ptr) /* out: rollback pointer to the
inserted undo log record, inserted undo log record,
ut_dulint_zero if BTR_NO_UNDO_LOG ut_dulint_zero if BTR_NO_UNDO_LOG
flag was specified */ flag was specified */
...@@ -1337,7 +1337,7 @@ trx_undo_rec_t* ...@@ -1337,7 +1337,7 @@ trx_undo_rec_t*
trx_undo_get_undo_rec_low( trx_undo_get_undo_rec_low(
/*======================*/ /*======================*/
/* out, own: copy of the record */ /* out, own: copy of the record */
dulint roll_ptr, /* in: roll pointer to record */ roll_ptr_t roll_ptr, /* in: roll pointer to record */
mem_heap_t* heap) /* in: memory heap where copied */ mem_heap_t* heap) /* in: memory heap where copied */
{ {
trx_undo_rec_t* undo_rec; trx_undo_rec_t* undo_rec;
...@@ -1377,8 +1377,8 @@ trx_undo_get_undo_rec( ...@@ -1377,8 +1377,8 @@ trx_undo_get_undo_rec(
fetch the old version; NOTE: the fetch the old version; NOTE: the
caller must have latches on the caller must have latches on the
clustered index page and purge_view */ clustered index page and purge_view */
dulint roll_ptr, /* in: roll pointer to record */ roll_ptr_t roll_ptr, /* in: roll pointer to record */
dulint trx_id, /* in: id of the trx that generated trx_id_t trx_id, /* in: id of the trx that generated
the roll pointer: it points to an the roll pointer: it points to an
undo log of this transaction */ undo log of this transaction */
trx_undo_rec_t** undo_rec, /* out, own: copy of the record */ trx_undo_rec_t** undo_rec, /* out, own: copy of the record */
...@@ -1432,13 +1432,13 @@ trx_undo_prev_version_build( ...@@ -1432,13 +1432,13 @@ trx_undo_prev_version_build(
{ {
trx_undo_rec_t* undo_rec = NULL; trx_undo_rec_t* undo_rec = NULL;
dtuple_t* entry; dtuple_t* entry;
dulint rec_trx_id; trx_id_t rec_trx_id;
ulint type; ulint type;
dulint undo_no; undo_no_t undo_no;
dulint table_id; dulint table_id;
dulint trx_id; trx_id_t trx_id;
dulint roll_ptr; roll_ptr_t roll_ptr;
dulint old_roll_ptr; roll_ptr_t old_roll_ptr;
upd_t* update; upd_t* update;
byte* ptr; byte* ptr;
ulint info_bits; ulint info_bits;
......
...@@ -657,10 +657,10 @@ static ...@@ -657,10 +657,10 @@ static
ibool ibool
trx_undo_arr_store_info( trx_undo_arr_store_info(
/*====================*/ /*====================*/
/* out: FALSE if the record already existed in the /* out: FALSE if the record already
array */ existed in the array */
trx_t* trx, /* in: transaction */ trx_t* trx, /* in: transaction */
dulint undo_no)/* in: undo number */ undo_no_t undo_no)/* in: undo number */
{ {
trx_undo_inf_t* cell; trx_undo_inf_t* cell;
trx_undo_inf_t* stored_here; trx_undo_inf_t* stored_here;
...@@ -720,7 +720,7 @@ void ...@@ -720,7 +720,7 @@ void
trx_undo_arr_remove_info( trx_undo_arr_remove_info(
/*=====================*/ /*=====================*/
trx_undo_arr_t* arr, /* in: undo number array */ trx_undo_arr_t* arr, /* in: undo number array */
dulint undo_no)/* in: undo number */ undo_no_t undo_no)/* in: undo number */
{ {
trx_undo_inf_t* cell; trx_undo_inf_t* cell;
ulint n_used; ulint n_used;
...@@ -750,7 +750,7 @@ trx_undo_arr_remove_info( ...@@ -750,7 +750,7 @@ trx_undo_arr_remove_info(
/*********************************************************************** /***********************************************************************
Gets the biggest undo number in an array. */ Gets the biggest undo number in an array. */
static static
dulint undo_no_t
trx_undo_arr_get_biggest( trx_undo_arr_get_biggest(
/*=====================*/ /*=====================*/
/* out: biggest value, ut_dulint_zero if /* out: biggest value, ut_dulint_zero if
...@@ -759,7 +759,7 @@ trx_undo_arr_get_biggest( ...@@ -759,7 +759,7 @@ trx_undo_arr_get_biggest(
{ {
trx_undo_inf_t* cell; trx_undo_inf_t* cell;
ulint n_used; ulint n_used;
dulint biggest; undo_no_t biggest;
ulint n; ulint n;
ulint i; ulint i;
...@@ -790,11 +790,11 @@ UNIV_INTERN ...@@ -790,11 +790,11 @@ UNIV_INTERN
void void
trx_roll_try_truncate( trx_roll_try_truncate(
/*==================*/ /*==================*/
trx_t* trx) /* in: transaction */ trx_t* trx) /* in/out: transaction */
{ {
trx_undo_arr_t* arr; trx_undo_arr_t* arr;
dulint limit; undo_no_t limit;
dulint biggest; undo_no_t biggest;
ut_ad(mutex_own(&(trx->undo_mutex))); ut_ad(mutex_own(&(trx->undo_mutex)));
ut_ad(mutex_own(&((trx->rseg)->mutex))); ut_ad(mutex_own(&((trx->rseg)->mutex)));
...@@ -886,8 +886,8 @@ trx_roll_pop_top_rec_of_trx( ...@@ -886,8 +886,8 @@ trx_roll_pop_top_rec_of_trx(
if none left, or if the undo number of the if none left, or if the undo number of the
top record would be less than the limit */ top record would be less than the limit */
trx_t* trx, /* in: transaction */ trx_t* trx, /* in: transaction */
dulint limit, /* in: least undo number we need */ undo_no_t limit, /* in: least undo number we need */
dulint* roll_ptr,/* out: roll pointer to undo record */ roll_ptr_t* roll_ptr,/* out: roll pointer to undo record */
mem_heap_t* heap) /* in: memory heap where copied */ mem_heap_t* heap) /* in: memory heap where copied */
{ {
trx_undo_t* undo; trx_undo_t* undo;
...@@ -895,7 +895,7 @@ trx_roll_pop_top_rec_of_trx( ...@@ -895,7 +895,7 @@ trx_roll_pop_top_rec_of_trx(
trx_undo_t* upd_undo; trx_undo_t* upd_undo;
trx_undo_rec_t* undo_rec; trx_undo_rec_t* undo_rec;
trx_undo_rec_t* undo_rec_copy; trx_undo_rec_t* undo_rec_copy;
dulint undo_no; undo_no_t undo_no;
ibool is_insert; ibool is_insert;
trx_rseg_t* rseg; trx_rseg_t* rseg;
ulint progress_pct; ulint progress_pct;
...@@ -1013,9 +1013,9 @@ UNIV_INTERN ...@@ -1013,9 +1013,9 @@ UNIV_INTERN
ibool ibool
trx_undo_rec_reserve( trx_undo_rec_reserve(
/*=================*/ /*=================*/
/* out: TRUE if succeeded */ /* out: TRUE if succeeded */
trx_t* trx, /* in: transaction */ trx_t* trx, /* in/out: transaction */
dulint undo_no)/* in: undo number of the record */ undo_no_t undo_no)/* in: undo number of the record */
{ {
ibool ret; ibool ret;
...@@ -1034,8 +1034,8 @@ UNIV_INTERN ...@@ -1034,8 +1034,8 @@ UNIV_INTERN
void void
trx_undo_rec_release( trx_undo_rec_release(
/*=================*/ /*=================*/
trx_t* trx, /* in: transaction */ trx_t* trx, /* in/out: transaction */
dulint undo_no)/* in: undo number */ undo_no_t undo_no)/* in: undo number */
{ {
trx_undo_arr_t* arr; trx_undo_arr_t* arr;
......
...@@ -115,7 +115,7 @@ trx_undo_mem_create( ...@@ -115,7 +115,7 @@ trx_undo_mem_create(
ulint id, /* in: slot index within rseg */ ulint id, /* in: slot index within rseg */
ulint type, /* in: type of the log: TRX_UNDO_INSERT or ulint type, /* in: type of the log: TRX_UNDO_INSERT or
TRX_UNDO_UPDATE */ TRX_UNDO_UPDATE */
dulint trx_id, /* in: id of the trx for which the undo log trx_id_t trx_id, /* in: id of the trx for which the undo log
is created */ is created */
const XID* xid, /* in: X/Open XA transaction identification*/ const XID* xid, /* in: X/Open XA transaction identification*/
ulint page_no,/* in: undo log header page number */ ulint page_no,/* in: undo log header page number */
...@@ -129,11 +129,12 @@ static ...@@ -129,11 +129,12 @@ static
ulint ulint
trx_undo_insert_header_reuse( trx_undo_insert_header_reuse(
/*=========================*/ /*=========================*/
/* out: undo log header byte offset on page */ /* out: undo log header byte
page_t* undo_page, /* in: insert undo log segment header page, offset on page */
x-latched */ page_t* undo_page, /* in/out: insert undo log segment
dulint trx_id, /* in: transaction id */ header page, x-latched */
mtr_t* mtr); /* in: mtr */ trx_id_t trx_id, /* in: transaction id */
mtr_t* mtr); /* in: mtr */
/************************************************************************** /**************************************************************************
If an update undo log can be discarded immediately, this function frees the If an update undo log can be discarded immediately, this function frees the
space, resetting the page to the proper state for caching. */ space, resetting the page to the proper state for caching. */
...@@ -514,9 +515,9 @@ UNIV_INLINE ...@@ -514,9 +515,9 @@ UNIV_INLINE
void void
trx_undo_header_create_log( trx_undo_header_create_log(
/*=======================*/ /*=======================*/
page_t* undo_page, /* in: undo log header page */ const page_t* undo_page, /* in: undo log header page */
dulint trx_id, /* in: transaction id */ trx_id_t trx_id, /* in: transaction id */
mtr_t* mtr) /* in: mtr */ mtr_t* mtr) /* in: mtr */
{ {
mlog_write_initial_log_record(undo_page, MLOG_UNDO_HDR_CREATE, mtr); mlog_write_initial_log_record(undo_page, MLOG_UNDO_HDR_CREATE, mtr);
...@@ -534,13 +535,14 @@ static ...@@ -534,13 +535,14 @@ static
ulint ulint
trx_undo_header_create( trx_undo_header_create(
/*===================*/ /*===================*/
/* out: header byte offset on page */ /* out: header byte offset on page */
page_t* undo_page, /* in: undo log segment header page, page_t* undo_page, /* in/out: undo log segment
x-latched; it is assumed that there are header page, x-latched; it is
TRX_UNDO_LOG_XA_HDR_SIZE bytes free space assumed that there is
on it */ TRX_UNDO_LOG_XA_HDR_SIZE bytes
dulint trx_id, /* in: transaction id */ free space on it */
mtr_t* mtr) /* in: mtr */ trx_id_t trx_id, /* in: transaction id */
mtr_t* mtr) /* in: mtr */
{ {
trx_upagef_t* page_hdr; trx_upagef_t* page_hdr;
trx_usegf_t* seg_hdr; trx_usegf_t* seg_hdr;
...@@ -685,9 +687,9 @@ UNIV_INLINE ...@@ -685,9 +687,9 @@ UNIV_INLINE
void void
trx_undo_insert_header_reuse_log( trx_undo_insert_header_reuse_log(
/*=============================*/ /*=============================*/
page_t* undo_page, /* in: undo log header page */ const page_t* undo_page, /* in: undo log header page */
dulint trx_id, /* in: transaction id */ trx_id_t trx_id, /* in: transaction id */
mtr_t* mtr) /* in: mtr */ mtr_t* mtr) /* in: mtr */
{ {
mlog_write_initial_log_record(undo_page, MLOG_UNDO_HDR_REUSE, mtr); mlog_write_initial_log_record(undo_page, MLOG_UNDO_HDR_REUSE, mtr);
...@@ -710,7 +712,7 @@ trx_undo_parse_page_header( ...@@ -710,7 +712,7 @@ trx_undo_parse_page_header(
page_t* page, /* in: page or NULL */ page_t* page, /* in: page or NULL */
mtr_t* mtr) /* in: mtr or NULL */ mtr_t* mtr) /* in: mtr or NULL */
{ {
dulint trx_id; trx_id_t trx_id;
ptr = mach_dulint_parse_compressed(ptr, end_ptr, &trx_id); ptr = mach_dulint_parse_compressed(ptr, end_ptr, &trx_id);
...@@ -739,11 +741,12 @@ static ...@@ -739,11 +741,12 @@ static
ulint ulint
trx_undo_insert_header_reuse( trx_undo_insert_header_reuse(
/*=========================*/ /*=========================*/
/* out: undo log header byte offset on page */ /* out: undo log header byte
page_t* undo_page, /* in: insert undo log segment header page, offset on page */
x-latched */ page_t* undo_page, /* in/out: insert undo log segment
dulint trx_id, /* in: transaction id */ header page, x-latched */
mtr_t* mtr) /* in: mtr */ trx_id_t trx_id, /* in: transaction id */
mtr_t* mtr) /* in: mtr */
{ {
trx_upagef_t* page_hdr; trx_upagef_t* page_hdr;
trx_usegf_t* seg_hdr; trx_usegf_t* seg_hdr;
...@@ -1064,7 +1067,7 @@ trx_undo_truncate_end( ...@@ -1064,7 +1067,7 @@ trx_undo_truncate_end(
/*==================*/ /*==================*/
trx_t* trx, /* in: transaction whose undo log it is */ trx_t* trx, /* in: transaction whose undo log it is */
trx_undo_t* undo, /* in: undo log */ trx_undo_t* undo, /* in: undo log */
dulint limit) /* in: all undo records with undo number undo_no_t limit) /* in: all undo records with undo number
>= this value should be truncated */ >= this value should be truncated */
{ {
page_t* undo_page; page_t* undo_page;
...@@ -1137,15 +1140,17 @@ UNIV_INTERN ...@@ -1137,15 +1140,17 @@ UNIV_INTERN
void void
trx_undo_truncate_start( trx_undo_truncate_start(
/*====================*/ /*====================*/
trx_rseg_t* rseg, /* in: rollback segment */ trx_rseg_t* rseg, /* in: rollback segment */
ulint space, /* in: space id of the log */ ulint space, /* in: space id of the log */
ulint hdr_page_no, /* in: header page number */ ulint hdr_page_no, /* in: header page number */
ulint hdr_offset, /* in: header offset on the page */ ulint hdr_offset, /* in: header offset on the page */
dulint limit) /* in: all undo pages with undo numbers < undo_no_t limit) /* in: all undo pages with
this value should be truncated; NOTE that undo numbers < this value
the function only frees whole pages; the should be truncated; NOTE that
header page is not freed, but emptied, if the function only frees whole
all the records there are < limit */ pages; the header page is not
freed, but emptied, if all the
records there are < limit */
{ {
page_t* undo_page; page_t* undo_page;
trx_undo_rec_t* rec; trx_undo_rec_t* rec;
...@@ -1270,7 +1275,7 @@ trx_undo_mem_create_at_db_start( ...@@ -1270,7 +1275,7 @@ trx_undo_mem_create_at_db_start(
trx_undo_t* undo; trx_undo_t* undo;
ulint type; ulint type;
ulint state; ulint state;
dulint trx_id; trx_id_t trx_id;
ulint offset; ulint offset;
fil_addr_t last_addr; fil_addr_t last_addr;
page_t* last_page; page_t* last_page;
...@@ -1443,7 +1448,7 @@ trx_undo_mem_create( ...@@ -1443,7 +1448,7 @@ trx_undo_mem_create(
ulint id, /* in: slot index within rseg */ ulint id, /* in: slot index within rseg */
ulint type, /* in: type of the log: TRX_UNDO_INSERT or ulint type, /* in: type of the log: TRX_UNDO_INSERT or
TRX_UNDO_UPDATE */ TRX_UNDO_UPDATE */
dulint trx_id, /* in: id of the trx for which the undo log trx_id_t trx_id, /* in: id of the trx for which the undo log
is created */ is created */
const XID* xid, /* in: X/Open transaction identification */ const XID* xid, /* in: X/Open transaction identification */
ulint page_no,/* in: undo log header page number */ ulint page_no,/* in: undo log header page number */
...@@ -1498,7 +1503,7 @@ void ...@@ -1498,7 +1503,7 @@ void
trx_undo_mem_init_for_reuse( trx_undo_mem_init_for_reuse(
/*========================*/ /*========================*/
trx_undo_t* undo, /* in: undo log to init */ trx_undo_t* undo, /* in: undo log to init */
dulint trx_id, /* in: id of the trx for which the undo log trx_id_t trx_id, /* in: id of the trx for which the undo log
is created */ is created */
const XID* xid, /* in: X/Open XA transaction identification*/ const XID* xid, /* in: X/Open XA transaction identification*/
ulint offset) /* in: undo log header byte offset on page */ ulint offset) /* in: undo log header byte offset on page */
...@@ -1557,7 +1562,7 @@ trx_undo_create( ...@@ -1557,7 +1562,7 @@ trx_undo_create(
trx_rseg_t* rseg, /* in: rollback segment memory copy */ trx_rseg_t* rseg, /* in: rollback segment memory copy */
ulint type, /* in: type of the log: TRX_UNDO_INSERT or ulint type, /* in: type of the log: TRX_UNDO_INSERT or
TRX_UNDO_UPDATE */ TRX_UNDO_UPDATE */
dulint trx_id, /* in: id of the trx for which the undo log trx_id_t trx_id, /* in: id of the trx for which the undo log
is created */ is created */
const XID* xid, /* in: X/Open transaction identification*/ const XID* xid, /* in: X/Open transaction identification*/
trx_undo_t** undo, /* out: the new undo log object, undefined trx_undo_t** undo, /* out: the new undo log object, undefined
...@@ -1627,7 +1632,7 @@ trx_undo_reuse_cached( ...@@ -1627,7 +1632,7 @@ trx_undo_reuse_cached(
trx_rseg_t* rseg, /* in: rollback segment memory object */ trx_rseg_t* rseg, /* in: rollback segment memory object */
ulint type, /* in: type of the log: TRX_UNDO_INSERT or ulint type, /* in: type of the log: TRX_UNDO_INSERT or
TRX_UNDO_UPDATE */ TRX_UNDO_UPDATE */
dulint trx_id, /* in: id of the trx for which the undo log trx_id_t trx_id, /* in: id of the trx for which the undo log
is used */ is used */
const XID* xid, /* in: X/Open XA transaction identification */ const XID* xid, /* in: X/Open XA transaction identification */
mtr_t* mtr) /* in: mtr */ mtr_t* mtr) /* in: mtr */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment