List:Commits« Previous MessageNext Message »
From:tomas Date:December 13 2007 10:30am
Subject:bk commit into 5.1 tree (tomas:1.2788)
View as plain text  
Below is the list of changes that have just been committed into a local
5.1 repository of tomas. When tomas 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://dev.mysql.com/doc/mysql/en/installing-source-tree.html

ChangeSet@stripped, 2007-12-13 11:30:41+01:00, tomas@stripped +3 -0
  enable setting of allow batching flag also for client threads (not only replication sql thread)

  mysql-test/suite/ndb/r/ndb_sql_allow_batching.result@stripped, 2007-12-13 11:30:38+01:00, tomas@stripped +50 -0
    New BitKeeper file ``mysql-test/suite/ndb/r/ndb_sql_allow_batching.result''

  mysql-test/suite/ndb/r/ndb_sql_allow_batching.result@stripped, 2007-12-13 11:30:38+01:00, tomas@stripped +0 -0

  mysql-test/suite/ndb/t/ndb_sql_allow_batching.test@stripped, 2007-12-13 11:30:38+01:00, tomas@stripped +46 -0
    New BitKeeper file ``mysql-test/suite/ndb/t/ndb_sql_allow_batching.test''

  mysql-test/suite/ndb/t/ndb_sql_allow_batching.test@stripped, 2007-12-13 11:30:38+01:00, tomas@stripped +0 -0

  sql/set_var.cc@stripped, 2007-12-13 11:30:38+01:00, tomas@stripped +3 -0
    enable setting of allow batching flag also for client threads (not only replication sql thread)

diff -Nrup a/mysql-test/suite/ndb/r/ndb_sql_allow_batching.result b/mysql-test/suite/ndb/r/ndb_sql_allow_batching.result
--- /dev/null	Wed Dec 31 16:00:00 196900
+++ b/mysql-test/suite/ndb/r/ndb_sql_allow_batching.result	2007-12-13 11:30:38 +01:00
@@ -0,0 +1,50 @@
+DROP TABLE IF EXISTS t1;
+create table t1 (a int key, b int) engine ndb;
+create table t2 (a int key, b int) engine ndb;
+insert into t1 values (0,0),(1,1),(2,2);
+insert into t2 select * from t1;
+begin;
+set sql_allow_batching=1;
+update t1 set b=0 where a=2;
+commit;
+@ndb_execute_count:=VARIABLE_VALUE-@ndb_init_execute_count
+1
+select * from t1 order by a;
+a	b
+0	0
+1	1
+2	0
+
+With batching only 1 roundtrip
+
+begin;
+set sql_allow_batching=1;
+insert into t1 values (10,10);
+insert into t2 values (10,10);
+commit;
+@ndb_execute_count:=VARIABLE_VALUE-@ndb_init_execute_count
+1
+select * from t1 order by a;
+a	b
+0	0
+1	1
+2	0
+10	10
+
+Without batching only 3 roundtrips
+
+begin;
+set sql_allow_batching=0;
+insert into t1 values (11,11);
+insert into t2 values (11,11);
+commit;
+@ndb_execute_count:=VARIABLE_VALUE-@ndb_init_execute_count
+3
+select * from t1 order by a;
+a	b
+0	0
+1	1
+2	0
+10	10
+11	11
+drop table t1, t2;
diff -Nrup a/mysql-test/suite/ndb/t/ndb_sql_allow_batching.test b/mysql-test/suite/ndb/t/ndb_sql_allow_batching.test
--- /dev/null	Wed Dec 31 16:00:00 196900
+++ b/mysql-test/suite/ndb/t/ndb_sql_allow_batching.test	2007-12-13 11:30:38 +01:00
@@ -0,0 +1,46 @@
+-- source include/have_ndb.inc
+
+--disable_warnings
+DROP TABLE IF EXISTS t1;
+--enable_warnings
+
+create table t1 (a int key, b int) engine ndb;
+create table t2 (a int key, b int) engine ndb;
+
+insert into t1 values (0,0),(1,1),(2,2);
+insert into t2 select * from t1;
+
+--source include/ndb_init_execute_count.inc
+begin;
+set sql_allow_batching=1;
+update t1 set b=0 where a=2;
+commit;
+--source include/ndb_execute_count.inc
+select * from t1 order by a;
+
+--echo
+--echo With batching only 1 roundtrip
+--echo
+--source include/ndb_init_execute_count.inc
+begin;
+set sql_allow_batching=1;
+insert into t1 values (10,10);
+insert into t2 values (10,10);
+commit;
+--source include/ndb_execute_count.inc
+select * from t1 order by a;
+
+--echo
+--echo Without batching only 3 roundtrips
+--echo
+--source include/ndb_init_execute_count.inc
+begin;
+set sql_allow_batching=0;
+insert into t1 values (11,11);
+insert into t2 values (11,11);
+commit;
+--source include/ndb_execute_count.inc
+select * from t1 order by a;
+
+# cleanup
+drop table t1, t2;
diff -Nrup a/sql/set_var.cc b/sql/set_var.cc
--- a/sql/set_var.cc	2007-12-10 23:13:39 +01:00
+++ b/sql/set_var.cc	2007-12-13 11:30:38 +01:00
@@ -565,6 +565,9 @@ static sys_var_thd_bit	sys_log_binlog(&v
                                        check_log_update,
 				       set_option_bit,
 				       OPTION_BIN_LOG);
+static sys_var_thd_bit	sys_sql_allow_batchine(&vars, "sql_allow_batching", 0,
+                                               set_option_bit,
+                                               OPTION_ALLOW_BATCH);
 static sys_var_thd_bit	sys_sql_warnings(&vars, "sql_warnings", 0,
 					 set_option_bit,
 					 OPTION_WARNINGS);
Thread
bk commit into 5.1 tree (tomas:1.2788)tomas13 Dec