summaryrefslogtreecommitdiff
path: root/innobase/include
diff options
context:
space:
mode:
authorheikki@hundin.mysql.fi <>2003-04-16 16:45:01 +0300
committerheikki@hundin.mysql.fi <>2003-04-16 16:45:01 +0300
commitf841b4ae234359210d240879236653db2dec7281 (patch)
tree7fff68a7504903b0da22aa86bbf09e69351a2184 /innobase/include
parentcde0099e23654a34e35c0227141f91c7c0751842 (diff)
downloadmariadb-git-f841b4ae234359210d240879236653db2dec7281.tar.gz
Many files:
Merge InnoDB-4.0.13; DROP FOREIGN KEY now works
Diffstat (limited to 'innobase/include')
-rw-r--r--innobase/include/db0err.h2
-rw-r--r--innobase/include/dict0dict.h35
-rw-r--r--innobase/include/row0ins.h1
3 files changed, 37 insertions, 1 deletions
diff --git a/innobase/include/db0err.h b/innobase/include/db0err.h
index c67c09bad27..ab7d0caa35c 100644
--- a/innobase/include/db0err.h
+++ b/innobase/include/db0err.h
@@ -44,6 +44,8 @@ Created 5/24/1996 Heikki Tuuri
#define DB_CORRUPTION 39 /* data structure corruption noticed */
#define DB_COL_APPEARS_TWICE_IN_INDEX 40 /* InnoDB cannot handle an index
where same column appears twice */
+#define DB_CANNOT_DROP_CONSTRAINT 40 /* dropping a foreign key constraint
+ from a table failed */
/* The following are partial failure codes */
#define DB_FAIL 1000
diff --git a/innobase/include/dict0dict.h b/innobase/include/dict0dict.h
index b5e6e04a1de..600965700ed 100644
--- a/innobase/include/dict0dict.h
+++ b/innobase/include/dict0dict.h
@@ -219,6 +219,24 @@ dict_create_foreign_constraints(
char* name); /* in: table full name in the normalized form
database_name/table_name */
/**************************************************************************
+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 */
+ char*** constraints_to_drop); /* out: id's of the
+ constraints to drop */
+/**************************************************************************
Returns a table object and memoryfixes it. 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. */
@@ -333,6 +351,16 @@ dict_print_info_on_foreign_keys(
char* str, /* in/out: pointer to a string */
ulint len, /* in: space in str available for info */
dict_table_t* table); /* in: table */
+/**************************************************************************
+Sprintfs to a string info on a foreign key of a table in a format suitable
+for CREATE TABLE. */
+
+char*
+dict_print_info_on_foreign_key_in_create_format(
+/*============================================*/
+ /* out: how far in buf we printed */
+ dict_foreign_t* foreign,/* in: foreign key constraint */
+ char* buf); /* in: buffer of at least 5000 bytes */
/************************************************************************
Gets the first index on the table (the clustered index). */
UNIV_INLINE
@@ -808,6 +836,13 @@ void
dict_mutex_exit_for_mysql(void);
/*===========================*/
+/* The following len must be at least 10000 bytes! */
+#define DICT_FOREIGN_ERR_BUF_LEN 10000
+
+/* Buffer for storing detailed information about the latest foreig key
+error */
+extern char* dict_foreign_err_buf;
+extern mutex_t dict_foreign_err_mutex; /* mutex protecting the buffer */
extern dict_sys_t* dict_sys; /* the dictionary system */
extern rw_lock_t dict_operation_lock;
diff --git a/innobase/include/row0ins.h b/innobase/include/row0ins.h
index cc3b9fa7e9a..a5b4b74e7fc 100644
--- a/innobase/include/row0ins.h
+++ b/innobase/include/row0ins.h
@@ -35,7 +35,6 @@ row_ins_check_foreign_constraint(
dictionary cache if they exist at all */
dict_table_t* table, /* in: if check_ref is TRUE, then the foreign
table, else the referenced table */
- dict_index_t* index, /* in: index in table */
dtuple_t* entry, /* in: index entry for index */
que_thr_t* thr); /* in: query thread */
/*************************************************************************