mirror of
https://github.com/MariaDB/server.git
synced 2025-01-20 14:02:32 +01:00
71a4f691b2
Active transactions must not switch table or index definitions on the fly, for several reasons, including the following: * copied indexes do not carry any history or locking information; that is, rollbacks, read views, and record locking would be broken * huge potential for race conditions, inconsistent reads and writes, loss of data, and corruption Instead of trying to track down if the table was changed during a transaction, acquire appropriate locks that protect the creation and dropping of indexes. innodb-index.test: Test the locking of CREATE INDEX and DROP INDEX. Test that consistent reads work across dropped indexes. lock_rec_insert_check_and_lock(): Relax the lock_table_has() assertion. When inserting a record into an index, the table must be at least IX-locked. However, when an index is being created, an IS-lock on the table is sufficient. row_merge_lock_table(): Add the parameter enum lock_mode mode, which must be LOCK_X or LOCK_S. row_merge_drop_table(): Assert that n_mysql_handles_opened == 0. Unconditionally drop the table. ha_innobase::add_index(): Acquire an X or S lock on the table, as appropriate. After acquiring an X lock, assert that n_mysql_handles_opened == 1. Remove the comments about dropping tables in the background. ha_innobase::final_drop_index(): Acquire an X lock on the table. dict_table_t: Remove version_number, to_be_dropped, and prebuilts. ins_node_t: Remove table_version_number. enum lock_mode: Move the definition from lock0lock.h to lock0types.h. ROW_PREBUILT_OBSOLETE, row_update_prebuilt(), row_prebuilt_table_obsolete(): Remove. row_prebuilt_t: Remove the declaration from row0types.h. row_drop_table_for_mysql_no_commit(): Always print a warning if a table was added to the background drop queue.
42 lines
920 B
C
42 lines
920 B
C
/******************************************************
|
|
Row operation global types
|
|
|
|
(c) 1996 Innobase Oy
|
|
|
|
Created 12/27/1996 Heikki Tuuri
|
|
*******************************************************/
|
|
|
|
#ifndef row0types_h
|
|
#define row0types_h
|
|
|
|
typedef struct plan_struct plan_t;
|
|
|
|
typedef struct upd_struct upd_t;
|
|
|
|
typedef struct upd_field_struct upd_field_t;
|
|
|
|
typedef struct upd_node_struct upd_node_t;
|
|
|
|
typedef struct del_node_struct del_node_t;
|
|
|
|
typedef struct ins_node_struct ins_node_t;
|
|
|
|
typedef struct sel_node_struct sel_node_t;
|
|
|
|
typedef struct open_node_struct open_node_t;
|
|
|
|
typedef struct fetch_node_struct fetch_node_t;
|
|
|
|
typedef struct row_printf_node_struct row_printf_node_t;
|
|
typedef struct sel_buf_struct sel_buf_t;
|
|
|
|
typedef struct undo_node_struct undo_node_t;
|
|
|
|
typedef struct purge_node_struct purge_node_t;
|
|
|
|
typedef struct row_ext_struct row_ext_t;
|
|
|
|
/* MySQL data types */
|
|
typedef struct st_table TABLE;
|
|
|
|
#endif
|