List:Internals« Previous MessageNext Message »
From:sinisa Date:February 19 2004 5:43pm
Subject:bk commit into 4.0 tree (Sinisa:1.1744)
View as plain text  
Below is the list of changes that have just been committed into a local
4.0 repository of Sinisa. When Sinisa 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.1744 04/02/19 19:43:46 Sinisa@stripped +3 -0
  Fix for a bug #2799.
  
  Multi-table delete's with tables having foreign key constraints
  did not return the error.
  
  Also added tests for multi-table updates.
   

  sql/sql_delete.cc
    1.104 04/02/19 19:43:43 Sinisa@stripped +7 -2
    Fix for a bug #2799.
    
    Multi-table delete's with tables having foreign key constraints
    did not return the error.
    
    Also added tests for multi-table updates.
     

  mysql-test/t/multi_update.test
    1.29 04/02/19 19:43:43 Sinisa@stripped +13 -1
    Fix for a bug #2799.
    
    Multi-table delete's with tables having foreign key constraints
    did not return the error.
    
    Also added tests for multi-table updates.
     

  mysql-test/r/multi_update.result
    1.27 04/02/19 19:43:43 Sinisa@stripped +13 -0
    Fix for a bug #2799.
    
    Multi-table delete's with tables having foreign key constraints
    did not return the error.
    
    Also added tests for multi-table updates.
     

# 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:	Sinisa
# Host:	sinisa.nasamreza.org
# Root:	/mnt/work/mysql-4.0

--- 1.103/sql/sql_delete.cc	Tue Dec 16 12:12:28 2003
+++ 1.104/sql/sql_delete.cc	Thu Feb 19 19:43:43 2004
@@ -347,7 +347,7 @@
       table->status|= STATUS_DELETED;
       if (!(error=table->file->delete_row(table->record[0])))
 	deleted++;
-      else if (!table_being_deleted->next)
+      else if (!table_being_deleted->next || table_being_deleted->table->file->has_transactions())
       {
 	table->file->print_error(error,MYF(0));
 	DBUG_RETURN(1);
@@ -450,7 +450,12 @@
       if ((local_error=table->file->delete_row(table->record[0])))
       {
 	table->file->print_error(local_error,MYF(0));
-	break;
+	if (transactional_tables)
+	{
+	  DBUG_RETURN(local_error);
+	}
+	else
+	  break;
       }
       deleted++;
     }

--- 1.26/mysql-test/r/multi_update.result	Fri Dec 12 23:21:55 2003
+++ 1.27/mysql-test/r/multi_update.result	Thu Feb 19 19:43:43 2004
@@ -360,3 +360,16 @@
 delete t1, t2 from t2,t1 
 where t1.id1=t2.id2 and 0=1;
 drop table t1,t2;
+create table `t1` (`id` int( 11 ) not null  ,primary key ( `id` )) type = innodb;
+insert into `t1`values ( 1 ) ;
+create table `t2` (`id` int( 11 ) not null default '0',unique key `id` ( `id` ) ,constraint `t1_id_fk` foreign key ( `id` ) references `t1` (`id` )) type = innodb;
+insert into `t2`values ( 1 ) ;
+create table `t3` (`id` int( 11 ) not null default '0',key `id` ( `id` ) ,constraint `t2_id_fk` foreign key ( `id` ) references `t2` (`id` )) type = innodb;
+insert into `t3`values ( 1 ) ;
+delete t3,t2,t1 from t1,t2,t3 where t1.id =1 and t2.id = t1.id and t3.id = t2.id;
+Cannot delete or update a parent row: a foreign key constraint fails
+update t1,t2,t3 set t3.id=5, t2.id=6, t1.id=7  where t1.id =1 and t2.id = t1.id and t3.id = t2.id;
+Cannot delete or update a parent row: a foreign key constraint fails
+update t3 set  t3.id=7  where t1.id =1 and t2.id = t1.id and t3.id = t2.id;
+Unknown table 't1' in where clause
+drop table t3,t2,t1;

--- 1.28/mysql-test/t/multi_update.test	Fri Dec 12 23:21:55 2003
+++ 1.29/mysql-test/t/multi_update.test	Thu Feb 19 19:43:43 2004
@@ -302,4 +302,16 @@
   where t1.id1=t2.id2 and 0=1;
 
 drop table t1,t2;
-
+create table `t1` (`id` int( 11 ) not null  ,primary key ( `id` )) type = innodb;
+insert into `t1`values ( 1 ) ;
+create table `t2` (`id` int( 11 ) not null default '0',unique key `id` ( `id` ) ,constraint `t1_id_fk` foreign key ( `id` ) references `t1` (`id` )) type = innodb;
+insert into `t2`values ( 1 ) ;
+create table `t3` (`id` int( 11 ) not null default '0',key `id` ( `id` ) ,constraint `t2_id_fk` foreign key ( `id` ) references `t2` (`id` )) type = innodb;
+insert into `t3`values ( 1 ) ;
+--error 1217
+delete t3,t2,t1 from t1,t2,t3 where t1.id =1 and t2.id = t1.id and t3.id = t2.id;
+--error 1217
+update t1,t2,t3 set t3.id=5, t2.id=6, t1.id=7  where t1.id =1 and t2.id = t1.id and t3.id = t2.id;
+--error 1109
+update t3 set  t3.id=7  where t1.id =1 and t2.id = t1.id and t3.id = t2.id;
+drop table t3,t2,t1;
Thread
bk commit into 4.0 tree (Sinisa:1.1744)sinisa23 Feb