mirror of
https://github.com/MariaDB/server.git
synced 2025-01-19 21:42:35 +01:00
d1485aad0e
Multiple tablespaces for InnoDB sql_table.cc: Tell explicitly that InnoDB should retrieve all columns in CHECKSUM TABLE sql_update.cc, sql_select.cc, my_base.h: More descriptive flag name HA_EXTRA_RETRIEVE_ALL_COLS include/my_base.h: More descriptive flag name HA_EXTRA_RETRIEVE_ALL_COLS sql/sql_select.cc: More descriptive flag name HA_EXTRA_RETRIEVE_ALL_COLS sql/sql_update.cc: More descriptive flag name HA_EXTRA_RETRIEVE_ALL_COLS sql/sql_table.cc: Tell explicitly that InnoDB should retrieve all columns in CHECKSUM TABLE sql/sql_db.cc: Multiple tablespaces for InnoDB sql/ha_innodb.cc: Multiple tablespaces for InnoDB sql/mysqld.cc: Multiple tablespaces for InnoDB sql/set_var.cc: Multiple tablespaces for InnoDB sql/sql_cache.cc: Multiple tablespaces for InnoDB sql/ha_innodb.h: Multiple tablespaces for InnoDB innobase/include/btr0btr.ic: Multiple tablespaces for InnoDB innobase/include/btr0pcur.ic: Multiple tablespaces for InnoDB innobase/include/data0type.ic: Multiple tablespaces for InnoDB innobase/include/dyn0dyn.ic: Multiple tablespaces for InnoDB innobase/include/fut0lst.ic: Multiple tablespaces for InnoDB innobase/include/log0log.ic: Multiple tablespaces for InnoDB innobase/include/mach0data.ic: Multiple tablespaces for InnoDB innobase/include/mtr0log.ic: Multiple tablespaces for InnoDB innobase/include/rem0rec.ic: Multiple tablespaces for InnoDB innobase/include/ut0byte.ic: Multiple tablespaces for InnoDB innobase/include/ut0ut.ic: Multiple tablespaces for InnoDB innobase/include/buf0buf.h: Multiple tablespaces for InnoDB innobase/include/buf0lru.h: Multiple tablespaces for InnoDB innobase/include/buf0rea.h: Multiple tablespaces for InnoDB innobase/include/data0type.h: Multiple tablespaces for InnoDB innobase/include/db0err.h: Multiple tablespaces for InnoDB innobase/include/dict0boot.h: Multiple tablespaces for InnoDB innobase/include/dict0dict.h: Multiple tablespaces for InnoDB innobase/include/dict0load.h: Multiple tablespaces for InnoDB innobase/include/dict0mem.h: Multiple tablespaces for InnoDB innobase/include/fil0fil.h: Multiple tablespaces for InnoDB innobase/include/fsp0fsp.h: Multiple tablespaces for InnoDB innobase/include/ibuf0ibuf.h: Multiple tablespaces for InnoDB innobase/include/lock0lock.h: Multiple tablespaces for InnoDB innobase/include/log0log.h: Multiple tablespaces for InnoDB innobase/include/log0recv.h: Multiple tablespaces for InnoDB innobase/include/os0file.h: Multiple tablespaces for InnoDB innobase/include/page0page.h: Multiple tablespaces for InnoDB innobase/include/que0types.h: Multiple tablespaces for InnoDB innobase/include/rem0rec.h: Multiple tablespaces for InnoDB innobase/include/srv0srv.h: Multiple tablespaces for InnoDB innobase/include/srv0start.h: Multiple tablespaces for InnoDB innobase/include/sync0sync.h: Multiple tablespaces for InnoDB innobase/include/trx0sys.h: Multiple tablespaces for InnoDB innobase/include/ut0byte.h: Multiple tablespaces for InnoDB innobase/include/univ.i: Multiple tablespaces for InnoDB innobase/btr/btr0cur.c: Multiple tablespaces for InnoDB innobase/btr/btr0sea.c: Multiple tablespaces for InnoDB innobase/buf/buf0buf.c: Multiple tablespaces for InnoDB innobase/buf/buf0flu.c: Multiple tablespaces for InnoDB innobase/buf/buf0lru.c: Multiple tablespaces for InnoDB innobase/buf/buf0rea.c: Multiple tablespaces for InnoDB innobase/data/data0type.c: Multiple tablespaces for InnoDB innobase/dict/dict0boot.c: Multiple tablespaces for InnoDB innobase/dict/dict0crea.c: Multiple tablespaces for InnoDB innobase/dict/dict0dict.c: Multiple tablespaces for InnoDB innobase/dict/dict0load.c: Multiple tablespaces for InnoDB innobase/dict/dict0mem.c: Multiple tablespaces for InnoDB innobase/fil/fil0fil.c: Multiple tablespaces for InnoDB innobase/fsp/fsp0fsp.c: Multiple tablespaces for InnoDB innobase/ha/ha0ha.c: Multiple tablespaces for InnoDB innobase/ibuf/ibuf0ibuf.c: Multiple tablespaces for InnoDB innobase/log/log0log.c: Multiple tablespaces for InnoDB innobase/log/log0recv.c: Multiple tablespaces for InnoDB innobase/mach/mach0data.c: Multiple tablespaces for InnoDB innobase/mem/mem0dbg.c: Multiple tablespaces for InnoDB innobase/mem/mem0pool.c: Multiple tablespaces for InnoDB innobase/mtr/mtr0log.c: Multiple tablespaces for InnoDB innobase/os/os0file.c: Multiple tablespaces for InnoDB innobase/os/os0proc.c: Multiple tablespaces for InnoDB innobase/page/page0cur.c: Multiple tablespaces for InnoDB innobase/que/que0que.c: Multiple tablespaces for InnoDB innobase/row/row0ins.c: Multiple tablespaces for InnoDB innobase/row/row0mysql.c: Multiple tablespaces for InnoDB innobase/row/row0sel.c: Multiple tablespaces for InnoDB innobase/row/row0upd.c: Multiple tablespaces for InnoDB innobase/srv/srv0srv.c: Multiple tablespaces for InnoDB innobase/srv/srv0start.c: Multiple tablespaces for InnoDB innobase/sync/sync0rw.c: Multiple tablespaces for InnoDB innobase/sync/sync0sync.c: Multiple tablespaces for InnoDB innobase/trx/trx0sys.c: Multiple tablespaces for InnoDB innobase/trx/trx0trx.c: Multiple tablespaces for InnoDB innobase/trx/trx0undo.c: Multiple tablespaces for InnoDB innobase/ut/ut0byte.c: Multiple tablespaces for InnoDB innobase/ut/ut0ut.c: Multiple tablespaces for InnoDB
147 lines
4.2 KiB
Text
147 lines
4.2 KiB
Text
/**********************************************************************
|
|
File-based list utilities
|
|
|
|
(c) 1995 Innobase Oy
|
|
|
|
Created 11/28/1995 Heikki Tuuri
|
|
***********************************************************************/
|
|
|
|
#include "fut0fut.h"
|
|
#include "mtr0log.h"
|
|
#include "buf0buf.h"
|
|
|
|
/* We define the field offsets of a node for the list */
|
|
#define FLST_PREV 0 /* 6-byte address of the previous list element;
|
|
the page part of address is FIL_NULL, if no
|
|
previous element */
|
|
#define FLST_NEXT FIL_ADDR_SIZE /* 6-byte address of the next
|
|
list element; the page part of address
|
|
is FIL_NULL, if no next element */
|
|
|
|
/* We define the field offsets of a base node for the list */
|
|
#define FLST_LEN 0 /* 32-bit list length field */
|
|
#define FLST_FIRST 4 /* 6-byte address of the first element
|
|
of the list; undefined if empty list */
|
|
#define FLST_LAST (4 + FIL_ADDR_SIZE) /* 6-byte address of the
|
|
last element of the list; undefined
|
|
if empty list */
|
|
|
|
/************************************************************************
|
|
Writes a file address. */
|
|
UNIV_INLINE
|
|
void
|
|
flst_write_addr(
|
|
/*============*/
|
|
fil_faddr_t* faddr, /* in: pointer to file faddress */
|
|
fil_addr_t addr, /* in: file address */
|
|
mtr_t* mtr) /* in: mini-transaction handle */
|
|
{
|
|
ut_ad(faddr && mtr);
|
|
ut_ad(mtr_memo_contains(mtr, buf_block_align(faddr),
|
|
MTR_MEMO_PAGE_X_FIX));
|
|
|
|
mlog_write_ulint(faddr + FIL_ADDR_PAGE, addr.page, MLOG_4BYTES, mtr);
|
|
mlog_write_ulint(faddr + FIL_ADDR_BYTE, addr.boffset,
|
|
MLOG_2BYTES, mtr);
|
|
}
|
|
|
|
/************************************************************************
|
|
Reads a file address. */
|
|
UNIV_INLINE
|
|
fil_addr_t
|
|
flst_read_addr(
|
|
/*===========*/
|
|
/* out: file address */
|
|
fil_faddr_t* faddr, /* in: pointer to file faddress */
|
|
mtr_t* mtr) /* in: mini-transaction handle */
|
|
{
|
|
fil_addr_t addr;
|
|
|
|
ut_ad(faddr && mtr);
|
|
|
|
addr.page = mtr_read_ulint(faddr + FIL_ADDR_PAGE, MLOG_4BYTES, mtr);
|
|
addr.boffset = mtr_read_ulint(faddr + FIL_ADDR_BYTE, MLOG_2BYTES,
|
|
mtr);
|
|
return(addr);
|
|
}
|
|
|
|
/************************************************************************
|
|
Initializes a list base node. */
|
|
UNIV_INLINE
|
|
void
|
|
flst_init(
|
|
/*======*/
|
|
flst_base_node_t* base, /* in: pointer to base node */
|
|
mtr_t* mtr) /* in: mini-transaction handle */
|
|
{
|
|
ut_ad(mtr_memo_contains(mtr, buf_block_align(base),
|
|
MTR_MEMO_PAGE_X_FIX));
|
|
mlog_write_ulint(base + FLST_LEN, 0, MLOG_4BYTES, mtr);
|
|
flst_write_addr(base + FLST_FIRST, fil_addr_null, mtr);
|
|
flst_write_addr(base + FLST_LAST, fil_addr_null, mtr);
|
|
}
|
|
|
|
/************************************************************************
|
|
Gets list length. */
|
|
UNIV_INLINE
|
|
ulint
|
|
flst_get_len(
|
|
/*=========*/
|
|
/* out: length */
|
|
flst_base_node_t* base, /* in: pointer to base node */
|
|
mtr_t* mtr) /* in: mini-transaction handle */
|
|
{
|
|
return(mtr_read_ulint(base + FLST_LEN, MLOG_4BYTES, mtr));
|
|
}
|
|
|
|
/************************************************************************
|
|
Gets list first node address. */
|
|
UNIV_INLINE
|
|
fil_addr_t
|
|
flst_get_first(
|
|
/*===========*/
|
|
/* out: file address */
|
|
flst_base_node_t* base, /* in: pointer to base node */
|
|
mtr_t* mtr) /* in: mini-transaction handle */
|
|
{
|
|
return(flst_read_addr(base + FLST_FIRST, mtr));
|
|
}
|
|
|
|
/************************************************************************
|
|
Gets list last node address. */
|
|
UNIV_INLINE
|
|
fil_addr_t
|
|
flst_get_last(
|
|
/*==========*/
|
|
/* out: file address */
|
|
flst_base_node_t* base, /* in: pointer to base node */
|
|
mtr_t* mtr) /* in: mini-transaction handle */
|
|
{
|
|
return(flst_read_addr(base + FLST_LAST, mtr));
|
|
}
|
|
|
|
/************************************************************************
|
|
Gets list next node address. */
|
|
UNIV_INLINE
|
|
fil_addr_t
|
|
flst_get_next_addr(
|
|
/*===============*/
|
|
/* out: file address */
|
|
flst_node_t* node, /* in: pointer to node */
|
|
mtr_t* mtr) /* in: mini-transaction handle */
|
|
{
|
|
return(flst_read_addr(node + FLST_NEXT, mtr));
|
|
}
|
|
|
|
/************************************************************************
|
|
Gets list prev node address. */
|
|
UNIV_INLINE
|
|
fil_addr_t
|
|
flst_get_prev_addr(
|
|
/*===============*/
|
|
/* out: file address */
|
|
flst_node_t* node, /* in: pointer to node */
|
|
mtr_t* mtr) /* in: mini-transaction handle */
|
|
{
|
|
return(flst_read_addr(node + FLST_PREV, mtr));
|
|
}
|