mirror of
https://github.com/MariaDB/server.git
synced 2025-01-17 04:22:27 +01:00
Merge from mysql-5.1 to mysql-5.5.
This commit is contained in:
commit
dcb5011700
3 changed files with 0 additions and 79 deletions
|
@ -87,10 +87,6 @@ that index record. */
|
|||
enum undo_exec {
|
||||
UNDO_NODE_FETCH_NEXT = 1, /*!< we should fetch the next
|
||||
undo log record */
|
||||
UNDO_NODE_PREV_VERS, /*!< the roll ptr to previous
|
||||
version of a row is stored in
|
||||
node, and undo should be done
|
||||
based on it */
|
||||
UNDO_NODE_INSERT, /*!< undo a fresh insert of a
|
||||
row to a table */
|
||||
UNDO_NODE_MODIFY /*!< undo a modify operation
|
||||
|
@ -108,9 +104,6 @@ struct undo_node_struct{
|
|||
undo_no_t undo_no;/*!< undo number of the record */
|
||||
ulint rec_type;/*!< undo log record type: TRX_UNDO_INSERT_REC,
|
||||
... */
|
||||
roll_ptr_t new_roll_ptr;
|
||||
/*!< roll ptr to restore to clustered index
|
||||
record */
|
||||
trx_id_t new_trx_id; /*!< trx id to restore to clustered index
|
||||
record */
|
||||
btr_pcur_t pcur; /*!< persistent cursor used in searching the
|
||||
|
|
|
@ -68,36 +68,6 @@ check.
|
|||
If you make a change in this module make sure that no codepath is
|
||||
introduced where a call to log_free_check() is bypassed. */
|
||||
|
||||
/***********************************************************//**
|
||||
Checks if also the previous version of the clustered index record was
|
||||
modified or inserted by the same transaction, and its undo number is such
|
||||
that it should be undone in the same rollback.
|
||||
@return TRUE if also previous modify or insert of this row should be undone */
|
||||
static
|
||||
ibool
|
||||
row_undo_mod_undo_also_prev_vers(
|
||||
/*=============================*/
|
||||
undo_node_t* node, /*!< in: row undo node */
|
||||
undo_no_t* undo_no)/*!< out: the undo number */
|
||||
{
|
||||
trx_undo_rec_t* undo_rec;
|
||||
trx_t* trx;
|
||||
|
||||
trx = node->trx;
|
||||
|
||||
if (node->new_trx_id != trx->id) {
|
||||
|
||||
*undo_no = 0;
|
||||
return(FALSE);
|
||||
}
|
||||
|
||||
undo_rec = trx_undo_get_undo_rec_low(node->new_roll_ptr, node->heap);
|
||||
|
||||
*undo_no = trx_undo_rec_get_undo_no(undo_rec);
|
||||
|
||||
return(trx->roll_limit <= *undo_no);
|
||||
}
|
||||
|
||||
/***********************************************************//**
|
||||
Undoes a modify in a clustered index record.
|
||||
@return DB_SUCCESS, DB_FAIL, or error code: we may run out of file space */
|
||||
|
@ -226,19 +196,11 @@ row_undo_mod_clust(
|
|||
btr_pcur_t* pcur;
|
||||
mtr_t mtr;
|
||||
ulint err;
|
||||
ibool success;
|
||||
ibool more_vers;
|
||||
undo_no_t new_undo_no;
|
||||
|
||||
ut_ad(node && thr);
|
||||
|
||||
log_free_check();
|
||||
|
||||
/* Check if also the previous version of the clustered index record
|
||||
should be undone in this same rollback operation */
|
||||
|
||||
more_vers = row_undo_mod_undo_also_prev_vers(node, &new_undo_no);
|
||||
|
||||
pcur = &(node->pcur);
|
||||
|
||||
mtr_start(&mtr);
|
||||
|
@ -286,20 +248,6 @@ row_undo_mod_clust(
|
|||
|
||||
trx_undo_rec_release(node->trx, node->undo_no);
|
||||
|
||||
if (more_vers && err == DB_SUCCESS) {
|
||||
|
||||
/* Reserve the undo log record to the prior version after
|
||||
committing &mtr: this is necessary to comply with the latching
|
||||
order, as &mtr may contain the fsp latch which is lower in
|
||||
the latch hierarchy than trx->undo_mutex. */
|
||||
|
||||
success = trx_undo_rec_reserve(node->trx, new_undo_no);
|
||||
|
||||
if (success) {
|
||||
node->state = UNDO_NODE_PREV_VERS;
|
||||
}
|
||||
}
|
||||
|
||||
return(err);
|
||||
}
|
||||
|
||||
|
@ -847,7 +795,6 @@ row_undo_mod_parse_undo_rec(
|
|||
trx_undo_update_rec_get_update(ptr, clust_index, type, trx_id,
|
||||
roll_ptr, info_bits, trx,
|
||||
node->heap, &(node->update));
|
||||
node->new_roll_ptr = roll_ptr;
|
||||
node->new_trx_id = trx_id;
|
||||
node->cmpl_info = cmpl_info;
|
||||
}
|
||||
|
|
|
@ -276,25 +276,6 @@ row_undo(
|
|||
node->roll_ptr = roll_ptr;
|
||||
node->undo_no = trx_undo_rec_get_undo_no(node->undo_rec);
|
||||
|
||||
if (trx_undo_roll_ptr_is_insert(roll_ptr)) {
|
||||
|
||||
node->state = UNDO_NODE_INSERT;
|
||||
} else {
|
||||
node->state = UNDO_NODE_MODIFY;
|
||||
}
|
||||
|
||||
} else if (node->state == UNDO_NODE_PREV_VERS) {
|
||||
|
||||
/* Undo should be done to the same clustered index record
|
||||
again in this same rollback, restoring the previous version */
|
||||
|
||||
roll_ptr = node->new_roll_ptr;
|
||||
|
||||
node->undo_rec = trx_undo_get_undo_rec_low(roll_ptr,
|
||||
node->heap);
|
||||
node->roll_ptr = roll_ptr;
|
||||
node->undo_no = trx_undo_rec_get_undo_no(node->undo_rec);
|
||||
|
||||
if (trx_undo_roll_ptr_is_insert(roll_ptr)) {
|
||||
|
||||
node->state = UNDO_NODE_INSERT;
|
||||
|
|
Loading…
Reference in a new issue