Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
mariadb
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
mariadb
Commits
5112674d
Commit
5112674d
authored
Apr 16, 2003
by
heikki@hundin.mysql.fi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
row0ins.c:
Better fix for the ON DELETE SET NULL problem
parent
609c8d9c
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
12 deletions
+10
-12
innobase/row/row0ins.c
innobase/row/row0ins.c
+10
-12
No files found.
innobase/row/row0ins.c
View file @
5112674d
...
@@ -323,7 +323,7 @@ row_ins_clust_index_entry_by_modify(
...
@@ -323,7 +323,7 @@ row_ins_clust_index_entry_by_modify(
/*************************************************************************
/*************************************************************************
Returns TRUE if in a cascaded update/delete an ancestor node of node
Returns TRUE if in a cascaded update/delete an ancestor node of node
updates table. */
updates
(not DELETE, but UPDATE)
table. */
static
static
ibool
ibool
row_ins_cascade_ancestor_updates_table
(
row_ins_cascade_ancestor_updates_table
(
...
@@ -341,7 +341,7 @@ row_ins_cascade_ancestor_updates_table(
...
@@ -341,7 +341,7 @@ row_ins_cascade_ancestor_updates_table(
upd_node
=
parent
;
upd_node
=
parent
;
if
(
upd_node
->
table
==
table
)
{
if
(
upd_node
->
table
==
table
&&
upd_node
->
is_delete
==
FALSE
)
{
return
(
TRUE
);
return
(
TRUE
);
}
}
...
@@ -678,17 +678,15 @@ row_ins_foreign_check_on_constraint(
...
@@ -678,17 +678,15 @@ row_ins_foreign_check_on_constraint(
}
}
}
}
/* We do not allow cyclic cascaded updating of the same table, except
/* We do not allow cyclic cascaded updating (DELETE is allowed,
in the case the update is the action of ON DELETE SET NULL, which
but not UPDATE) of the same table, as this can lead to an infinite
cannot lead to an infinite cycle. Check that we are not updating the
cycle. Check that we are not updating the same table which is
same table which is already being modified in this cascade chain. We
already being modified in this cascade chain. We have to check
have to check this because the modification of the indexes of a
this also because the modification of the indexes of a 'parent'
'parent' table may still be incomplete, and we must avoid seeing the
table may still be incomplete, and we must avoid seeing the indexes
indexes of the parent table in an inconsistent state! In this way we
of the parent table in an inconsistent state! */
also prevent possible infinite update loops caused by cyclic cascaded
updates. */
if
(
!
no
de
->
is_delete
if
(
!
casca
de
->
is_delete
&&
row_ins_cascade_ancestor_updates_table
(
cascade
,
table
))
{
&&
row_ins_cascade_ancestor_updates_table
(
cascade
,
table
))
{
/* We do not know if this would break foreign key
/* We do not know if this would break foreign key
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment