2001-02-17 14:19:19 +02:00
|
|
|
/******************************************************
|
|
|
|
Data dictionary system
|
|
|
|
|
|
|
|
(c) 1996 Innobase Oy
|
|
|
|
|
|
|
|
Created 1/8/1996 Heikki Tuuri
|
|
|
|
*******************************************************/
|
|
|
|
|
|
|
|
#ifndef dict0dict_h
|
|
|
|
#define dict0dict_h
|
|
|
|
|
|
|
|
#include "univ.i"
|
|
|
|
#include "dict0types.h"
|
|
|
|
#include "dict0mem.h"
|
|
|
|
#include "data0type.h"
|
|
|
|
#include "data0data.h"
|
|
|
|
#include "sync0sync.h"
|
|
|
|
#include "sync0rw.h"
|
|
|
|
#include "mem0mem.h"
|
|
|
|
#include "rem0types.h"
|
|
|
|
#include "btr0types.h"
|
|
|
|
#include "ut0mem.h"
|
|
|
|
#include "ut0lst.h"
|
|
|
|
#include "hash0hash.h"
|
|
|
|
#include "ut0rnd.h"
|
|
|
|
#include "ut0byte.h"
|
|
|
|
#include "trx0types.h"
|
|
|
|
|
Applied innodb-5.1-ss269 snapshot.
Fixed BUGS:
#3300: "UPDATE statement with no index column in where condition locks
all rows"
Implement semi-consistent read to reduce lock conflicts at the cost
of breaking serializability.
ha_innobase::unlock_row(): reset the "did semi consistent read" flag
ha_innobase::was_semi_consistent_read(),
ha_innobase::try_semi_consistent_read(): new methods
row_prebuilt_t, row_create_prebuilt(): add field row_read_type for
keeping track of semi-consistent reads
row_vers_build_for_semi_consistent_read(),
row_sel_build_committed_vers_for_mysql(): new functions
row_search_for_mysql(): implement semi-consistent reads
#9802: "Foreign key checks disallow alter table".
Added test cases.
#12456: "Cursor shows incorrect data - DML does not affect,
probably caching"
This patch implements a high-granularity read view to be used with
cursors. In this high-granularity consistent read view modifications
done by the creating transaction after the cursor is created or
future transactions are not visible. But those modifications that
transaction did before the cursor was created are visible.
#12701: "Support >4GB buffer pool and log files on 64-bit Windows"
Do not call os_file_create_tmpfile() at runtime. Instead, create all
tempfiles at startup and guard access to them with mutexes.
#13778: "If FOREIGN_KEY_CHECKS=0, one can create inconsistent FOREIGN KEYs".
When FOREIGN_KEY_CHECKS=0 we still need to check that datatypes between
foreign key references are compatible.
#14189: "VARBINARY and BINARY variables: trailing space ignored with InnoDB"
innobase_init(): Assert that
DATA_MYSQL_BINARY_CHARSET_COLL == my_charset_bin.number.
dtype_get_pad_char(): Do not pad VARBINARY or BINARY columns.
row_ins_cascade_calc_update_vec(): Refuse ON UPDATE CASCADE when trying
to change the length of a VARBINARY column that refers to or is referenced
by a BINARY column. BINARY columns are no longer padded on comparison,
and thus they cannot be padded on storage either.
#14747: "Race condition can cause btr_search_drop_page_hash_index() to crash"
Note that buf_block_t::index should be protected by btr_search_latch
or an s-latch or x-latch on the index page.
btr_search_drop_page_hash_index(): Read block->index while holding
btr_search_latch and use the cached value in the loop. Remove some
redundant assertions.
#15108: "mysqld crashes when innodb_log_file_size is set > 4G"
#15308: "Problem of Order with Enum Column in Primary Key"
#15550: "mysqld crashes in printing a FOREIGN KEY error in InnoDB"
row_ins_foreign_report_add_err(): When printing the parent record,
use the index in the parent table rather than the index in the child table.
#15653: "Slow inserts to InnoDB if many thousands of .ibd files"
Keep track on unflushed modifications to file spaces. When there are tens
of thousands of file spaces, flushing all files in fil_flush_file_spaces()
would be very slow.
fil_flush_file_spaces(): Only flush unflushed file spaces.
fil_space_t, fil_system_t: Add a list of unflushed spaces.
#15991: "innodb-file-per-table + symlink database + rename = cr"
os_file_handle_error(): Map the error codes EXDEV, ENOTDIR, and EISDIR
to the new code OS_FILE_PATH_ERROR. Treat this code as OS_FILE_PATH_ERROR.
This fixes the crash on RENAME TABLE when the .ibd file is a symbolic link
to a different file system.
#16157: "InnoDB crashes when main location settings are empty"
This patch is from Heikki.
#16298: "InnoDB segfaults in INSERTs in upgrade of 4.0 -> 5.0 tables
with VARCHAR BINARY"
dict_load_columns(): Set the charset-collation code
DATA_MYSQL_BINARY_CHARSET_COLL for those binary string columns
that lack a charset-collation code, i.e., the tables were created
with an older version of MySQL/InnoDB than 4.1.2.
#16229: "MySQL/InnoDB uses full explicit table locks in trigger processing"
Take a InnoDB table lock only if user has explicitly requested a table
lock. Added some additional comments to store_lock() and external_lock().
#16387: "InnoDB crash when dropping a foreign key <table>_ibfk_0"
Do not mistake TABLENAME_ibfk_0 for auto-generated id.
dict_table_get_highest_foreign_id(): Ignore foreign constraint
identifiers starting with the pattern TABLENAME_ibfk_0.
#16582: "InnoDB: Error in an adaptive hash index pointer to page"
Account for a race condition when dropping the adaptive hash index
for a B-tree page.
btr_search_drop_page_hash_index(): Retry the operation if a hash index
with different parameters was built meanwhile. Add diagnostics for the
case that hash node pointers to the page remain.
btr_search_info_update_hash(), btr_search_info_update_slow():
Document the parameter "info" as in/out.
#16814: "SHOW INNODB STATUS format error in LATEST FOREIGN KEY ERROR
section"
Add a missing newline to the LAST FOREIGN KEY ERROR section in SHOW
INNODB STATUS output.
dict_foreign_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 unititialised values"
buf_block_init(): Reset magic_n, buf_fix_count and io_fix to avoid
testing uninitialized variables.
2006-03-10 19:22:21 +03:00
|
|
|
#ifndef UNIV_HOTBACKUP
|
2005-04-27 02:57:19 +03:00
|
|
|
/**********************************************************************
|
|
|
|
Makes all characters in a NUL-terminated UTF-8 string lower case. */
|
|
|
|
|
|
|
|
void
|
|
|
|
dict_casedn_str(
|
|
|
|
/*============*/
|
|
|
|
char* a); /* in/out: string to put in lower case */
|
Applied innodb-5.1-ss269 snapshot.
Fixed BUGS:
#3300: "UPDATE statement with no index column in where condition locks
all rows"
Implement semi-consistent read to reduce lock conflicts at the cost
of breaking serializability.
ha_innobase::unlock_row(): reset the "did semi consistent read" flag
ha_innobase::was_semi_consistent_read(),
ha_innobase::try_semi_consistent_read(): new methods
row_prebuilt_t, row_create_prebuilt(): add field row_read_type for
keeping track of semi-consistent reads
row_vers_build_for_semi_consistent_read(),
row_sel_build_committed_vers_for_mysql(): new functions
row_search_for_mysql(): implement semi-consistent reads
#9802: "Foreign key checks disallow alter table".
Added test cases.
#12456: "Cursor shows incorrect data - DML does not affect,
probably caching"
This patch implements a high-granularity read view to be used with
cursors. In this high-granularity consistent read view modifications
done by the creating transaction after the cursor is created or
future transactions are not visible. But those modifications that
transaction did before the cursor was created are visible.
#12701: "Support >4GB buffer pool and log files on 64-bit Windows"
Do not call os_file_create_tmpfile() at runtime. Instead, create all
tempfiles at startup and guard access to them with mutexes.
#13778: "If FOREIGN_KEY_CHECKS=0, one can create inconsistent FOREIGN KEYs".
When FOREIGN_KEY_CHECKS=0 we still need to check that datatypes between
foreign key references are compatible.
#14189: "VARBINARY and BINARY variables: trailing space ignored with InnoDB"
innobase_init(): Assert that
DATA_MYSQL_BINARY_CHARSET_COLL == my_charset_bin.number.
dtype_get_pad_char(): Do not pad VARBINARY or BINARY columns.
row_ins_cascade_calc_update_vec(): Refuse ON UPDATE CASCADE when trying
to change the length of a VARBINARY column that refers to or is referenced
by a BINARY column. BINARY columns are no longer padded on comparison,
and thus they cannot be padded on storage either.
#14747: "Race condition can cause btr_search_drop_page_hash_index() to crash"
Note that buf_block_t::index should be protected by btr_search_latch
or an s-latch or x-latch on the index page.
btr_search_drop_page_hash_index(): Read block->index while holding
btr_search_latch and use the cached value in the loop. Remove some
redundant assertions.
#15108: "mysqld crashes when innodb_log_file_size is set > 4G"
#15308: "Problem of Order with Enum Column in Primary Key"
#15550: "mysqld crashes in printing a FOREIGN KEY error in InnoDB"
row_ins_foreign_report_add_err(): When printing the parent record,
use the index in the parent table rather than the index in the child table.
#15653: "Slow inserts to InnoDB if many thousands of .ibd files"
Keep track on unflushed modifications to file spaces. When there are tens
of thousands of file spaces, flushing all files in fil_flush_file_spaces()
would be very slow.
fil_flush_file_spaces(): Only flush unflushed file spaces.
fil_space_t, fil_system_t: Add a list of unflushed spaces.
#15991: "innodb-file-per-table + symlink database + rename = cr"
os_file_handle_error(): Map the error codes EXDEV, ENOTDIR, and EISDIR
to the new code OS_FILE_PATH_ERROR. Treat this code as OS_FILE_PATH_ERROR.
This fixes the crash on RENAME TABLE when the .ibd file is a symbolic link
to a different file system.
#16157: "InnoDB crashes when main location settings are empty"
This patch is from Heikki.
#16298: "InnoDB segfaults in INSERTs in upgrade of 4.0 -> 5.0 tables
with VARCHAR BINARY"
dict_load_columns(): Set the charset-collation code
DATA_MYSQL_BINARY_CHARSET_COLL for those binary string columns
that lack a charset-collation code, i.e., the tables were created
with an older version of MySQL/InnoDB than 4.1.2.
#16229: "MySQL/InnoDB uses full explicit table locks in trigger processing"
Take a InnoDB table lock only if user has explicitly requested a table
lock. Added some additional comments to store_lock() and external_lock().
#16387: "InnoDB crash when dropping a foreign key <table>_ibfk_0"
Do not mistake TABLENAME_ibfk_0 for auto-generated id.
dict_table_get_highest_foreign_id(): Ignore foreign constraint
identifiers starting with the pattern TABLENAME_ibfk_0.
#16582: "InnoDB: Error in an adaptive hash index pointer to page"
Account for a race condition when dropping the adaptive hash index
for a B-tree page.
btr_search_drop_page_hash_index(): Retry the operation if a hash index
with different parameters was built meanwhile. Add diagnostics for the
case that hash node pointers to the page remain.
btr_search_info_update_hash(), btr_search_info_update_slow():
Document the parameter "info" as in/out.
#16814: "SHOW INNODB STATUS format error in LATEST FOREIGN KEY ERROR
section"
Add a missing newline to the LAST FOREIGN KEY ERROR section in SHOW
INNODB STATUS output.
dict_foreign_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 unititialised values"
buf_block_init(): Reset magic_n, buf_fix_count and io_fix to avoid
testing uninitialized variables.
2006-03-10 19:22:21 +03:00
|
|
|
#endif /* !UNIV_HOTBACKUP */
|
2004-02-09 01:32:00 +02:00
|
|
|
/************************************************************************
|
|
|
|
Get the database name length in a table name. */
|
|
|
|
|
|
|
|
ulint
|
|
|
|
dict_get_db_name_len(
|
|
|
|
/*=================*/
|
2004-04-01 16:51:34 +03:00
|
|
|
/* out: database name length */
|
|
|
|
const char* name); /* in: table name in the form
|
|
|
|
dbname '/' tablename */
|
2002-01-28 22:18:49 +02:00
|
|
|
/************************************************************************
|
2006-07-26 13:28:51 +04:00
|
|
|
Return the end of table name where we have removed dbname and '/'. */
|
|
|
|
|
|
|
|
const char*
|
|
|
|
dict_remove_db_name(
|
|
|
|
/*================*/
|
|
|
|
/* out: table name */
|
|
|
|
const char* name); /* in: table name in the form
|
|
|
|
dbname '/' tablename */
|
|
|
|
/************************************************************************
|
2002-01-28 22:18:49 +02:00
|
|
|
Decrements the count of open MySQL handles to a table. */
|
|
|
|
|
|
|
|
void
|
|
|
|
dict_table_decrement_handle_count(
|
|
|
|
/*==============================*/
|
|
|
|
dict_table_t* table); /* in: table */
|
2001-02-17 14:19:19 +02:00
|
|
|
/**************************************************************************
|
|
|
|
Inits the data dictionary module. */
|
|
|
|
|
|
|
|
void
|
|
|
|
dict_init(void);
|
|
|
|
/*===========*/
|
2003-10-07 17:28:59 +03:00
|
|
|
/************************************************************************
|
|
|
|
Gets the space id of every table of the data dictionary and makes a linear
|
|
|
|
list and a hash table of them to the data dictionary cache. This function
|
|
|
|
can be called at database startup if we did not need to do a crash recovery.
|
|
|
|
In crash recovery we must scan the space id's from the .ibd files in MySQL
|
|
|
|
database directories. */
|
|
|
|
|
|
|
|
void
|
|
|
|
dict_load_space_id_list(void);
|
|
|
|
/*=========================*/
|
2001-02-17 14:19:19 +02:00
|
|
|
/*************************************************************************
|
|
|
|
Gets the column data type. */
|
|
|
|
UNIV_INLINE
|
2006-09-21 01:39:09 -06:00
|
|
|
void
|
|
|
|
dict_col_copy_type(
|
|
|
|
/*===============*/
|
|
|
|
const dict_col_t* col, /* in: column */
|
|
|
|
dtype_t* type); /* out: data type */
|
|
|
|
/*************************************************************************
|
|
|
|
Gets the column data type. */
|
|
|
|
|
|
|
|
void
|
|
|
|
dict_col_copy_type_noninline(
|
|
|
|
/*=========================*/
|
|
|
|
const dict_col_t* col, /* in: column */
|
|
|
|
dtype_t* type); /* out: data type */
|
|
|
|
/***************************************************************************
|
|
|
|
Returns the minimum size of the column. */
|
|
|
|
UNIV_INLINE
|
|
|
|
ulint
|
|
|
|
dict_col_get_min_size(
|
|
|
|
/*==================*/
|
|
|
|
/* out: minimum size */
|
|
|
|
const dict_col_t* col); /* in: column */
|
|
|
|
/***************************************************************************
|
|
|
|
Returns the maximum size of the column. */
|
|
|
|
UNIV_INLINE
|
|
|
|
ulint
|
|
|
|
dict_col_get_max_size(
|
|
|
|
/*==================*/
|
|
|
|
/* out: maximum size */
|
|
|
|
const dict_col_t* col); /* in: column */
|
|
|
|
/***************************************************************************
|
|
|
|
Returns the size of a fixed size column, 0 if not a fixed size column. */
|
|
|
|
UNIV_INLINE
|
|
|
|
ulint
|
|
|
|
dict_col_get_fixed_size(
|
|
|
|
/*====================*/
|
|
|
|
/* out: fixed size, or 0 */
|
|
|
|
const dict_col_t* col); /* in: column */
|
|
|
|
/***************************************************************************
|
|
|
|
Returns the ROW_FORMAT=REDUNDANT stored SQL NULL size of a column.
|
|
|
|
For fixed length types it is the fixed length of the type, otherwise 0. */
|
|
|
|
UNIV_INLINE
|
|
|
|
ulint
|
|
|
|
dict_col_get_sql_null_size(
|
|
|
|
/*=======================*/
|
|
|
|
/* out: SQL null storage size
|
|
|
|
in ROW_FORMAT=REDUNDANT */
|
|
|
|
const dict_col_t* col); /* in: column */
|
|
|
|
|
2001-02-17 14:19:19 +02:00
|
|
|
/*************************************************************************
|
|
|
|
Gets the column number. */
|
|
|
|
UNIV_INLINE
|
|
|
|
ulint
|
|
|
|
dict_col_get_no(
|
|
|
|
/*============*/
|
2006-09-21 01:39:09 -06:00
|
|
|
const dict_col_t* col);
|
2001-02-17 14:19:19 +02:00
|
|
|
/*************************************************************************
|
|
|
|
Gets the column position in the clustered index. */
|
|
|
|
UNIV_INLINE
|
|
|
|
ulint
|
|
|
|
dict_col_get_clust_pos(
|
|
|
|
/*===================*/
|
2006-09-21 01:39:09 -06:00
|
|
|
const dict_col_t* col, /* in: table column */
|
|
|
|
const dict_index_t* clust_index); /* in: clustered index */
|
|
|
|
/*************************************************************************
|
|
|
|
Gets the column position in the clustered index. */
|
|
|
|
|
|
|
|
ulint
|
|
|
|
dict_col_get_clust_pos_noninline(
|
|
|
|
/*=============================*/
|
|
|
|
const dict_col_t* col, /* in: table column */
|
|
|
|
const dict_index_t* clust_index); /* in: clustered index */
|
Applied innodb-5.1-ss475 snapshot.
* Fix BUG#15650: "DELETE with LEFT JOIN crashes server with innodb_locks_unsafe_for binlog"
* Fix BUG#17134: "Partitions: uncommitted changes are visible"
* Fix BUG#17992: "Partitions: InnoDB, somehow rotten table after UPDATE"
row0ins.c: MySQL's partitioned table code does not set preduilt->sql_stat_start right
if it does an insert in the same statement after doing a search first in the same
partition table. We now write trx id always to the buffer, not just when flag
sql_stat_start is on. This will waste CPU time very sightly.
* Fix BUG#18077: "InnoDB uses full explicit table locks in stored FUNCTION"
* Fix BUG#18238: "When locks exhaust the buffer pool, InnoDB does not roll back the trx"
* Fix BUG#18252" "Disk space leak in updates of InnoDB BLOB rows in 5.0 and 5.1"
* Fix BUG#18283: "When InnoDB returns error 'lock table full', MySQL can write to binlog too much"
* Fix BUG#18350: "Use consistent read in CREATE ... SELECT ... if innodb_locks_unsafe_for_binlog"
* Fix BUG#18384: "InnoDB memory leak on duplicate key errors in 5.0 if row has many columns"
* Fix BUG#18934: "InnoDB crashes when table uses column names like DB_ROW_ID"
Refuse tables that use reserved column names.
* InnoDB's SQL parser:
- Add support for UNSIGNED types, EXIT keyword, quoted identifiers, user-function callbacks
for processing results of FETCH statements, bound literals, DATA_VARCHAR for bound literals.
- Allow bound literals of type non-INTEGER to be of length 0.
- Add make_flex.sh and update lexer/parser generation documentation.
- Add comment clarifying the difference between 'alias' and 'indirection' fields in sym_node_t.
- Remove never reached duplicate code in pars_set_dfield_type().
- Rewrite pars_info datatypes and APIs, add a few helper functions.
- Since the functions definitions in pars_info_t are accessed after pars_sql() returns
in the query graph execution stage, we can't free pars_info_t in pars_sql(). Instead,
make pars_sql() transfer ownership of pars_info_t to the created query graph, and
make que_graph_free() free it if needed.
- Allow access to system columns like DB_ROW_ID.
* Use bound literals in row_truncate_table_for_mysql, row_drop_table_for_mysql,
row_discard_tablespace_for_mysql, and row_rename_table_for_mysql.
* Setting an isolation level of the transaction to read committed weakens the locks for
this session similarly like the option innodb_locks_unsafe_for binlog. This patch removes
alnost all gap locking (used in next-key locking) and makes MySQL to release the row locks
on the rows which does not belong to result set. Additionally, nonlocking selects on
INSERT INTO SELECT, UPDATE ... (SELECT ...), and CREATE ... SELECT ... use a nonlocking
consistent read. If a binlog is used, then binlog format should be set to row based
binloging to make the execution of the complex SQL statements.
* Disable the statistic variables btr_search_n_hash_fail and n_hash_succ, n_hash_fail,
n_patt_succ, and n_searches of btr_search_t in builds without #ifdef UNIV_SEARCH_PERF_STAT.
* Make innodb.test faster. Group all consistent read test cases to a one test case and
wait their lock timeout after all have been send to the server. Decrease amount of rows
inserted in a certain test - this has no effect on the effectiveness of the test and
reduces the running time by ~10 sec. Remove temporary work-arounds from innodb.result
now that ALTER TABLE DROP FOREIGN KEY works once again.
* Make innodb_unsafe_binlog.test faster. Grout all consistent read test cases to a one
test case amd wait their lock timeout after all have been sent to the server. Remove
unnecessary option --loose_innodb_lock_wait_timeout.
* Print dictionary memory size in SHOW INNODB STATUS.
* Fix memory leaks in row_create_table_for_mysql() in rare corner cases.
* Remove code related to clustered tables. They were never implemented, and the
implementation would be challenging with ROW_FORMAT=COMPACT. Remove the table types
DICT_TABLE_CLUSTER_MEMBER and DICT_TABLE_CLUSTER and all related tests and functions.
dict_table_t: Remove mix_id, mix_len, mix_id_len, mix_id_buf, and cluster_name.
plan_t: Remove mixed_index.
dict_create_sys_tables_tuple(): Set MIX_ID=0, MIX_LEN=0, CLUSTER_NAME=NULL when
inserting into SYS_TABLES.
dict_tree_check_search_tuple(): Enclose in #ifdef UNIV_DEBUG.
* Move calling of thr_local_free() from trx_free_for_mysql() to
innobase_close_connection().
2006-04-23 12:48:31 +04:00
|
|
|
/********************************************************************
|
|
|
|
If the given column name is reserved for InnoDB system columns, return
|
|
|
|
TRUE. */
|
|
|
|
|
|
|
|
ibool
|
|
|
|
dict_col_name_is_reserved(
|
|
|
|
/*======================*/
|
|
|
|
/* out: TRUE if name is reserved */
|
|
|
|
const char* name); /* in: column name */
|
2001-05-21 19:04:46 +03:00
|
|
|
/************************************************************************
|
2002-07-31 00:47:20 +03:00
|
|
|
Initializes the autoinc counter. It is not an error to initialize an already
|
2001-05-21 19:04:46 +03:00
|
|
|
initialized counter. */
|
|
|
|
|
|
|
|
void
|
|
|
|
dict_table_autoinc_initialize(
|
|
|
|
/*==========================*/
|
|
|
|
dict_table_t* table, /* in: table */
|
2002-07-31 00:47:20 +03:00
|
|
|
ib_longlong value); /* in: next value to assign to a row */
|
2001-05-21 19:04:46 +03:00
|
|
|
/************************************************************************
|
2002-07-31 00:47:20 +03:00
|
|
|
Gets the next autoinc value (== autoinc counter value), 0 if not yet
|
|
|
|
initialized. If initialized, increments the counter by 1. */
|
2001-05-21 19:04:46 +03:00
|
|
|
|
|
|
|
ib_longlong
|
|
|
|
dict_table_autoinc_get(
|
|
|
|
/*===================*/
|
|
|
|
/* out: value for a new row, or 0 */
|
|
|
|
dict_table_t* table); /* in: table */
|
|
|
|
/************************************************************************
|
2002-09-04 18:53:48 +02:00
|
|
|
Decrements the autoinc counter value by 1. */
|
2002-03-21 18:03:09 +02:00
|
|
|
|
2002-09-04 18:53:48 +02:00
|
|
|
void
|
|
|
|
dict_table_autoinc_decrement(
|
|
|
|
/*=========================*/
|
2002-03-21 18:03:09 +02:00
|
|
|
dict_table_t* table); /* in: table */
|
|
|
|
/************************************************************************
|
2002-09-04 19:01:39 +02:00
|
|
|
Reads the next autoinc value (== autoinc counter value), 0 if not yet
|
|
|
|
initialized. */
|
|
|
|
|
|
|
|
ib_longlong
|
|
|
|
dict_table_autoinc_read(
|
|
|
|
/*====================*/
|
|
|
|
/* out: value for a new row, or 0 */
|
|
|
|
dict_table_t* table); /* in: table */
|
|
|
|
/************************************************************************
|
2002-07-31 00:47:20 +03:00
|
|
|
Peeks the autoinc counter value, 0 if not yet initialized. Does not
|
|
|
|
increment the counter. The read not protected by any mutex! */
|
|
|
|
|
|
|
|
ib_longlong
|
|
|
|
dict_table_autoinc_peek(
|
|
|
|
/*====================*/
|
|
|
|
/* out: value of the counter */
|
|
|
|
dict_table_t* table); /* in: table */
|
|
|
|
/************************************************************************
|
|
|
|
Updates the autoinc counter if the value supplied is equal or bigger than the
|
2001-05-21 19:04:46 +03:00
|
|
|
current value. If not inited, does nothing. */
|
|
|
|
|
|
|
|
void
|
|
|
|
dict_table_autoinc_update(
|
|
|
|
/*======================*/
|
2002-07-31 00:47:20 +03:00
|
|
|
|
2001-05-21 19:04:46 +03:00
|
|
|
dict_table_t* table, /* in: table */
|
|
|
|
ib_longlong value); /* in: value which was assigned to a row */
|
2001-02-17 14:19:19 +02:00
|
|
|
/**************************************************************************
|
|
|
|
Adds a table object to the dictionary cache. */
|
|
|
|
|
|
|
|
void
|
|
|
|
dict_table_add_to_cache(
|
|
|
|
/*====================*/
|
|
|
|
dict_table_t* table); /* in: table */
|
|
|
|
/**************************************************************************
|
|
|
|
Removes a table object from the dictionary cache. */
|
|
|
|
|
|
|
|
void
|
|
|
|
dict_table_remove_from_cache(
|
|
|
|
/*=========================*/
|
|
|
|
dict_table_t* table); /* in, own: table */
|
|
|
|
/**************************************************************************
|
|
|
|
Renames a table object. */
|
|
|
|
|
|
|
|
ibool
|
|
|
|
dict_table_rename_in_cache(
|
|
|
|
/*=======================*/
|
|
|
|
/* out: TRUE if success */
|
|
|
|
dict_table_t* table, /* in: table */
|
2004-05-17 14:40:31 +03:00
|
|
|
const char* new_name, /* in: new name */
|
2002-03-21 18:03:09 +02:00
|
|
|
ibool rename_also_foreigns);/* in: in ALTER TABLE we want
|
|
|
|
to preserve the original table name
|
|
|
|
in constraints which reference it */
|
2001-02-17 14:19:19 +02:00
|
|
|
/**************************************************************************
|
2003-10-07 17:28:59 +03:00
|
|
|
Change the id of a table object in the dictionary cache. This is used in
|
|
|
|
DISCARD TABLESPACE. */
|
|
|
|
|
|
|
|
void
|
|
|
|
dict_table_change_id_in_cache(
|
|
|
|
/*==========================*/
|
|
|
|
dict_table_t* table, /* in: table object already in cache */
|
|
|
|
dulint new_id);/* in: new id to set */
|
|
|
|
/**************************************************************************
|
2001-10-10 22:47:08 +03:00
|
|
|
Adds a foreign key constraint object to the dictionary cache. May free
|
|
|
|
the object if there already is an object with the same identifier in.
|
|
|
|
At least one of foreign table or referenced table must already be in
|
|
|
|
the dictionary cache! */
|
|
|
|
|
|
|
|
ulint
|
|
|
|
dict_foreign_add_to_cache(
|
|
|
|
/*======================*/
|
|
|
|
/* out: DB_SUCCESS or error code */
|
2005-04-12 16:12:34 +03:00
|
|
|
dict_foreign_t* foreign, /* in, own: foreign key constraint */
|
Applied innodb-5.1-ss269 snapshot.
Fixed BUGS:
#3300: "UPDATE statement with no index column in where condition locks
all rows"
Implement semi-consistent read to reduce lock conflicts at the cost
of breaking serializability.
ha_innobase::unlock_row(): reset the "did semi consistent read" flag
ha_innobase::was_semi_consistent_read(),
ha_innobase::try_semi_consistent_read(): new methods
row_prebuilt_t, row_create_prebuilt(): add field row_read_type for
keeping track of semi-consistent reads
row_vers_build_for_semi_consistent_read(),
row_sel_build_committed_vers_for_mysql(): new functions
row_search_for_mysql(): implement semi-consistent reads
#9802: "Foreign key checks disallow alter table".
Added test cases.
#12456: "Cursor shows incorrect data - DML does not affect,
probably caching"
This patch implements a high-granularity read view to be used with
cursors. In this high-granularity consistent read view modifications
done by the creating transaction after the cursor is created or
future transactions are not visible. But those modifications that
transaction did before the cursor was created are visible.
#12701: "Support >4GB buffer pool and log files on 64-bit Windows"
Do not call os_file_create_tmpfile() at runtime. Instead, create all
tempfiles at startup and guard access to them with mutexes.
#13778: "If FOREIGN_KEY_CHECKS=0, one can create inconsistent FOREIGN KEYs".
When FOREIGN_KEY_CHECKS=0 we still need to check that datatypes between
foreign key references are compatible.
#14189: "VARBINARY and BINARY variables: trailing space ignored with InnoDB"
innobase_init(): Assert that
DATA_MYSQL_BINARY_CHARSET_COLL == my_charset_bin.number.
dtype_get_pad_char(): Do not pad VARBINARY or BINARY columns.
row_ins_cascade_calc_update_vec(): Refuse ON UPDATE CASCADE when trying
to change the length of a VARBINARY column that refers to or is referenced
by a BINARY column. BINARY columns are no longer padded on comparison,
and thus they cannot be padded on storage either.
#14747: "Race condition can cause btr_search_drop_page_hash_index() to crash"
Note that buf_block_t::index should be protected by btr_search_latch
or an s-latch or x-latch on the index page.
btr_search_drop_page_hash_index(): Read block->index while holding
btr_search_latch and use the cached value in the loop. Remove some
redundant assertions.
#15108: "mysqld crashes when innodb_log_file_size is set > 4G"
#15308: "Problem of Order with Enum Column in Primary Key"
#15550: "mysqld crashes in printing a FOREIGN KEY error in InnoDB"
row_ins_foreign_report_add_err(): When printing the parent record,
use the index in the parent table rather than the index in the child table.
#15653: "Slow inserts to InnoDB if many thousands of .ibd files"
Keep track on unflushed modifications to file spaces. When there are tens
of thousands of file spaces, flushing all files in fil_flush_file_spaces()
would be very slow.
fil_flush_file_spaces(): Only flush unflushed file spaces.
fil_space_t, fil_system_t: Add a list of unflushed spaces.
#15991: "innodb-file-per-table + symlink database + rename = cr"
os_file_handle_error(): Map the error codes EXDEV, ENOTDIR, and EISDIR
to the new code OS_FILE_PATH_ERROR. Treat this code as OS_FILE_PATH_ERROR.
This fixes the crash on RENAME TABLE when the .ibd file is a symbolic link
to a different file system.
#16157: "InnoDB crashes when main location settings are empty"
This patch is from Heikki.
#16298: "InnoDB segfaults in INSERTs in upgrade of 4.0 -> 5.0 tables
with VARCHAR BINARY"
dict_load_columns(): Set the charset-collation code
DATA_MYSQL_BINARY_CHARSET_COLL for those binary string columns
that lack a charset-collation code, i.e., the tables were created
with an older version of MySQL/InnoDB than 4.1.2.
#16229: "MySQL/InnoDB uses full explicit table locks in trigger processing"
Take a InnoDB table lock only if user has explicitly requested a table
lock. Added some additional comments to store_lock() and external_lock().
#16387: "InnoDB crash when dropping a foreign key <table>_ibfk_0"
Do not mistake TABLENAME_ibfk_0 for auto-generated id.
dict_table_get_highest_foreign_id(): Ignore foreign constraint
identifiers starting with the pattern TABLENAME_ibfk_0.
#16582: "InnoDB: Error in an adaptive hash index pointer to page"
Account for a race condition when dropping the adaptive hash index
for a B-tree page.
btr_search_drop_page_hash_index(): Retry the operation if a hash index
with different parameters was built meanwhile. Add diagnostics for the
case that hash node pointers to the page remain.
btr_search_info_update_hash(), btr_search_info_update_slow():
Document the parameter "info" as in/out.
#16814: "SHOW INNODB STATUS format error in LATEST FOREIGN KEY ERROR
section"
Add a missing newline to the LAST FOREIGN KEY ERROR section in SHOW
INNODB STATUS output.
dict_foreign_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 unititialised values"
buf_block_init(): Reset magic_n, buf_fix_count and io_fix to avoid
testing uninitialized variables.
2006-03-10 19:22:21 +03:00
|
|
|
ibool check_charsets);/* in: TRUE=check charset
|
|
|
|
compatibility */
|
2001-10-10 22:47:08 +03:00
|
|
|
/*************************************************************************
|
2004-02-09 23:57:29 +02:00
|
|
|
Checks if a table is referenced by foreign keys. */
|
|
|
|
|
|
|
|
ibool
|
|
|
|
dict_table_referenced_by_foreign_key(
|
|
|
|
/*=================================*/
|
|
|
|
/* out: TRUE if table is referenced by a
|
|
|
|
foreign key */
|
|
|
|
dict_table_t* table); /* in: InnoDB table */
|
Applied innodb-5.1-ss594 snapshot.
Fixed BUG#19542 "InnoDB doesn't increase the Handler_read_prev couter".
Fixed BUG#19609 "Case sensitivity of innodb_data_file_path gives stupid error".
Fixed BUG#19727 "InnoDB crashed server and crashed tables are ot recoverable".
Also:
* Remove remnants of the obsolete concept of memoryfixing tables and indexes.
* Remove unused dict_table_LRU_trim().
* Remove unused 'trx' parameter from dict_table_get_on_id_low(),
dict_table_get(), dict_table_get_and_increment_handle_count().
* Add a normal linked list implementation.
* Add a work queue implementation.
* Add 'level' parameter to mutex_create() and rw_lock_create().
Remove mutex_set_level() and rw_lock_set_level().
* Rename SYNC_LEVEL_NONE to SYNC_LEVEL_VARYING.
* Add support for bound ids in InnoDB's parser.
* Define UNIV_BTR_DEBUG for enabling consistency checks of
FIL_PAGE_NEXT and FIL_PAGE_PREV when accessing sibling
pages of B-tree indexes.
btr_validate_level(): Check the validity of the doubly linked
list formed by FIL_PAGE_NEXT and FIL_PAGE_PREV.
* Adapt InnoDB to the new tablename to filename encoding in MySQL 5.1.
ut_print_name(), ut_print_name1(): Add parameter 'table_id' for
distinguishing names of tables from other identifiers.
New: innobase_convert_from_table_id(), innobase_convert_from_id(),
innobase_convert_from_filename(), innobase_get_charset.
dict_accept(), dict_scan_id(), dict_scan_col(), dict_scan_table_name(),
dict_skip_word(), dict_create_foreign_constraints_low(): Add
parameter 'cs' so that isspace() can be replaced with my_isspace(),
whose operation depends on the connection character set.
dict_scan_id(): Convert identifier to UTF-8.
dict_str_starts_with_keyword(): New extern function, to replace
dict_accept() in row_search_for_mysql().
mysql_get_identifier_quote_char(): Replaced with innobase_print_identifier().
ha_innobase::create(): Remove the thd->convert_strin() call. Pass the
statement to InnoDB in the connection character set and let InnoDB
convert the identifier to UTF-8.
* Add max_row_size to dict_table_t.
* btr0cur.c
btr_copy_externally_stored_field(): Only set the 'offset' variable
when needed.
* buf0buf.c
buf_page_io_complete(): Write to the error log if the page number or
the space id o the disk do not match those in memory. Also write to
the error log if a page was read from the doublewrite buffer. The
doublewrite buffer should be only read by the lower-level function
fil_io() at database startup.
* dict0dict.c
dict_scan_table_name(): Remove fallback to differently encoded name
when the table is not found. The encoding is handled at a higher level.
* ha_innodb.cc
Increment statistic counter in ha_innobase::index_prev() (bug 19542).
Add innobase_convert_string wrapper function and a new file
ha_prototypes.h.
innobase_print_identifier(): Remove TODO comment before calling
get_quote_char_for_identifier(). That function apparently assumes
the identifier to be encoded in UTF-8.
* ibuf0ibuf.c|h
ibuf_count_get(), ibuf_counts[], ibuf_count_inited(): Define these
only #ifdef UNIV_IBUF_DEBUG. Previously, when compiled without
UNIV_IBUF_DEBUG, invoking ibuf_count_get() would crash InnoDB.
The function is only being called #ifdef UNIV_IBUF_DEBUG.
* innodb.result
Adjust the results for changes in the foreign key error messages.
* mem0mem.c|h
New: mem_heap_dup(), mem_heap_printf(), mem_heap_cat().
* os0file.c
Check the page trailers also after writing to disk. This improves
chances of diagnosing bug 18886.
os_file_check_page_trailers(): New function for checking that the
two copies of the LSN stamped on the page match.
os_aio_simulated_handle(): Call os_file_check_page_trailers()
before and after os_file_write().
* row0mysql.c
Move trx_commit_for_mysql(trx) calls before calls to
row_mysql_unlock_data_dictionary(trx) (bug 19727).
* row0sel.c
row_fetch_print(): Handle SQL NULL values without crashing.
row_sel_store_mysql_rec(): Remove useless call to rec_get_nth_field
when handling an externally stored column.
Fetch externally stored fields when using InnoDB's internal SQL
parser.
Optimize BLOB selects by using prebuilt->blob_heap directly instead
of first reading BLOB data to a temporary heap and then copying it
to prebuilt->blob_heap.
* srv0srv.c
srv_master_thread(): Remove unreachable code.
* srv0start.c
srv_parse_data_file_paths_and_sizes(): Accept lower-case 'm' and
'g' as abbreviations of megabyte and gigabyte (bug 19609).
srv_parse_megabytes(): New fuction.
* ut0dbg.c|h
Implement InnoDB assertions (ut_a and ut_error) with abort() when
the code is compiled with GCC 3 or later on other platforms than
Windows or Netware. Also disable the variable ut_dbg_stop_threads
and the function ut_dbg_stop_thread() i this case, unless
UNIV_SYC_DEBUG is defined. This should allow the compiler to
generate more compact code for assertions.
* ut0list.c|h
Add ib_list_create_heap().
2006-06-01 10:34:04 +04:00
|
|
|
/**************************************************************************
|
|
|
|
Determines whether a string starts with the specified keyword. */
|
|
|
|
|
|
|
|
ibool
|
|
|
|
dict_str_starts_with_keyword(
|
|
|
|
/*=========================*/
|
|
|
|
/* out: TRUE if str starts
|
|
|
|
with keyword */
|
|
|
|
void* mysql_thd, /* in: MySQL thread handle */
|
|
|
|
const char* str, /* in: string to scan for keyword */
|
|
|
|
const char* keyword); /* in: keyword to look for */
|
2004-02-09 23:57:29 +02:00
|
|
|
/*************************************************************************
|
2001-10-10 22:47:08 +03:00
|
|
|
Scans a table create SQL string and adds to the data dictionary
|
|
|
|
the foreign key constraints declared in the string. This function
|
|
|
|
should be called after the indexes for a table have been created.
|
|
|
|
Each foreign key constraint must be accompanied with indexes in
|
|
|
|
bot participating tables. The indexes are allowed to contain more
|
|
|
|
fields than mentioned in the constraint. */
|
|
|
|
|
|
|
|
ulint
|
|
|
|
dict_create_foreign_constraints(
|
|
|
|
/*============================*/
|
2004-05-17 14:40:31 +03:00
|
|
|
/* out: error code or DB_SUCCESS */
|
|
|
|
trx_t* trx, /* in: transaction */
|
|
|
|
const char* sql_string, /* in: table create statement where
|
|
|
|
foreign keys are declared like:
|
|
|
|
FOREIGN KEY (a, b) REFERENCES
|
|
|
|
table2(c, d), table2 can be written
|
|
|
|
also with the database
|
|
|
|
name before it: test.table2; the
|
|
|
|
default database id the database of
|
|
|
|
parameter name */
|
2005-09-06 14:38:21 +03:00
|
|
|
const char* name, /* in: table full name in the
|
2004-05-17 14:40:31 +03:00
|
|
|
normalized form
|
|
|
|
database_name/table_name */
|
2005-09-06 14:38:21 +03:00
|
|
|
ibool reject_fks); /* in: if TRUE, fail with error
|
|
|
|
code DB_CANNOT_ADD_CONSTRAINT if
|
|
|
|
any foreign keys are found. */
|
2001-10-10 22:47:08 +03:00
|
|
|
/**************************************************************************
|
2003-04-16 16:45:01 +03:00
|
|
|
Parses the CONSTRAINT id's to be dropped in an ALTER TABLE statement. */
|
|
|
|
|
|
|
|
ulint
|
|
|
|
dict_foreign_parse_drop_constraints(
|
|
|
|
/*================================*/
|
|
|
|
/* out: DB_SUCCESS or
|
|
|
|
DB_CANNOT_DROP_CONSTRAINT if
|
|
|
|
syntax error or the constraint
|
|
|
|
id does not match */
|
|
|
|
mem_heap_t* heap, /* in: heap from which we can
|
|
|
|
allocate memory */
|
|
|
|
trx_t* trx, /* in: transaction */
|
|
|
|
dict_table_t* table, /* in: table */
|
|
|
|
ulint* n, /* out: number of constraints
|
|
|
|
to drop */
|
2004-04-01 16:51:34 +03:00
|
|
|
const char*** constraints_to_drop); /* out: id's of the
|
2003-04-16 16:45:01 +03:00
|
|
|
constraints to drop */
|
|
|
|
/**************************************************************************
|
2007-01-04 19:51:34 -07:00
|
|
|
Returns a table object and optionally increment its MySQL open handle count.
|
|
|
|
NOTE! This is a high-level function to be used mainly from outside the
|
|
|
|
'dict' directory. Inside this directory dict_table_get_low is usually the
|
|
|
|
appropriate function. */
|
2001-02-17 14:19:19 +02:00
|
|
|
|
|
|
|
dict_table_t*
|
|
|
|
dict_table_get(
|
|
|
|
/*===========*/
|
2004-05-17 14:40:31 +03:00
|
|
|
/* out: table, NULL if
|
|
|
|
does not exist */
|
2007-01-04 19:51:34 -07:00
|
|
|
const char* table_name, /* in: table name */
|
|
|
|
ibool inc_mysql_count);
|
|
|
|
/* in: whether to increment the open
|
|
|
|
handle count on the table */
|
2002-02-14 10:24:27 +02:00
|
|
|
/**************************************************************************
|
Applied innodb-5.1-ss594 snapshot.
Fixed BUG#19542 "InnoDB doesn't increase the Handler_read_prev couter".
Fixed BUG#19609 "Case sensitivity of innodb_data_file_path gives stupid error".
Fixed BUG#19727 "InnoDB crashed server and crashed tables are ot recoverable".
Also:
* Remove remnants of the obsolete concept of memoryfixing tables and indexes.
* Remove unused dict_table_LRU_trim().
* Remove unused 'trx' parameter from dict_table_get_on_id_low(),
dict_table_get(), dict_table_get_and_increment_handle_count().
* Add a normal linked list implementation.
* Add a work queue implementation.
* Add 'level' parameter to mutex_create() and rw_lock_create().
Remove mutex_set_level() and rw_lock_set_level().
* Rename SYNC_LEVEL_NONE to SYNC_LEVEL_VARYING.
* Add support for bound ids in InnoDB's parser.
* Define UNIV_BTR_DEBUG for enabling consistency checks of
FIL_PAGE_NEXT and FIL_PAGE_PREV when accessing sibling
pages of B-tree indexes.
btr_validate_level(): Check the validity of the doubly linked
list formed by FIL_PAGE_NEXT and FIL_PAGE_PREV.
* Adapt InnoDB to the new tablename to filename encoding in MySQL 5.1.
ut_print_name(), ut_print_name1(): Add parameter 'table_id' for
distinguishing names of tables from other identifiers.
New: innobase_convert_from_table_id(), innobase_convert_from_id(),
innobase_convert_from_filename(), innobase_get_charset.
dict_accept(), dict_scan_id(), dict_scan_col(), dict_scan_table_name(),
dict_skip_word(), dict_create_foreign_constraints_low(): Add
parameter 'cs' so that isspace() can be replaced with my_isspace(),
whose operation depends on the connection character set.
dict_scan_id(): Convert identifier to UTF-8.
dict_str_starts_with_keyword(): New extern function, to replace
dict_accept() in row_search_for_mysql().
mysql_get_identifier_quote_char(): Replaced with innobase_print_identifier().
ha_innobase::create(): Remove the thd->convert_strin() call. Pass the
statement to InnoDB in the connection character set and let InnoDB
convert the identifier to UTF-8.
* Add max_row_size to dict_table_t.
* btr0cur.c
btr_copy_externally_stored_field(): Only set the 'offset' variable
when needed.
* buf0buf.c
buf_page_io_complete(): Write to the error log if the page number or
the space id o the disk do not match those in memory. Also write to
the error log if a page was read from the doublewrite buffer. The
doublewrite buffer should be only read by the lower-level function
fil_io() at database startup.
* dict0dict.c
dict_scan_table_name(): Remove fallback to differently encoded name
when the table is not found. The encoding is handled at a higher level.
* ha_innodb.cc
Increment statistic counter in ha_innobase::index_prev() (bug 19542).
Add innobase_convert_string wrapper function and a new file
ha_prototypes.h.
innobase_print_identifier(): Remove TODO comment before calling
get_quote_char_for_identifier(). That function apparently assumes
the identifier to be encoded in UTF-8.
* ibuf0ibuf.c|h
ibuf_count_get(), ibuf_counts[], ibuf_count_inited(): Define these
only #ifdef UNIV_IBUF_DEBUG. Previously, when compiled without
UNIV_IBUF_DEBUG, invoking ibuf_count_get() would crash InnoDB.
The function is only being called #ifdef UNIV_IBUF_DEBUG.
* innodb.result
Adjust the results for changes in the foreign key error messages.
* mem0mem.c|h
New: mem_heap_dup(), mem_heap_printf(), mem_heap_cat().
* os0file.c
Check the page trailers also after writing to disk. This improves
chances of diagnosing bug 18886.
os_file_check_page_trailers(): New function for checking that the
two copies of the LSN stamped on the page match.
os_aio_simulated_handle(): Call os_file_check_page_trailers()
before and after os_file_write().
* row0mysql.c
Move trx_commit_for_mysql(trx) calls before calls to
row_mysql_unlock_data_dictionary(trx) (bug 19727).
* row0sel.c
row_fetch_print(): Handle SQL NULL values without crashing.
row_sel_store_mysql_rec(): Remove useless call to rec_get_nth_field
when handling an externally stored column.
Fetch externally stored fields when using InnoDB's internal SQL
parser.
Optimize BLOB selects by using prebuilt->blob_heap directly instead
of first reading BLOB data to a temporary heap and then copying it
to prebuilt->blob_heap.
* srv0srv.c
srv_master_thread(): Remove unreachable code.
* srv0start.c
srv_parse_data_file_paths_and_sizes(): Accept lower-case 'm' and
'g' as abbreviations of megabyte and gigabyte (bug 19609).
srv_parse_megabytes(): New fuction.
* ut0dbg.c|h
Implement InnoDB assertions (ut_a and ut_error) with abort() when
the code is compiled with GCC 3 or later on other platforms than
Windows or Netware. Also disable the variable ut_dbg_stop_threads
and the function ut_dbg_stop_thread() i this case, unless
UNIV_SYC_DEBUG is defined. This should allow the compiler to
generate more compact code for assertions.
* ut0list.c|h
Add ib_list_create_heap().
2006-06-01 10:34:04 +04:00
|
|
|
Returns a table object based on table id. */
|
2001-02-17 14:19:19 +02:00
|
|
|
|
|
|
|
dict_table_t*
|
|
|
|
dict_table_get_on_id(
|
|
|
|
/*=================*/
|
|
|
|
/* out: table, NULL if does not exist */
|
|
|
|
dulint table_id, /* in: table id */
|
|
|
|
trx_t* trx); /* in: transaction handle */
|
|
|
|
/**************************************************************************
|
Applied innodb-5.1-ss594 snapshot.
Fixed BUG#19542 "InnoDB doesn't increase the Handler_read_prev couter".
Fixed BUG#19609 "Case sensitivity of innodb_data_file_path gives stupid error".
Fixed BUG#19727 "InnoDB crashed server and crashed tables are ot recoverable".
Also:
* Remove remnants of the obsolete concept of memoryfixing tables and indexes.
* Remove unused dict_table_LRU_trim().
* Remove unused 'trx' parameter from dict_table_get_on_id_low(),
dict_table_get(), dict_table_get_and_increment_handle_count().
* Add a normal linked list implementation.
* Add a work queue implementation.
* Add 'level' parameter to mutex_create() and rw_lock_create().
Remove mutex_set_level() and rw_lock_set_level().
* Rename SYNC_LEVEL_NONE to SYNC_LEVEL_VARYING.
* Add support for bound ids in InnoDB's parser.
* Define UNIV_BTR_DEBUG for enabling consistency checks of
FIL_PAGE_NEXT and FIL_PAGE_PREV when accessing sibling
pages of B-tree indexes.
btr_validate_level(): Check the validity of the doubly linked
list formed by FIL_PAGE_NEXT and FIL_PAGE_PREV.
* Adapt InnoDB to the new tablename to filename encoding in MySQL 5.1.
ut_print_name(), ut_print_name1(): Add parameter 'table_id' for
distinguishing names of tables from other identifiers.
New: innobase_convert_from_table_id(), innobase_convert_from_id(),
innobase_convert_from_filename(), innobase_get_charset.
dict_accept(), dict_scan_id(), dict_scan_col(), dict_scan_table_name(),
dict_skip_word(), dict_create_foreign_constraints_low(): Add
parameter 'cs' so that isspace() can be replaced with my_isspace(),
whose operation depends on the connection character set.
dict_scan_id(): Convert identifier to UTF-8.
dict_str_starts_with_keyword(): New extern function, to replace
dict_accept() in row_search_for_mysql().
mysql_get_identifier_quote_char(): Replaced with innobase_print_identifier().
ha_innobase::create(): Remove the thd->convert_strin() call. Pass the
statement to InnoDB in the connection character set and let InnoDB
convert the identifier to UTF-8.
* Add max_row_size to dict_table_t.
* btr0cur.c
btr_copy_externally_stored_field(): Only set the 'offset' variable
when needed.
* buf0buf.c
buf_page_io_complete(): Write to the error log if the page number or
the space id o the disk do not match those in memory. Also write to
the error log if a page was read from the doublewrite buffer. The
doublewrite buffer should be only read by the lower-level function
fil_io() at database startup.
* dict0dict.c
dict_scan_table_name(): Remove fallback to differently encoded name
when the table is not found. The encoding is handled at a higher level.
* ha_innodb.cc
Increment statistic counter in ha_innobase::index_prev() (bug 19542).
Add innobase_convert_string wrapper function and a new file
ha_prototypes.h.
innobase_print_identifier(): Remove TODO comment before calling
get_quote_char_for_identifier(). That function apparently assumes
the identifier to be encoded in UTF-8.
* ibuf0ibuf.c|h
ibuf_count_get(), ibuf_counts[], ibuf_count_inited(): Define these
only #ifdef UNIV_IBUF_DEBUG. Previously, when compiled without
UNIV_IBUF_DEBUG, invoking ibuf_count_get() would crash InnoDB.
The function is only being called #ifdef UNIV_IBUF_DEBUG.
* innodb.result
Adjust the results for changes in the foreign key error messages.
* mem0mem.c|h
New: mem_heap_dup(), mem_heap_printf(), mem_heap_cat().
* os0file.c
Check the page trailers also after writing to disk. This improves
chances of diagnosing bug 18886.
os_file_check_page_trailers(): New function for checking that the
two copies of the LSN stamped on the page match.
os_aio_simulated_handle(): Call os_file_check_page_trailers()
before and after os_file_write().
* row0mysql.c
Move trx_commit_for_mysql(trx) calls before calls to
row_mysql_unlock_data_dictionary(trx) (bug 19727).
* row0sel.c
row_fetch_print(): Handle SQL NULL values without crashing.
row_sel_store_mysql_rec(): Remove useless call to rec_get_nth_field
when handling an externally stored column.
Fetch externally stored fields when using InnoDB's internal SQL
parser.
Optimize BLOB selects by using prebuilt->blob_heap directly instead
of first reading BLOB data to a temporary heap and then copying it
to prebuilt->blob_heap.
* srv0srv.c
srv_master_thread(): Remove unreachable code.
* srv0start.c
srv_parse_data_file_paths_and_sizes(): Accept lower-case 'm' and
'g' as abbreviations of megabyte and gigabyte (bug 19609).
srv_parse_megabytes(): New fuction.
* ut0dbg.c|h
Implement InnoDB assertions (ut_a and ut_error) with abort() when
the code is compiled with GCC 3 or later on other platforms than
Windows or Netware. Also disable the variable ut_dbg_stop_threads
and the function ut_dbg_stop_thread() i this case, unless
UNIV_SYC_DEBUG is defined. This should allow the compiler to
generate more compact code for assertions.
* ut0list.c|h
Add ib_list_create_heap().
2006-06-01 10:34:04 +04:00
|
|
|
Returns a table object based on table id. */
|
2001-02-17 14:19:19 +02:00
|
|
|
UNIV_INLINE
|
|
|
|
dict_table_t*
|
|
|
|
dict_table_get_on_id_low(
|
|
|
|
/*=====================*/
|
|
|
|
/* out: table, NULL if does not exist */
|
Applied innodb-5.1-ss594 snapshot.
Fixed BUG#19542 "InnoDB doesn't increase the Handler_read_prev couter".
Fixed BUG#19609 "Case sensitivity of innodb_data_file_path gives stupid error".
Fixed BUG#19727 "InnoDB crashed server and crashed tables are ot recoverable".
Also:
* Remove remnants of the obsolete concept of memoryfixing tables and indexes.
* Remove unused dict_table_LRU_trim().
* Remove unused 'trx' parameter from dict_table_get_on_id_low(),
dict_table_get(), dict_table_get_and_increment_handle_count().
* Add a normal linked list implementation.
* Add a work queue implementation.
* Add 'level' parameter to mutex_create() and rw_lock_create().
Remove mutex_set_level() and rw_lock_set_level().
* Rename SYNC_LEVEL_NONE to SYNC_LEVEL_VARYING.
* Add support for bound ids in InnoDB's parser.
* Define UNIV_BTR_DEBUG for enabling consistency checks of
FIL_PAGE_NEXT and FIL_PAGE_PREV when accessing sibling
pages of B-tree indexes.
btr_validate_level(): Check the validity of the doubly linked
list formed by FIL_PAGE_NEXT and FIL_PAGE_PREV.
* Adapt InnoDB to the new tablename to filename encoding in MySQL 5.1.
ut_print_name(), ut_print_name1(): Add parameter 'table_id' for
distinguishing names of tables from other identifiers.
New: innobase_convert_from_table_id(), innobase_convert_from_id(),
innobase_convert_from_filename(), innobase_get_charset.
dict_accept(), dict_scan_id(), dict_scan_col(), dict_scan_table_name(),
dict_skip_word(), dict_create_foreign_constraints_low(): Add
parameter 'cs' so that isspace() can be replaced with my_isspace(),
whose operation depends on the connection character set.
dict_scan_id(): Convert identifier to UTF-8.
dict_str_starts_with_keyword(): New extern function, to replace
dict_accept() in row_search_for_mysql().
mysql_get_identifier_quote_char(): Replaced with innobase_print_identifier().
ha_innobase::create(): Remove the thd->convert_strin() call. Pass the
statement to InnoDB in the connection character set and let InnoDB
convert the identifier to UTF-8.
* Add max_row_size to dict_table_t.
* btr0cur.c
btr_copy_externally_stored_field(): Only set the 'offset' variable
when needed.
* buf0buf.c
buf_page_io_complete(): Write to the error log if the page number or
the space id o the disk do not match those in memory. Also write to
the error log if a page was read from the doublewrite buffer. The
doublewrite buffer should be only read by the lower-level function
fil_io() at database startup.
* dict0dict.c
dict_scan_table_name(): Remove fallback to differently encoded name
when the table is not found. The encoding is handled at a higher level.
* ha_innodb.cc
Increment statistic counter in ha_innobase::index_prev() (bug 19542).
Add innobase_convert_string wrapper function and a new file
ha_prototypes.h.
innobase_print_identifier(): Remove TODO comment before calling
get_quote_char_for_identifier(). That function apparently assumes
the identifier to be encoded in UTF-8.
* ibuf0ibuf.c|h
ibuf_count_get(), ibuf_counts[], ibuf_count_inited(): Define these
only #ifdef UNIV_IBUF_DEBUG. Previously, when compiled without
UNIV_IBUF_DEBUG, invoking ibuf_count_get() would crash InnoDB.
The function is only being called #ifdef UNIV_IBUF_DEBUG.
* innodb.result
Adjust the results for changes in the foreign key error messages.
* mem0mem.c|h
New: mem_heap_dup(), mem_heap_printf(), mem_heap_cat().
* os0file.c
Check the page trailers also after writing to disk. This improves
chances of diagnosing bug 18886.
os_file_check_page_trailers(): New function for checking that the
two copies of the LSN stamped on the page match.
os_aio_simulated_handle(): Call os_file_check_page_trailers()
before and after os_file_write().
* row0mysql.c
Move trx_commit_for_mysql(trx) calls before calls to
row_mysql_unlock_data_dictionary(trx) (bug 19727).
* row0sel.c
row_fetch_print(): Handle SQL NULL values without crashing.
row_sel_store_mysql_rec(): Remove useless call to rec_get_nth_field
when handling an externally stored column.
Fetch externally stored fields when using InnoDB's internal SQL
parser.
Optimize BLOB selects by using prebuilt->blob_heap directly instead
of first reading BLOB data to a temporary heap and then copying it
to prebuilt->blob_heap.
* srv0srv.c
srv_master_thread(): Remove unreachable code.
* srv0start.c
srv_parse_data_file_paths_and_sizes(): Accept lower-case 'm' and
'g' as abbreviations of megabyte and gigabyte (bug 19609).
srv_parse_megabytes(): New fuction.
* ut0dbg.c|h
Implement InnoDB assertions (ut_a and ut_error) with abort() when
the code is compiled with GCC 3 or later on other platforms than
Windows or Netware. Also disable the variable ut_dbg_stop_threads
and the function ut_dbg_stop_thread() i this case, unless
UNIV_SYC_DEBUG is defined. This should allow the compiler to
generate more compact code for assertions.
* ut0list.c|h
Add ib_list_create_heap().
2006-06-01 10:34:04 +04:00
|
|
|
dulint table_id); /* in: table id */
|
2001-02-17 14:19:19 +02:00
|
|
|
/**************************************************************************
|
2001-10-10 22:47:08 +03:00
|
|
|
Checks if a table is in the dictionary cache. */
|
|
|
|
UNIV_INLINE
|
|
|
|
dict_table_t*
|
|
|
|
dict_table_check_if_in_cache_low(
|
Applied innodb-5.1-ss269 snapshot.
Fixed BUGS:
#3300: "UPDATE statement with no index column in where condition locks
all rows"
Implement semi-consistent read to reduce lock conflicts at the cost
of breaking serializability.
ha_innobase::unlock_row(): reset the "did semi consistent read" flag
ha_innobase::was_semi_consistent_read(),
ha_innobase::try_semi_consistent_read(): new methods
row_prebuilt_t, row_create_prebuilt(): add field row_read_type for
keeping track of semi-consistent reads
row_vers_build_for_semi_consistent_read(),
row_sel_build_committed_vers_for_mysql(): new functions
row_search_for_mysql(): implement semi-consistent reads
#9802: "Foreign key checks disallow alter table".
Added test cases.
#12456: "Cursor shows incorrect data - DML does not affect,
probably caching"
This patch implements a high-granularity read view to be used with
cursors. In this high-granularity consistent read view modifications
done by the creating transaction after the cursor is created or
future transactions are not visible. But those modifications that
transaction did before the cursor was created are visible.
#12701: "Support >4GB buffer pool and log files on 64-bit Windows"
Do not call os_file_create_tmpfile() at runtime. Instead, create all
tempfiles at startup and guard access to them with mutexes.
#13778: "If FOREIGN_KEY_CHECKS=0, one can create inconsistent FOREIGN KEYs".
When FOREIGN_KEY_CHECKS=0 we still need to check that datatypes between
foreign key references are compatible.
#14189: "VARBINARY and BINARY variables: trailing space ignored with InnoDB"
innobase_init(): Assert that
DATA_MYSQL_BINARY_CHARSET_COLL == my_charset_bin.number.
dtype_get_pad_char(): Do not pad VARBINARY or BINARY columns.
row_ins_cascade_calc_update_vec(): Refuse ON UPDATE CASCADE when trying
to change the length of a VARBINARY column that refers to or is referenced
by a BINARY column. BINARY columns are no longer padded on comparison,
and thus they cannot be padded on storage either.
#14747: "Race condition can cause btr_search_drop_page_hash_index() to crash"
Note that buf_block_t::index should be protected by btr_search_latch
or an s-latch or x-latch on the index page.
btr_search_drop_page_hash_index(): Read block->index while holding
btr_search_latch and use the cached value in the loop. Remove some
redundant assertions.
#15108: "mysqld crashes when innodb_log_file_size is set > 4G"
#15308: "Problem of Order with Enum Column in Primary Key"
#15550: "mysqld crashes in printing a FOREIGN KEY error in InnoDB"
row_ins_foreign_report_add_err(): When printing the parent record,
use the index in the parent table rather than the index in the child table.
#15653: "Slow inserts to InnoDB if many thousands of .ibd files"
Keep track on unflushed modifications to file spaces. When there are tens
of thousands of file spaces, flushing all files in fil_flush_file_spaces()
would be very slow.
fil_flush_file_spaces(): Only flush unflushed file spaces.
fil_space_t, fil_system_t: Add a list of unflushed spaces.
#15991: "innodb-file-per-table + symlink database + rename = cr"
os_file_handle_error(): Map the error codes EXDEV, ENOTDIR, and EISDIR
to the new code OS_FILE_PATH_ERROR. Treat this code as OS_FILE_PATH_ERROR.
This fixes the crash on RENAME TABLE when the .ibd file is a symbolic link
to a different file system.
#16157: "InnoDB crashes when main location settings are empty"
This patch is from Heikki.
#16298: "InnoDB segfaults in INSERTs in upgrade of 4.0 -> 5.0 tables
with VARCHAR BINARY"
dict_load_columns(): Set the charset-collation code
DATA_MYSQL_BINARY_CHARSET_COLL for those binary string columns
that lack a charset-collation code, i.e., the tables were created
with an older version of MySQL/InnoDB than 4.1.2.
#16229: "MySQL/InnoDB uses full explicit table locks in trigger processing"
Take a InnoDB table lock only if user has explicitly requested a table
lock. Added some additional comments to store_lock() and external_lock().
#16387: "InnoDB crash when dropping a foreign key <table>_ibfk_0"
Do not mistake TABLENAME_ibfk_0 for auto-generated id.
dict_table_get_highest_foreign_id(): Ignore foreign constraint
identifiers starting with the pattern TABLENAME_ibfk_0.
#16582: "InnoDB: Error in an adaptive hash index pointer to page"
Account for a race condition when dropping the adaptive hash index
for a B-tree page.
btr_search_drop_page_hash_index(): Retry the operation if a hash index
with different parameters was built meanwhile. Add diagnostics for the
case that hash node pointers to the page remain.
btr_search_info_update_hash(), btr_search_info_update_slow():
Document the parameter "info" as in/out.
#16814: "SHOW INNODB STATUS format error in LATEST FOREIGN KEY ERROR
section"
Add a missing newline to the LAST FOREIGN KEY ERROR section in SHOW
INNODB STATUS output.
dict_foreign_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 unititialised values"
buf_block_init(): Reset magic_n, buf_fix_count and io_fix to avoid
testing uninitialized variables.
2006-03-10 19:22:21 +03:00
|
|
|
/*=============================*/
|
2004-05-17 14:40:31 +03:00
|
|
|
/* out: table, NULL if not found */
|
|
|
|
const char* table_name); /* in: table name */
|
2001-10-10 22:47:08 +03:00
|
|
|
/**************************************************************************
|
2001-02-17 14:19:19 +02:00
|
|
|
Gets a table; loads it to the dictionary cache if necessary. A low-level
|
|
|
|
function. */
|
|
|
|
UNIV_INLINE
|
|
|
|
dict_table_t*
|
|
|
|
dict_table_get_low(
|
|
|
|
/*===============*/
|
2004-05-17 14:40:31 +03:00
|
|
|
/* out: table, NULL if not found */
|
|
|
|
const char* table_name); /* in: table name */
|
2001-02-17 14:19:19 +02:00
|
|
|
/**************************************************************************
|
Applied innodb-5.1-ss475 snapshot.
* Fix BUG#15650: "DELETE with LEFT JOIN crashes server with innodb_locks_unsafe_for binlog"
* Fix BUG#17134: "Partitions: uncommitted changes are visible"
* Fix BUG#17992: "Partitions: InnoDB, somehow rotten table after UPDATE"
row0ins.c: MySQL's partitioned table code does not set preduilt->sql_stat_start right
if it does an insert in the same statement after doing a search first in the same
partition table. We now write trx id always to the buffer, not just when flag
sql_stat_start is on. This will waste CPU time very sightly.
* Fix BUG#18077: "InnoDB uses full explicit table locks in stored FUNCTION"
* Fix BUG#18238: "When locks exhaust the buffer pool, InnoDB does not roll back the trx"
* Fix BUG#18252" "Disk space leak in updates of InnoDB BLOB rows in 5.0 and 5.1"
* Fix BUG#18283: "When InnoDB returns error 'lock table full', MySQL can write to binlog too much"
* Fix BUG#18350: "Use consistent read in CREATE ... SELECT ... if innodb_locks_unsafe_for_binlog"
* Fix BUG#18384: "InnoDB memory leak on duplicate key errors in 5.0 if row has many columns"
* Fix BUG#18934: "InnoDB crashes when table uses column names like DB_ROW_ID"
Refuse tables that use reserved column names.
* InnoDB's SQL parser:
- Add support for UNSIGNED types, EXIT keyword, quoted identifiers, user-function callbacks
for processing results of FETCH statements, bound literals, DATA_VARCHAR for bound literals.
- Allow bound literals of type non-INTEGER to be of length 0.
- Add make_flex.sh and update lexer/parser generation documentation.
- Add comment clarifying the difference between 'alias' and 'indirection' fields in sym_node_t.
- Remove never reached duplicate code in pars_set_dfield_type().
- Rewrite pars_info datatypes and APIs, add a few helper functions.
- Since the functions definitions in pars_info_t are accessed after pars_sql() returns
in the query graph execution stage, we can't free pars_info_t in pars_sql(). Instead,
make pars_sql() transfer ownership of pars_info_t to the created query graph, and
make que_graph_free() free it if needed.
- Allow access to system columns like DB_ROW_ID.
* Use bound literals in row_truncate_table_for_mysql, row_drop_table_for_mysql,
row_discard_tablespace_for_mysql, and row_rename_table_for_mysql.
* Setting an isolation level of the transaction to read committed weakens the locks for
this session similarly like the option innodb_locks_unsafe_for binlog. This patch removes
alnost all gap locking (used in next-key locking) and makes MySQL to release the row locks
on the rows which does not belong to result set. Additionally, nonlocking selects on
INSERT INTO SELECT, UPDATE ... (SELECT ...), and CREATE ... SELECT ... use a nonlocking
consistent read. If a binlog is used, then binlog format should be set to row based
binloging to make the execution of the complex SQL statements.
* Disable the statistic variables btr_search_n_hash_fail and n_hash_succ, n_hash_fail,
n_patt_succ, and n_searches of btr_search_t in builds without #ifdef UNIV_SEARCH_PERF_STAT.
* Make innodb.test faster. Group all consistent read test cases to a one test case and
wait their lock timeout after all have been send to the server. Decrease amount of rows
inserted in a certain test - this has no effect on the effectiveness of the test and
reduces the running time by ~10 sec. Remove temporary work-arounds from innodb.result
now that ALTER TABLE DROP FOREIGN KEY works once again.
* Make innodb_unsafe_binlog.test faster. Grout all consistent read test cases to a one
test case amd wait their lock timeout after all have been sent to the server. Remove
unnecessary option --loose_innodb_lock_wait_timeout.
* Print dictionary memory size in SHOW INNODB STATUS.
* Fix memory leaks in row_create_table_for_mysql() in rare corner cases.
* Remove code related to clustered tables. They were never implemented, and the
implementation would be challenging with ROW_FORMAT=COMPACT. Remove the table types
DICT_TABLE_CLUSTER_MEMBER and DICT_TABLE_CLUSTER and all related tests and functions.
dict_table_t: Remove mix_id, mix_len, mix_id_len, mix_id_buf, and cluster_name.
plan_t: Remove mixed_index.
dict_create_sys_tables_tuple(): Set MIX_ID=0, MIX_LEN=0, CLUSTER_NAME=NULL when
inserting into SYS_TABLES.
dict_tree_check_search_tuple(): Enclose in #ifdef UNIV_DEBUG.
* Move calling of thr_local_free() from trx_free_for_mysql() to
innobase_close_connection().
2006-04-23 12:48:31 +04:00
|
|
|
A noninlined version of dict_table_get_low. */
|
|
|
|
|
|
|
|
dict_table_t*
|
|
|
|
dict_table_get_low_noninlined(
|
|
|
|
/*==========================*/
|
|
|
|
/* out: table, NULL if not found */
|
|
|
|
const char* table_name); /* in: table name */
|
|
|
|
/**************************************************************************
|
2001-02-17 14:19:19 +02:00
|
|
|
Returns an index object. */
|
|
|
|
UNIV_INLINE
|
|
|
|
dict_index_t*
|
|
|
|
dict_table_get_index(
|
|
|
|
/*=================*/
|
|
|
|
/* out: index, NULL if does not exist */
|
|
|
|
dict_table_t* table, /* in: table */
|
2004-05-17 14:40:31 +03:00
|
|
|
const char* name); /* in: index name */
|
2001-02-17 14:19:19 +02:00
|
|
|
/**************************************************************************
|
|
|
|
Returns an index object. */
|
|
|
|
|
|
|
|
dict_index_t*
|
|
|
|
dict_table_get_index_noninline(
|
|
|
|
/*===========================*/
|
|
|
|
/* out: index, NULL if does not exist */
|
|
|
|
dict_table_t* table, /* in: table */
|
2004-05-17 14:40:31 +03:00
|
|
|
const char* name); /* in: index name */
|
2001-02-17 14:19:19 +02:00
|
|
|
/**************************************************************************
|
2006-09-21 01:39:09 -06:00
|
|
|
Returns a column's name. */
|
|
|
|
|
|
|
|
const char*
|
|
|
|
dict_table_get_col_name(
|
|
|
|
/*====================*/
|
|
|
|
/* out: column name. NOTE: not
|
|
|
|
guaranteed to stay valid if table is
|
|
|
|
modified in any way (columns added,
|
|
|
|
etc.). */
|
|
|
|
const dict_table_t* table, /* in: table */
|
|
|
|
ulint col_nr);/* in: column number */
|
|
|
|
|
|
|
|
/**************************************************************************
|
2004-06-16 13:41:14 +03:00
|
|
|
Prints a table definition. */
|
2001-02-17 14:19:19 +02:00
|
|
|
|
|
|
|
void
|
2004-06-16 13:41:14 +03:00
|
|
|
dict_table_print(
|
|
|
|
/*=============*/
|
2001-02-17 14:19:19 +02:00
|
|
|
dict_table_t* table); /* in: table */
|
|
|
|
/**************************************************************************
|
2004-06-16 13:41:14 +03:00
|
|
|
Prints a table data. */
|
2001-10-10 22:47:08 +03:00
|
|
|
|
|
|
|
void
|
2004-06-16 13:41:14 +03:00
|
|
|
dict_table_print_low(
|
|
|
|
/*=================*/
|
2001-10-10 22:47:08 +03:00
|
|
|
dict_table_t* table); /* in: table */
|
|
|
|
/**************************************************************************
|
2001-02-17 14:19:19 +02:00
|
|
|
Prints a table data when we know the table name. */
|
|
|
|
|
|
|
|
void
|
|
|
|
dict_table_print_by_name(
|
|
|
|
/*=====================*/
|
2004-05-17 14:40:31 +03:00
|
|
|
const char* name);
|
2001-10-30 17:38:44 +02:00
|
|
|
/**************************************************************************
|
2004-04-01 16:51:34 +03:00
|
|
|
Outputs info on foreign keys of a table. */
|
2001-10-30 17:38:44 +02:00
|
|
|
|
|
|
|
void
|
|
|
|
dict_print_info_on_foreign_keys(
|
|
|
|
/*============================*/
|
2002-03-21 18:03:09 +02:00
|
|
|
ibool create_table_format, /* in: if TRUE then print in
|
|
|
|
a format suitable to be inserted into
|
|
|
|
a CREATE TABLE, otherwise in the format
|
|
|
|
of SHOW TABLE STATUS */
|
2004-04-06 16:14:43 +03:00
|
|
|
FILE* file, /* in: file where to print */
|
2004-10-01 11:51:59 +03:00
|
|
|
trx_t* trx, /* in: transaction */
|
2001-10-30 17:38:44 +02:00
|
|
|
dict_table_t* table); /* in: table */
|
2003-04-16 16:45:01 +03:00
|
|
|
/**************************************************************************
|
2004-04-06 16:14:43 +03:00
|
|
|
Outputs info on a foreign key of a table in a format suitable for
|
|
|
|
CREATE TABLE. */
|
|
|
|
void
|
2003-04-16 16:45:01 +03:00
|
|
|
dict_print_info_on_foreign_key_in_create_format(
|
|
|
|
/*============================================*/
|
2005-09-23 16:22:27 +03:00
|
|
|
FILE* file, /* in: file where to print */
|
|
|
|
trx_t* trx, /* in: transaction */
|
|
|
|
dict_foreign_t* foreign, /* in: foreign key constraint */
|
|
|
|
ibool add_newline); /* in: whether to add a newline */
|
2004-04-06 16:14:43 +03:00
|
|
|
/************************************************************************
|
|
|
|
Displays the names of the index and the table. */
|
|
|
|
void
|
|
|
|
dict_index_name_print(
|
|
|
|
/*==================*/
|
|
|
|
FILE* file, /* in: output stream */
|
2004-10-01 11:51:59 +03:00
|
|
|
trx_t* trx, /* in: transaction */
|
2004-04-06 16:14:43 +03:00
|
|
|
const dict_index_t* index); /* in: index to print */
|
2001-02-17 14:19:19 +02:00
|
|
|
/************************************************************************
|
|
|
|
Gets the first index on the table (the clustered index). */
|
|
|
|
UNIV_INLINE
|
|
|
|
dict_index_t*
|
|
|
|
dict_table_get_first_index(
|
|
|
|
/*=======================*/
|
|
|
|
/* out: index, NULL if none exists */
|
|
|
|
dict_table_t* table); /* in: table */
|
|
|
|
/************************************************************************
|
|
|
|
Gets the first index on the table (the clustered index). */
|
|
|
|
|
|
|
|
dict_index_t*
|
|
|
|
dict_table_get_first_index_noninline(
|
|
|
|
/*=================================*/
|
|
|
|
/* out: index, NULL if none exists */
|
|
|
|
dict_table_t* table); /* in: table */
|
|
|
|
/************************************************************************
|
|
|
|
Gets the next index on the table. */
|
|
|
|
UNIV_INLINE
|
|
|
|
dict_index_t*
|
|
|
|
dict_table_get_next_index(
|
|
|
|
/*======================*/
|
|
|
|
/* out: index, NULL if none left */
|
|
|
|
dict_index_t* index); /* in: index */
|
|
|
|
/************************************************************************
|
|
|
|
Gets the next index on the table. */
|
|
|
|
|
|
|
|
dict_index_t*
|
|
|
|
dict_table_get_next_index_noninline(
|
|
|
|
/*================================*/
|
|
|
|
/* out: index, NULL if none left */
|
|
|
|
dict_index_t* index); /* in: index */
|
|
|
|
/************************************************************************
|
|
|
|
Gets the number of user-defined columns in a table in the dictionary
|
|
|
|
cache. */
|
|
|
|
UNIV_INLINE
|
|
|
|
ulint
|
|
|
|
dict_table_get_n_user_cols(
|
|
|
|
/*=======================*/
|
|
|
|
/* out: number of user-defined (e.g., not
|
|
|
|
ROW_ID) columns of a table */
|
|
|
|
dict_table_t* table); /* in: table */
|
|
|
|
/************************************************************************
|
|
|
|
Gets the number of system columns in a table in the dictionary cache. */
|
|
|
|
UNIV_INLINE
|
|
|
|
ulint
|
|
|
|
dict_table_get_n_sys_cols(
|
|
|
|
/*======================*/
|
|
|
|
/* out: number of system (e.g.,
|
|
|
|
ROW_ID) columns of a table */
|
|
|
|
dict_table_t* table); /* in: table */
|
|
|
|
/************************************************************************
|
|
|
|
Gets the number of all columns (also system) in a table in the dictionary
|
|
|
|
cache. */
|
|
|
|
UNIV_INLINE
|
|
|
|
ulint
|
|
|
|
dict_table_get_n_cols(
|
|
|
|
/*==================*/
|
|
|
|
/* out: number of columns of a table */
|
|
|
|
dict_table_t* table); /* in: table */
|
|
|
|
/************************************************************************
|
|
|
|
Gets the nth column of a table. */
|
|
|
|
UNIV_INLINE
|
2006-09-21 01:39:09 -06:00
|
|
|
const dict_col_t*
|
2001-02-17 14:19:19 +02:00
|
|
|
dict_table_get_nth_col(
|
|
|
|
/*===================*/
|
2006-09-21 01:39:09 -06:00
|
|
|
/* out: pointer to column object */
|
|
|
|
const dict_table_t* table, /* in: table */
|
|
|
|
ulint pos); /* in: position of column */
|
2001-02-17 14:19:19 +02:00
|
|
|
/************************************************************************
|
|
|
|
Gets the nth column of a table. */
|
|
|
|
|
2006-09-21 01:39:09 -06:00
|
|
|
const dict_col_t*
|
2001-02-17 14:19:19 +02:00
|
|
|
dict_table_get_nth_col_noninline(
|
|
|
|
/*=============================*/
|
2006-09-21 01:39:09 -06:00
|
|
|
/* out: pointer to column object */
|
|
|
|
const dict_table_t* table, /* in: table */
|
|
|
|
ulint pos); /* in: position of column */
|
2001-02-17 14:19:19 +02:00
|
|
|
/************************************************************************
|
|
|
|
Gets the given system column of a table. */
|
|
|
|
UNIV_INLINE
|
2006-09-21 01:39:09 -06:00
|
|
|
const dict_col_t*
|
2001-02-17 14:19:19 +02:00
|
|
|
dict_table_get_sys_col(
|
|
|
|
/*===================*/
|
2006-09-21 01:39:09 -06:00
|
|
|
/* out: pointer to column object */
|
|
|
|
const dict_table_t* table, /* in: table */
|
|
|
|
ulint sys); /* in: DATA_ROW_ID, ... */
|
2001-02-17 14:19:19 +02:00
|
|
|
/************************************************************************
|
|
|
|
Gets the given system column number of a table. */
|
|
|
|
UNIV_INLINE
|
|
|
|
ulint
|
|
|
|
dict_table_get_sys_col_no(
|
|
|
|
/*======================*/
|
|
|
|
/* out: column number */
|
|
|
|
dict_table_t* table, /* in: table */
|
|
|
|
ulint sys); /* in: DATA_ROW_ID, ... */
|
2004-03-17 19:37:48 +02:00
|
|
|
/************************************************************************
|
Applied innodb-5.1-ss269 snapshot.
Fixed BUGS:
#3300: "UPDATE statement with no index column in where condition locks
all rows"
Implement semi-consistent read to reduce lock conflicts at the cost
of breaking serializability.
ha_innobase::unlock_row(): reset the "did semi consistent read" flag
ha_innobase::was_semi_consistent_read(),
ha_innobase::try_semi_consistent_read(): new methods
row_prebuilt_t, row_create_prebuilt(): add field row_read_type for
keeping track of semi-consistent reads
row_vers_build_for_semi_consistent_read(),
row_sel_build_committed_vers_for_mysql(): new functions
row_search_for_mysql(): implement semi-consistent reads
#9802: "Foreign key checks disallow alter table".
Added test cases.
#12456: "Cursor shows incorrect data - DML does not affect,
probably caching"
This patch implements a high-granularity read view to be used with
cursors. In this high-granularity consistent read view modifications
done by the creating transaction after the cursor is created or
future transactions are not visible. But those modifications that
transaction did before the cursor was created are visible.
#12701: "Support >4GB buffer pool and log files on 64-bit Windows"
Do not call os_file_create_tmpfile() at runtime. Instead, create all
tempfiles at startup and guard access to them with mutexes.
#13778: "If FOREIGN_KEY_CHECKS=0, one can create inconsistent FOREIGN KEYs".
When FOREIGN_KEY_CHECKS=0 we still need to check that datatypes between
foreign key references are compatible.
#14189: "VARBINARY and BINARY variables: trailing space ignored with InnoDB"
innobase_init(): Assert that
DATA_MYSQL_BINARY_CHARSET_COLL == my_charset_bin.number.
dtype_get_pad_char(): Do not pad VARBINARY or BINARY columns.
row_ins_cascade_calc_update_vec(): Refuse ON UPDATE CASCADE when trying
to change the length of a VARBINARY column that refers to or is referenced
by a BINARY column. BINARY columns are no longer padded on comparison,
and thus they cannot be padded on storage either.
#14747: "Race condition can cause btr_search_drop_page_hash_index() to crash"
Note that buf_block_t::index should be protected by btr_search_latch
or an s-latch or x-latch on the index page.
btr_search_drop_page_hash_index(): Read block->index while holding
btr_search_latch and use the cached value in the loop. Remove some
redundant assertions.
#15108: "mysqld crashes when innodb_log_file_size is set > 4G"
#15308: "Problem of Order with Enum Column in Primary Key"
#15550: "mysqld crashes in printing a FOREIGN KEY error in InnoDB"
row_ins_foreign_report_add_err(): When printing the parent record,
use the index in the parent table rather than the index in the child table.
#15653: "Slow inserts to InnoDB if many thousands of .ibd files"
Keep track on unflushed modifications to file spaces. When there are tens
of thousands of file spaces, flushing all files in fil_flush_file_spaces()
would be very slow.
fil_flush_file_spaces(): Only flush unflushed file spaces.
fil_space_t, fil_system_t: Add a list of unflushed spaces.
#15991: "innodb-file-per-table + symlink database + rename = cr"
os_file_handle_error(): Map the error codes EXDEV, ENOTDIR, and EISDIR
to the new code OS_FILE_PATH_ERROR. Treat this code as OS_FILE_PATH_ERROR.
This fixes the crash on RENAME TABLE when the .ibd file is a symbolic link
to a different file system.
#16157: "InnoDB crashes when main location settings are empty"
This patch is from Heikki.
#16298: "InnoDB segfaults in INSERTs in upgrade of 4.0 -> 5.0 tables
with VARCHAR BINARY"
dict_load_columns(): Set the charset-collation code
DATA_MYSQL_BINARY_CHARSET_COLL for those binary string columns
that lack a charset-collation code, i.e., the tables were created
with an older version of MySQL/InnoDB than 4.1.2.
#16229: "MySQL/InnoDB uses full explicit table locks in trigger processing"
Take a InnoDB table lock only if user has explicitly requested a table
lock. Added some additional comments to store_lock() and external_lock().
#16387: "InnoDB crash when dropping a foreign key <table>_ibfk_0"
Do not mistake TABLENAME_ibfk_0 for auto-generated id.
dict_table_get_highest_foreign_id(): Ignore foreign constraint
identifiers starting with the pattern TABLENAME_ibfk_0.
#16582: "InnoDB: Error in an adaptive hash index pointer to page"
Account for a race condition when dropping the adaptive hash index
for a B-tree page.
btr_search_drop_page_hash_index(): Retry the operation if a hash index
with different parameters was built meanwhile. Add diagnostics for the
case that hash node pointers to the page remain.
btr_search_info_update_hash(), btr_search_info_update_slow():
Document the parameter "info" as in/out.
#16814: "SHOW INNODB STATUS format error in LATEST FOREIGN KEY ERROR
section"
Add a missing newline to the LAST FOREIGN KEY ERROR section in SHOW
INNODB STATUS output.
dict_foreign_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 unititialised values"
buf_block_init(): Reset magic_n, buf_fix_count and io_fix to avoid
testing uninitialized variables.
2006-03-10 19:22:21 +03:00
|
|
|
Check whether the table uses the compact page format. */
|
|
|
|
UNIV_INLINE
|
|
|
|
ibool
|
|
|
|
dict_table_is_comp(
|
|
|
|
/*===============*/
|
|
|
|
/* out: TRUE if table uses the
|
|
|
|
compact page format */
|
|
|
|
const dict_table_t* table); /* in: table */
|
|
|
|
/************************************************************************
|
Applied innodb-5.1-ss475 snapshot.
* Fix BUG#15650: "DELETE with LEFT JOIN crashes server with innodb_locks_unsafe_for binlog"
* Fix BUG#17134: "Partitions: uncommitted changes are visible"
* Fix BUG#17992: "Partitions: InnoDB, somehow rotten table after UPDATE"
row0ins.c: MySQL's partitioned table code does not set preduilt->sql_stat_start right
if it does an insert in the same statement after doing a search first in the same
partition table. We now write trx id always to the buffer, not just when flag
sql_stat_start is on. This will waste CPU time very sightly.
* Fix BUG#18077: "InnoDB uses full explicit table locks in stored FUNCTION"
* Fix BUG#18238: "When locks exhaust the buffer pool, InnoDB does not roll back the trx"
* Fix BUG#18252" "Disk space leak in updates of InnoDB BLOB rows in 5.0 and 5.1"
* Fix BUG#18283: "When InnoDB returns error 'lock table full', MySQL can write to binlog too much"
* Fix BUG#18350: "Use consistent read in CREATE ... SELECT ... if innodb_locks_unsafe_for_binlog"
* Fix BUG#18384: "InnoDB memory leak on duplicate key errors in 5.0 if row has many columns"
* Fix BUG#18934: "InnoDB crashes when table uses column names like DB_ROW_ID"
Refuse tables that use reserved column names.
* InnoDB's SQL parser:
- Add support for UNSIGNED types, EXIT keyword, quoted identifiers, user-function callbacks
for processing results of FETCH statements, bound literals, DATA_VARCHAR for bound literals.
- Allow bound literals of type non-INTEGER to be of length 0.
- Add make_flex.sh and update lexer/parser generation documentation.
- Add comment clarifying the difference between 'alias' and 'indirection' fields in sym_node_t.
- Remove never reached duplicate code in pars_set_dfield_type().
- Rewrite pars_info datatypes and APIs, add a few helper functions.
- Since the functions definitions in pars_info_t are accessed after pars_sql() returns
in the query graph execution stage, we can't free pars_info_t in pars_sql(). Instead,
make pars_sql() transfer ownership of pars_info_t to the created query graph, and
make que_graph_free() free it if needed.
- Allow access to system columns like DB_ROW_ID.
* Use bound literals in row_truncate_table_for_mysql, row_drop_table_for_mysql,
row_discard_tablespace_for_mysql, and row_rename_table_for_mysql.
* Setting an isolation level of the transaction to read committed weakens the locks for
this session similarly like the option innodb_locks_unsafe_for binlog. This patch removes
alnost all gap locking (used in next-key locking) and makes MySQL to release the row locks
on the rows which does not belong to result set. Additionally, nonlocking selects on
INSERT INTO SELECT, UPDATE ... (SELECT ...), and CREATE ... SELECT ... use a nonlocking
consistent read. If a binlog is used, then binlog format should be set to row based
binloging to make the execution of the complex SQL statements.
* Disable the statistic variables btr_search_n_hash_fail and n_hash_succ, n_hash_fail,
n_patt_succ, and n_searches of btr_search_t in builds without #ifdef UNIV_SEARCH_PERF_STAT.
* Make innodb.test faster. Group all consistent read test cases to a one test case and
wait their lock timeout after all have been send to the server. Decrease amount of rows
inserted in a certain test - this has no effect on the effectiveness of the test and
reduces the running time by ~10 sec. Remove temporary work-arounds from innodb.result
now that ALTER TABLE DROP FOREIGN KEY works once again.
* Make innodb_unsafe_binlog.test faster. Grout all consistent read test cases to a one
test case amd wait their lock timeout after all have been sent to the server. Remove
unnecessary option --loose_innodb_lock_wait_timeout.
* Print dictionary memory size in SHOW INNODB STATUS.
* Fix memory leaks in row_create_table_for_mysql() in rare corner cases.
* Remove code related to clustered tables. They were never implemented, and the
implementation would be challenging with ROW_FORMAT=COMPACT. Remove the table types
DICT_TABLE_CLUSTER_MEMBER and DICT_TABLE_CLUSTER and all related tests and functions.
dict_table_t: Remove mix_id, mix_len, mix_id_len, mix_id_buf, and cluster_name.
plan_t: Remove mixed_index.
dict_create_sys_tables_tuple(): Set MIX_ID=0, MIX_LEN=0, CLUSTER_NAME=NULL when
inserting into SYS_TABLES.
dict_tree_check_search_tuple(): Enclose in #ifdef UNIV_DEBUG.
* Move calling of thr_local_free() from trx_free_for_mysql() to
innobase_close_connection().
2006-04-23 12:48:31 +04:00
|
|
|
Check whether the table uses the compact page format. */
|
|
|
|
|
2006-03-11 19:13:31 +01:00
|
|
|
ibool
|
Applied innodb-5.1-ss475 snapshot.
* Fix BUG#15650: "DELETE with LEFT JOIN crashes server with innodb_locks_unsafe_for binlog"
* Fix BUG#17134: "Partitions: uncommitted changes are visible"
* Fix BUG#17992: "Partitions: InnoDB, somehow rotten table after UPDATE"
row0ins.c: MySQL's partitioned table code does not set preduilt->sql_stat_start right
if it does an insert in the same statement after doing a search first in the same
partition table. We now write trx id always to the buffer, not just when flag
sql_stat_start is on. This will waste CPU time very sightly.
* Fix BUG#18077: "InnoDB uses full explicit table locks in stored FUNCTION"
* Fix BUG#18238: "When locks exhaust the buffer pool, InnoDB does not roll back the trx"
* Fix BUG#18252" "Disk space leak in updates of InnoDB BLOB rows in 5.0 and 5.1"
* Fix BUG#18283: "When InnoDB returns error 'lock table full', MySQL can write to binlog too much"
* Fix BUG#18350: "Use consistent read in CREATE ... SELECT ... if innodb_locks_unsafe_for_binlog"
* Fix BUG#18384: "InnoDB memory leak on duplicate key errors in 5.0 if row has many columns"
* Fix BUG#18934: "InnoDB crashes when table uses column names like DB_ROW_ID"
Refuse tables that use reserved column names.
* InnoDB's SQL parser:
- Add support for UNSIGNED types, EXIT keyword, quoted identifiers, user-function callbacks
for processing results of FETCH statements, bound literals, DATA_VARCHAR for bound literals.
- Allow bound literals of type non-INTEGER to be of length 0.
- Add make_flex.sh and update lexer/parser generation documentation.
- Add comment clarifying the difference between 'alias' and 'indirection' fields in sym_node_t.
- Remove never reached duplicate code in pars_set_dfield_type().
- Rewrite pars_info datatypes and APIs, add a few helper functions.
- Since the functions definitions in pars_info_t are accessed after pars_sql() returns
in the query graph execution stage, we can't free pars_info_t in pars_sql(). Instead,
make pars_sql() transfer ownership of pars_info_t to the created query graph, and
make que_graph_free() free it if needed.
- Allow access to system columns like DB_ROW_ID.
* Use bound literals in row_truncate_table_for_mysql, row_drop_table_for_mysql,
row_discard_tablespace_for_mysql, and row_rename_table_for_mysql.
* Setting an isolation level of the transaction to read committed weakens the locks for
this session similarly like the option innodb_locks_unsafe_for binlog. This patch removes
alnost all gap locking (used in next-key locking) and makes MySQL to release the row locks
on the rows which does not belong to result set. Additionally, nonlocking selects on
INSERT INTO SELECT, UPDATE ... (SELECT ...), and CREATE ... SELECT ... use a nonlocking
consistent read. If a binlog is used, then binlog format should be set to row based
binloging to make the execution of the complex SQL statements.
* Disable the statistic variables btr_search_n_hash_fail and n_hash_succ, n_hash_fail,
n_patt_succ, and n_searches of btr_search_t in builds without #ifdef UNIV_SEARCH_PERF_STAT.
* Make innodb.test faster. Group all consistent read test cases to a one test case and
wait their lock timeout after all have been send to the server. Decrease amount of rows
inserted in a certain test - this has no effect on the effectiveness of the test and
reduces the running time by ~10 sec. Remove temporary work-arounds from innodb.result
now that ALTER TABLE DROP FOREIGN KEY works once again.
* Make innodb_unsafe_binlog.test faster. Grout all consistent read test cases to a one
test case amd wait their lock timeout after all have been sent to the server. Remove
unnecessary option --loose_innodb_lock_wait_timeout.
* Print dictionary memory size in SHOW INNODB STATUS.
* Fix memory leaks in row_create_table_for_mysql() in rare corner cases.
* Remove code related to clustered tables. They were never implemented, and the
implementation would be challenging with ROW_FORMAT=COMPACT. Remove the table types
DICT_TABLE_CLUSTER_MEMBER and DICT_TABLE_CLUSTER and all related tests and functions.
dict_table_t: Remove mix_id, mix_len, mix_id_len, mix_id_buf, and cluster_name.
plan_t: Remove mixed_index.
dict_create_sys_tables_tuple(): Set MIX_ID=0, MIX_LEN=0, CLUSTER_NAME=NULL when
inserting into SYS_TABLES.
dict_tree_check_search_tuple(): Enclose in #ifdef UNIV_DEBUG.
* Move calling of thr_local_free() from trx_free_for_mysql() to
innobase_close_connection().
2006-04-23 12:48:31 +04:00
|
|
|
dict_table_is_comp_noninline(
|
|
|
|
/*=========================*/
|
2006-03-11 19:13:31 +01:00
|
|
|
/* out: TRUE if table uses the
|
|
|
|
compact page format */
|
|
|
|
const dict_table_t* table); /* in: table */
|
|
|
|
/************************************************************************
|
2004-03-17 19:37:48 +02:00
|
|
|
Checks if a column is in the ordering columns of the clustered index of a
|
|
|
|
table. Column prefixes are treated like whole columns. */
|
|
|
|
|
|
|
|
ibool
|
|
|
|
dict_table_col_in_clustered_key(
|
|
|
|
/*============================*/
|
|
|
|
/* out: TRUE if the column, or its prefix, is
|
|
|
|
in the clustered key */
|
|
|
|
dict_table_t* table, /* in: table */
|
|
|
|
ulint n); /* in: column number */
|
2001-02-17 14:19:19 +02:00
|
|
|
/***********************************************************************
|
|
|
|
Copies types of columns contained in table to tuple. */
|
|
|
|
|
|
|
|
void
|
|
|
|
dict_table_copy_types(
|
|
|
|
/*==================*/
|
|
|
|
dtuple_t* tuple, /* in: data tuple */
|
|
|
|
dict_table_t* table); /* in: index */
|
|
|
|
/**************************************************************************
|
2001-10-10 22:47:08 +03:00
|
|
|
Looks for an index with the given id. NOTE that we do not reserve
|
|
|
|
the dictionary mutex: this function is for emergency purposes like
|
|
|
|
printing info of a corrupt database page! */
|
|
|
|
|
|
|
|
dict_index_t*
|
|
|
|
dict_index_find_on_id_low(
|
|
|
|
/*======================*/
|
|
|
|
/* out: index or NULL if not found from cache */
|
|
|
|
dulint id); /* in: index id */
|
|
|
|
/**************************************************************************
|
2006-09-21 01:39:09 -06:00
|
|
|
Adds an index to the dictionary cache. */
|
2001-02-17 14:19:19 +02:00
|
|
|
|
2006-09-21 01:39:09 -06:00
|
|
|
void
|
2001-02-17 14:19:19 +02:00
|
|
|
dict_index_add_to_cache(
|
|
|
|
/*====================*/
|
|
|
|
dict_table_t* table, /* in: table on which the index is */
|
2005-01-14 13:54:23 +02:00
|
|
|
dict_index_t* index, /* in, own: index; NOTE! The index memory
|
2001-02-17 14:19:19 +02:00
|
|
|
object is freed in this function! */
|
2005-01-14 13:54:23 +02:00
|
|
|
ulint page_no);/* in: root page number of the index */
|
2001-02-17 14:19:19 +02:00
|
|
|
/************************************************************************
|
|
|
|
Gets the number of fields in the internal representation of an index,
|
|
|
|
including fields added by the dictionary system. */
|
|
|
|
UNIV_INLINE
|
|
|
|
ulint
|
|
|
|
dict_index_get_n_fields(
|
|
|
|
/*====================*/
|
|
|
|
/* out: number of fields */
|
|
|
|
dict_index_t* index); /* in: an internal representation of index
|
|
|
|
(in the dictionary cache) */
|
|
|
|
/************************************************************************
|
|
|
|
Gets the number of fields in the internal representation of an index
|
|
|
|
that uniquely determine the position of an index entry in the index, if
|
|
|
|
we do not take multiversioning into account: in the B-tree use the value
|
|
|
|
returned by dict_index_get_n_unique_in_tree. */
|
|
|
|
UNIV_INLINE
|
|
|
|
ulint
|
|
|
|
dict_index_get_n_unique(
|
|
|
|
/*====================*/
|
|
|
|
/* out: number of fields */
|
|
|
|
dict_index_t* index); /* in: an internal representation of index
|
|
|
|
(in the dictionary cache) */
|
|
|
|
/************************************************************************
|
|
|
|
Gets the number of fields in the internal representation of an index
|
|
|
|
which uniquely determine the position of an index entry in the index, if
|
|
|
|
we also take multiversioning into account. */
|
|
|
|
UNIV_INLINE
|
|
|
|
ulint
|
|
|
|
dict_index_get_n_unique_in_tree(
|
|
|
|
/*============================*/
|
|
|
|
/* out: number of fields */
|
|
|
|
dict_index_t* index); /* in: an internal representation of index
|
|
|
|
(in the dictionary cache) */
|
|
|
|
/************************************************************************
|
|
|
|
Gets the number of user-defined ordering fields in the index. In the internal
|
|
|
|
representation we add the row id to the ordering fields to make all indexes
|
|
|
|
unique, but this function returns the number of fields the user defined
|
|
|
|
in the index as ordering fields. */
|
|
|
|
UNIV_INLINE
|
|
|
|
ulint
|
|
|
|
dict_index_get_n_ordering_defined_by_user(
|
|
|
|
/*======================================*/
|
|
|
|
/* out: number of fields */
|
|
|
|
dict_index_t* index); /* in: an internal representation of index
|
|
|
|
(in the dictionary cache) */
|
|
|
|
/************************************************************************
|
|
|
|
Gets the nth field of an index. */
|
|
|
|
UNIV_INLINE
|
|
|
|
dict_field_t*
|
|
|
|
dict_index_get_nth_field(
|
|
|
|
/*=====================*/
|
|
|
|
/* out: pointer to field object */
|
|
|
|
dict_index_t* index, /* in: index */
|
|
|
|
ulint pos); /* in: position of field */
|
|
|
|
/************************************************************************
|
2006-09-21 01:39:09 -06:00
|
|
|
Gets pointer to the nth column in an index. */
|
2001-02-17 14:19:19 +02:00
|
|
|
UNIV_INLINE
|
2006-09-21 01:39:09 -06:00
|
|
|
const dict_col_t*
|
|
|
|
dict_index_get_nth_col(
|
|
|
|
/*===================*/
|
|
|
|
/* out: column */
|
|
|
|
const dict_index_t* index, /* in: index */
|
|
|
|
ulint pos); /* in: position of the field */
|
2001-02-17 14:19:19 +02:00
|
|
|
/************************************************************************
|
|
|
|
Gets the column number of the nth field in an index. */
|
|
|
|
UNIV_INLINE
|
|
|
|
ulint
|
|
|
|
dict_index_get_nth_col_no(
|
|
|
|
/*======================*/
|
2006-09-21 01:39:09 -06:00
|
|
|
/* out: column number */
|
|
|
|
const dict_index_t* index, /* in: index */
|
|
|
|
ulint pos); /* in: position of the field */
|
2001-02-17 14:19:19 +02:00
|
|
|
/************************************************************************
|
|
|
|
Looks for column n in an index. */
|
|
|
|
|
|
|
|
ulint
|
|
|
|
dict_index_get_nth_col_pos(
|
|
|
|
/*=======================*/
|
|
|
|
/* out: position in internal representation
|
|
|
|
of the index; if not contained, returns
|
|
|
|
ULINT_UNDEFINED */
|
|
|
|
dict_index_t* index, /* in: index */
|
|
|
|
ulint n); /* in: column number */
|
|
|
|
/************************************************************************
|
2003-06-22 16:20:06 +03:00
|
|
|
Returns TRUE if the index contains a column or a prefix of that column. */
|
|
|
|
|
|
|
|
ibool
|
|
|
|
dict_index_contains_col_or_prefix(
|
|
|
|
/*==============================*/
|
|
|
|
/* out: TRUE if contains the column or its
|
|
|
|
prefix */
|
|
|
|
dict_index_t* index, /* in: index */
|
|
|
|
ulint n); /* in: column number */
|
|
|
|
/************************************************************************
|
2004-09-16 20:50:24 +03:00
|
|
|
Looks for a matching field in an index. The column has to be the same. The
|
|
|
|
column in index must be complete, or must contain a prefix longer than the
|
|
|
|
column in index2. That is, we must be able to construct the prefix in index2
|
|
|
|
from the prefix in index. */
|
2003-06-15 01:04:28 +03:00
|
|
|
|
|
|
|
ulint
|
|
|
|
dict_index_get_nth_field_pos(
|
|
|
|
/*=========================*/
|
|
|
|
/* out: position in internal representation
|
|
|
|
of the index; if not contained, returns
|
|
|
|
ULINT_UNDEFINED */
|
|
|
|
dict_index_t* index, /* in: index from which to search */
|
|
|
|
dict_index_t* index2, /* in: index */
|
|
|
|
ulint n); /* in: field number in index2 */
|
|
|
|
/************************************************************************
|
2001-02-17 14:19:19 +02:00
|
|
|
Looks for column n position in the clustered index. */
|
|
|
|
|
|
|
|
ulint
|
|
|
|
dict_table_get_nth_col_pos(
|
|
|
|
/*=======================*/
|
|
|
|
/* out: position in internal representation
|
|
|
|
of the clustered index */
|
|
|
|
dict_table_t* table, /* in: table */
|
|
|
|
ulint n); /* in: column number */
|
|
|
|
/************************************************************************
|
|
|
|
Returns the position of a system column in an index. */
|
|
|
|
UNIV_INLINE
|
|
|
|
ulint
|
|
|
|
dict_index_get_sys_col_pos(
|
|
|
|
/*=======================*/
|
|
|
|
/* out: position, ULINT_UNDEFINED if not
|
|
|
|
contained */
|
|
|
|
dict_index_t* index, /* in: index */
|
|
|
|
ulint type); /* in: DATA_ROW_ID, ... */
|
|
|
|
/***********************************************************************
|
2004-12-02 19:45:07 +02:00
|
|
|
Adds a column to index. */
|
|
|
|
|
|
|
|
void
|
|
|
|
dict_index_add_col(
|
|
|
|
/*===============*/
|
|
|
|
dict_index_t* index, /* in: index */
|
2006-09-21 01:39:09 -06:00
|
|
|
dict_table_t* table, /* in: table */
|
2004-12-02 19:45:07 +02:00
|
|
|
dict_col_t* col, /* in: column */
|
|
|
|
ulint prefix_len); /* in: column prefix length */
|
|
|
|
/***********************************************************************
|
2001-02-17 14:19:19 +02:00
|
|
|
Copies types of fields contained in index to tuple. */
|
|
|
|
|
|
|
|
void
|
|
|
|
dict_index_copy_types(
|
|
|
|
/*==================*/
|
|
|
|
dtuple_t* tuple, /* in: data tuple */
|
|
|
|
dict_index_t* index, /* in: index */
|
|
|
|
ulint n_fields); /* in: number of field types to copy */
|
|
|
|
/*************************************************************************
|
|
|
|
Gets the field column. */
|
|
|
|
UNIV_INLINE
|
2006-09-21 01:39:09 -06:00
|
|
|
const dict_col_t*
|
2001-02-17 14:19:19 +02:00
|
|
|
dict_field_get_col(
|
|
|
|
/*===============*/
|
2006-09-21 01:39:09 -06:00
|
|
|
const dict_field_t* field);
|
2001-02-17 14:19:19 +02:00
|
|
|
|
2006-10-20 12:36:15 -06:00
|
|
|
#ifdef UNIV_DEBUG
|
2001-02-17 14:19:19 +02:00
|
|
|
/**************************************************************************
|
|
|
|
Returns an index object if it is found in the dictionary cache. */
|
|
|
|
|
|
|
|
dict_index_t*
|
|
|
|
dict_index_get_if_in_cache(
|
|
|
|
/*=======================*/
|
|
|
|
/* out: index, NULL if not found */
|
|
|
|
dulint index_id); /* in: index id */
|
|
|
|
/**************************************************************************
|
|
|
|
Checks that a tuple has n_fields_cmp value in a sensible range, so that
|
|
|
|
no comparison can occur with the page number field in a node pointer. */
|
|
|
|
|
|
|
|
ibool
|
2006-09-21 01:39:09 -06:00
|
|
|
dict_index_check_search_tuple(
|
|
|
|
/*==========================*/
|
2001-02-17 14:19:19 +02:00
|
|
|
/* out: TRUE if ok */
|
2006-09-21 01:39:09 -06:00
|
|
|
dict_index_t* index, /* in: index */
|
2001-02-17 14:19:19 +02:00
|
|
|
dtuple_t* tuple); /* in: tuple used in a search */
|
Applied innodb-5.1-ss475 snapshot.
* Fix BUG#15650: "DELETE with LEFT JOIN crashes server with innodb_locks_unsafe_for binlog"
* Fix BUG#17134: "Partitions: uncommitted changes are visible"
* Fix BUG#17992: "Partitions: InnoDB, somehow rotten table after UPDATE"
row0ins.c: MySQL's partitioned table code does not set preduilt->sql_stat_start right
if it does an insert in the same statement after doing a search first in the same
partition table. We now write trx id always to the buffer, not just when flag
sql_stat_start is on. This will waste CPU time very sightly.
* Fix BUG#18077: "InnoDB uses full explicit table locks in stored FUNCTION"
* Fix BUG#18238: "When locks exhaust the buffer pool, InnoDB does not roll back the trx"
* Fix BUG#18252" "Disk space leak in updates of InnoDB BLOB rows in 5.0 and 5.1"
* Fix BUG#18283: "When InnoDB returns error 'lock table full', MySQL can write to binlog too much"
* Fix BUG#18350: "Use consistent read in CREATE ... SELECT ... if innodb_locks_unsafe_for_binlog"
* Fix BUG#18384: "InnoDB memory leak on duplicate key errors in 5.0 if row has many columns"
* Fix BUG#18934: "InnoDB crashes when table uses column names like DB_ROW_ID"
Refuse tables that use reserved column names.
* InnoDB's SQL parser:
- Add support for UNSIGNED types, EXIT keyword, quoted identifiers, user-function callbacks
for processing results of FETCH statements, bound literals, DATA_VARCHAR for bound literals.
- Allow bound literals of type non-INTEGER to be of length 0.
- Add make_flex.sh and update lexer/parser generation documentation.
- Add comment clarifying the difference between 'alias' and 'indirection' fields in sym_node_t.
- Remove never reached duplicate code in pars_set_dfield_type().
- Rewrite pars_info datatypes and APIs, add a few helper functions.
- Since the functions definitions in pars_info_t are accessed after pars_sql() returns
in the query graph execution stage, we can't free pars_info_t in pars_sql(). Instead,
make pars_sql() transfer ownership of pars_info_t to the created query graph, and
make que_graph_free() free it if needed.
- Allow access to system columns like DB_ROW_ID.
* Use bound literals in row_truncate_table_for_mysql, row_drop_table_for_mysql,
row_discard_tablespace_for_mysql, and row_rename_table_for_mysql.
* Setting an isolation level of the transaction to read committed weakens the locks for
this session similarly like the option innodb_locks_unsafe_for binlog. This patch removes
alnost all gap locking (used in next-key locking) and makes MySQL to release the row locks
on the rows which does not belong to result set. Additionally, nonlocking selects on
INSERT INTO SELECT, UPDATE ... (SELECT ...), and CREATE ... SELECT ... use a nonlocking
consistent read. If a binlog is used, then binlog format should be set to row based
binloging to make the execution of the complex SQL statements.
* Disable the statistic variables btr_search_n_hash_fail and n_hash_succ, n_hash_fail,
n_patt_succ, and n_searches of btr_search_t in builds without #ifdef UNIV_SEARCH_PERF_STAT.
* Make innodb.test faster. Group all consistent read test cases to a one test case and
wait their lock timeout after all have been send to the server. Decrease amount of rows
inserted in a certain test - this has no effect on the effectiveness of the test and
reduces the running time by ~10 sec. Remove temporary work-arounds from innodb.result
now that ALTER TABLE DROP FOREIGN KEY works once again.
* Make innodb_unsafe_binlog.test faster. Grout all consistent read test cases to a one
test case amd wait their lock timeout after all have been sent to the server. Remove
unnecessary option --loose_innodb_lock_wait_timeout.
* Print dictionary memory size in SHOW INNODB STATUS.
* Fix memory leaks in row_create_table_for_mysql() in rare corner cases.
* Remove code related to clustered tables. They were never implemented, and the
implementation would be challenging with ROW_FORMAT=COMPACT. Remove the table types
DICT_TABLE_CLUSTER_MEMBER and DICT_TABLE_CLUSTER and all related tests and functions.
dict_table_t: Remove mix_id, mix_len, mix_id_len, mix_id_buf, and cluster_name.
plan_t: Remove mixed_index.
dict_create_sys_tables_tuple(): Set MIX_ID=0, MIX_LEN=0, CLUSTER_NAME=NULL when
inserting into SYS_TABLES.
dict_tree_check_search_tuple(): Enclose in #ifdef UNIV_DEBUG.
* Move calling of thr_local_free() from trx_free_for_mysql() to
innobase_close_connection().
2006-04-23 12:48:31 +04:00
|
|
|
#endif /* UNIV_DEBUG */
|
2001-02-17 14:19:19 +02:00
|
|
|
/**************************************************************************
|
|
|
|
Builds a node pointer out of a physical record and a page number. */
|
|
|
|
|
|
|
|
dtuple_t*
|
2006-09-21 01:39:09 -06:00
|
|
|
dict_index_build_node_ptr(
|
|
|
|
/*======================*/
|
2001-02-17 14:19:19 +02:00
|
|
|
/* out, own: node pointer */
|
2006-09-21 01:39:09 -06:00
|
|
|
dict_index_t* index, /* in: index */
|
2003-10-07 17:28:59 +03:00
|
|
|
rec_t* rec, /* in: record for which to build node
|
|
|
|
pointer */
|
2001-02-17 14:19:19 +02:00
|
|
|
ulint page_no,/* in: page number to put in node pointer */
|
2001-11-17 13:48:39 +02:00
|
|
|
mem_heap_t* heap, /* in: memory heap where pointer created */
|
Applied innodb-5.1-ss269 snapshot.
Fixed BUGS:
#3300: "UPDATE statement with no index column in where condition locks
all rows"
Implement semi-consistent read to reduce lock conflicts at the cost
of breaking serializability.
ha_innobase::unlock_row(): reset the "did semi consistent read" flag
ha_innobase::was_semi_consistent_read(),
ha_innobase::try_semi_consistent_read(): new methods
row_prebuilt_t, row_create_prebuilt(): add field row_read_type for
keeping track of semi-consistent reads
row_vers_build_for_semi_consistent_read(),
row_sel_build_committed_vers_for_mysql(): new functions
row_search_for_mysql(): implement semi-consistent reads
#9802: "Foreign key checks disallow alter table".
Added test cases.
#12456: "Cursor shows incorrect data - DML does not affect,
probably caching"
This patch implements a high-granularity read view to be used with
cursors. In this high-granularity consistent read view modifications
done by the creating transaction after the cursor is created or
future transactions are not visible. But those modifications that
transaction did before the cursor was created are visible.
#12701: "Support >4GB buffer pool and log files on 64-bit Windows"
Do not call os_file_create_tmpfile() at runtime. Instead, create all
tempfiles at startup and guard access to them with mutexes.
#13778: "If FOREIGN_KEY_CHECKS=0, one can create inconsistent FOREIGN KEYs".
When FOREIGN_KEY_CHECKS=0 we still need to check that datatypes between
foreign key references are compatible.
#14189: "VARBINARY and BINARY variables: trailing space ignored with InnoDB"
innobase_init(): Assert that
DATA_MYSQL_BINARY_CHARSET_COLL == my_charset_bin.number.
dtype_get_pad_char(): Do not pad VARBINARY or BINARY columns.
row_ins_cascade_calc_update_vec(): Refuse ON UPDATE CASCADE when trying
to change the length of a VARBINARY column that refers to or is referenced
by a BINARY column. BINARY columns are no longer padded on comparison,
and thus they cannot be padded on storage either.
#14747: "Race condition can cause btr_search_drop_page_hash_index() to crash"
Note that buf_block_t::index should be protected by btr_search_latch
or an s-latch or x-latch on the index page.
btr_search_drop_page_hash_index(): Read block->index while holding
btr_search_latch and use the cached value in the loop. Remove some
redundant assertions.
#15108: "mysqld crashes when innodb_log_file_size is set > 4G"
#15308: "Problem of Order with Enum Column in Primary Key"
#15550: "mysqld crashes in printing a FOREIGN KEY error in InnoDB"
row_ins_foreign_report_add_err(): When printing the parent record,
use the index in the parent table rather than the index in the child table.
#15653: "Slow inserts to InnoDB if many thousands of .ibd files"
Keep track on unflushed modifications to file spaces. When there are tens
of thousands of file spaces, flushing all files in fil_flush_file_spaces()
would be very slow.
fil_flush_file_spaces(): Only flush unflushed file spaces.
fil_space_t, fil_system_t: Add a list of unflushed spaces.
#15991: "innodb-file-per-table + symlink database + rename = cr"
os_file_handle_error(): Map the error codes EXDEV, ENOTDIR, and EISDIR
to the new code OS_FILE_PATH_ERROR. Treat this code as OS_FILE_PATH_ERROR.
This fixes the crash on RENAME TABLE when the .ibd file is a symbolic link
to a different file system.
#16157: "InnoDB crashes when main location settings are empty"
This patch is from Heikki.
#16298: "InnoDB segfaults in INSERTs in upgrade of 4.0 -> 5.0 tables
with VARCHAR BINARY"
dict_load_columns(): Set the charset-collation code
DATA_MYSQL_BINARY_CHARSET_COLL for those binary string columns
that lack a charset-collation code, i.e., the tables were created
with an older version of MySQL/InnoDB than 4.1.2.
#16229: "MySQL/InnoDB uses full explicit table locks in trigger processing"
Take a InnoDB table lock only if user has explicitly requested a table
lock. Added some additional comments to store_lock() and external_lock().
#16387: "InnoDB crash when dropping a foreign key <table>_ibfk_0"
Do not mistake TABLENAME_ibfk_0 for auto-generated id.
dict_table_get_highest_foreign_id(): Ignore foreign constraint
identifiers starting with the pattern TABLENAME_ibfk_0.
#16582: "InnoDB: Error in an adaptive hash index pointer to page"
Account for a race condition when dropping the adaptive hash index
for a B-tree page.
btr_search_drop_page_hash_index(): Retry the operation if a hash index
with different parameters was built meanwhile. Add diagnostics for the
case that hash node pointers to the page remain.
btr_search_info_update_hash(), btr_search_info_update_slow():
Document the parameter "info" as in/out.
#16814: "SHOW INNODB STATUS format error in LATEST FOREIGN KEY ERROR
section"
Add a missing newline to the LAST FOREIGN KEY ERROR section in SHOW
INNODB STATUS output.
dict_foreign_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 unititialised values"
buf_block_init(): Reset magic_n, buf_fix_count and io_fix to avoid
testing uninitialized variables.
2006-03-10 19:22:21 +03:00
|
|
|
ulint level); /* in: level of rec in tree: 0 means leaf
|
2001-11-17 13:48:39 +02:00
|
|
|
level */
|
2001-02-17 14:19:19 +02:00
|
|
|
/**************************************************************************
|
|
|
|
Copies an initial segment of a physical record, long enough to specify an
|
|
|
|
index entry uniquely. */
|
|
|
|
|
|
|
|
rec_t*
|
2006-09-21 01:39:09 -06:00
|
|
|
dict_index_copy_rec_order_prefix(
|
|
|
|
/*=============================*/
|
2001-02-17 14:19:19 +02:00
|
|
|
/* out: pointer to the prefix record */
|
2006-09-21 01:39:09 -06:00
|
|
|
dict_index_t* index, /* in: index */
|
2001-02-17 14:19:19 +02:00
|
|
|
rec_t* rec, /* in: record for which to copy prefix */
|
2004-12-02 19:45:07 +02:00
|
|
|
ulint* n_fields,/* out: number of fields copied */
|
2001-02-17 14:19:19 +02:00
|
|
|
byte** buf, /* in/out: memory buffer for the copied prefix,
|
|
|
|
or NULL */
|
|
|
|
ulint* buf_size);/* in/out: buffer size */
|
|
|
|
/**************************************************************************
|
|
|
|
Builds a typed data tuple out of a physical record. */
|
|
|
|
|
|
|
|
dtuple_t*
|
2006-09-21 01:39:09 -06:00
|
|
|
dict_index_build_data_tuple(
|
|
|
|
/*========================*/
|
2001-02-17 14:19:19 +02:00
|
|
|
/* out, own: data tuple */
|
2006-09-21 01:39:09 -06:00
|
|
|
dict_index_t* index, /* in: index */
|
2001-02-17 14:19:19 +02:00
|
|
|
rec_t* rec, /* in: record for which to build data tuple */
|
2004-12-02 19:45:07 +02:00
|
|
|
ulint n_fields,/* in: number of data fields */
|
2001-02-17 14:19:19 +02:00
|
|
|
mem_heap_t* heap); /* in: memory heap where tuple created */
|
|
|
|
/*************************************************************************
|
|
|
|
Gets the space id of the root of the index tree. */
|
|
|
|
UNIV_INLINE
|
|
|
|
ulint
|
2006-09-21 01:39:09 -06:00
|
|
|
dict_index_get_space(
|
|
|
|
/*=================*/
|
2001-02-17 14:19:19 +02:00
|
|
|
/* out: space id */
|
2006-09-21 01:39:09 -06:00
|
|
|
dict_index_t* index); /* in: index */
|
2001-02-17 14:19:19 +02:00
|
|
|
/*************************************************************************
|
|
|
|
Sets the space id of the root of the index tree. */
|
|
|
|
UNIV_INLINE
|
|
|
|
void
|
2006-09-21 01:39:09 -06:00
|
|
|
dict_index_set_space(
|
|
|
|
/*=================*/
|
|
|
|
dict_index_t* index, /* in: index */
|
2001-02-17 14:19:19 +02:00
|
|
|
ulint space); /* in: space id */
|
|
|
|
/*************************************************************************
|
|
|
|
Gets the page number of the root of the index tree. */
|
|
|
|
UNIV_INLINE
|
|
|
|
ulint
|
2006-09-21 01:39:09 -06:00
|
|
|
dict_index_get_page(
|
|
|
|
/*================*/
|
2001-02-17 14:19:19 +02:00
|
|
|
/* out: page number */
|
2006-09-21 01:39:09 -06:00
|
|
|
dict_index_t* tree); /* in: index */
|
2001-02-17 14:19:19 +02:00
|
|
|
/*************************************************************************
|
|
|
|
Sets the page number of the root of index tree. */
|
|
|
|
UNIV_INLINE
|
|
|
|
void
|
2006-09-21 01:39:09 -06:00
|
|
|
dict_index_set_page(
|
|
|
|
/*================*/
|
|
|
|
dict_index_t* index, /* in: index */
|
2001-02-17 14:19:19 +02:00
|
|
|
ulint page); /* in: page number */
|
|
|
|
/*************************************************************************
|
|
|
|
Gets the type of the index tree. */
|
|
|
|
UNIV_INLINE
|
|
|
|
ulint
|
2006-09-21 01:39:09 -06:00
|
|
|
dict_index_get_type(
|
|
|
|
/*================*/
|
2001-02-17 14:19:19 +02:00
|
|
|
/* out: type */
|
2006-09-21 01:39:09 -06:00
|
|
|
dict_index_t* index); /* in: index */
|
2001-02-17 14:19:19 +02:00
|
|
|
/*************************************************************************
|
|
|
|
Gets the read-write lock of the index tree. */
|
|
|
|
UNIV_INLINE
|
|
|
|
rw_lock_t*
|
2006-09-21 01:39:09 -06:00
|
|
|
dict_index_get_lock(
|
|
|
|
/*================*/
|
2001-02-17 14:19:19 +02:00
|
|
|
/* out: read-write lock */
|
2006-09-21 01:39:09 -06:00
|
|
|
dict_index_t* index); /* in: index */
|
2001-02-17 14:19:19 +02:00
|
|
|
/************************************************************************
|
|
|
|
Returns free space reserved for future updates of records. This is
|
|
|
|
relevant only in the case of many consecutive inserts, as updates
|
|
|
|
which make the records bigger might fragment the index. */
|
|
|
|
UNIV_INLINE
|
|
|
|
ulint
|
2006-09-21 01:39:09 -06:00
|
|
|
dict_index_get_space_reserve(void);
|
|
|
|
/*==============================*/
|
2001-02-17 14:19:19 +02:00
|
|
|
/* out: number of free bytes on page,
|
|
|
|
reserved for updates */
|
|
|
|
/*************************************************************************
|
2001-10-10 22:47:08 +03:00
|
|
|
Calculates the minimum record length in an index. */
|
|
|
|
|
|
|
|
ulint
|
|
|
|
dict_index_calc_min_rec_len(
|
|
|
|
/*========================*/
|
|
|
|
dict_index_t* index); /* in: index */
|
|
|
|
/*************************************************************************
|
|
|
|
Calculates new estimates for table and index statistics. The statistics
|
|
|
|
are used in query optimization. */
|
|
|
|
|
|
|
|
void
|
|
|
|
dict_update_statistics_low(
|
|
|
|
/*=======================*/
|
|
|
|
dict_table_t* table, /* in: table */
|
|
|
|
ibool has_dict_mutex);/* in: TRUE if the caller has the
|
Applied innodb-5.1-ss269 snapshot.
Fixed BUGS:
#3300: "UPDATE statement with no index column in where condition locks
all rows"
Implement semi-consistent read to reduce lock conflicts at the cost
of breaking serializability.
ha_innobase::unlock_row(): reset the "did semi consistent read" flag
ha_innobase::was_semi_consistent_read(),
ha_innobase::try_semi_consistent_read(): new methods
row_prebuilt_t, row_create_prebuilt(): add field row_read_type for
keeping track of semi-consistent reads
row_vers_build_for_semi_consistent_read(),
row_sel_build_committed_vers_for_mysql(): new functions
row_search_for_mysql(): implement semi-consistent reads
#9802: "Foreign key checks disallow alter table".
Added test cases.
#12456: "Cursor shows incorrect data - DML does not affect,
probably caching"
This patch implements a high-granularity read view to be used with
cursors. In this high-granularity consistent read view modifications
done by the creating transaction after the cursor is created or
future transactions are not visible. But those modifications that
transaction did before the cursor was created are visible.
#12701: "Support >4GB buffer pool and log files on 64-bit Windows"
Do not call os_file_create_tmpfile() at runtime. Instead, create all
tempfiles at startup and guard access to them with mutexes.
#13778: "If FOREIGN_KEY_CHECKS=0, one can create inconsistent FOREIGN KEYs".
When FOREIGN_KEY_CHECKS=0 we still need to check that datatypes between
foreign key references are compatible.
#14189: "VARBINARY and BINARY variables: trailing space ignored with InnoDB"
innobase_init(): Assert that
DATA_MYSQL_BINARY_CHARSET_COLL == my_charset_bin.number.
dtype_get_pad_char(): Do not pad VARBINARY or BINARY columns.
row_ins_cascade_calc_update_vec(): Refuse ON UPDATE CASCADE when trying
to change the length of a VARBINARY column that refers to or is referenced
by a BINARY column. BINARY columns are no longer padded on comparison,
and thus they cannot be padded on storage either.
#14747: "Race condition can cause btr_search_drop_page_hash_index() to crash"
Note that buf_block_t::index should be protected by btr_search_latch
or an s-latch or x-latch on the index page.
btr_search_drop_page_hash_index(): Read block->index while holding
btr_search_latch and use the cached value in the loop. Remove some
redundant assertions.
#15108: "mysqld crashes when innodb_log_file_size is set > 4G"
#15308: "Problem of Order with Enum Column in Primary Key"
#15550: "mysqld crashes in printing a FOREIGN KEY error in InnoDB"
row_ins_foreign_report_add_err(): When printing the parent record,
use the index in the parent table rather than the index in the child table.
#15653: "Slow inserts to InnoDB if many thousands of .ibd files"
Keep track on unflushed modifications to file spaces. When there are tens
of thousands of file spaces, flushing all files in fil_flush_file_spaces()
would be very slow.
fil_flush_file_spaces(): Only flush unflushed file spaces.
fil_space_t, fil_system_t: Add a list of unflushed spaces.
#15991: "innodb-file-per-table + symlink database + rename = cr"
os_file_handle_error(): Map the error codes EXDEV, ENOTDIR, and EISDIR
to the new code OS_FILE_PATH_ERROR. Treat this code as OS_FILE_PATH_ERROR.
This fixes the crash on RENAME TABLE when the .ibd file is a symbolic link
to a different file system.
#16157: "InnoDB crashes when main location settings are empty"
This patch is from Heikki.
#16298: "InnoDB segfaults in INSERTs in upgrade of 4.0 -> 5.0 tables
with VARCHAR BINARY"
dict_load_columns(): Set the charset-collation code
DATA_MYSQL_BINARY_CHARSET_COLL for those binary string columns
that lack a charset-collation code, i.e., the tables were created
with an older version of MySQL/InnoDB than 4.1.2.
#16229: "MySQL/InnoDB uses full explicit table locks in trigger processing"
Take a InnoDB table lock only if user has explicitly requested a table
lock. Added some additional comments to store_lock() and external_lock().
#16387: "InnoDB crash when dropping a foreign key <table>_ibfk_0"
Do not mistake TABLENAME_ibfk_0 for auto-generated id.
dict_table_get_highest_foreign_id(): Ignore foreign constraint
identifiers starting with the pattern TABLENAME_ibfk_0.
#16582: "InnoDB: Error in an adaptive hash index pointer to page"
Account for a race condition when dropping the adaptive hash index
for a B-tree page.
btr_search_drop_page_hash_index(): Retry the operation if a hash index
with different parameters was built meanwhile. Add diagnostics for the
case that hash node pointers to the page remain.
btr_search_info_update_hash(), btr_search_info_update_slow():
Document the parameter "info" as in/out.
#16814: "SHOW INNODB STATUS format error in LATEST FOREIGN KEY ERROR
section"
Add a missing newline to the LAST FOREIGN KEY ERROR section in SHOW
INNODB STATUS output.
dict_foreign_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 unititialised values"
buf_block_init(): Reset magic_n, buf_fix_count and io_fix to avoid
testing uninitialized variables.
2006-03-10 19:22:21 +03:00
|
|
|
dictionary mutex */
|
2001-10-10 22:47:08 +03:00
|
|
|
/*************************************************************************
|
2001-02-17 14:19:19 +02:00
|
|
|
Calculates new estimates for table and index statistics. The statistics
|
|
|
|
are used in query optimization. */
|
|
|
|
|
|
|
|
void
|
|
|
|
dict_update_statistics(
|
|
|
|
/*===================*/
|
|
|
|
dict_table_t* table); /* in: table */
|
|
|
|
/************************************************************************
|
|
|
|
Reserves the dictionary system mutex for MySQL. */
|
|
|
|
|
|
|
|
void
|
|
|
|
dict_mutex_enter_for_mysql(void);
|
|
|
|
/*============================*/
|
|
|
|
/************************************************************************
|
|
|
|
Releases the dictionary system mutex for MySQL. */
|
|
|
|
|
|
|
|
void
|
|
|
|
dict_mutex_exit_for_mysql(void);
|
|
|
|
/*===========================*/
|
2004-04-02 16:25:48 +03:00
|
|
|
/************************************************************************
|
|
|
|
Checks if the database name in two table names is the same. */
|
2001-02-17 14:19:19 +02:00
|
|
|
|
2004-04-02 16:25:48 +03:00
|
|
|
ibool
|
|
|
|
dict_tables_have_same_db(
|
|
|
|
/*=====================*/
|
|
|
|
/* out: TRUE if same db name */
|
|
|
|
const char* name1, /* in: table name in the form
|
|
|
|
dbname '/' tablename */
|
|
|
|
const char* name2); /* in: table name in the form
|
|
|
|
dbname '/' tablename */
|
2004-10-14 15:36:36 +03:00
|
|
|
/*************************************************************************
|
|
|
|
Scans from pointer onwards. Stops if is at the start of a copy of
|
|
|
|
'string' where characters are compared without case sensitivity. Stops
|
|
|
|
also at '\0'. */
|
|
|
|
|
|
|
|
const char*
|
|
|
|
dict_scan_to(
|
|
|
|
/*=========*/
|
|
|
|
/* out: scanned up to this */
|
|
|
|
const char* ptr, /* in: scan from */
|
|
|
|
const char* string);/* in: look for this */
|
2003-05-04 23:24:23 +03:00
|
|
|
/* Buffers for storing detailed information about the latest foreign key
|
|
|
|
and unique key errors */
|
2004-04-06 16:14:43 +03:00
|
|
|
extern FILE* dict_foreign_err_file;
|
2003-05-04 23:24:23 +03:00
|
|
|
extern mutex_t dict_foreign_err_mutex; /* mutex protecting the buffers */
|
2001-02-17 14:19:19 +02:00
|
|
|
|
2001-10-10 22:47:08 +03:00
|
|
|
extern dict_sys_t* dict_sys; /* the dictionary system */
|
2002-10-29 23:16:46 +02:00
|
|
|
extern rw_lock_t dict_operation_lock;
|
2001-02-17 14:19:19 +02:00
|
|
|
|
|
|
|
/* Dictionary system struct */
|
|
|
|
struct dict_sys_struct{
|
|
|
|
mutex_t mutex; /* mutex protecting the data
|
|
|
|
dictionary; protects also the
|
|
|
|
disk-based dictionary system tables;
|
|
|
|
this mutex serializes CREATE TABLE
|
|
|
|
and DROP TABLE, as well as reading
|
|
|
|
the dictionary data for a table from
|
|
|
|
system tables */
|
|
|
|
dulint row_id; /* the next row id to assign;
|
|
|
|
NOTE that at a checkpoint this
|
|
|
|
must be written to the dict system
|
|
|
|
header and flushed to a file; in
|
|
|
|
recovery this must be derived from
|
|
|
|
the log records */
|
Applied innodb-5.1-ss269 snapshot.
Fixed BUGS:
#3300: "UPDATE statement with no index column in where condition locks
all rows"
Implement semi-consistent read to reduce lock conflicts at the cost
of breaking serializability.
ha_innobase::unlock_row(): reset the "did semi consistent read" flag
ha_innobase::was_semi_consistent_read(),
ha_innobase::try_semi_consistent_read(): new methods
row_prebuilt_t, row_create_prebuilt(): add field row_read_type for
keeping track of semi-consistent reads
row_vers_build_for_semi_consistent_read(),
row_sel_build_committed_vers_for_mysql(): new functions
row_search_for_mysql(): implement semi-consistent reads
#9802: "Foreign key checks disallow alter table".
Added test cases.
#12456: "Cursor shows incorrect data - DML does not affect,
probably caching"
This patch implements a high-granularity read view to be used with
cursors. In this high-granularity consistent read view modifications
done by the creating transaction after the cursor is created or
future transactions are not visible. But those modifications that
transaction did before the cursor was created are visible.
#12701: "Support >4GB buffer pool and log files on 64-bit Windows"
Do not call os_file_create_tmpfile() at runtime. Instead, create all
tempfiles at startup and guard access to them with mutexes.
#13778: "If FOREIGN_KEY_CHECKS=0, one can create inconsistent FOREIGN KEYs".
When FOREIGN_KEY_CHECKS=0 we still need to check that datatypes between
foreign key references are compatible.
#14189: "VARBINARY and BINARY variables: trailing space ignored with InnoDB"
innobase_init(): Assert that
DATA_MYSQL_BINARY_CHARSET_COLL == my_charset_bin.number.
dtype_get_pad_char(): Do not pad VARBINARY or BINARY columns.
row_ins_cascade_calc_update_vec(): Refuse ON UPDATE CASCADE when trying
to change the length of a VARBINARY column that refers to or is referenced
by a BINARY column. BINARY columns are no longer padded on comparison,
and thus they cannot be padded on storage either.
#14747: "Race condition can cause btr_search_drop_page_hash_index() to crash"
Note that buf_block_t::index should be protected by btr_search_latch
or an s-latch or x-latch on the index page.
btr_search_drop_page_hash_index(): Read block->index while holding
btr_search_latch and use the cached value in the loop. Remove some
redundant assertions.
#15108: "mysqld crashes when innodb_log_file_size is set > 4G"
#15308: "Problem of Order with Enum Column in Primary Key"
#15550: "mysqld crashes in printing a FOREIGN KEY error in InnoDB"
row_ins_foreign_report_add_err(): When printing the parent record,
use the index in the parent table rather than the index in the child table.
#15653: "Slow inserts to InnoDB if many thousands of .ibd files"
Keep track on unflushed modifications to file spaces. When there are tens
of thousands of file spaces, flushing all files in fil_flush_file_spaces()
would be very slow.
fil_flush_file_spaces(): Only flush unflushed file spaces.
fil_space_t, fil_system_t: Add a list of unflushed spaces.
#15991: "innodb-file-per-table + symlink database + rename = cr"
os_file_handle_error(): Map the error codes EXDEV, ENOTDIR, and EISDIR
to the new code OS_FILE_PATH_ERROR. Treat this code as OS_FILE_PATH_ERROR.
This fixes the crash on RENAME TABLE when the .ibd file is a symbolic link
to a different file system.
#16157: "InnoDB crashes when main location settings are empty"
This patch is from Heikki.
#16298: "InnoDB segfaults in INSERTs in upgrade of 4.0 -> 5.0 tables
with VARCHAR BINARY"
dict_load_columns(): Set the charset-collation code
DATA_MYSQL_BINARY_CHARSET_COLL for those binary string columns
that lack a charset-collation code, i.e., the tables were created
with an older version of MySQL/InnoDB than 4.1.2.
#16229: "MySQL/InnoDB uses full explicit table locks in trigger processing"
Take a InnoDB table lock only if user has explicitly requested a table
lock. Added some additional comments to store_lock() and external_lock().
#16387: "InnoDB crash when dropping a foreign key <table>_ibfk_0"
Do not mistake TABLENAME_ibfk_0 for auto-generated id.
dict_table_get_highest_foreign_id(): Ignore foreign constraint
identifiers starting with the pattern TABLENAME_ibfk_0.
#16582: "InnoDB: Error in an adaptive hash index pointer to page"
Account for a race condition when dropping the adaptive hash index
for a B-tree page.
btr_search_drop_page_hash_index(): Retry the operation if a hash index
with different parameters was built meanwhile. Add diagnostics for the
case that hash node pointers to the page remain.
btr_search_info_update_hash(), btr_search_info_update_slow():
Document the parameter "info" as in/out.
#16814: "SHOW INNODB STATUS format error in LATEST FOREIGN KEY ERROR
section"
Add a missing newline to the LAST FOREIGN KEY ERROR section in SHOW
INNODB STATUS output.
dict_foreign_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 unititialised values"
buf_block_init(): Reset magic_n, buf_fix_count and io_fix to avoid
testing uninitialized variables.
2006-03-10 19:22:21 +03:00
|
|
|
hash_table_t* table_hash; /* hash table of the tables, based
|
2001-02-17 14:19:19 +02:00
|
|
|
on name */
|
Applied innodb-5.1-ss269 snapshot.
Fixed BUGS:
#3300: "UPDATE statement with no index column in where condition locks
all rows"
Implement semi-consistent read to reduce lock conflicts at the cost
of breaking serializability.
ha_innobase::unlock_row(): reset the "did semi consistent read" flag
ha_innobase::was_semi_consistent_read(),
ha_innobase::try_semi_consistent_read(): new methods
row_prebuilt_t, row_create_prebuilt(): add field row_read_type for
keeping track of semi-consistent reads
row_vers_build_for_semi_consistent_read(),
row_sel_build_committed_vers_for_mysql(): new functions
row_search_for_mysql(): implement semi-consistent reads
#9802: "Foreign key checks disallow alter table".
Added test cases.
#12456: "Cursor shows incorrect data - DML does not affect,
probably caching"
This patch implements a high-granularity read view to be used with
cursors. In this high-granularity consistent read view modifications
done by the creating transaction after the cursor is created or
future transactions are not visible. But those modifications that
transaction did before the cursor was created are visible.
#12701: "Support >4GB buffer pool and log files on 64-bit Windows"
Do not call os_file_create_tmpfile() at runtime. Instead, create all
tempfiles at startup and guard access to them with mutexes.
#13778: "If FOREIGN_KEY_CHECKS=0, one can create inconsistent FOREIGN KEYs".
When FOREIGN_KEY_CHECKS=0 we still need to check that datatypes between
foreign key references are compatible.
#14189: "VARBINARY and BINARY variables: trailing space ignored with InnoDB"
innobase_init(): Assert that
DATA_MYSQL_BINARY_CHARSET_COLL == my_charset_bin.number.
dtype_get_pad_char(): Do not pad VARBINARY or BINARY columns.
row_ins_cascade_calc_update_vec(): Refuse ON UPDATE CASCADE when trying
to change the length of a VARBINARY column that refers to or is referenced
by a BINARY column. BINARY columns are no longer padded on comparison,
and thus they cannot be padded on storage either.
#14747: "Race condition can cause btr_search_drop_page_hash_index() to crash"
Note that buf_block_t::index should be protected by btr_search_latch
or an s-latch or x-latch on the index page.
btr_search_drop_page_hash_index(): Read block->index while holding
btr_search_latch and use the cached value in the loop. Remove some
redundant assertions.
#15108: "mysqld crashes when innodb_log_file_size is set > 4G"
#15308: "Problem of Order with Enum Column in Primary Key"
#15550: "mysqld crashes in printing a FOREIGN KEY error in InnoDB"
row_ins_foreign_report_add_err(): When printing the parent record,
use the index in the parent table rather than the index in the child table.
#15653: "Slow inserts to InnoDB if many thousands of .ibd files"
Keep track on unflushed modifications to file spaces. When there are tens
of thousands of file spaces, flushing all files in fil_flush_file_spaces()
would be very slow.
fil_flush_file_spaces(): Only flush unflushed file spaces.
fil_space_t, fil_system_t: Add a list of unflushed spaces.
#15991: "innodb-file-per-table + symlink database + rename = cr"
os_file_handle_error(): Map the error codes EXDEV, ENOTDIR, and EISDIR
to the new code OS_FILE_PATH_ERROR. Treat this code as OS_FILE_PATH_ERROR.
This fixes the crash on RENAME TABLE when the .ibd file is a symbolic link
to a different file system.
#16157: "InnoDB crashes when main location settings are empty"
This patch is from Heikki.
#16298: "InnoDB segfaults in INSERTs in upgrade of 4.0 -> 5.0 tables
with VARCHAR BINARY"
dict_load_columns(): Set the charset-collation code
DATA_MYSQL_BINARY_CHARSET_COLL for those binary string columns
that lack a charset-collation code, i.e., the tables were created
with an older version of MySQL/InnoDB than 4.1.2.
#16229: "MySQL/InnoDB uses full explicit table locks in trigger processing"
Take a InnoDB table lock only if user has explicitly requested a table
lock. Added some additional comments to store_lock() and external_lock().
#16387: "InnoDB crash when dropping a foreign key <table>_ibfk_0"
Do not mistake TABLENAME_ibfk_0 for auto-generated id.
dict_table_get_highest_foreign_id(): Ignore foreign constraint
identifiers starting with the pattern TABLENAME_ibfk_0.
#16582: "InnoDB: Error in an adaptive hash index pointer to page"
Account for a race condition when dropping the adaptive hash index
for a B-tree page.
btr_search_drop_page_hash_index(): Retry the operation if a hash index
with different parameters was built meanwhile. Add diagnostics for the
case that hash node pointers to the page remain.
btr_search_info_update_hash(), btr_search_info_update_slow():
Document the parameter "info" as in/out.
#16814: "SHOW INNODB STATUS format error in LATEST FOREIGN KEY ERROR
section"
Add a missing newline to the LAST FOREIGN KEY ERROR section in SHOW
INNODB STATUS output.
dict_foreign_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 unititialised values"
buf_block_init(): Reset magic_n, buf_fix_count and io_fix to avoid
testing uninitialized variables.
2006-03-10 19:22:21 +03:00
|
|
|
hash_table_t* table_id_hash; /* hash table of the tables, based
|
2001-02-17 14:19:19 +02:00
|
|
|
on id */
|
|
|
|
UT_LIST_BASE_NODE_T(dict_table_t)
|
Applied innodb-5.1-ss269 snapshot.
Fixed BUGS:
#3300: "UPDATE statement with no index column in where condition locks
all rows"
Implement semi-consistent read to reduce lock conflicts at the cost
of breaking serializability.
ha_innobase::unlock_row(): reset the "did semi consistent read" flag
ha_innobase::was_semi_consistent_read(),
ha_innobase::try_semi_consistent_read(): new methods
row_prebuilt_t, row_create_prebuilt(): add field row_read_type for
keeping track of semi-consistent reads
row_vers_build_for_semi_consistent_read(),
row_sel_build_committed_vers_for_mysql(): new functions
row_search_for_mysql(): implement semi-consistent reads
#9802: "Foreign key checks disallow alter table".
Added test cases.
#12456: "Cursor shows incorrect data - DML does not affect,
probably caching"
This patch implements a high-granularity read view to be used with
cursors. In this high-granularity consistent read view modifications
done by the creating transaction after the cursor is created or
future transactions are not visible. But those modifications that
transaction did before the cursor was created are visible.
#12701: "Support >4GB buffer pool and log files on 64-bit Windows"
Do not call os_file_create_tmpfile() at runtime. Instead, create all
tempfiles at startup and guard access to them with mutexes.
#13778: "If FOREIGN_KEY_CHECKS=0, one can create inconsistent FOREIGN KEYs".
When FOREIGN_KEY_CHECKS=0 we still need to check that datatypes between
foreign key references are compatible.
#14189: "VARBINARY and BINARY variables: trailing space ignored with InnoDB"
innobase_init(): Assert that
DATA_MYSQL_BINARY_CHARSET_COLL == my_charset_bin.number.
dtype_get_pad_char(): Do not pad VARBINARY or BINARY columns.
row_ins_cascade_calc_update_vec(): Refuse ON UPDATE CASCADE when trying
to change the length of a VARBINARY column that refers to or is referenced
by a BINARY column. BINARY columns are no longer padded on comparison,
and thus they cannot be padded on storage either.
#14747: "Race condition can cause btr_search_drop_page_hash_index() to crash"
Note that buf_block_t::index should be protected by btr_search_latch
or an s-latch or x-latch on the index page.
btr_search_drop_page_hash_index(): Read block->index while holding
btr_search_latch and use the cached value in the loop. Remove some
redundant assertions.
#15108: "mysqld crashes when innodb_log_file_size is set > 4G"
#15308: "Problem of Order with Enum Column in Primary Key"
#15550: "mysqld crashes in printing a FOREIGN KEY error in InnoDB"
row_ins_foreign_report_add_err(): When printing the parent record,
use the index in the parent table rather than the index in the child table.
#15653: "Slow inserts to InnoDB if many thousands of .ibd files"
Keep track on unflushed modifications to file spaces. When there are tens
of thousands of file spaces, flushing all files in fil_flush_file_spaces()
would be very slow.
fil_flush_file_spaces(): Only flush unflushed file spaces.
fil_space_t, fil_system_t: Add a list of unflushed spaces.
#15991: "innodb-file-per-table + symlink database + rename = cr"
os_file_handle_error(): Map the error codes EXDEV, ENOTDIR, and EISDIR
to the new code OS_FILE_PATH_ERROR. Treat this code as OS_FILE_PATH_ERROR.
This fixes the crash on RENAME TABLE when the .ibd file is a symbolic link
to a different file system.
#16157: "InnoDB crashes when main location settings are empty"
This patch is from Heikki.
#16298: "InnoDB segfaults in INSERTs in upgrade of 4.0 -> 5.0 tables
with VARCHAR BINARY"
dict_load_columns(): Set the charset-collation code
DATA_MYSQL_BINARY_CHARSET_COLL for those binary string columns
that lack a charset-collation code, i.e., the tables were created
with an older version of MySQL/InnoDB than 4.1.2.
#16229: "MySQL/InnoDB uses full explicit table locks in trigger processing"
Take a InnoDB table lock only if user has explicitly requested a table
lock. Added some additional comments to store_lock() and external_lock().
#16387: "InnoDB crash when dropping a foreign key <table>_ibfk_0"
Do not mistake TABLENAME_ibfk_0 for auto-generated id.
dict_table_get_highest_foreign_id(): Ignore foreign constraint
identifiers starting with the pattern TABLENAME_ibfk_0.
#16582: "InnoDB: Error in an adaptive hash index pointer to page"
Account for a race condition when dropping the adaptive hash index
for a B-tree page.
btr_search_drop_page_hash_index(): Retry the operation if a hash index
with different parameters was built meanwhile. Add diagnostics for the
case that hash node pointers to the page remain.
btr_search_info_update_hash(), btr_search_info_update_slow():
Document the parameter "info" as in/out.
#16814: "SHOW INNODB STATUS format error in LATEST FOREIGN KEY ERROR
section"
Add a missing newline to the LAST FOREIGN KEY ERROR section in SHOW
INNODB STATUS output.
dict_foreign_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 unititialised values"
buf_block_init(): Reset magic_n, buf_fix_count and io_fix to avoid
testing uninitialized variables.
2006-03-10 19:22:21 +03:00
|
|
|
table_LRU; /* LRU list of tables */
|
2001-02-17 14:19:19 +02:00
|
|
|
ulint size; /* varying space in bytes occupied
|
|
|
|
by the data dictionary table and
|
|
|
|
index objects */
|
|
|
|
dict_table_t* sys_tables; /* SYS_TABLES table */
|
|
|
|
dict_table_t* sys_columns; /* SYS_COLUMNS table */
|
|
|
|
dict_table_t* sys_indexes; /* SYS_INDEXES table */
|
|
|
|
dict_table_t* sys_fields; /* SYS_FIELDS table */
|
2003-10-07 17:28:59 +03:00
|
|
|
};
|
2001-02-17 14:19:19 +02:00
|
|
|
|
|
|
|
#ifndef UNIV_NONINL
|
|
|
|
#include "dict0dict.ic"
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#endif
|