diff options
Diffstat (limited to 'storage/innobase/include/dict0crea.h')
-rw-r--r-- | storage/innobase/include/dict0crea.h | 69 |
1 files changed, 59 insertions, 10 deletions
diff --git a/storage/innobase/include/dict0crea.h b/storage/innobase/include/dict0crea.h index 68fc9ba195a..217da0142ee 100644 --- a/storage/innobase/include/dict0crea.h +++ b/storage/innobase/include/dict0crea.h @@ -1,6 +1,6 @@ /***************************************************************************** -Copyright (c) 1996, 2009, Oracle and/or its affiliates. All Rights Reserved. +Copyright (c) 1996, 2012, Oracle and/or its affiliates. All Rights Reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software @@ -42,7 +42,9 @@ tab_create_graph_create( /*====================*/ dict_table_t* table, /*!< in: table to create, built as a memory data structure */ - mem_heap_t* heap); /*!< in: heap where created */ + mem_heap_t* heap, /*!< in: heap where created */ + bool commit);/*!< in: true if the commit node should be + added to the query graph */ /*********************************************************************//** Creates an index create graph. @return own: index create node */ @@ -52,7 +54,9 @@ ind_create_graph_create( /*====================*/ dict_index_t* index, /*!< in: index to create, built as a memory data structure */ - mem_heap_t* heap); /*!< in: heap where created */ + mem_heap_t* heap, /*!< in: heap where created */ + bool commit);/*!< in: true if the commit node should be + added to the query graph */ /***********************************************************//** Creates a table. This is a high-level function used in SQL execution graphs. @return query thread to run next or NULL */ @@ -99,11 +103,11 @@ dict_drop_index_tree( mtr_t* mtr); /*!< in: mtr having the latch on the record page */ /****************************************************************//** Creates the foreign key constraints system tables inside InnoDB -at database creation or database start if they are not found or are +at server bootstrap or server start if they are not found or are not of the right form. @return DB_SUCCESS or error code */ UNIV_INTERN -ulint +dberr_t dict_create_or_check_foreign_constraint_tables(void); /*================================================*/ /********************************************************************//** @@ -115,7 +119,7 @@ given locally for this table, that is, the number is not global, as in the old format constraints < 4.0.18 it used to be. @return error code or DB_SUCCESS */ UNIV_INTERN -ulint +dberr_t dict_create_add_foreigns_to_dictionary( /*===================================*/ ulint start_id,/*!< in: if we are actually doing ALTER TABLE @@ -127,11 +131,56 @@ dict_create_add_foreigns_to_dictionary( so far has no constraints for which the name was generated here */ dict_table_t* table, /*!< in: table */ - trx_t* trx); /*!< in: transaction */ + trx_t* trx) /*!< in: transaction */ + __attribute__((nonnull, warn_unused_result)); +/****************************************************************//** +Creates the tablespaces and datafiles system tables inside InnoDB +at server bootstrap or server start if they are not found or are +not of the right form. +@return DB_SUCCESS or error code */ +UNIV_INTERN +dberr_t +dict_create_or_check_sys_tablespace(void); +/*=====================================*/ +/********************************************************************//** +Add a single tablespace definition to the data dictionary tables in the +database. +@return error code or DB_SUCCESS */ +UNIV_INTERN +dberr_t +dict_create_add_tablespace_to_dictionary( +/*=====================================*/ + ulint space, /*!< in: tablespace id */ + const char* name, /*!< in: tablespace name */ + ulint flags, /*!< in: tablespace flags */ + const char* path, /*!< in: tablespace path */ + trx_t* trx, /*!< in: transaction */ + bool commit); /*!< in: if true then commit the + transaction */ +/********************************************************************//** +Table create node structure */ -/* Table create node structure */ +/********************************************************************//** +Add a single foreign key definition to the data dictionary tables in the +database. We also generate names to constraints that were not named by the +user. A generated constraint has a name of the format +databasename/tablename_ibfk_NUMBER, where the numbers start from 1, and +are given locally for this table, that is, the number is not global, as in +the old format constraints < 4.0.18 it used to be. +@return error code or DB_SUCCESS */ +UNIV_INTERN +dberr_t +dict_create_add_foreign_to_dictionary( +/*==================================*/ + ulint* id_nr, /*!< in/out: number to use in id generation; + incremented if used */ + dict_table_t* table, /*!< in: table */ + dict_foreign_t* foreign,/*!< in: foreign */ + trx_t* trx) /*!< in/out: dictionary transaction */ + __attribute__((nonnull, warn_unused_result)); -struct tab_node_struct{ +/* Table create node structure */ +struct tab_node_t{ que_common_t common; /*!< node type: QUE_NODE_TABLE_CREATE */ dict_table_t* table; /*!< table to create, built as a memory data structure with dict_mem_... functions */ @@ -160,7 +209,7 @@ struct tab_node_struct{ /* Index create node struct */ -struct ind_node_struct{ +struct ind_node_t{ que_common_t common; /*!< node type: QUE_NODE_INDEX_CREATE */ dict_index_t* index; /*!< index to create, built as a memory data structure with dict_mem_... functions */ |