summaryrefslogtreecommitdiff
path: root/innobase/include
diff options
context:
space:
mode:
authorunknown <osku@127.(none)>2005-09-06 14:38:21 +0300
committerunknown <osku@127.(none)>2005-09-06 14:38:21 +0300
commit2d1c26cc61f83a6d3522fa677c8e7d6d0a89732c (patch)
tree55410fefb1c963b614b51967171775a6bdaab72b /innobase/include
parent7b2aacb73d43b8d6fa62167610c0cd1e734ffed9 (diff)
downloadmariadb-git-2d1c26cc61f83a6d3522fa677c8e7d6d0a89732c.tar.gz
InnoDB: Reject foreign keys in temporary tables. Closes bug #12084.
innobase/dict/dict0dict.c: Add reject_fks parameter to dict_create_foreign_constraints_low and dict_create_foreign_constraints. innobase/include/dict0dict.h: Add reject_fks parameter to dict_create_foreign_constraints. innobase/include/row0mysql.h: Add reject_fks parameter to row_table_add_foreign_constraints. innobase/row/row0mysql.c: Add reject_fks parameter to row_table_add_foreign_constraints. sql/ha_innodb.cc: In create, pass correct reject_fks argument to row_table_add_foreign_constraints depending on whether we're creating a temporary table or not. Also move duplicated cleanup code to a single place.
Diffstat (limited to 'innobase/include')
-rw-r--r--innobase/include/dict0dict.h5
-rw-r--r--innobase/include/row0mysql.h6
2 files changed, 9 insertions, 2 deletions
diff --git a/innobase/include/dict0dict.h b/innobase/include/dict0dict.h
index d9cda402bac..a1232acdca7 100644
--- a/innobase/include/dict0dict.h
+++ b/innobase/include/dict0dict.h
@@ -228,9 +228,12 @@ dict_create_foreign_constraints(
name before it: test.table2; the
default database id the database of
parameter name */
- const char* name); /* in: table full name in the
+ const char* name, /* in: table full name in the
normalized form
database_name/table_name */
+ ibool reject_fks); /* in: if TRUE, fail with error
+ code DB_CANNOT_ADD_CONSTRAINT if
+ any foreign keys are found. */
/**************************************************************************
Parses the CONSTRAINT id's to be dropped in an ALTER TABLE statement. */
diff --git a/innobase/include/row0mysql.h b/innobase/include/row0mysql.h
index 4e6ff73b0f8..a61705b90be 100644
--- a/innobase/include/row0mysql.h
+++ b/innobase/include/row0mysql.h
@@ -355,9 +355,13 @@ row_table_add_foreign_constraints(
FOREIGN KEY (a, b) REFERENCES table2(c, d),
table2 can be written also with the
database name before it: test.table2 */
- const char* name); /* in: table full name in the
+ const char* name, /* in: table full name in the
normalized form
database_name/table_name */
+ ibool reject_fks); /* in: if TRUE, fail with error
+ code DB_CANNOT_ADD_CONSTRAINT if
+ any foreign keys are found. */
+
/*************************************************************************
The master thread in srv0srv.c calls this regularly to drop tables which
we must drop in background after queries to them have ended. Such lazy