diff options
author | unknown <heikki@hundin.mysql.fi> | 2003-10-13 11:20:19 +0300 |
---|---|---|
committer | unknown <heikki@hundin.mysql.fi> | 2003-10-13 11:20:19 +0300 |
commit | 423747b570b5f01b4d2dd06da991f6a8ce15101f (patch) | |
tree | 5d5b7191e57ae4eafdff3f6a259ba37729217404 /innobase/include/row0mysql.h | |
parent | 963d7baba7a1c37bd2154f04303df8e469f15049 (diff) | |
download | mariadb-git-423747b570b5f01b4d2dd06da991f6a8ce15101f.tar.gz |
Many files:
ALTER TABLE ... DISCARD/IMPORT TABLESPACE
Track crash in buf_LRU_block_remove_hashed_page + 1807 reported in MySQL-3.23.5x
sql/ha_innodb.cc:
ALTER TABLE ... DISCARD/IMPORT TABLESPACE
sql/sql_class.cc:
ALTER TABLE ... DISCARD/IMPORT TABLESPACE
sql/sql_parse.cc:
ALTER TABLE ... DISCARD/IMPORT TABLESPACE
sql/sql_table.cc:
ALTER TABLE ... DISCARD/IMPORT TABLESPACE
sql/ha_innodb.h:
ALTER TABLE ... DISCARD/IMPORT TABLESPACE
sql/handler.h:
ALTER TABLE ... DISCARD/IMPORT TABLESPACE
sql/lex.h:
ALTER TABLE ... DISCARD/IMPORT TABLESPACE
sql/mysql_priv.h:
ALTER TABLE ... DISCARD/IMPORT TABLESPACE
sql/sql_class.h:
ALTER TABLE ... DISCARD/IMPORT TABLESPACE
sql/sql_lex.h:
ALTER TABLE ... DISCARD/IMPORT TABLESPACE
sql/sql_yacc.yy:
ALTER TABLE ... DISCARD/IMPORT TABLESPACE
innobase/ha/ha0ha.c:
Track crash in buf_LRU_block_remove_hashed_page + 1807 reported in MySQL-3.23.5x
innobase/ha/hash0hash.c:
Track crash in buf_LRU_block_remove_hashed_page + 1807 reported in MySQL-3.23.5x
innobase/buf/buf0buf.c:
Track crash in buf_LRU_block_remove_hashed_page + 1807 reported in MySQL-3.23.5x
innobase/buf/buf0flu.c:
Track crash in buf_LRU_block_remove_hashed_page + 1807 reported in MySQL-3.23.5x
innobase/buf/buf0lru.c:
Track crash in buf_LRU_block_remove_hashed_page + 1807 reported in MySQL-3.23.5x
innobase/buf/buf0rea.c:
Track crash in buf_LRU_block_remove_hashed_page + 1807 reported in MySQL-3.23.5x
innobase/btr/btr0btr.c:
Track crash in buf_LRU_block_remove_hashed_page + 1807 reported in MySQL-3.23.5x
innobase/btr/btr0sea.c:
Track crash in buf_LRU_block_remove_hashed_page + 1807 reported in MySQL-3.23.5x
innobase/fil/fil0fil.c:
ALTER TABLE ... DISCARD/IMPORT TABLESPACE
innobase/include/buf0buf.h:
ALTER TABLE ... DISCARD/IMPORT TABLESPACE
innobase/include/ha0ha.h:
ALTER TABLE ... DISCARD/IMPORT TABLESPACE
innobase/include/hash0hash.h:
ALTER TABLE ... DISCARD/IMPORT TABLESPACE
innobase/include/row0mysql.h:
ALTER TABLE ... DISCARD/IMPORT TABLESPACE
innobase/include/buf0buf.ic:
ALTER TABLE ... DISCARD/IMPORT TABLESPACE
innobase/include/ha0ha.ic:
ALTER TABLE ... DISCARD/IMPORT TABLESPACE
innobase/include/ibuf0ibuf.ic:
ALTER TABLE ... DISCARD/IMPORT TABLESPACE
innobase/page/page0page.c:
ALTER TABLE ... DISCARD/IMPORT TABLESPACE
innobase/row/row0mysql.c:
ALTER TABLE ... DISCARD/IMPORT TABLESPACE
innobase/row/row0purge.c:
ALTER TABLE ... DISCARD/IMPORT TABLESPACE
innobase/row/row0uins.c:
ALTER TABLE ... DISCARD/IMPORT TABLESPACE
innobase/row/row0umod.c:
ALTER TABLE ... DISCARD/IMPORT TABLESPACE
Diffstat (limited to 'innobase/include/row0mysql.h')
-rw-r--r-- | innobase/include/row0mysql.h | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/innobase/include/row0mysql.h b/innobase/include/row0mysql.h index 1964f53dabb..fade3709631 100644 --- a/innobase/include/row0mysql.h +++ b/innobase/include/row0mysql.h @@ -339,6 +339,45 @@ row_drop_table_for_mysql( char* name, /* in: table name */ trx_t* trx); /* in: transaction handle */ /************************************************************************* +Discards the tablespace of a table which stored in an .ibd file. Discarding +means that this function deletes the .ibd file and assigns a new table id for +the table. Also the flag table->ibd_file_missing is set TRUE. + +How do we prevent crashes caused by ongoing operations on the table? Old +operations could try to access non-existent pages. + +1) SQL queries, INSERT, SELECT, ...: we must get an exclusive MySQL table lock +on the table before we can do DISCARD TABLESPACE. Then there are no running +queries on the table. +2) Purge and rollback: we assign a new table id for the table. Since purge and +rollback look for the table based on the table id, they see the table as +'dropped' and discard their operations. +3) Insert buffer: we remove all entries for the tablespace in the insert +buffer tree; as long as the tablespace mem object does not exist, ongoing +insert buffer page merges are discarded in buf0rea.c. If we recreate the +tablespace mem object with IMPORT TABLESPACE later, then the tablespace will +have the same id, but the tablespace_version field in the mem object is +different, and ongoing old insert buffer page merges get discarded. +4) Linear readahead and random readahead: we use the same method as in 3) to +discard ongoing operations. */ + +int +row_discard_tablespace_for_mysql( +/*=============================*/ + /* out: error code or DB_SUCCESS */ + char* name, /* in: table name */ + trx_t* trx); /* in: transaction handle */ +/********************************************************************* +Imports a tablespace. The space id in the .ibd file must match the space id +of the table in the data dictionary. */ + +int +row_import_tablespace_for_mysql( +/*============================*/ + /* out: error code or DB_SUCCESS */ + char* name, /* in: table name */ + trx_t* trx); /* in: transaction handle */ +/************************************************************************* Drops a database for MySQL. */ int |