Below is the list of changes that have just been committed into a local
mysqldoc repository of jan. When jan does a push these changes will
be propagated to the main repository and, within 24 hours after the
push, to the public repository.
For information on how to access the public repository
see http://www.mysql.com/doc/I/n/Installing_source_tree.html
ChangeSet
1.2645 05/05/12 09:14:07 jan@stripped +1 -0
After review fixes.
Docs/manual.texi
1.2833 05/05/12 09:14:01 jan@stripped +18 -10
After review fixes.
# This is a BitKeeper patch. What follows are the unified diffs for the
# set of deltas contained in the patch. The rest of the patch, the part
# that BitKeeper cares about, is below these diffs.
# User: jan
# Host: hundin.mysql.fi
# Root: /home/jan/mysqldoc
--- 1.2832/Docs/manual.texi Tue May 10 08:51:11 2005
+++ 1.2833/Docs/manual.texi Thu May 12 09:14:01 2005
@@ -68395,22 +68395,22 @@
table that has some matching rows in the child table is dependent on
the @emph{referential action} specified using @code{ON UPDATE} and
@code{ON DETETE} subclauses of the @code{FOREIGN KEY} clause. When
-the user attempts to delete a row from a parnt table, and there
+the user attempts to delete or update a row from a parent table, and there
are one or more matching rows in the child table, @code{InnoDB}
supports five options regarding the action to be taken:
@itemize @bullet
-@item @code{CASCADE}: Delete the row from the parent table and
-automatically delete the matching rows in the child table.
+@item @code{CASCADE}: Delete or update the row from the parent table and
+automatically delete or update the matching rows in the child table.
@code{ON DELETE CASCADE} is available starting from MySQL 3.23.50
and @code{ON UPDATE CASCADE} is available starting from 4.0.8.
-@item @code{SET NULL}: Delete the row from the parent table and
+@item @code{SET NULL}: Delete or update the row from the parent table and
set the foreign key column(s) in the child table to @code{NULL}.
This is only valid if the foreign key columns do not have the
-@code{NOT NULL} qualifier specified. @code{ON DELETE CASCADE}
-is available starting from MySQL 3.23.50 and @code{ON UPDATE CASCADE}
+@code{NOT NULL} qualifier specified. @code{ON DELETE SET NULL}
+is available starting from MySQL 3.23.50 and @code{ON UPDATE SET NULL}
is available starting from 4.0.8.
@item @code{SET DEFAULT}: @code{InnoDB} rejects table definitions
@@ -68421,20 +68421,28 @@
to delete or update a primary key value will not be allowed to
proceed if there is a related foreign key value in the referenced
table (Gruber, Mastering SQL, 2000:181). Starting from 4.0.18
-@code{InnoDB} rejects the delete operation from the parent
+@code{InnoDB} rejects the delete or update operation for the parent
table.
-@item @code{RESTRICT}: Rejects the delete operation from the
-parent table
+@item @code{RESTRICT}: Rejects the delete or update operation for the
+parent table. @code{NO ACTION} and @code{RESTRICT} are the same as
+omitting the @code{ON DELETE} or @code{ON UPDATE} clause.
+(Some database systems have deferred checks, and @code{NO ACTION} is a
+deferred check. In MySQL, foreign key constraints are checked
+immediately, so @code{NO ACTION} and @code{RESTRICT} are the same.)
@end itemize
@code{InnoDB} supports the same options when the candidate key in
-the parent table is update. With @code{CASCADE}, the foreign key
+the parent table updated. With @code{CASCADE}, the foreign key
column(s) in the child table are set to new value(s) of the
candidate key in the parent table. In the same way, the updates
cascade if updated column(s) in the child table reference
foreign keys in another table.
+
+Note that @code{InnoDB} supports foreign key references within a table
+and in these cases child table really means dependent records
+within the table.
@code{InnoDB} needs indexes on foreign keys and referenced keys so that
foreign key checks can be fast and not require a table scan. Starting with
| Thread |
|---|
| • bk commit - mysqldoc@docsrva tree (jan:1.2645) | jan.lindstrom | 12 May |