mariadb/include/mem0dbg.ic
marko c820140599 branches/innodb+: Merge revisions 6364:6447 from branches/zip:
------------------------------------------------------------------------
  r6367 | marko | 2009-12-28 15:39:19 +0200 (Mon, 28 Dec 2009) | 2 lines
  Changed paths:
     M /branches/zip/dict/dict0dict.c

  branches/zip: dict_index_add_to_cache(): Always free the index object,
  also when returning DB_CORRUPTION.
  ------------------------------------------------------------------------
  r6425 | marko | 2010-01-12 13:47:11 +0200 (Tue, 12 Jan 2010) | 45 lines
  Changed paths:
     M /branches/zip/ChangeLog
     M /branches/zip/handler/ha_innodb.cc
     M /branches/zip/handler/ha_innodb.h
     M /branches/zip/row/row0mysql.c

  branches/zip: Merge revisions 6350:6424 from branches/5.1:

    ------------------------------------------------------------------------
    r6421 | jyang | 2010-01-12 07:59:16 +0200 (Tue, 12 Jan 2010) | 8 lines
    Changed paths:
       M /branches/5.1/row/row0mysql.c

    branches/5.1: Fix bug #49238: Creating/Dropping a temporary table
    while at 1023 transactions will cause assert. Handle possible
    DB_TOO_MANY_CONCURRENT_TRXS when deleting metadata in
    row_drop_table_for_mysql().

    rb://220, approved by Marko
    ------------------------------------------------------------------------
    r6422 | marko | 2010-01-12 11:34:27 +0200 (Tue, 12 Jan 2010) | 3 lines
    Changed paths:
       M /branches/5.1/handler/ha_innodb.cc
       M /branches/5.1/handler/ha_innodb.h

    branches/5.1: Non-functional change:
    Make innobase_get_int_col_max_value() a static function.
    It does not access any fields of class ha_innobase.
    ------------------------------------------------------------------------
    r6424 | marko | 2010-01-12 12:22:19 +0200 (Tue, 12 Jan 2010) | 16 lines
    Changed paths:
       M /branches/5.1/handler/ha_innodb.cc
       M /branches/5.1/handler/ha_innodb.h

    branches/5.1: In innobase_initialize_autoinc(), do not attempt to read
    the maximum auto-increment value from the table if
    innodb_force_recovery is set to at least 4, so that writes are
    disabled. (Bug #46193)

    innobase_get_int_col_max_value(): Move the function definition before
    ha_innobase::innobase_initialize_autoinc(), because that function now
    calls this function.

    ha_innobase::innobase_initialize_autoinc(): Change the return type to
    void.  Do not attempt to read the maximum auto-increment value from
    the table if innodb_force_recovery is set to at least 4.  Issue
    ER_AUTOINC_READ_FAILED to the client when the auto-increment value
    cannot be read.

    rb://144 by Sunny, revised by Marko
    ------------------------------------------------------------------------
  ------------------------------------------------------------------------
  r6426 | marko | 2010-01-12 15:36:14 +0200 (Tue, 12 Jan 2010) | 2 lines
  Changed paths:
     M /branches/zip/row/row0sel.c

  branches/zip: row_sel_sec_rec_is_for_clust_rec(): Document the return value
  more accurately.
  ------------------------------------------------------------------------
  r6433 | marko | 2010-01-13 13:19:00 +0200 (Wed, 13 Jan 2010) | 2 lines
  Changed paths:
     M /branches/zip/dict/dict0crea.c
     M /branches/zip/dict/dict0load.c

  branches/zip: dict_sys_tables_get_flags(), dict_create_sys_*_tuple():
  Add some const qualifiers and comments.
  ------------------------------------------------------------------------
  r6445 | marko | 2010-01-13 17:15:29 +0200 (Wed, 13 Jan 2010) | 3 lines
  Changed paths:
     M /branches/zip/ChangeLog
     M /branches/zip/buf/buf0buf.c

  branches/zip: buf_pool_drop_hash_index(): Check block->page.state
  before checking block->is_hashed, because the latter may be uninitialized
  right after server startup.
  ------------------------------------------------------------------------
  r6446 | marko | 2010-01-13 17:20:10 +0200 (Wed, 13 Jan 2010) | 3 lines
  Changed paths:
     M /branches/zip/include/mem0dbg.h
     M /branches/zip/include/mem0dbg.ic
     M /branches/zip/mem/mem0dbg.c
     M /branches/zip/sync/sync0sync.c

  branches/zip: Treat mem_hash_mutex specially in mutex_free(),
  and explicitly free mem_hash_mutex in mem_close().
  This fixes the breakage of UNIV_MEM_DEBUG that was filed as Issue #434.
  ------------------------------------------------------------------------
  r6447 | marko | 2010-01-13 17:43:44 +0200 (Wed, 13 Jan 2010) | 5 lines
  Changed paths:
     M /branches/zip/ChangeLog
     M /branches/zip/row/row0sel.c

  branches/zip: row_sel_get_clust_rec_for_mysql(): On the READ UNCOMMITTED
  isolation level, do not attempt to access a clustered index record
  that has been marked for deletion.  This fixes Issue #433.

  Approved by Heikki over the IM.
  ------------------------------------------------------------------------
2010-01-13 20:01:10 +00:00

109 lines
3.7 KiB
Text

/*****************************************************************************
Copyright (c) 1994, 2009, Innobase Oy. All Rights Reserved.
This program is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free Software
Foundation; version 2 of the License.
This program is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with
this program; if not, write to the Free Software Foundation, Inc., 59 Temple
Place, Suite 330, Boston, MA 02111-1307 USA
*****************************************************************************/
/********************************************************************//**
@file include/mem0dbg.ic
The memory management: the debug code. This is not an independent
compilation module but is included in mem0mem.*.
Created 6/8/1994 Heikki Tuuri
*************************************************************************/
#ifdef UNIV_MEM_DEBUG
extern ulint mem_current_allocated_memory;
/******************************************************************//**
Initializes an allocated memory field in the debug version. */
UNIV_INTERN
void
mem_field_init(
/*===========*/
byte* buf, /*!< in: memory field */
ulint n); /*!< in: how many bytes the user requested */
/******************************************************************//**
Erases an allocated memory field in the debug version. */
UNIV_INTERN
void
mem_field_erase(
/*============*/
byte* buf, /*!< in: memory field */
ulint n); /*!< in: how many bytes the user requested */
/***************************************************************//**
Initializes a buffer to a random combination of hex BA and BE.
Used to initialize allocated memory. */
UNIV_INTERN
void
mem_init_buf(
/*=========*/
byte* buf, /*!< in: pointer to buffer */
ulint n); /*!< in: length of buffer */
/***************************************************************//**
Initializes a buffer to a random combination of hex DE and AD.
Used to erase freed memory. */
UNIV_INTERN
void
mem_erase_buf(
/*==========*/
byte* buf, /*!< in: pointer to buffer */
ulint n); /*!< in: length of buffer */
/***************************************************************//**
Inserts a created memory heap to the hash table of
current allocated memory heaps.
Initializes the hash table when first called. */
UNIV_INTERN
void
mem_hash_insert(
/*============*/
mem_heap_t* heap, /*!< in: the created heap */
const char* file_name, /*!< in: file name of creation */
ulint line); /*!< in: line where created */
/***************************************************************//**
Removes a memory heap (which is going to be freed by the caller)
from the list of live memory heaps. Returns the size of the heap
in terms of how much memory in bytes was allocated for the user of
the heap (not the total space occupied by the heap).
Also validates the heap.
NOTE: This function does not free the storage occupied by the
heap itself, only the node in the list of heaps. */
UNIV_INTERN
void
mem_hash_remove(
/*============*/
mem_heap_t* heap, /*!< in: the heap to be freed */
const char* file_name, /*!< in: file name of freeing */
ulint line); /*!< in: line where freed */
void
mem_field_header_set_len(byte* field, ulint len);
ulint
mem_field_header_get_len(byte* field);
void
mem_field_header_set_check(byte* field, ulint check);
ulint
mem_field_header_get_check(byte* field);
void
mem_field_trailer_set_check(byte* field, ulint check);
ulint
mem_field_trailer_get_check(byte* field);
#endif /* UNIV_MEM_DEBUG */