diff options
Diffstat (limited to 'storage/maria/trnman.c')
-rw-r--r-- | storage/maria/trnman.c | 24 |
1 files changed, 23 insertions, 1 deletions
diff --git a/storage/maria/trnman.c b/storage/maria/trnman.c index 56f6c52b2f5..0c7f6c54f5e 100644 --- a/storage/maria/trnman.c +++ b/storage/maria/trnman.c @@ -194,6 +194,7 @@ int trnman_init(TrID initial_trid) DBUG_RETURN(0); } + /* NOTE this could only be called in the "idle" state - no transaction can be @@ -229,6 +230,7 @@ void trnman_destroy() DBUG_VOID_RETURN; } + /* NOTE TrID is limited to 6 bytes. Initial value of the generator @@ -267,7 +269,7 @@ static uint get_short_trid(TRN *trn) } /** - Allocates and initialzies a new TRN object + Allocates and initializes a new TRN object @note the 'wt' parameter can only be 0 in a single-threaded code (or, generally, where threads cannot block each other), otherwise the @@ -384,6 +386,26 @@ TRN *trnman_new_trn(WT_THD *wt) DBUG_RETURN(trn); } + +/* + Initialize a temporary TRN object for logging a new transaction id (trid) + to it. Used by create table to associate a create trid to the table. + + Out: trn->trid is updated with next available trid +*/ + +void trnman_init_tmp_trn_for_logging_trid(TRN *trn) +{ + *trn= dummy_transaction_object; + /* Avoid logging short_id */ + trn->short_id= 1; + /* Trid gets logged in translog_write_record */ + trn->first_undo_lsn= 0; + /* Get next free trid */ + trn->trid= trnman_get_min_safe_trid(); +} + + /* remove a trn from the active list. if necessary - move to committed list and set commit_trid |