List:Internals« Previous MessageNext Message »
From:Marko Mäkelä Date:July 13 2004 11:41pm
Subject:bk commit into 4.0 tree (marko:1.1912)
View as plain text  
Below is the list of changes that have just been committed into a local
4.0 repository of marko. When marko 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.1912 04/07/14 00:41:27 marko@stripped +1 -0
  InnoDB: Limit the depth of cascaded DELETE or UPDATE (Bug #4446)

  innobase/row/row0ins.c
    1.37 04/07/14 00:39:47 marko@stripped +18 -0
    row_ins_foreign_check_on_constraint(): limit the recursion depth

# 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:	marko
# Host:	hundin.mysql.fi
# Root:	/home/marko/j/mysql-4.0

--- 1.36/innobase/row/row0ins.c	Thu Jun 17 13:25:02 2004
+++ 1.37/innobase/row/row0ins.c	Wed Jul 14 00:39:47 2004
@@ -859,6 +859,24 @@
 			(update->fields + i)->new_val.data = NULL;
 			(update->fields + i)->extern_storage = FALSE;
 		}
+	} else {
+		/* Limit the recursion depth */
+		ulint		n_ancestors	= 0;
+		upd_node_t*	ancestor	= thr->run_node;
+		while (ancestor) {
+			n_ancestors++;
+			ancestor = que_node_get_parent(ancestor);
+		}
+
+		if (n_ancestors > 50) {
+			err = DB_ROW_IS_REFERENCED;
+
+			row_ins_foreign_report_err(
+(char*)"Trying a too deep cascaded delete or update\n",
+			thr, foreign, btr_pcur_get_rec(pcur), entry);
+
+			goto nonstandard_exit_func;
+		}
 	}
 
 	if (!node->is_delete
Thread
bk commit into 4.0 tree (marko:1.1912)Marko Mäkelä13 Jul