From 41e6a1f89c943083e46fba9f548333629eefbbd9 Mon Sep 17 00:00:00 2001
From: Matthias Leich <Matthias.Leich@sun.com>
Date: Thu, 5 Feb 2009 21:47:23 +0100
Subject: 2. Slice of fix for Bug#42003 tests missing the disconnect of
 connections <> default    - If missing: add "disconnect <session>"    - If
 physical disconnect of non "default" sessions is not finished      at test
 end: add routine which waits till this happened + additional improvements   -
 remove superfluous files created by the test   - replace error numbers by
 error names   - remove trailing spaces, replace tabs by spaces   - unify
 writing of bugs within comments   - correct comments   - minor changes of
 formatting Fixed tests:   backup   check   compress   grant  
 information_schema   multi_update   overflow   packet  
 query_cache_not_embedded   sp-threads   subselect   synchronization  
 timezone_grant

---
 mysql-test/t/multi_update.test | 55 ++++++++++++++++++++++++++----------------
 1 file changed, 34 insertions(+), 21 deletions(-)

(limited to 'mysql-test/t/multi_update.test')

diff --git a/mysql-test/t/multi_update.test b/mysql-test/t/multi_update.test
index 2bb3b17340c..9f493189e6d 100644
--- a/mysql-test/t/multi_update.test
+++ b/mysql-test/t/multi_update.test
@@ -24,17 +24,17 @@ let $1 = 100;
 while ($1)
  {
   let $2 = 5;
-  eval insert into t1(t) values ('$1'); 
+  eval insert into t1(t) values ('$1');
   while ($2)
    {
-     eval insert into t2(id2,t) values ($1,'$2'); 
+     eval insert into t2(id2,t) values ($1,'$2');
      let $3 = 10;
      while ($3)
      {
-       eval insert into t3(id3,t) values ($1,'$2'); 
+       eval insert into t3(id3,t) values ($1,'$2');
        dec $3;
      }
-     dec $2; 
+     dec $2;
    }
   dec $1;
  }
@@ -79,11 +79,11 @@ let $1 = 1000;
 while ($1)
  {
   let $2 = 5;
-  eval insert into t1 values ($1,'aaaaaaaaaaaaaaaaaaaa'); 
+  eval insert into t1 values ($1,'aaaaaaaaaaaaaaaaaaaa');
   while ($2)
    {
-     eval insert into t2(id2,t) values ($1,'bbbbbbbbbbbbbbbbb'); 
-     dec $2; 
+     eval insert into t2(id2,t) values ($1,'bbbbbbbbbbbbbbbbb');
+     dec $2;
    }
   dec $1;
  }
@@ -317,7 +317,7 @@ update t2, t1 set t2.field=t1.field
 
 delete t1, t2 from t2 inner join t1 on t1.id1=t2.id2
   where 0=1;
-delete t1, t2 from t2,t1 
+delete t1, t2 from t2,t1
   where t1.id1=t2.id2 and 0=1;
 
 drop table t1,t2;
@@ -351,7 +351,7 @@ create table `t2` (`c2_id` int(10) unsigned NULL auto_increment, `c2_p_id` int(1
 insert into t1 values (0,'A01-Comp',1);
 insert into t1 values (0,'B01-Comp',1);
 insert into t2 values (0,1,'A Note',1);
-update t1 left join t2 on p_id = c2_p_id set c2_note = 'asdf-1' where p_id = 2; 
+update t1 left join t2 on p_id = c2_p_id set c2_note = 'asdf-1' where p_id = 2;
 select * from t1;
 select * from t2;
 drop table t1, t2;
@@ -379,6 +379,9 @@ revoke all privileges on mysqltest.t1 from mysqltest_1@localhost;
 revoke all privileges on mysqltest.* from mysqltest_1@localhost;
 delete from mysql.user where user=_binary'mysqltest_1';
 drop database mysqltest;
+connection default;
+disconnect user1;
+disconnect root;
 
 #
 # multi delete wrong table check
@@ -393,7 +396,7 @@ drop table t1, t2, t3;
 #
 # multi* unique updating table check
 #
-create table t1 (col1 int); 
+create table t1 (col1 int);
 create table t2 (col1 int);
 -- error ER_UPDATE_TABLE_USED
 update t1,t2 set t1.col1 = (select max(col1) from t1) where t1.col1 = t2.col1;
@@ -401,16 +404,16 @@ update t1,t2 set t1.col1 = (select max(col1) from t1) where t1.col1 = t2.col1;
 delete t1 from t1,t2 where t1.col1 < (select max(col1) from t1) and t1.col1 = t2.col1;
 drop table t1,t2;
 
-# Test for BUG#5837 - delete with outer join and const tables
+# Test for Bug#5837 delete with outer join and const tables
 --disable_warnings
 create table t1 (
-  aclid bigint not null primary key, 
-  status tinyint(1) not null 
+  aclid bigint not null primary key,
+  status tinyint(1) not null
 ) engine = innodb;
 
 create table t2 (
-  refid bigint not null primary key, 
-  aclid bigint, index idx_acl(aclid) 
+  refid bigint not null primary key,
+  aclid bigint, index idx_acl(aclid)
 ) engine = innodb;
 --enable_warnings
 insert into t2 values(1,null);
@@ -418,7 +421,7 @@ delete t2, t1 from t2 left join t1 on (t2.aclid=t1.aclid) where t2.refid='1';
 drop table t1, t2;
 
 #
-# Bug#19225: unchecked error leads to server crash
+# Bug#19225 unchecked error leads to server crash
 #
 create table t1(a int);
 create table t2(a int);
@@ -428,7 +431,7 @@ drop table t1, t2;
 # End of 4.1 tests
 
 #
-# Test for bug #1980.
+# Test for Bug#1980.
 #
 --disable_warnings
 create table t1 ( c char(8) not null ) engine=innodb;
@@ -484,9 +487,12 @@ send alter table t1 add column c int default 100 after a;
 
 connect (updater,localhost,root,,test);
 connection updater;
+# Wait till "alter table t1 ..." is in work.
+sleep 2;
 send update t1, v1 set t1.b=t1.a+t1.b+v1.b where t1.a=v1.a;
 
 connection locker;
+# Wait till "update t1, v1 ..." is in work.
 sleep 2;
 unlock tables;
 
@@ -500,8 +506,14 @@ select * from t2;
 drop view v1;
 drop table t1, t2;
 
+connection default;
+disconnect locker;
+disconnect changer;
+disconnect updater;
+
+
 #
-# Bug#27716  	multi-update did partially and has not binlogged
+# Bug#27716 multi-update did partially and has not binlogged
 #
 
 CREATE TABLE `t1` (
@@ -536,11 +548,12 @@ reset master;
 UPDATE t2,t1  SET t2.a=t2.b where t2.a=t1.a;
 show master status /* there must be the UPDATE query event */;
 
-# cleanup bug#27716
+# cleanup
 drop table t1, t2;
 
+
 #
-# Bug #29136  	erred multi-delete on trans table does not rollback 
+# Bug#29136 erred multi-delete on trans table does not rollback
 #
 
 # prepare
@@ -569,7 +582,7 @@ select count(*) from t3 /* must be 1 */;
 # the query must be in binlog (no surprise though)
 source include/show_binlog_events.inc;
 
-# cleanup bug#29136
+# cleanup
 drop table t1, t2, t3;
 
 
-- 
cgit v1.2.1