CLASS UpdateLogRec

#include <logrec.h>

UpdateLogRec is the log record for writes (i.e. updates) done by transactions.

So for every

an UpdateLogRec is created and written into the log.

UpdateLogRec is a subclass of logRecord (in log.h).


Fields


struct UpdateLogData{

};

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)