List:Commits« Previous MessageNext Message »
From:Andrei Elkin Date:February 21 2011 2:38pm
Subject:bzr commit into mysql-next-mr-wl5569 branch (andrei.elkin:3272) WL#5599
View as plain text  
#At file:///home/andrei/MySQL/BZR/2a-23May/WL/mysql-next-mr-wl5569/ based on revid:andrei.elkin@stripped

 3272 Andrei Elkin	2011-02-21
      wl#5599 Query parallel replication.
      
      Fixed few issues revealed by testing.
      
      1. All db:s are picked up not just updated ones;
      2. Added opt files to rpl_parallel_mult_db to let it pass with righer big (8 db:s) values.
      3. Added over-max db:s tests.
     @ mysql-test/r/mysqld--help-notwin.result
        results get updated.
     @ mysql-test/suite/rpl/r/rpl_parallel_ddl.result
        results get updated.
     @ mysql-test/suite/rpl/r/rpl_parallel_multi_db.result
        results get updated.
     @ mysql-test/suite/rpl/r/rpl_parallel_start_stop.result
        results get updated.
     @ mysql-test/suite/rpl/t/rpl_parallel_ddl.test
        added over-the-max updated db:s case through RENAME tables.
     @ mysql-test/suite/rpl/t/rpl_parallel_fallback.test
        Marked a todo.
     @ mysql-test/suite/rpl/t/rpl_parallel_multi_db.test
        increased the number of db:s. Notice that forces to change the default of --thread-stack size;
        added over-the-max updated db:s case through multi-updates.
     @ mysql-test/suite/rpl/t/rpl_parallel_start_stop.test
        removed explicit log pos from the results.
     @ mysql-test/suite/sys_vars/r/all_vars.result
        results get updated.
     @ sql/binlog.cc
        Changed location of comparisions against MAX_DBS_IN_QUERY_MTS to be inside the adding to db list method;
        refined logics of gathering db in decide_(): *all* db:s whenever there is at least one table to update are picked up.
     @ sql/log_event.cc
        removed an extraneous assert.
     @ sql/log_event.h
        updated some comments.
     @ sql/share/errmsg-utf8.txt
        Added a new error/warning on master specific to Query parallel replication.
     @ sql/sql_table.cc
        Changed location of comparisions against MAX_DBS_IN_QUERY_MTS to be inside the adding to db list method.

    added:
      mysql-test/suite/rpl/t/rpl_parallel_multi_db-master.opt
      mysql-test/suite/rpl/t/rpl_parallel_multi_db-slave.opt
    modified:
      mysql-test/r/mysqld--help-notwin.result
      mysql-test/suite/rpl/r/rpl_parallel_ddl.result
      mysql-test/suite/rpl/r/rpl_parallel_multi_db.result
      mysql-test/suite/rpl/r/rpl_parallel_start_stop.result
      mysql-test/suite/rpl/t/rpl_parallel_ddl.test
      mysql-test/suite/rpl/t/rpl_parallel_fallback.test
      mysql-test/suite/rpl/t/rpl_parallel_multi_db.test
      mysql-test/suite/rpl/t/rpl_parallel_start_stop.test
      mysql-test/suite/sys_vars/r/all_vars.result
      sql/binlog.cc
      sql/log_event.cc
      sql/log_event.h
      sql/share/errmsg-utf8.txt
      sql/sql_table.cc
=== modified file 'mysql-test/r/mysqld--help-notwin.result'
--- a/mysql-test/r/mysqld--help-notwin.result	2011-02-17 19:56:48 +0000
+++ b/mysql-test/r/mysqld--help-notwin.result	2011-02-21 14:38:13 +0000
@@ -362,6 +362,10 @@ The following options may be given as th
  If enabled slave itself computes the event appying time
  value to implicitly affected timestamp columms. Otherwise
  (default) it installs prescribed by the master value
+ --mts-master-updated-dbs-max=# 
+ The maximum number of databases that a query log event
+ can contain in its header in order to faciliate the
+ parallel applying on the slave.
  --mts-partition-hash-soft-max=# 
  Number of records in the mts partition hash below which
  entries with zero usage are tolerated
@@ -907,6 +911,7 @@ mts-checkpoint-group 512
 mts-checkpoint-period 300
 mts-coordinator-basic-nap 5
 mts-exp-slave-local-timestamp FALSE
+mts-master-updated-dbs-max 16
 mts-partition-hash-soft-max 16
 mts-pending-jobs-size-max 16777216
 mts-slave-parallel-workers 0

=== modified file 'mysql-test/suite/rpl/r/rpl_parallel_ddl.result'
--- a/mysql-test/suite/rpl/r/rpl_parallel_ddl.result	2011-02-19 16:26:33 +0000
+++ b/mysql-test/suite/rpl/r/rpl_parallel_ddl.result	2011-02-21 14:38:13 +0000
@@ -3,806 +3,6 @@ include/master-slave.inc
 include/stop_slave.inc
 set @save.mts_slave_parallel_workers= @@global.mts_slave_parallel_workers;
 set @@global.mts_slave_parallel_workers= 4;
-create database d32;
-create table d32.t8 (a int);
-select round(rand()*8) into @var;
-insert into d32.t8 values (@var);
-create table d32.t7 (a int);
-select round(rand()*8) into @var;
-insert into d32.t7 values (@var);
-create table d32.t6 (a int);
-select round(rand()*8) into @var;
-insert into d32.t6 values (@var);
-create table d32.t5 (a int);
-select round(rand()*8) into @var;
-insert into d32.t5 values (@var);
-create table d32.t4 (a int);
-select round(rand()*8) into @var;
-insert into d32.t4 values (@var);
-create table d32.t3 (a int);
-select round(rand()*8) into @var;
-insert into d32.t3 values (@var);
-create table d32.t2 (a int);
-select round(rand()*8) into @var;
-insert into d32.t2 values (@var);
-create table d32.t1 (a int);
-select round(rand()*8) into @var;
-insert into d32.t1 values (@var);
-create database d31;
-create table d31.t8 (a int);
-select round(rand()*8) into @var;
-insert into d31.t8 values (@var);
-create table d31.t7 (a int);
-select round(rand()*8) into @var;
-insert into d31.t7 values (@var);
-create table d31.t6 (a int);
-select round(rand()*8) into @var;
-insert into d31.t6 values (@var);
-create table d31.t5 (a int);
-select round(rand()*8) into @var;
-insert into d31.t5 values (@var);
-create table d31.t4 (a int);
-select round(rand()*8) into @var;
-insert into d31.t4 values (@var);
-create table d31.t3 (a int);
-select round(rand()*8) into @var;
-insert into d31.t3 values (@var);
-create table d31.t2 (a int);
-select round(rand()*8) into @var;
-insert into d31.t2 values (@var);
-create table d31.t1 (a int);
-select round(rand()*8) into @var;
-insert into d31.t1 values (@var);
-create database d30;
-create table d30.t8 (a int);
-select round(rand()*8) into @var;
-insert into d30.t8 values (@var);
-create table d30.t7 (a int);
-select round(rand()*8) into @var;
-insert into d30.t7 values (@var);
-create table d30.t6 (a int);
-select round(rand()*8) into @var;
-insert into d30.t6 values (@var);
-create table d30.t5 (a int);
-select round(rand()*8) into @var;
-insert into d30.t5 values (@var);
-create table d30.t4 (a int);
-select round(rand()*8) into @var;
-insert into d30.t4 values (@var);
-create table d30.t3 (a int);
-select round(rand()*8) into @var;
-insert into d30.t3 values (@var);
-create table d30.t2 (a int);
-select round(rand()*8) into @var;
-insert into d30.t2 values (@var);
-create table d30.t1 (a int);
-select round(rand()*8) into @var;
-insert into d30.t1 values (@var);
-create database d29;
-create table d29.t8 (a int);
-select round(rand()*8) into @var;
-insert into d29.t8 values (@var);
-create table d29.t7 (a int);
-select round(rand()*8) into @var;
-insert into d29.t7 values (@var);
-create table d29.t6 (a int);
-select round(rand()*8) into @var;
-insert into d29.t6 values (@var);
-create table d29.t5 (a int);
-select round(rand()*8) into @var;
-insert into d29.t5 values (@var);
-create table d29.t4 (a int);
-select round(rand()*8) into @var;
-insert into d29.t4 values (@var);
-create table d29.t3 (a int);
-select round(rand()*8) into @var;
-insert into d29.t3 values (@var);
-create table d29.t2 (a int);
-select round(rand()*8) into @var;
-insert into d29.t2 values (@var);
-create table d29.t1 (a int);
-select round(rand()*8) into @var;
-insert into d29.t1 values (@var);
-create database d28;
-create table d28.t8 (a int);
-select round(rand()*8) into @var;
-insert into d28.t8 values (@var);
-create table d28.t7 (a int);
-select round(rand()*8) into @var;
-insert into d28.t7 values (@var);
-create table d28.t6 (a int);
-select round(rand()*8) into @var;
-insert into d28.t6 values (@var);
-create table d28.t5 (a int);
-select round(rand()*8) into @var;
-insert into d28.t5 values (@var);
-create table d28.t4 (a int);
-select round(rand()*8) into @var;
-insert into d28.t4 values (@var);
-create table d28.t3 (a int);
-select round(rand()*8) into @var;
-insert into d28.t3 values (@var);
-create table d28.t2 (a int);
-select round(rand()*8) into @var;
-insert into d28.t2 values (@var);
-create table d28.t1 (a int);
-select round(rand()*8) into @var;
-insert into d28.t1 values (@var);
-create database d27;
-create table d27.t8 (a int);
-select round(rand()*8) into @var;
-insert into d27.t8 values (@var);
-create table d27.t7 (a int);
-select round(rand()*8) into @var;
-insert into d27.t7 values (@var);
-create table d27.t6 (a int);
-select round(rand()*8) into @var;
-insert into d27.t6 values (@var);
-create table d27.t5 (a int);
-select round(rand()*8) into @var;
-insert into d27.t5 values (@var);
-create table d27.t4 (a int);
-select round(rand()*8) into @var;
-insert into d27.t4 values (@var);
-create table d27.t3 (a int);
-select round(rand()*8) into @var;
-insert into d27.t3 values (@var);
-create table d27.t2 (a int);
-select round(rand()*8) into @var;
-insert into d27.t2 values (@var);
-create table d27.t1 (a int);
-select round(rand()*8) into @var;
-insert into d27.t1 values (@var);
-create database d26;
-create table d26.t8 (a int);
-select round(rand()*8) into @var;
-insert into d26.t8 values (@var);
-create table d26.t7 (a int);
-select round(rand()*8) into @var;
-insert into d26.t7 values (@var);
-create table d26.t6 (a int);
-select round(rand()*8) into @var;
-insert into d26.t6 values (@var);
-create table d26.t5 (a int);
-select round(rand()*8) into @var;
-insert into d26.t5 values (@var);
-create table d26.t4 (a int);
-select round(rand()*8) into @var;
-insert into d26.t4 values (@var);
-create table d26.t3 (a int);
-select round(rand()*8) into @var;
-insert into d26.t3 values (@var);
-create table d26.t2 (a int);
-select round(rand()*8) into @var;
-insert into d26.t2 values (@var);
-create table d26.t1 (a int);
-select round(rand()*8) into @var;
-insert into d26.t1 values (@var);
-create database d25;
-create table d25.t8 (a int);
-select round(rand()*8) into @var;
-insert into d25.t8 values (@var);
-create table d25.t7 (a int);
-select round(rand()*8) into @var;
-insert into d25.t7 values (@var);
-create table d25.t6 (a int);
-select round(rand()*8) into @var;
-insert into d25.t6 values (@var);
-create table d25.t5 (a int);
-select round(rand()*8) into @var;
-insert into d25.t5 values (@var);
-create table d25.t4 (a int);
-select round(rand()*8) into @var;
-insert into d25.t4 values (@var);
-create table d25.t3 (a int);
-select round(rand()*8) into @var;
-insert into d25.t3 values (@var);
-create table d25.t2 (a int);
-select round(rand()*8) into @var;
-insert into d25.t2 values (@var);
-create table d25.t1 (a int);
-select round(rand()*8) into @var;
-insert into d25.t1 values (@var);
-create database d24;
-create table d24.t8 (a int);
-select round(rand()*8) into @var;
-insert into d24.t8 values (@var);
-create table d24.t7 (a int);
-select round(rand()*8) into @var;
-insert into d24.t7 values (@var);
-create table d24.t6 (a int);
-select round(rand()*8) into @var;
-insert into d24.t6 values (@var);
-create table d24.t5 (a int);
-select round(rand()*8) into @var;
-insert into d24.t5 values (@var);
-create table d24.t4 (a int);
-select round(rand()*8) into @var;
-insert into d24.t4 values (@var);
-create table d24.t3 (a int);
-select round(rand()*8) into @var;
-insert into d24.t3 values (@var);
-create table d24.t2 (a int);
-select round(rand()*8) into @var;
-insert into d24.t2 values (@var);
-create table d24.t1 (a int);
-select round(rand()*8) into @var;
-insert into d24.t1 values (@var);
-create database d23;
-create table d23.t8 (a int);
-select round(rand()*8) into @var;
-insert into d23.t8 values (@var);
-create table d23.t7 (a int);
-select round(rand()*8) into @var;
-insert into d23.t7 values (@var);
-create table d23.t6 (a int);
-select round(rand()*8) into @var;
-insert into d23.t6 values (@var);
-create table d23.t5 (a int);
-select round(rand()*8) into @var;
-insert into d23.t5 values (@var);
-create table d23.t4 (a int);
-select round(rand()*8) into @var;
-insert into d23.t4 values (@var);
-create table d23.t3 (a int);
-select round(rand()*8) into @var;
-insert into d23.t3 values (@var);
-create table d23.t2 (a int);
-select round(rand()*8) into @var;
-insert into d23.t2 values (@var);
-create table d23.t1 (a int);
-select round(rand()*8) into @var;
-insert into d23.t1 values (@var);
-create database d22;
-create table d22.t8 (a int);
-select round(rand()*8) into @var;
-insert into d22.t8 values (@var);
-create table d22.t7 (a int);
-select round(rand()*8) into @var;
-insert into d22.t7 values (@var);
-create table d22.t6 (a int);
-select round(rand()*8) into @var;
-insert into d22.t6 values (@var);
-create table d22.t5 (a int);
-select round(rand()*8) into @var;
-insert into d22.t5 values (@var);
-create table d22.t4 (a int);
-select round(rand()*8) into @var;
-insert into d22.t4 values (@var);
-create table d22.t3 (a int);
-select round(rand()*8) into @var;
-insert into d22.t3 values (@var);
-create table d22.t2 (a int);
-select round(rand()*8) into @var;
-insert into d22.t2 values (@var);
-create table d22.t1 (a int);
-select round(rand()*8) into @var;
-insert into d22.t1 values (@var);
-create database d21;
-create table d21.t8 (a int);
-select round(rand()*8) into @var;
-insert into d21.t8 values (@var);
-create table d21.t7 (a int);
-select round(rand()*8) into @var;
-insert into d21.t7 values (@var);
-create table d21.t6 (a int);
-select round(rand()*8) into @var;
-insert into d21.t6 values (@var);
-create table d21.t5 (a int);
-select round(rand()*8) into @var;
-insert into d21.t5 values (@var);
-create table d21.t4 (a int);
-select round(rand()*8) into @var;
-insert into d21.t4 values (@var);
-create table d21.t3 (a int);
-select round(rand()*8) into @var;
-insert into d21.t3 values (@var);
-create table d21.t2 (a int);
-select round(rand()*8) into @var;
-insert into d21.t2 values (@var);
-create table d21.t1 (a int);
-select round(rand()*8) into @var;
-insert into d21.t1 values (@var);
-create database d20;
-create table d20.t8 (a int);
-select round(rand()*8) into @var;
-insert into d20.t8 values (@var);
-create table d20.t7 (a int);
-select round(rand()*8) into @var;
-insert into d20.t7 values (@var);
-create table d20.t6 (a int);
-select round(rand()*8) into @var;
-insert into d20.t6 values (@var);
-create table d20.t5 (a int);
-select round(rand()*8) into @var;
-insert into d20.t5 values (@var);
-create table d20.t4 (a int);
-select round(rand()*8) into @var;
-insert into d20.t4 values (@var);
-create table d20.t3 (a int);
-select round(rand()*8) into @var;
-insert into d20.t3 values (@var);
-create table d20.t2 (a int);
-select round(rand()*8) into @var;
-insert into d20.t2 values (@var);
-create table d20.t1 (a int);
-select round(rand()*8) into @var;
-insert into d20.t1 values (@var);
-create database d19;
-create table d19.t8 (a int);
-select round(rand()*8) into @var;
-insert into d19.t8 values (@var);
-create table d19.t7 (a int);
-select round(rand()*8) into @var;
-insert into d19.t7 values (@var);
-create table d19.t6 (a int);
-select round(rand()*8) into @var;
-insert into d19.t6 values (@var);
-create table d19.t5 (a int);
-select round(rand()*8) into @var;
-insert into d19.t5 values (@var);
-create table d19.t4 (a int);
-select round(rand()*8) into @var;
-insert into d19.t4 values (@var);
-create table d19.t3 (a int);
-select round(rand()*8) into @var;
-insert into d19.t3 values (@var);
-create table d19.t2 (a int);
-select round(rand()*8) into @var;
-insert into d19.t2 values (@var);
-create table d19.t1 (a int);
-select round(rand()*8) into @var;
-insert into d19.t1 values (@var);
-create database d18;
-create table d18.t8 (a int);
-select round(rand()*8) into @var;
-insert into d18.t8 values (@var);
-create table d18.t7 (a int);
-select round(rand()*8) into @var;
-insert into d18.t7 values (@var);
-create table d18.t6 (a int);
-select round(rand()*8) into @var;
-insert into d18.t6 values (@var);
-create table d18.t5 (a int);
-select round(rand()*8) into @var;
-insert into d18.t5 values (@var);
-create table d18.t4 (a int);
-select round(rand()*8) into @var;
-insert into d18.t4 values (@var);
-create table d18.t3 (a int);
-select round(rand()*8) into @var;
-insert into d18.t3 values (@var);
-create table d18.t2 (a int);
-select round(rand()*8) into @var;
-insert into d18.t2 values (@var);
-create table d18.t1 (a int);
-select round(rand()*8) into @var;
-insert into d18.t1 values (@var);
-create database d17;
-create table d17.t8 (a int);
-select round(rand()*8) into @var;
-insert into d17.t8 values (@var);
-create table d17.t7 (a int);
-select round(rand()*8) into @var;
-insert into d17.t7 values (@var);
-create table d17.t6 (a int);
-select round(rand()*8) into @var;
-insert into d17.t6 values (@var);
-create table d17.t5 (a int);
-select round(rand()*8) into @var;
-insert into d17.t5 values (@var);
-create table d17.t4 (a int);
-select round(rand()*8) into @var;
-insert into d17.t4 values (@var);
-create table d17.t3 (a int);
-select round(rand()*8) into @var;
-insert into d17.t3 values (@var);
-create table d17.t2 (a int);
-select round(rand()*8) into @var;
-insert into d17.t2 values (@var);
-create table d17.t1 (a int);
-select round(rand()*8) into @var;
-insert into d17.t1 values (@var);
-create database d16;
-create table d16.t8 (a int);
-select round(rand()*8) into @var;
-insert into d16.t8 values (@var);
-create table d16.t7 (a int);
-select round(rand()*8) into @var;
-insert into d16.t7 values (@var);
-create table d16.t6 (a int);
-select round(rand()*8) into @var;
-insert into d16.t6 values (@var);
-create table d16.t5 (a int);
-select round(rand()*8) into @var;
-insert into d16.t5 values (@var);
-create table d16.t4 (a int);
-select round(rand()*8) into @var;
-insert into d16.t4 values (@var);
-create table d16.t3 (a int);
-select round(rand()*8) into @var;
-insert into d16.t3 values (@var);
-create table d16.t2 (a int);
-select round(rand()*8) into @var;
-insert into d16.t2 values (@var);
-create table d16.t1 (a int);
-select round(rand()*8) into @var;
-insert into d16.t1 values (@var);
-create database d15;
-create table d15.t8 (a int);
-select round(rand()*8) into @var;
-insert into d15.t8 values (@var);
-create table d15.t7 (a int);
-select round(rand()*8) into @var;
-insert into d15.t7 values (@var);
-create table d15.t6 (a int);
-select round(rand()*8) into @var;
-insert into d15.t6 values (@var);
-create table d15.t5 (a int);
-select round(rand()*8) into @var;
-insert into d15.t5 values (@var);
-create table d15.t4 (a int);
-select round(rand()*8) into @var;
-insert into d15.t4 values (@var);
-create table d15.t3 (a int);
-select round(rand()*8) into @var;
-insert into d15.t3 values (@var);
-create table d15.t2 (a int);
-select round(rand()*8) into @var;
-insert into d15.t2 values (@var);
-create table d15.t1 (a int);
-select round(rand()*8) into @var;
-insert into d15.t1 values (@var);
-create database d14;
-create table d14.t8 (a int);
-select round(rand()*8) into @var;
-insert into d14.t8 values (@var);
-create table d14.t7 (a int);
-select round(rand()*8) into @var;
-insert into d14.t7 values (@var);
-create table d14.t6 (a int);
-select round(rand()*8) into @var;
-insert into d14.t6 values (@var);
-create table d14.t5 (a int);
-select round(rand()*8) into @var;
-insert into d14.t5 values (@var);
-create table d14.t4 (a int);
-select round(rand()*8) into @var;
-insert into d14.t4 values (@var);
-create table d14.t3 (a int);
-select round(rand()*8) into @var;
-insert into d14.t3 values (@var);
-create table d14.t2 (a int);
-select round(rand()*8) into @var;
-insert into d14.t2 values (@var);
-create table d14.t1 (a int);
-select round(rand()*8) into @var;
-insert into d14.t1 values (@var);
-create database d13;
-create table d13.t8 (a int);
-select round(rand()*8) into @var;
-insert into d13.t8 values (@var);
-create table d13.t7 (a int);
-select round(rand()*8) into @var;
-insert into d13.t7 values (@var);
-create table d13.t6 (a int);
-select round(rand()*8) into @var;
-insert into d13.t6 values (@var);
-create table d13.t5 (a int);
-select round(rand()*8) into @var;
-insert into d13.t5 values (@var);
-create table d13.t4 (a int);
-select round(rand()*8) into @var;
-insert into d13.t4 values (@var);
-create table d13.t3 (a int);
-select round(rand()*8) into @var;
-insert into d13.t3 values (@var);
-create table d13.t2 (a int);
-select round(rand()*8) into @var;
-insert into d13.t2 values (@var);
-create table d13.t1 (a int);
-select round(rand()*8) into @var;
-insert into d13.t1 values (@var);
-create database d12;
-create table d12.t8 (a int);
-select round(rand()*8) into @var;
-insert into d12.t8 values (@var);
-create table d12.t7 (a int);
-select round(rand()*8) into @var;
-insert into d12.t7 values (@var);
-create table d12.t6 (a int);
-select round(rand()*8) into @var;
-insert into d12.t6 values (@var);
-create table d12.t5 (a int);
-select round(rand()*8) into @var;
-insert into d12.t5 values (@var);
-create table d12.t4 (a int);
-select round(rand()*8) into @var;
-insert into d12.t4 values (@var);
-create table d12.t3 (a int);
-select round(rand()*8) into @var;
-insert into d12.t3 values (@var);
-create table d12.t2 (a int);
-select round(rand()*8) into @var;
-insert into d12.t2 values (@var);
-create table d12.t1 (a int);
-select round(rand()*8) into @var;
-insert into d12.t1 values (@var);
-create database d11;
-create table d11.t8 (a int);
-select round(rand()*8) into @var;
-insert into d11.t8 values (@var);
-create table d11.t7 (a int);
-select round(rand()*8) into @var;
-insert into d11.t7 values (@var);
-create table d11.t6 (a int);
-select round(rand()*8) into @var;
-insert into d11.t6 values (@var);
-create table d11.t5 (a int);
-select round(rand()*8) into @var;
-insert into d11.t5 values (@var);
-create table d11.t4 (a int);
-select round(rand()*8) into @var;
-insert into d11.t4 values (@var);
-create table d11.t3 (a int);
-select round(rand()*8) into @var;
-insert into d11.t3 values (@var);
-create table d11.t2 (a int);
-select round(rand()*8) into @var;
-insert into d11.t2 values (@var);
-create table d11.t1 (a int);
-select round(rand()*8) into @var;
-insert into d11.t1 values (@var);
-create database d10;
-create table d10.t8 (a int);
-select round(rand()*8) into @var;
-insert into d10.t8 values (@var);
-create table d10.t7 (a int);
-select round(rand()*8) into @var;
-insert into d10.t7 values (@var);
-create table d10.t6 (a int);
-select round(rand()*8) into @var;
-insert into d10.t6 values (@var);
-create table d10.t5 (a int);
-select round(rand()*8) into @var;
-insert into d10.t5 values (@var);
-create table d10.t4 (a int);
-select round(rand()*8) into @var;
-insert into d10.t4 values (@var);
-create table d10.t3 (a int);
-select round(rand()*8) into @var;
-insert into d10.t3 values (@var);
-create table d10.t2 (a int);
-select round(rand()*8) into @var;
-insert into d10.t2 values (@var);
-create table d10.t1 (a int);
-select round(rand()*8) into @var;
-insert into d10.t1 values (@var);
-create database d9;
-create table d9.t8 (a int);
-select round(rand()*8) into @var;
-insert into d9.t8 values (@var);
-create table d9.t7 (a int);
-select round(rand()*8) into @var;
-insert into d9.t7 values (@var);
-create table d9.t6 (a int);
-select round(rand()*8) into @var;
-insert into d9.t6 values (@var);
-create table d9.t5 (a int);
-select round(rand()*8) into @var;
-insert into d9.t5 values (@var);
-create table d9.t4 (a int);
-select round(rand()*8) into @var;
-insert into d9.t4 values (@var);
-create table d9.t3 (a int);
-select round(rand()*8) into @var;
-insert into d9.t3 values (@var);
-create table d9.t2 (a int);
-select round(rand()*8) into @var;
-insert into d9.t2 values (@var);
-create table d9.t1 (a int);
-select round(rand()*8) into @var;
-insert into d9.t1 values (@var);
-create database d8;
-create table d8.t8 (a int);
-select round(rand()*8) into @var;
-insert into d8.t8 values (@var);
-create table d8.t7 (a int);
-select round(rand()*8) into @var;
-insert into d8.t7 values (@var);
-create table d8.t6 (a int);
-select round(rand()*8) into @var;
-insert into d8.t6 values (@var);
-create table d8.t5 (a int);
-select round(rand()*8) into @var;
-insert into d8.t5 values (@var);
-create table d8.t4 (a int);
-select round(rand()*8) into @var;
-insert into d8.t4 values (@var);
-create table d8.t3 (a int);
-select round(rand()*8) into @var;
-insert into d8.t3 values (@var);
-create table d8.t2 (a int);
-select round(rand()*8) into @var;
-insert into d8.t2 values (@var);
-create table d8.t1 (a int);
-select round(rand()*8) into @var;
-insert into d8.t1 values (@var);
-create database d7;
-create table d7.t8 (a int);
-select round(rand()*8) into @var;
-insert into d7.t8 values (@var);
-create table d7.t7 (a int);
-select round(rand()*8) into @var;
-insert into d7.t7 values (@var);
-create table d7.t6 (a int);
-select round(rand()*8) into @var;
-insert into d7.t6 values (@var);
-create table d7.t5 (a int);
-select round(rand()*8) into @var;
-insert into d7.t5 values (@var);
-create table d7.t4 (a int);
-select round(rand()*8) into @var;
-insert into d7.t4 values (@var);
-create table d7.t3 (a int);
-select round(rand()*8) into @var;
-insert into d7.t3 values (@var);
-create table d7.t2 (a int);
-select round(rand()*8) into @var;
-insert into d7.t2 values (@var);
-create table d7.t1 (a int);
-select round(rand()*8) into @var;
-insert into d7.t1 values (@var);
-create database d6;
-create table d6.t8 (a int);
-select round(rand()*8) into @var;
-insert into d6.t8 values (@var);
-create table d6.t7 (a int);
-select round(rand()*8) into @var;
-insert into d6.t7 values (@var);
-create table d6.t6 (a int);
-select round(rand()*8) into @var;
-insert into d6.t6 values (@var);
-create table d6.t5 (a int);
-select round(rand()*8) into @var;
-insert into d6.t5 values (@var);
-create table d6.t4 (a int);
-select round(rand()*8) into @var;
-insert into d6.t4 values (@var);
-create table d6.t3 (a int);
-select round(rand()*8) into @var;
-insert into d6.t3 values (@var);
-create table d6.t2 (a int);
-select round(rand()*8) into @var;
-insert into d6.t2 values (@var);
-create table d6.t1 (a int);
-select round(rand()*8) into @var;
-insert into d6.t1 values (@var);
-create database d5;
-create table d5.t8 (a int);
-select round(rand()*8) into @var;
-insert into d5.t8 values (@var);
-create table d5.t7 (a int);
-select round(rand()*8) into @var;
-insert into d5.t7 values (@var);
-create table d5.t6 (a int);
-select round(rand()*8) into @var;
-insert into d5.t6 values (@var);
-create table d5.t5 (a int);
-select round(rand()*8) into @var;
-insert into d5.t5 values (@var);
-create table d5.t4 (a int);
-select round(rand()*8) into @var;
-insert into d5.t4 values (@var);
-create table d5.t3 (a int);
-select round(rand()*8) into @var;
-insert into d5.t3 values (@var);
-create table d5.t2 (a int);
-select round(rand()*8) into @var;
-insert into d5.t2 values (@var);
-create table d5.t1 (a int);
-select round(rand()*8) into @var;
-insert into d5.t1 values (@var);
-create database d4;
-create table d4.t8 (a int);
-select round(rand()*8) into @var;
-insert into d4.t8 values (@var);
-create table d4.t7 (a int);
-select round(rand()*8) into @var;
-insert into d4.t7 values (@var);
-create table d4.t6 (a int);
-select round(rand()*8) into @var;
-insert into d4.t6 values (@var);
-create table d4.t5 (a int);
-select round(rand()*8) into @var;
-insert into d4.t5 values (@var);
-create table d4.t4 (a int);
-select round(rand()*8) into @var;
-insert into d4.t4 values (@var);
-create table d4.t3 (a int);
-select round(rand()*8) into @var;
-insert into d4.t3 values (@var);
-create table d4.t2 (a int);
-select round(rand()*8) into @var;
-insert into d4.t2 values (@var);
-create table d4.t1 (a int);
-select round(rand()*8) into @var;
-insert into d4.t1 values (@var);
-create database d3;
-create table d3.t8 (a int);
-select round(rand()*8) into @var;
-insert into d3.t8 values (@var);
-create table d3.t7 (a int);
-select round(rand()*8) into @var;
-insert into d3.t7 values (@var);
-create table d3.t6 (a int);
-select round(rand()*8) into @var;
-insert into d3.t6 values (@var);
-create table d3.t5 (a int);
-select round(rand()*8) into @var;
-insert into d3.t5 values (@var);
-create table d3.t4 (a int);
-select round(rand()*8) into @var;
-insert into d3.t4 values (@var);
-create table d3.t3 (a int);
-select round(rand()*8) into @var;
-insert into d3.t3 values (@var);
-create table d3.t2 (a int);
-select round(rand()*8) into @var;
-insert into d3.t2 values (@var);
-create table d3.t1 (a int);
-select round(rand()*8) into @var;
-insert into d3.t1 values (@var);
-create database d2;
-create table d2.t8 (a int);
-select round(rand()*8) into @var;
-insert into d2.t8 values (@var);
-create table d2.t7 (a int);
-select round(rand()*8) into @var;
-insert into d2.t7 values (@var);
-create table d2.t6 (a int);
-select round(rand()*8) into @var;
-insert into d2.t6 values (@var);
-create table d2.t5 (a int);
-select round(rand()*8) into @var;
-insert into d2.t5 values (@var);
-create table d2.t4 (a int);
-select round(rand()*8) into @var;
-insert into d2.t4 values (@var);
-create table d2.t3 (a int);
-select round(rand()*8) into @var;
-insert into d2.t3 values (@var);
-create table d2.t2 (a int);
-select round(rand()*8) into @var;
-insert into d2.t2 values (@var);
-create table d2.t1 (a int);
-select round(rand()*8) into @var;
-insert into d2.t1 values (@var);
-create database d1;
-create table d1.t8 (a int);
-select round(rand()*8) into @var;
-insert into d1.t8 values (@var);
-create table d1.t7 (a int);
-select round(rand()*8) into @var;
-insert into d1.t7 values (@var);
-create table d1.t6 (a int);
-select round(rand()*8) into @var;
-insert into d1.t6 values (@var);
-create table d1.t5 (a int);
-select round(rand()*8) into @var;
-insert into d1.t5 values (@var);
-create table d1.t4 (a int);
-select round(rand()*8) into @var;
-insert into d1.t4 values (@var);
-create table d1.t3 (a int);
-select round(rand()*8) into @var;
-insert into d1.t3 values (@var);
-create table d1.t2 (a int);
-select round(rand()*8) into @var;
-insert into d1.t2 values (@var);
-create table d1.t1 (a int);
-select round(rand()*8) into @var;
-insert into d1.t1 values (@var);
 include/start_slave.inc
 Warnings:
 Note	1726	Temporary failed transaction retry is not supported in Parallel Slave. Such failure will force the slave to stop.

=== modified file 'mysql-test/suite/rpl/r/rpl_parallel_multi_db.result'
--- a/mysql-test/suite/rpl/r/rpl_parallel_multi_db.result	2011-02-17 19:56:48 +0000
+++ b/mysql-test/suite/rpl/r/rpl_parallel_multi_db.result	2011-02-21 14:38:13 +0000
@@ -6,6 +6,106 @@ set @@global.mts_slave_parallel_workers=
 include/start_slave.inc
 Warnings:
 Note	1726	Temporary failed transaction retry is not supported in Parallel Slave. Such failure will force the slave to stop.
+create database d8;
+create table d8.t8 (a int);
+select round(rand()*8) into @var;
+insert into d8.t8 values (@var);
+create table d8.t7 (a int);
+select round(rand()*8) into @var;
+insert into d8.t7 values (@var);
+create table d8.t6 (a int);
+select round(rand()*8) into @var;
+insert into d8.t6 values (@var);
+create table d8.t5 (a int);
+select round(rand()*8) into @var;
+insert into d8.t5 values (@var);
+create table d8.t4 (a int);
+select round(rand()*8) into @var;
+insert into d8.t4 values (@var);
+create table d8.t3 (a int);
+select round(rand()*8) into @var;
+insert into d8.t3 values (@var);
+create table d8.t2 (a int);
+select round(rand()*8) into @var;
+insert into d8.t2 values (@var);
+create table d8.t1 (a int);
+select round(rand()*8) into @var;
+insert into d8.t1 values (@var);
+create database d7;
+create table d7.t8 (a int);
+select round(rand()*8) into @var;
+insert into d7.t8 values (@var);
+create table d7.t7 (a int);
+select round(rand()*8) into @var;
+insert into d7.t7 values (@var);
+create table d7.t6 (a int);
+select round(rand()*8) into @var;
+insert into d7.t6 values (@var);
+create table d7.t5 (a int);
+select round(rand()*8) into @var;
+insert into d7.t5 values (@var);
+create table d7.t4 (a int);
+select round(rand()*8) into @var;
+insert into d7.t4 values (@var);
+create table d7.t3 (a int);
+select round(rand()*8) into @var;
+insert into d7.t3 values (@var);
+create table d7.t2 (a int);
+select round(rand()*8) into @var;
+insert into d7.t2 values (@var);
+create table d7.t1 (a int);
+select round(rand()*8) into @var;
+insert into d7.t1 values (@var);
+create database d6;
+create table d6.t8 (a int);
+select round(rand()*8) into @var;
+insert into d6.t8 values (@var);
+create table d6.t7 (a int);
+select round(rand()*8) into @var;
+insert into d6.t7 values (@var);
+create table d6.t6 (a int);
+select round(rand()*8) into @var;
+insert into d6.t6 values (@var);
+create table d6.t5 (a int);
+select round(rand()*8) into @var;
+insert into d6.t5 values (@var);
+create table d6.t4 (a int);
+select round(rand()*8) into @var;
+insert into d6.t4 values (@var);
+create table d6.t3 (a int);
+select round(rand()*8) into @var;
+insert into d6.t3 values (@var);
+create table d6.t2 (a int);
+select round(rand()*8) into @var;
+insert into d6.t2 values (@var);
+create table d6.t1 (a int);
+select round(rand()*8) into @var;
+insert into d6.t1 values (@var);
+create database d5;
+create table d5.t8 (a int);
+select round(rand()*8) into @var;
+insert into d5.t8 values (@var);
+create table d5.t7 (a int);
+select round(rand()*8) into @var;
+insert into d5.t7 values (@var);
+create table d5.t6 (a int);
+select round(rand()*8) into @var;
+insert into d5.t6 values (@var);
+create table d5.t5 (a int);
+select round(rand()*8) into @var;
+insert into d5.t5 values (@var);
+create table d5.t4 (a int);
+select round(rand()*8) into @var;
+insert into d5.t4 values (@var);
+create table d5.t3 (a int);
+select round(rand()*8) into @var;
+insert into d5.t3 values (@var);
+create table d5.t2 (a int);
+select round(rand()*8) into @var;
+insert into d5.t2 values (@var);
+create table d5.t1 (a int);
+select round(rand()*8) into @var;
+insert into d5.t1 values (@var);
 create database d4;
 create table d4.t8 (a int);
 select round(rand()*8) into @var;
@@ -106,6 +206,38 @@ insert into d1.t2 values (@var);
 create table d1.t1 (a int);
 select round(rand()*8) into @var;
 insert into d1.t1 values (@var);
+include/diff_tables.inc [master:d8.t8, slave:d8.t8]
+include/diff_tables.inc [master:d8.t7, slave:d8.t7]
+include/diff_tables.inc [master:d8.t6, slave:d8.t6]
+include/diff_tables.inc [master:d8.t5, slave:d8.t5]
+include/diff_tables.inc [master:d8.t4, slave:d8.t4]
+include/diff_tables.inc [master:d8.t3, slave:d8.t3]
+include/diff_tables.inc [master:d8.t2, slave:d8.t2]
+include/diff_tables.inc [master:d8.t1, slave:d8.t1]
+include/diff_tables.inc [master:d7.t8, slave:d7.t8]
+include/diff_tables.inc [master:d7.t7, slave:d7.t7]
+include/diff_tables.inc [master:d7.t6, slave:d7.t6]
+include/diff_tables.inc [master:d7.t5, slave:d7.t5]
+include/diff_tables.inc [master:d7.t4, slave:d7.t4]
+include/diff_tables.inc [master:d7.t3, slave:d7.t3]
+include/diff_tables.inc [master:d7.t2, slave:d7.t2]
+include/diff_tables.inc [master:d7.t1, slave:d7.t1]
+include/diff_tables.inc [master:d6.t8, slave:d6.t8]
+include/diff_tables.inc [master:d6.t7, slave:d6.t7]
+include/diff_tables.inc [master:d6.t6, slave:d6.t6]
+include/diff_tables.inc [master:d6.t5, slave:d6.t5]
+include/diff_tables.inc [master:d6.t4, slave:d6.t4]
+include/diff_tables.inc [master:d6.t3, slave:d6.t3]
+include/diff_tables.inc [master:d6.t2, slave:d6.t2]
+include/diff_tables.inc [master:d6.t1, slave:d6.t1]
+include/diff_tables.inc [master:d5.t8, slave:d5.t8]
+include/diff_tables.inc [master:d5.t7, slave:d5.t7]
+include/diff_tables.inc [master:d5.t6, slave:d5.t6]
+include/diff_tables.inc [master:d5.t5, slave:d5.t5]
+include/diff_tables.inc [master:d5.t4, slave:d5.t4]
+include/diff_tables.inc [master:d5.t3, slave:d5.t3]
+include/diff_tables.inc [master:d5.t2, slave:d5.t2]
+include/diff_tables.inc [master:d5.t1, slave:d5.t1]
 include/diff_tables.inc [master:d4.t8, slave:d4.t8]
 include/diff_tables.inc [master:d4.t7, slave:d4.t7]
 include/diff_tables.inc [master:d4.t6, slave:d4.t6]
@@ -138,4 +270,104 @@ include/diff_tables.inc [master:d1.t4, s
 include/diff_tables.inc [master:d1.t3, slave:d1.t3]
 include/diff_tables.inc [master:d1.t2, slave:d1.t2]
 include/diff_tables.inc [master:d1.t1, slave:d1.t1]
+create database d20;
+create table d20.t1 (a int);
+select round(rand()*8) into @var;
+insert into d20.t1 values (@var);
+create database d19;
+create table d19.t1 (a int);
+select round(rand()*8) into @var;
+insert into d19.t1 values (@var);
+create database d18;
+create table d18.t1 (a int);
+select round(rand()*8) into @var;
+insert into d18.t1 values (@var);
+create database d17;
+create table d17.t1 (a int);
+select round(rand()*8) into @var;
+insert into d17.t1 values (@var);
+create database d16;
+create table d16.t1 (a int);
+select round(rand()*8) into @var;
+insert into d16.t1 values (@var);
+create database d15;
+create table d15.t1 (a int);
+select round(rand()*8) into @var;
+insert into d15.t1 values (@var);
+create database d14;
+create table d14.t1 (a int);
+select round(rand()*8) into @var;
+insert into d14.t1 values (@var);
+create database d13;
+create table d13.t1 (a int);
+select round(rand()*8) into @var;
+insert into d13.t1 values (@var);
+create database d12;
+create table d12.t1 (a int);
+select round(rand()*8) into @var;
+insert into d12.t1 values (@var);
+create database d11;
+create table d11.t1 (a int);
+select round(rand()*8) into @var;
+insert into d11.t1 values (@var);
+create database d10;
+create table d10.t1 (a int);
+select round(rand()*8) into @var;
+insert into d10.t1 values (@var);
+create database d9;
+create table d9.t1 (a int);
+select round(rand()*8) into @var;
+insert into d9.t1 values (@var);
+create database d8;
+create table d8.t1 (a int);
+select round(rand()*8) into @var;
+insert into d8.t1 values (@var);
+create database d7;
+create table d7.t1 (a int);
+select round(rand()*8) into @var;
+insert into d7.t1 values (@var);
+create database d6;
+create table d6.t1 (a int);
+select round(rand()*8) into @var;
+insert into d6.t1 values (@var);
+create database d5;
+create table d5.t1 (a int);
+select round(rand()*8) into @var;
+insert into d5.t1 values (@var);
+create database d4;
+create table d4.t1 (a int);
+select round(rand()*8) into @var;
+insert into d4.t1 values (@var);
+create database d3;
+create table d3.t1 (a int);
+select round(rand()*8) into @var;
+insert into d3.t1 values (@var);
+create database d2;
+create table d2.t1 (a int);
+select round(rand()*8) into @var;
+insert into d2.t1 values (@var);
+create database d1;
+create table d1.t1 (a int);
+select round(rand()*8) into @var;
+insert into d1.t1 values (@var);
+include/diff_tables.inc [master:d20.t1, slave:d20.t1]
+include/diff_tables.inc [master:d19.t1, slave:d19.t1]
+include/diff_tables.inc [master:d18.t1, slave:d18.t1]
+include/diff_tables.inc [master:d17.t1, slave:d17.t1]
+include/diff_tables.inc [master:d16.t1, slave:d16.t1]
+include/diff_tables.inc [master:d15.t1, slave:d15.t1]
+include/diff_tables.inc [master:d14.t1, slave:d14.t1]
+include/diff_tables.inc [master:d13.t1, slave:d13.t1]
+include/diff_tables.inc [master:d12.t1, slave:d12.t1]
+include/diff_tables.inc [master:d11.t1, slave:d11.t1]
+include/diff_tables.inc [master:d10.t1, slave:d10.t1]
+include/diff_tables.inc [master:d9.t1, slave:d9.t1]
+include/diff_tables.inc [master:d8.t1, slave:d8.t1]
+include/diff_tables.inc [master:d7.t1, slave:d7.t1]
+include/diff_tables.inc [master:d6.t1, slave:d6.t1]
+include/diff_tables.inc [master:d5.t1, slave:d5.t1]
+include/diff_tables.inc [master:d4.t1, slave:d4.t1]
+include/diff_tables.inc [master:d3.t1, slave:d3.t1]
+include/diff_tables.inc [master:d2.t1, slave:d2.t1]
+include/diff_tables.inc [master:d1.t1, slave:d1.t1]
 set @@global.mts_slave_parallel_workers= @save.mts_slave_parallel_workers;

=== modified file 'mysql-test/suite/rpl/r/rpl_parallel_start_stop.result'
--- a/mysql-test/suite/rpl/r/rpl_parallel_start_stop.result	2010-12-27 18:54:41 +0000
+++ b/mysql-test/suite/rpl/r/rpl_parallel_start_stop.result	2011-02-21 14:38:13 +0000
@@ -60,7 +60,7 @@ Note	1726	Temporary failed transaction r
 include/stop_slave.inc
 create table t2 (a int);
 insert into t2 values (1);
-start slave until master_log_file='master-bin.000001', master_log_pos=2311;
+start slave until master_log_file='master-bin.000001', master_log_pos=MASTER_LOG_POS;
 Warnings:
 Note	1726	UNTIL condtion is not supported in Parallel Slave. Slave is started in the sequential execution mode.
 include/wait_for_slave_sql_to_stop.inc

=== modified file 'mysql-test/suite/rpl/t/rpl_parallel_ddl.test'
--- a/mysql-test/suite/rpl/t/rpl_parallel_ddl.test	2011-02-19 16:26:33 +0000
+++ b/mysql-test/suite/rpl/t/rpl_parallel_ddl.test	2011-02-21 14:38:13 +0000
@@ -30,6 +30,7 @@ let $queries= `select $dbs*$tables * 8`;
 # D2. CREATE/DROP/ALTER/RENAME table
 #
 
+--disable_query_log
 
 let $n= $dbs;
 while ($n)
@@ -63,6 +64,7 @@ while ($n)
   dec $n;
 }
 
+
 let $k= $queries;
 
 while ($k)
@@ -73,18 +75,15 @@ while ($k)
    let $n1_2= `select floor(rand()*$dbs) + 1`;
    let $m= `select floor(rand()*$tables) + 1`;
 
-   if ($n1)
-   {
-       --error 0,ER_TABLE_EXISTS_ERROR
-       eval rename d$n_1.t$m to d$n1_1.t$m, d$n_2.t$m to d$n1_2.t$m;
-       --error 0,ER_TABLE_EXISTS_ERROR
-       eval rename d$n1_1.t$m to d$n1.t$m,  d$n1_2.t$m to d$n2.t$m;
-   }
+   --error 0,ER_TABLE_EXISTS_ERROR
+   eval rename table d$n_1.t$m to d$n1_1.t$m, d$n_2.t$m to d$n1_2.t$m;
+   --error 0,ER_TABLE_EXISTS_ERROR
+   eval rename table d$n1_1.t$m to d$n_1.t$m,  d$n1_2.t$m to d$n_2.t$m;
+
    dec $k;
 }
 
-
-### sync_slave_with_master;
+--enable_query_log
 
 #
 # D3. CREATE/DROP Stored Proc, Stored Func, Trigger, Func
@@ -97,6 +96,7 @@ let $n1= $n;
 dec $n1;
 
 --disable_query_log
+
 while ($n1)
 {
   let $m= $tables;
@@ -125,8 +125,14 @@ while ($n1)
   dec $n;
   dec $n1;
 }
+
 --enable_query_log
 
+
+#
+# Run it on slave;
+#
+
 connection slave;
 source include/start_slave.inc;
 
@@ -151,6 +157,64 @@ while($n)
 }
 
 #
+# Finally, over-the-max-limit updated db:s
+#
+
+connection master;
+
+# Prepare the test with dropping the triggers
+
+let $n= $dbs;
+# n'th db tables won't have any trigger to avoid circular dependency
+let $n1= $n;
+dec $n1;
+
+--disable_query_log
+
+while ($n1)
+{
+  let $m= $tables;
+
+  while ($m)
+  {
+     eval drop trigger `d$n1`.`trg_t$m`;
+
+     dec $m;
+  }
+  dec $n;
+  dec $n1;
+}
+
+let $n1= $dbs;
+dec $n1;
+let $n2= $n1;
+dec $n2;
+let $tables_2_rename= ;
+let $m= `select floor(rand()*$tables) + 1`;
+
+while ($n2)
+{
+    let $tables_2_rename= $tables_2_rename d$n1.t$m to d$n2.t$m ,;
+    eval drop table d$n2.t$m;
+    dec $n1;
+    dec $n2;
+}
+
+
+let $n= $dbs;
+let $n1= $n;
+dec $n1;
+
+--disable_warnings
+# The following query will leave so many warnings as many extra db pairs
+eval rename table $tables_2_rename d$n.t$m to d$n1.t$m;
+--enable_warnings
+
+--enable_query_log
+
+
+
+#
 # Clean-up
 #
 

=== modified file 'mysql-test/suite/rpl/t/rpl_parallel_fallback.test'
--- a/mysql-test/suite/rpl/t/rpl_parallel_fallback.test	2010-12-27 18:54:41 +0000
+++ b/mysql-test/suite/rpl/t/rpl_parallel_fallback.test	2011-02-21 14:38:13 +0000
@@ -31,7 +31,7 @@ set @@session.binlog_format= row;
 create database d1;
 create table d1.t1 (a int auto_increment primary key) engine=innodb;
 
-#
+# (TODO: remove during refactoring)
 # Rows_query_log_event case
 #
 

=== added file 'mysql-test/suite/rpl/t/rpl_parallel_multi_db-master.opt'
--- a/mysql-test/suite/rpl/t/rpl_parallel_multi_db-master.opt	1970-01-01 00:00:00 +0000
+++ b/mysql-test/suite/rpl/t/rpl_parallel_multi_db-master.opt	2011-02-21 14:38:13 +0000
@@ -0,0 +1 @@
+--thread_stack=512K

=== added file 'mysql-test/suite/rpl/t/rpl_parallel_multi_db-slave.opt'
--- a/mysql-test/suite/rpl/t/rpl_parallel_multi_db-slave.opt	1970-01-01 00:00:00 +0000
+++ b/mysql-test/suite/rpl/t/rpl_parallel_multi_db-slave.opt	2011-02-21 14:38:13 +0000
@@ -0,0 +1 @@
+--thread_stack=512K

=== modified file 'mysql-test/suite/rpl/t/rpl_parallel_multi_db.test'
--- a/mysql-test/suite/rpl/t/rpl_parallel_multi_db.test	2011-02-17 19:56:48 +0000
+++ b/mysql-test/suite/rpl/t/rpl_parallel_multi_db.test	2011-02-21 14:38:13 +0000
@@ -21,12 +21,12 @@ connection slave;
 source include/stop_slave.inc;
 set @save.mts_slave_parallel_workers= @@global.mts_slave_parallel_workers;
 eval set @@global.mts_slave_parallel_workers= $workers;
-
 source include/start_slave.inc;
 
-let $dbs= 4;
+
+let $dbs= 8;
 let $tables= 8;
-let $queries= `select $dbs*$tables * 8`;
+let $queries= `select $dbs*$tables * 4`;
 
 #
 # 1. Case of multi-update
@@ -60,15 +60,36 @@ let $k= $queries;
 --disable_warnings
 while ($k)
 {
+   let $tables_in_query= `select 2 * (1 + floor(rand()*$dbs))`;
+   let $i= $tables_in_query;
+   let $table_list= ;
+   let $set_list= ;
+   while ($i)
+   {
+       let $n1= `select floor(rand()*$dbs + 1)`;
+       let $m1= `select floor(rand()*$tables + 1)`;
+       let $n2= `select floor(rand()*$dbs + 1)`;
+       let $m2= `select floor(rand()*$tables + 1)`;
+       let $table_list= $table_list d$n1.t$m1 as t_$i, ;
+       let $set_list= $set_list t_$i.a= ;
+       dec $i;
+
+       let $table_list= $table_list d$n2.t$m2 as t_$i, ;
+       let $set_list= $set_list t_$i.a + round(rand(10)), ;
+
+       dec $i;
+   }
    let $n1= `select floor(rand()*$dbs + 1)`;
-   let $m1= `select floor(rand()*$tables + 1)`;
+   let $m1= `select floor(rand()*$tables + 1)`;   
    let $n2= `select floor(rand()*$dbs + 1)`;
    let $m2= `select floor(rand()*$tables + 1)`;
-   let $n3= `select floor(rand()*$dbs + 1)`;
-   let $m3= `select floor(rand()*$tables + 1)`;
-   let $n4= `select floor(rand()*$dbs + 1)`;
-   let $m4= `select floor(rand()*$tables + 1)`;
-   eval update d$n1.t$m1 as t_1, d$n2.t$m2 as t_2, d$n3.t$m3, d$n4.t$m4 as t_3 set t_1.a=t_2.a+ round(rand(10)), t_2.a=t_3.a+ round(rand(10)), t_3.a=t_1.a+ round(rand(10)), t_3.a=t_1.a+ round(rand(10));
+
+##   --disable_warnings
+     
+     eval update $table_list d$n1.t$m1 as t_1_$i, d$n2.t$m2 as t_2_$i
+                 set $set_list t_1_$i.a=t_2_$i.a + round(rand(10));
+##   --enable_warnings
+
    dec $k;
 }
 --enable_warnings
@@ -203,9 +224,101 @@ while($n)
   dec $n;
 }
 
+#
+# Clean-up of the regular case tests
+#
+
+connection master;
+
+--disable_query_log
+
+let $n= $dbs;
+while ($n)
+{
+  eval drop database d$n;
+  dec $n;
+}
+
+--enable_query_log
+
+sync_slave_with_master;
 
 #
-# Clean-up
+# Over MAX_DBS_IN_QUERY_MTS
+#
+
+let $dbs= 20;
+let $queries= `select $dbs* 4`;
+
+connection master;
+
+let $n= $dbs;
+let $m= 1;
+while ($n)
+{
+  eval create database d$n;
+  eval create table d$n.t$m (a int);
+  eval select round(rand()*$tables) into @var;
+  eval insert into d$n.t$m values (@var);
+
+  dec $n;
+}
+
+--disable_query_log
+--disable_warnings
+
+let $k= $queries;
+
+while ($k)
+{
+   let $tables_in_query= `select 2 * (1 + floor(rand()*$dbs))`;
+   let $i= $tables_in_query;
+   let $table_list= ;
+   let $set_list= ;
+   while ($i)
+   {
+       let $n1= `select floor(rand()*$dbs + 1)`;
+       let $m1= 1;
+       let $n2= `select floor(rand()*$dbs + 1)`;
+       let $m2= 1;
+       let $table_list= $table_list d$n1.t$m1 as t_$i, ;
+       let $set_list= $set_list t_$i.a= ;
+       dec $i;
+
+       let $table_list= $table_list d$n2.t$m2 as t_$i, ;
+       let $set_list= $set_list t_$i.a + round(rand(10)), ;
+
+       dec $i;
+   }
+   let $n1= `select floor(rand()*$dbs + 1)`;
+   let $m1= 1;
+   let $n2= `select floor(rand()*$dbs + 1)`;
+   let $m2= 1;
+
+     eval update $table_list d$n1.t$m1 as t_1_$i, d$n2.t$m2 as t_2_$i
+                 set $set_list t_1_$i.a=t_2_$i.a + round(rand(10));
+   dec $k;
+}
+--enable_warnings
+--enable_query_log
+
+sync_slave_with_master;
+
+#
+# Consistency check
+#
+
+let $n = $dbs;
+let $m= 1;
+while($n)
+{
+  let $diff_tables=master:d$n.t$m, slave:d$n.t$m;
+  source include/diff_tables.inc;
+  dec $n;
+}
+
+#
+# The final clean-up
 #
 
 connection master;
@@ -223,6 +336,7 @@ while ($n)
 
 sync_slave_with_master;
 
+
 set @@global.mts_slave_parallel_workers= @save.mts_slave_parallel_workers;
 
 ### TODO: --source include/rpl_end.inc

=== modified file 'mysql-test/suite/rpl/t/rpl_parallel_start_stop.test'
--- a/mysql-test/suite/rpl/t/rpl_parallel_start_stop.test	2010-12-27 18:54:41 +0000
+++ b/mysql-test/suite/rpl/t/rpl_parallel_start_stop.test	2011-02-21 14:38:13 +0000
@@ -244,6 +244,7 @@ let $master_log_pos= query_get_value(SHO
 insert into t2 values (1);
 
 connection slave;
+--replace_regex /master_log_pos=[0-9]+/master_log_pos=MASTER_LOG_POS/
 eval start slave until master_log_file='$master_log_file', master_log_pos=$master_log_pos;
 
 source include/wait_for_slave_sql_to_stop.inc;

=== modified file 'mysql-test/suite/sys_vars/r/all_vars.result'
--- a/mysql-test/suite/sys_vars/r/all_vars.result	2011-02-17 19:56:48 +0000
+++ b/mysql-test/suite/sys_vars/r/all_vars.result	2011-02-21 14:38:13 +0000
@@ -12,6 +12,7 @@ There should be *no* long test name list
 select variable_name as `There should be *no* variables listed below:` from t2
 left join t1 on variable_name=test_name where test_name is null;
 There should be *no* variables listed below:
+MTS_SLAVE_WORKER_QUEUE_LEN_MAX
 INNODB_STATS_TRANSIENT_SAMPLE_PAGES
 MTS_PARTITION_HASH_SOFT_MAX
 MTS_EXP_SLAVE_LOCAL_TIMESTAMP
@@ -20,6 +21,7 @@ RELAY_LOG_BASENAME
 LOG_BIN_BASENAME
 INNODB_ANALYZE_IS_PERSISTENT
 INNODB_PRINT_ALL_DEADLOCKS
+MTS_MASTER_UPDATED_DBS_MAX
 INNODB_RESET_MONITOR_COUNTER
 MTS_SLAVE_PARALLEL_WORKERS
 MTS_WORKER_UNDERRUN_LEVEL
@@ -27,10 +29,10 @@ INNODB_RESET_ALL_MONITOR_COUNTER
 LOG_BIN_INDEX
 INNODB_DISABLE_MONITOR_COUNTER
 INNODB_ENABLE_MONITOR_COUNTER
-MTS_SLAVE_WORKER_QUEUE_LEN_MAX
 INNODB_FILE_FORMAT_MAX
 MTS_PENDING_JOBS_SIZE_MAX
 MTS_COORDINATOR_BASIC_NAP
+MTS_SLAVE_WORKER_QUEUE_LEN_MAX
 INNODB_STATS_TRANSIENT_SAMPLE_PAGES
 MTS_PARTITION_HASH_SOFT_MAX
 MTS_EXP_SLAVE_LOCAL_TIMESTAMP
@@ -39,6 +41,7 @@ RELAY_LOG_BASENAME
 LOG_BIN_BASENAME
 INNODB_ANALYZE_IS_PERSISTENT
 INNODB_PRINT_ALL_DEADLOCKS
+MTS_MASTER_UPDATED_DBS_MAX
 INNODB_RESET_MONITOR_COUNTER
 MTS_SLAVE_PARALLEL_WORKERS
 MTS_WORKER_UNDERRUN_LEVEL
@@ -46,7 +49,6 @@ INNODB_RESET_ALL_MONITOR_COUNTER
 LOG_BIN_INDEX
 INNODB_DISABLE_MONITOR_COUNTER
 INNODB_ENABLE_MONITOR_COUNTER
-MTS_SLAVE_WORKER_QUEUE_LEN_MAX
 INNODB_FILE_FORMAT_MAX
 MTS_PENDING_JOBS_SIZE_MAX
 MTS_COORDINATOR_BASIC_NAP

=== modified file 'sql/binlog.cc'
--- a/sql/binlog.cc	2011-02-19 16:26:33 +0000
+++ b/sql/binlog.cc	2011-02-21 14:38:13 +0000
@@ -4535,13 +4535,23 @@ THD::binlog_set_pending_rows_event(Rows_
 }
 
 /**
-   @param db    a c-string to be added sorted way to
-                THD::binlog_updated_db_names
+   @param db    db name c-string to be inserted into abc-sorted
+                THD::binlog_updated_db_names list.
 */
 void
 THD::add_to_binlog_updated_dbs(const char *db)
 {
-  char *after_db= strdup_root(mem_root, db);
+  char *after_db;
+  if (binlog_updated_db_names->elements ==  MAX_DBS_IN_QUERY_MTS + 1)
+  {
+    push_warning_printf(this, MYSQL_ERROR::WARN_LEVEL_WARN,
+                        ER_UPDATED_DBS_GREATER_MAX,
+                        ER(ER_UPDATED_DBS_GREATER_MAX),
+                        MAX_DBS_IN_QUERY_MTS);
+    return;
+  }
+
+  after_db= strdup_root(mem_root, db);
   if (binlog_updated_db_names->elements != 0)
   {
     List_iterator<char> it(*get_binlog_updated_db_names());
@@ -4771,26 +4781,6 @@ int THD::decide_logging_format(TABLE_LIS
         is_write= TRUE;
 
         prev_write_table= table->table;
-
-        if (variables.binlog_format != BINLOG_FORMAT_ROW &&
-            lex->sql_command != SQLCOM_END /* rows-event applying by slave */)
-        {
-          /*
-            Master side of the STMT format events parallelization.
-            Write-locked table's db:s are stored in a abc-ordered name list.
-            The list can remain empty if the only database that 
-            is updated is the default one.
-            In case the number of databases exceeds MAX_DBS_IN_QUERY_MTS
-            the list won't be sent to the slave either.
-          */
-
-          if (!binlog_updated_db_names)
-          {
-            binlog_updated_db_names= new List<char>; /* thd->mem_root is used */
-          }
-          if (binlog_updated_db_names->elements <  MAX_DBS_IN_QUERY_MTS + 1)
-            add_to_binlog_updated_dbs(table->db);
-        }
       }
 
       flags_access_some_set |= flags;
@@ -4814,6 +4804,28 @@ int THD::decide_logging_format(TABLE_LIS
          multi_access_engine= TRUE;
 
       prev_access_table= table->table;
+
+    }
+    
+    /*
+      Master side of DML in the STMT format events parallelization.
+      All involving table db:s are stored in a abc-ordered name list.
+      In case the number of databases exceeds MAX_DBS_IN_QUERY_MTS maximum
+      the list gathering breaks since it won't be sent to the slave.
+    */
+    if (is_write && variables.binlog_format != BINLOG_FORMAT_ROW &&
+        lex->sql_command != SQLCOM_END /* rows-event applying by slave */)
+    {
+      if (!binlog_updated_db_names)
+      {
+        binlog_updated_db_names= new List<char>; /* thd->mem_root is used */
+      }
+      for (TABLE_LIST *table= tables; table; table= table->next_global)
+      {
+        if (table->placeholder())
+          continue;
+        add_to_binlog_updated_dbs(table->db);
+      }
     }
 
     DBUG_PRINT("info", ("flags_write_all_set: 0x%llx", flags_write_all_set));

=== modified file 'sql/log_event.cc'
--- a/sql/log_event.cc	2011-02-17 19:56:48 +0000
+++ b/sql/log_event.cc	2011-02-21 14:38:13 +0000
@@ -2477,15 +2477,9 @@ Slave_worker *Log_event::get_slave_worke
       const_cast<Relay_log_info*>(rli)->curr_group_seen_begin= TRUE;
       return NULL;
     } 
-    else 
-    { 
-      DBUG_ASSERT(!rli->curr_group_seen_begin);
-
-      // Parallel single event proceeds to partiting etc ...
-    }
   }
 
-  //else // g
+  // g
 
   if (contains_partition_info())
   {

=== modified file 'sql/log_event.h'
--- a/sql/log_event.h	2011-02-17 19:56:48 +0000
+++ b/sql/log_event.h	2011-02-21 14:38:13 +0000
@@ -1892,7 +1892,8 @@ public:
   const char* get_db() { return db; }
 
   /**
-     Returns a default db in case of over-MAX_DBS_IN_QUERY_MTS actual db:s
+     Returns a list of updated db:s or the default db single item list
+     in case of over-MAX_DBS_IN_QUERY_MTS actual db:s.
   */
   virtual List<char>* mts_get_dbs()
   {

=== modified file 'sql/share/errmsg-utf8.txt'
--- a/sql/share/errmsg-utf8.txt	2010-12-27 18:54:41 +0000
+++ b/sql/share/errmsg-utf8.txt	2011-02-21 14:38:13 +0000
@@ -6458,3 +6458,5 @@ ER_BINLOG_STMT_CACHE_SIZE_GREATER_THAN_M
 
 ER_NO_FEATURE_ON_PARALLEL_SLAVE
   eng "%s is not supported in Parallel Slave. %s"
+ER_UPDATED_DBS_GREATER_MAX
+  eng "Modified database names number exceeds the maximum %d; the names are not written into the replication event."

=== modified file 'sql/sql_table.cc'
--- a/sql/sql_table.cc	2011-02-19 16:26:33 +0000
+++ b/sql/sql_table.cc	2011-02-21 14:38:13 +0000
@@ -2241,8 +2241,7 @@ int mysql_rm_table_no_locks(THD *thd, TA
     {
       thd->set_binlog_updated_db_names(new List<char>);
     }
-    if (thd->get_binlog_updated_db_names()->elements <  MAX_DBS_IN_QUERY_MTS + 1)
-      thd->add_to_binlog_updated_dbs(table->db);
+    thd->add_to_binlog_updated_dbs(table->db);
 
     /*
       drop_temporary_table may return one of the following error codes:
@@ -4571,9 +4570,6 @@ bool mysql_create_table(THD *thd, TABLE_
        (thd->is_current_stmt_binlog_format_row() &&
         !(create_info->options & HA_LEX_CREATE_TMP_TABLE))))
   {
-
-    DBUG_ASSERT(!thd->get_binlog_updated_db_names());
-
     thd->add_one_db_to_binlog_updated_dbs(create_table->db);
     result= write_bin_log(thd, TRUE, thd->query(), thd->query_length(), is_trans);
   }


Attachment: [text/bzr-bundle] bzr/andrei.elkin@oracle.com-20110221143813-xeef3tufr6adrwi7.bundle
Thread
bzr commit into mysql-next-mr-wl5569 branch (andrei.elkin:3272) WL#5599Andrei Elkin21 Feb