summaryrefslogtreecommitdiff
path: root/innobase/include/dict0crea.h
diff options
context:
space:
mode:
authorheikki@hundin.mysql.fi <>2004-02-09 01:32:00 +0200
committerheikki@hundin.mysql.fi <>2004-02-09 01:32:00 +0200
commit836e0b057adf7060e159654e444988676b40c14a (patch)
tree97777e82a25d2f9e6639039e005ecfe3303abd56 /innobase/include/dict0crea.h
parentd7b9d5c9e84a383c67f34511fd92255c3c4c7944 (diff)
downloadmariadb-git-836e0b057adf7060e159654e444988676b40c14a.tar.gz
Many files:
Fix bug #2167: generate foreign key id's locally for each table, in the form databasename/tablename_ibfk_number; if the user gives the constraint name explicitly remember it; these changes should ensure that foreign key id's in a slave are the same as in the master, and DROP FOREIGN KEY does not break replication sync0sync.c: UNIV_SYNC_DEBUG caused assertion in the creation of the doublewrite buffer, if we do not allow thousands of latches per thread
Diffstat (limited to 'innobase/include/dict0crea.h')
-rw-r--r--innobase/include/dict0crea.h15
1 files changed, 14 insertions, 1 deletions
diff --git a/innobase/include/dict0crea.h b/innobase/include/dict0crea.h
index ccdedff42c8..b2c3ad7ca96 100644
--- a/innobase/include/dict0crea.h
+++ b/innobase/include/dict0crea.h
@@ -81,12 +81,25 @@ dict_create_or_check_foreign_constraint_tables(void);
/*================================================*/
/* out: DB_SUCCESS or error code */
/************************************************************************
-Adds foreign key definitions to data dictionary tables in the database. */
+Adds foreign key definitions to data dictionary tables in the database. We
+look at table->foreign_list, and 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. */
ulint
dict_create_add_foreigns_to_dictionary(
/*===================================*/
/* out: error code or DB_SUCCESS */
+ ulint start_id,/* in: if we are actually doing ALTER TABLE
+ ADD CONSTRAINT, we want to generate constraint
+ numbers which are bigger than in the table so
+ far; we number the constraints from
+ start_id + 1 up; start_id should be set to 0 if
+ we are creating a new table, or if the table
+ so far has no constraints for which the name
+ was generated here */
dict_table_t* table, /* in: table */
trx_t* trx); /* in: transaction */