CLASS UpdateLogRec
#include <logrec.h>
UpdateLogRec is the log record for writes (i.e. updates) done by transactions.
So for every
Fields
struct UpdateLogData{
};
LOG_TYPE type; lsn_t prevlsn; int xid; // transaction id PageID page_id; // page that get updated int offset; // offset within the page int size; // number of bytes that change char data; // the undo and redo information. This variable is just a placeholder, // used for its address at the end of the LogData struct
UpdateLogData is how the buffer beginning at data_ptr for a log record is
structured. There are no actual fields, it is just how the byte array can be
casted into this struct.
Methods
lsn_t GetPrevLSN ( )
Returns prevlsn field (the LSN of the action taken before by this transaction).
int Getxid ( )
Returns xid field (the transaction id or transaction number, e.g. - 1 for T1)
PageID GetPageID ( )
Returns page_id field (the page being affected)
int GetOffset ( )
Returns offset field (the byte position on the page where the data is being written)
int GetSize ( )
Returns size field (the size of the Undo data)
char* GetUndo ( )
Returns a pointer to where the Undo data should be stored on the log record.
char* GetRedo ( )
Returns a pointer to where the Redo data should be stored on the log record.
RecErr SetPrevLSN ( lsn_t newlsn )
Sets the prevlsn field
RecErr Setxid ( int newxid )
Sets the xid field
RecErr SetPageID ( int newpgid )
Sets the page_id field
RecErr SetOffset ( int newoffset )
Sets the offset field
RecErr SetSize ( int newsize )
Sets the size field (the size of the Undo data)