diff options
author | unknown <heikki@hundin.mysql.fi> | 2002-12-22 01:54:29 +0200 |
---|---|---|
committer | unknown <heikki@hundin.mysql.fi> | 2002-12-22 01:54:29 +0200 |
commit | c20b11f9bd797a3f464bacce3a8f545b46a8bc45 (patch) | |
tree | 120402316f5b15cb879b72bdb1c4cf59c8d932cb /innobase/include | |
parent | 0b7e607314c5e371bf6647db8a26afe3d2a2079e (diff) | |
download | mariadb-git-c20b11f9bd797a3f464bacce3a8f545b46a8bc45.tar.gz |
Many files:
Merge InnoDB-4.0.7. Support for ON UPDATE CASCADE
sql_select.cc:
Remove superfluous prints to .err log when a locking SELECT fails to a deadlock or a lock wait timeout
sql/sql_select.cc:
Remove superfluous prints to .err log when a locking SELECT fails to a deadlock or a lock wait timeout
innobase/btr/btr0sea.c:
Merge InnoDB-4.0.7. Support for ON UPDATE CASCADE
innobase/dict/dict0dict.c:
Merge InnoDB-4.0.7. Support for ON UPDATE CASCADE
innobase/fsp/fsp0fsp.c:
Merge InnoDB-4.0.7. Support for ON UPDATE CASCADE
innobase/ibuf/ibuf0ibuf.c:
Merge InnoDB-4.0.7. Support for ON UPDATE CASCADE
innobase/include/buf0buf.h:
Merge InnoDB-4.0.7. Support for ON UPDATE CASCADE
innobase/include/db0err.h:
Merge InnoDB-4.0.7. Support for ON UPDATE CASCADE
innobase/include/dict0mem.h:
Merge InnoDB-4.0.7. Support for ON UPDATE CASCADE
innobase/include/mem0mem.h:
Merge InnoDB-4.0.7. Support for ON UPDATE CASCADE
innobase/include/row0mysql.h:
Merge InnoDB-4.0.7. Support for ON UPDATE CASCADE
innobase/include/row0upd.h:
Merge InnoDB-4.0.7. Support for ON UPDATE CASCADE
innobase/include/mem0mem.ic:
Merge InnoDB-4.0.7. Support for ON UPDATE CASCADE
innobase/mem/mem0pool.c:
Merge InnoDB-4.0.7. Support for ON UPDATE CASCADE
innobase/row/row0ins.c:
Merge InnoDB-4.0.7. Support for ON UPDATE CASCADE
innobase/row/row0mysql.c:
Merge InnoDB-4.0.7. Support for ON UPDATE CASCADE
innobase/row/row0sel.c:
Merge InnoDB-4.0.7. Support for ON UPDATE CASCADE
innobase/row/row0upd.c:
Merge InnoDB-4.0.7. Support for ON UPDATE CASCADE
innobase/srv/srv0start.c:
Merge InnoDB-4.0.7. Support for ON UPDATE CASCADE
innobase/ut/ut0ut.c:
Merge InnoDB-4.0.7. Support for ON UPDATE CASCADE
Diffstat (limited to 'innobase/include')
-rw-r--r-- | innobase/include/buf0buf.h | 7 | ||||
-rw-r--r-- | innobase/include/db0err.h | 5 | ||||
-rw-r--r-- | innobase/include/dict0mem.h | 7 | ||||
-rw-r--r-- | innobase/include/mem0mem.h | 14 | ||||
-rw-r--r-- | innobase/include/mem0mem.ic | 7 | ||||
-rw-r--r-- | innobase/include/row0mysql.h | 10 | ||||
-rw-r--r-- | innobase/include/row0upd.h | 5 |
7 files changed, 40 insertions, 15 deletions
diff --git a/innobase/include/buf0buf.h b/innobase/include/buf0buf.h index f76c437bd1d..395f88a2c7c 100644 --- a/innobase/include/buf0buf.h +++ b/innobase/include/buf0buf.h @@ -728,8 +728,8 @@ struct buf_block_struct{ bufferfixed, or (2) the thread has an x-latch on the block */ - /* 5. Hash search fields: NOTE that these fields are protected by - btr_search_mutex */ + /* 5. Hash search fields: NOTE that the first 4 fields are NOT + protected by any semaphore! */ ulint n_hash_helps; /* counter which controls building of a new hash index for the page */ @@ -742,6 +742,9 @@ struct buf_block_struct{ whether the leftmost record of several records with the same prefix should be indexed in the hash index */ + + /* The following 4 fields are protected by btr_search_latch: */ + ibool is_hashed; /* TRUE if hash index has already been built on this page; note that it does not guarantee that the index is diff --git a/innobase/include/db0err.h b/innobase/include/db0err.h index ae4b0fe4cc5..c67c09bad27 100644 --- a/innobase/include/db0err.h +++ b/innobase/include/db0err.h @@ -42,8 +42,9 @@ Created 5/24/1996 Heikki Tuuri #define DB_CANNOT_ADD_CONSTRAINT 38 /* adding a foreign key constraint to a table failed */ #define DB_CORRUPTION 39 /* data structure corruption noticed */ -#define DB_COL_APPEARS_TWICE_IN_INDEX 40 - +#define DB_COL_APPEARS_TWICE_IN_INDEX 40 /* InnoDB cannot handle an index + where same column appears twice */ + /* The following are partial failure codes */ #define DB_FAIL 1000 #define DB_OVERFLOW 1001 diff --git a/innobase/include/dict0mem.h b/innobase/include/dict0mem.h index 22293389bae..0798541cfe0 100644 --- a/innobase/include/dict0mem.h +++ b/innobase/include/dict0mem.h @@ -280,8 +280,15 @@ struct dict_foreign_struct{ table */ }; +/* The flags for ON_UPDATE and ON_DELETE can be ORed; the default is that +a foreign key constraint is enforced, therefore RESTRICT just means no flag */ #define DICT_FOREIGN_ON_DELETE_CASCADE 1 #define DICT_FOREIGN_ON_DELETE_SET_NULL 2 +#define DICT_FOREIGN_ON_UPDATE_CASCADE 4 +#define DICT_FOREIGN_ON_UPDATE_SET_NULL 8 +#define DICT_FOREIGN_ON_DELETE_NO_ACTION 16 +#define DICT_FOREIGN_ON_UPDATE_NO_ACTION 32 + #define DICT_INDEX_MAGIC_N 76789786 diff --git a/innobase/include/mem0mem.h b/innobase/include/mem0mem.h index bfd25f5bdbe..9ab3b2cd754 100644 --- a/innobase/include/mem0mem.h +++ b/innobase/include/mem0mem.h @@ -127,16 +127,18 @@ mem_heap_create_func( ulint line /* in: line where created */ ); /********************************************************************* -NOTE: Use the corresponding macro instead of this function. -Frees the space occupied by a memory heap. */ +NOTE: Use the corresponding macro instead of this function. Frees the space +occupied by a memory heap. In the debug version erases the heap memory +blocks. */ UNIV_INLINE void mem_heap_free_func( /*===============*/ - mem_heap_t* heap, /* in, own: heap to be freed */ - char* file_name, /* in: file name where freed */ - ulint line /* in: line where freed */ -); + mem_heap_t* heap, /* in, own: heap to be freed */ + char* file_name __attribute__((unused)), + /* in: file name where freed */ + ulint line __attribute__((unused))); + /* in: line where freed */ /******************************************************************* Allocates n bytes of memory from a memory heap. */ UNIV_INLINE diff --git a/innobase/include/mem0mem.ic b/innobase/include/mem0mem.ic index a7abb93d91d..1ff8c66e80a 100644 --- a/innobase/include/mem0mem.ic +++ b/innobase/include/mem0mem.ic @@ -440,9 +440,10 @@ void mem_heap_free_func( /*===============*/ mem_heap_t* heap, /* in, own: heap to be freed */ - char* file_name, /* in: file name where freed */ - ulint line /* in: line where freed */ - ) + char* file_name __attribute__((unused)), + /* in: file name where freed */ + ulint line __attribute__((unused))) + /* in: line where freed */ { mem_block_t* block; mem_block_t* prev_block; diff --git a/innobase/include/row0mysql.h b/innobase/include/row0mysql.h index 44b470fe7ea..25d2ab77007 100644 --- a/innobase/include/row0mysql.h +++ b/innobase/include/row0mysql.h @@ -492,7 +492,11 @@ struct row_prebuilt_struct { fetch many rows from the same cursor: it saves CPU time to fetch them in a batch; we reserve mysql_row_len - bytes for each such row */ + bytes for each such row; these + pointers point 4 bytes past the + allocated mem buf start, because + there is a 4 byte magic number at the + start and at the end */ ulint fetch_cache_first;/* position of the first not yet fetched row in fetch_cache */ ulint n_fetch_cached; /* number of not yet fetched rows @@ -501,8 +505,12 @@ struct row_prebuilt_struct { to this heap */ mem_heap_t* old_vers_heap; /* memory heap where a previous version is built in consistent read */ + ulint magic_n2; /* this should be the same as + magic_n */ }; +#define ROW_PREBUILT_FETCH_MAGIC_N 465765687 + #define ROW_MYSQL_WHOLE_ROW 0 #define ROW_MYSQL_REC_FIELDS 1 #define ROW_MYSQL_NO_TEMPLATE 2 diff --git a/innobase/include/row0upd.h b/innobase/include/row0upd.h index 9a3e2463267..273ec6074eb 100644 --- a/innobase/include/row0upd.h +++ b/innobase/include/row0upd.h @@ -312,8 +312,11 @@ struct upd_node_struct{ ibool in_mysql_interface; /* TRUE if the update node was created for the MySQL interface */ + dict_foreign_t* foreign;/* NULL or pointer to a foreign key + constraint if this update node is used in + doing an ON DELETE or ON UPDATE operation */ upd_node_t* cascade_node;/* NULL or an update node template which - is used to implement ON DELETE CASCADE + is used to implement ON DELETE/UPDATE CASCADE or ... SET NULL for foreign keys */ mem_heap_t* cascade_heap;/* NULL or a mem heap where the cascade node is created */ |