mariadb/innobase/include/ha0ha.h
unknown fd6db50c0b Applied innodb-5.0-ss368 snapshot
Fixed bugs:
  #16814: SHOW INNODB STATUS format error in LATEST FOREIGN KEY ERROR section
    dict_foreign_key_error_report(): Always print a newline after invoking
    dict_print_info_on_foreign_key_in_create_format().
  #16827: Better InnoDB error message if ibdata files omitted from my.cnf.
  #17126: CHECK TABLE on InnoDB causes a short hang during check of adaptive hash.
    CHECK TABLE blocking other queries, by releasing the btr_search_latch
    periodically during the adaptive hash table validation.
  #17405: Valgrind: conditional jump or move depends on uninitialised valuesw.
    buf_block_init(): Reset magic_n, buf_fix_count, and io_fix to avoid testing
    uninitialised variables.
  #18077: InnoDB uses full explicit table locks in stored FUNCTION.
  #18238: When locks exhaust the buffer pool, InnoDB does not roll back the trx.
    Check in pessimistic insert and update if the buffer pool is exhausted by locks.
  #18252: Disk space leaks in updates of InnoDB BLOB rows.
    btr_cur_pessimistic_update(): Invoke rec_get_offset() after rec_set_field_extern_bits().
    btr_store_big_rec_extern_fields(): Note that offsets will no longer be valid
    after calling this function.
  #18283: When InnoDB returns error 'lock table full', MySQL can write to binlog too much.
  #18384: InnoDB memory leak on duplicate key errors if row has many columns.
    row_ins_duplicate_error_in_clust(): Call mem_heap_free(heap) at func_exit if needed.
  #18350: Use consistent read in CREATE ... SELECT .. if innodb_locks_unsafe_for_binlog is used.


innobase/btr/btr0cur.c:
  Applied innodb-5.0-ss368 snapshot
innobase/btr/btr0sea.c:
  Applied innodb-5.0-ss368 snapshot
innobase/buf/buf0buf.c:
  Applied innodb-5.0-ss368 snapshot
innobase/buf/buf0lru.c:
  Applied innodb-5.0-ss368 snapshot
innobase/data/data0type.c:
  Applied innodb-5.0-ss368 snapshot
    dtype_print(): Fix printing of prtype.
innobase/dict/dict0dict.c:
  Applied innodb-5.0-ss368 snapshot
innobase/fil/fil0fil.c:
  Applied innodb-5.0-ss368 snapshot
    fil_extend_space_to_desired_size(): in UNIV_HOTBACKUP builds,
    do not touch srv_data_file_sizes[] or srv_n_data_files.
innobase/ha/ha0ha.c:
  Applied innodb-5.0-ss368 snapshot
innobase/include/btr0cur.h:
  Applied innodb-5.0-ss368 snapshot
innobase/include/buf0lru.h:
  Applied innodb-5.0-ss368 snapshot
innobase/include/ha0ha.h:
  Applied innodb-5.0-ss368 snapshot
innobase/include/page0page.ic:
  Applied innodb-5.0-ss368 snapshot
    Remove UNIV_RELEASE_NOT_YET_STABLE and related checks.
innobase/include/univ.i:
  Applied innodb-5.0-ss368 snapshot
    Remove UNIV_RELEASES_NOT_YET_STABLE and related checks.
innobase/row/row0ins.c:
  Applied innodb-5.0-ss368 snapshot
innobase/row/row0sel.c:
  Applied innodb-5.0-ss368 snapshot
    Remove UNIV_RELEASE_NOT_YET_STABLE and related checks.
    page_rec_is_comp(): Remove the bounds check.
    row_sel_field_store_in_mysql_format(): Turn the assertions
    on mbminlen, mbmaxlen, and templ->type into debug assertions.
innobase/row/row0upd.c:
  Applied innodb-5.0-ss368 snapshot
mysql-test/t/innodb.test:
  Applied innodb-5.0-ss368 snapshot
sql/ha_innodb.cc:
  Applied innodb-5.0-ss368 snapshot
    Fix memory allocation bug (by changing MY_WME to MY_FAE) in get_share.
    Also partially fix coding style of the function.
2006-03-29 23:04:32 +04:00

148 lines
4.8 KiB
C

/******************************************************
The hash table with external chains
(c) 1994-1997 Innobase Oy
Created 8/18/1994 Heikki Tuuri
*******************************************************/
#ifndef ha0ha_h
#define ha0ha_h
#include "univ.i"
#include "hash0hash.h"
#include "page0types.h"
/*****************************************************************
Looks for an element in a hash table. */
UNIV_INLINE
void*
ha_search_and_get_data(
/*===================*/
/* out: pointer to the data of the first hash
table node in chain having the fold number,
NULL if not found */
hash_table_t* table, /* in: hash table */
ulint fold); /* in: folded value of the searched data */
/*************************************************************
Looks for an element when we know the pointer to the data and updates
the pointer to data if found. */
void
ha_search_and_update_if_found(
/*==========================*/
hash_table_t* table, /* in: hash table */
ulint fold, /* in: folded value of the searched data */
void* data, /* in: pointer to the data */
void* new_data);/* in: new pointer to the data */
/*****************************************************************
Creates a hash table with >= n array cells. The actual number of cells is
chosen to be a prime number slightly bigger than n. */
hash_table_t*
ha_create(
/*======*/
/* out, own: created table */
ibool in_btr_search, /* in: TRUE if the hash table is used in
the btr_search module */
ulint n, /* in: number of array cells */
ulint n_mutexes, /* in: number of mutexes to protect the
hash table: must be a power of 2 */
ulint mutex_level); /* in: level of the mutexes in the latching
order: this is used in the debug version */
/*****************************************************************
Inserts an entry into a hash table. If an entry with the same fold number
is found, its node is updated to point to the new data, and no new node
is inserted. */
ibool
ha_insert_for_fold(
/*===============*/
/* out: TRUE if succeed, FALSE if no more
memory could be allocated */
hash_table_t* table, /* in: hash table */
ulint fold, /* in: folded value of data; if a node with
the same fold value already exists, it is
updated to point to the same data, and no new
node is created! */
void* data); /* in: data, must not be NULL */
/*****************************************************************
Reserves the necessary hash table mutex and inserts an entry into the hash
table. */
UNIV_INLINE
ibool
ha_insert_for_fold_mutex(
/*=====================*/
/* out: TRUE if succeed, FALSE if no more
memory could be allocated */
hash_table_t* table, /* in: hash table */
ulint fold, /* in: folded value of data; if a node with
the same fold value already exists, it is
updated to point to the same data, and no new
node is created! */
void* data); /* in: data, must not be NULL */
/*****************************************************************
Deletes an entry from a hash table. */
void
ha_delete(
/*======*/
hash_table_t* table, /* in: hash table */
ulint fold, /* in: folded value of data */
void* data); /* in: data, must not be NULL and must exist
in the hash table */
/*************************************************************
Looks for an element when we know the pointer to the data and deletes
it from the hash table if found. */
UNIV_INLINE
ibool
ha_search_and_delete_if_found(
/*==========================*/
/* out: TRUE if found */
hash_table_t* table, /* in: hash table */
ulint fold, /* in: folded value of the searched data */
void* data); /* in: pointer to the data */
/*********************************************************************
Removes from the chain determined by fold all nodes whose data pointer
points to the page given. */
void
ha_remove_all_nodes_to_page(
/*========================*/
hash_table_t* table, /* in: hash table */
ulint fold, /* in: fold value */
page_t* page); /* in: buffer page */
/*****************************************************************
Validates a given range of the cells in hash table. */
ibool
ha_validate(
/*========*/
/* out: TRUE if ok */
hash_table_t* table, /* in: hash table */
ulint start_index, /* in: start index */
ulint end_index); /* in: end index */
/*****************************************************************
Prints info of a hash table. */
void
ha_print_info(
/*==========*/
FILE* file, /* in: file where to print */
hash_table_t* table); /* in: hash table */
/* The hash table external chain node */
typedef struct ha_node_struct ha_node_t;
struct ha_node_struct {
ha_node_t* next; /* next chain node or NULL if none */
void* data; /* pointer to the data */
ulint fold; /* fold value for the data */
};
#ifndef UNIV_NONINL
#include "ha0ha.ic"
#endif
#endif