mirror of
https://github.com/MariaDB/server.git
synced 2025-01-19 13:32:33 +01:00
0eacf58fd5
Removed unused code .del-os0trash.c~8cae5c1695501117: Delete: innobase/os/os0trash.c dict0crea.c: Protect all sprintf(%s) with assertions BitKeeper/deleted/.del-os0trash.c~8cae5c1695501117: Delete: innobase/os/os0trash.c innobase/btr/btr0sea.c: Removed unused code innobase/buf/buf0buf.c: Removed unused code innobase/com/com0shm.c: Removed unused code innobase/data/data0data.c: Removed unused code innobase/dict/dict0crea.c: Removed unused code innobase/fsp/fsp0fsp.c: Removed unused code innobase/ha/ha0ha.c: Removed unused code innobase/include/btr0cur.h: Removed unused code innobase/include/btr0sea.h: Removed unused code innobase/include/buf0buf.ic: Removed unused code innobase/include/data0data.h: Removed unused code innobase/include/dict0crea.h: Removed unused code innobase/include/dict0dict.h: Removed unused code innobase/include/ibuf0ibuf.h: Removed unused code innobase/include/lock0lock.h: Removed unused code innobase/include/mem0dbg.h: Removed unused code innobase/include/mem0mem.ic: Removed unused code innobase/include/mtr0log.h: Removed unused code innobase/include/mtr0mtr.h: Removed unused code innobase/include/os0proc.h: Removed unused code innobase/include/os0thread.h: Removed unused code innobase/include/rem0cmp.ic: Removed unused code innobase/include/row0row.h: Removed unused code innobase/include/srv0srv.h: Removed unused code innobase/include/sync0sync.h: Removed unused code innobase/lock/lock0lock.c: Removed unused code innobase/log/log0recv.c: Removed unused code innobase/mem/mem0dbg.c: Removed unused code innobase/mtr/mtr0mtr.c: Removed unused code innobase/os/os0proc.c: Removed unused code innobase/page/page0page.c: Removed unused code innobase/que/que0que.c: Removed unused code innobase/rem/rem0cmp.c: Removed unused code innobase/row/row0ins.c: Removed unused code innobase/row/row0mysql.c: Removed unused code innobase/row/row0row.c: Removed unused code innobase/srv/srv0srv.c: Removed unused code innobase/srv/srv0start.c: Removed unused code innobase/sync/sync0sync.c: Removed unused code innobase/trx/trx0rec.c: Removed unused code innobase/trx/trx0trx.c: Removed unused code innobase/ut/ut0dbg.c: Removed unused code innobase/ut/ut0mem.c: Removed unused code innobase/ut/ut0ut.c: Removed unused code
169 lines
5.3 KiB
C
169 lines
5.3 KiB
C
/******************************************************
|
|
Mini-transaction logging routines
|
|
|
|
(c) 1995 Innobase Oy
|
|
|
|
Created 12/7/1995 Heikki Tuuri
|
|
*******************************************************/
|
|
|
|
#ifndef mtr0log_h
|
|
#define mtr0log_h
|
|
|
|
#include "univ.i"
|
|
#include "mtr0mtr.h"
|
|
|
|
/************************************************************
|
|
Writes 1 - 4 bytes to a file page buffered in the buffer pool.
|
|
Writes the corresponding log record to the mini-transaction log. */
|
|
|
|
void
|
|
mlog_write_ulint(
|
|
/*=============*/
|
|
byte* ptr, /* in: pointer where to write */
|
|
ulint val, /* in: value to write */
|
|
byte type, /* in: MLOG_1BYTE, MLOG_2BYTES, MLOG_4BYTES */
|
|
mtr_t* mtr); /* in: mini-transaction handle */
|
|
/************************************************************
|
|
Writes 8 bytes to a file page buffered in the buffer pool.
|
|
Writes the corresponding log record to the mini-transaction log. */
|
|
|
|
void
|
|
mlog_write_dulint(
|
|
/*==============*/
|
|
byte* ptr, /* in: pointer where to write */
|
|
dulint val, /* in: value to write */
|
|
byte type, /* in: MLOG_8BYTES */
|
|
mtr_t* mtr); /* in: mini-transaction handle */
|
|
/************************************************************
|
|
Writes a string to a file page buffered in the buffer pool. Writes the
|
|
corresponding log record to the mini-transaction log. */
|
|
|
|
void
|
|
mlog_write_string(
|
|
/*==============*/
|
|
byte* ptr, /* in: pointer where to write */
|
|
byte* str, /* in: string to write */
|
|
ulint len, /* in: string length */
|
|
mtr_t* mtr); /* in: mini-transaction handle */
|
|
/************************************************************
|
|
Writes initial part of a log record consisting of one-byte item
|
|
type and four-byte space and page numbers. */
|
|
|
|
void
|
|
mlog_write_initial_log_record(
|
|
/*==========================*/
|
|
byte* ptr, /* in: pointer to (inside) a buffer frame
|
|
holding the file page where modification
|
|
is made */
|
|
byte type, /* in: log item type: MLOG_1BYTE, ... */
|
|
mtr_t* mtr); /* in: mini-transaction handle */
|
|
/************************************************************
|
|
Catenates 1 - 4 bytes to the mtr log. */
|
|
UNIV_INLINE
|
|
void
|
|
mlog_catenate_ulint(
|
|
/*================*/
|
|
mtr_t* mtr, /* in: mtr */
|
|
ulint val, /* in: value to write */
|
|
ulint type); /* in: MLOG_1BYTE, MLOG_2BYTES, MLOG_4BYTES */
|
|
/************************************************************
|
|
Catenates n bytes to the mtr log. */
|
|
|
|
void
|
|
mlog_catenate_string(
|
|
/*=================*/
|
|
mtr_t* mtr, /* in: mtr */
|
|
byte* str, /* in: string to write */
|
|
ulint len); /* in: string length */
|
|
/************************************************************
|
|
Catenates a compressed ulint to mlog. */
|
|
UNIV_INLINE
|
|
void
|
|
mlog_catenate_ulint_compressed(
|
|
/*===========================*/
|
|
mtr_t* mtr, /* in: mtr */
|
|
ulint val); /* in: value to write */
|
|
/************************************************************
|
|
Catenates a compressed dulint to mlog. */
|
|
UNIV_INLINE
|
|
void
|
|
mlog_catenate_dulint_compressed(
|
|
/*============================*/
|
|
mtr_t* mtr, /* in: mtr */
|
|
dulint val); /* in: value to write */
|
|
/************************************************************
|
|
Opens a buffer to mlog. It must be closed with mlog_close. */
|
|
UNIV_INLINE
|
|
byte*
|
|
mlog_open(
|
|
/*======*/
|
|
/* out: buffer, NULL if log mode MTR_LOG_NONE */
|
|
mtr_t* mtr, /* in: mtr */
|
|
ulint size); /* in: buffer size in bytes */
|
|
/************************************************************
|
|
Closes a buffer opened to mlog. */
|
|
UNIV_INLINE
|
|
void
|
|
mlog_close(
|
|
/*=======*/
|
|
mtr_t* mtr, /* in: mtr */
|
|
byte* ptr); /* in: buffer space from ptr up was not used */
|
|
/************************************************************
|
|
Writes the initial part of a log record. */
|
|
UNIV_INLINE
|
|
byte*
|
|
mlog_write_initial_log_record_fast(
|
|
/*===============================*/
|
|
/* out: new value of log_ptr */
|
|
byte* ptr, /* in: pointer to (inside) a buffer frame holding the
|
|
file page where modification is made */
|
|
byte type, /* in: log item type: MLOG_1BYTE, ... */
|
|
byte* log_ptr,/* in: pointer to mtr log which has been opened */
|
|
mtr_t* mtr); /* in: mtr */
|
|
/************************************************************
|
|
Parses an initial log record written by mlog_write_initial_log_record. */
|
|
|
|
byte*
|
|
mlog_parse_initial_log_record(
|
|
/*==========================*/
|
|
/* out: parsed record end, NULL if not a complete
|
|
record */
|
|
byte* ptr, /* in: buffer */
|
|
byte* end_ptr,/* in: buffer end */
|
|
byte* type, /* out: log record type: MLOG_1BYTE, ... */
|
|
ulint* space, /* out: space id */
|
|
ulint* page_no);/* out: page number */
|
|
/************************************************************
|
|
Parses a log record written by mlog_write_ulint or mlog_write_dulint. */
|
|
|
|
byte*
|
|
mlog_parse_nbytes(
|
|
/*==============*/
|
|
/* out: parsed record end, NULL if not a complete
|
|
record */
|
|
ulint type, /* in: log record type: MLOG_1BYTE, ... */
|
|
byte* ptr, /* in: buffer */
|
|
byte* end_ptr,/* in: buffer end */
|
|
byte* page); /* in: page where to apply the log record, or NULL */
|
|
/************************************************************
|
|
Parses a log record written by mlog_write_string. */
|
|
|
|
byte*
|
|
mlog_parse_string(
|
|
/*==============*/
|
|
/* out: parsed record end, NULL if not a complete
|
|
record */
|
|
byte* ptr, /* in: buffer */
|
|
byte* end_ptr,/* in: buffer end */
|
|
byte* page); /* in: page where to apply the log record, or NULL */
|
|
|
|
|
|
/* Insert, update, and maybe other functions may use this value to define an
|
|
extra mlog buffer size for variable size data */
|
|
#define MLOG_BUF_MARGIN 256
|
|
|
|
#ifndef UNIV_NONINL
|
|
#include "mtr0log.ic"
|
|
#endif
|
|
|
|
#endif
|