List:Commits« Previous MessageNext Message »
From:tomas Date:November 1 2007 9:27am
Subject:bk commit into 5.1 tree (tomas:1.2696)
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-11-01 10:27:03+01:00, tomas@stripped +3 -0
  wl#2680 - batched update
  - remove not needed execute no commit

  mysql-test/suite/ndb/r/ndb_update_no_read.result@stripped, 2007-11-01 10:27:00+01:00, tomas@stripped +25 -25
    wl#2680 - batched update
    - remove not needed execute no commit

  mysql-test/suite/ndb/t/ndb_update_no_read.test@stripped, 2007-11-01 10:27:00+01:00, tomas@stripped +19 -19
    wl#2680 - batched update
    - remove not needed execute no commit

  sql/ha_ndbcluster.cc@stripped, 2007-11-01 10:27:00+01:00, tomas@stripped +3 -1
    wl#2680 - batched update
    - remove not needed execute no commit

diff -Nrup a/mysql-test/suite/ndb/r/ndb_update_no_read.result b/mysql-test/suite/ndb/r/ndb_update_no_read.result
--- a/mysql-test/suite/ndb/r/ndb_update_no_read.result	2007-11-01 08:05:42 +01:00
+++ b/mysql-test/suite/ndb/r/ndb_update_no_read.result	2007-11-01 10:27:00 +01:00
@@ -7,17 +7,17 @@ insert into t1 values (1,10,1),(2,9,1),(
 affected rows: 10
 info: Records: 10  Duplicates: 0  Warnings: 0
 
-# expected result 4 roundtrips
+# expected result 3 roundtrips
 # 1 - info call
 # 1 - read the row
-# 1 - update the row
-# 1 - commit the transaction
+# 0 - update the row (deferred to commit)
+# 1 - update + commit the transaction
 
 update t1 set c = 111, b = 20 where a = 1;
 affected rows: 1
 info: Rows matched: 1  Changed: 1  Warnings: 0
 @ndb_execute_count:=VARIABLE_VALUE-@ndb_init_execute_count
-4
+3
 affected rows: 1
 select * from t1 where a = 1 order by a;
 a	b	c
@@ -39,17 +39,17 @@ select * from t1 where a = 1 order by a;
 a	b	c
 affected rows: 0
 
-# expected result 4 roundtrips
+# expected result 3 roundtrips
 # 1 - info call
 # 1 - read the rows
-# 1 - update the rows
-# 1 - commit the transaction
+# 0 - update the row (deferred to commit)
+# 1 - update + commit the transaction
 
 update t1 set c = 12, b = 19 where b = 2;
 affected rows: 1
 info: Rows matched: 1  Changed: 1  Warnings: 0
 @ndb_execute_count:=VARIABLE_VALUE-@ndb_init_execute_count
-4
+3
 affected rows: 1
 select * from t1 where b = 2 order by a;
 a	b	c
@@ -70,17 +70,17 @@ select * from t1 where b = 19 order by a
 a	b	c
 affected rows: 0
 
-# expected result 5 roundtrips
+# expected result 4 roundtrips
 # 1 - info call
-# 3 - read the rows
-# 0 - update the rows (executed during read)
-# 1 - commit the transaction
+# 2 - read the rows
+# 0 - update the rows (deferred to commit)
+# 1 - update + commit the transaction
 
 update t1 set c = 22 where a = 10 or a >= 10;
 affected rows: 1
 info: Rows matched: 1  Changed: 1  Warnings: 0
 @ndb_execute_count:=VARIABLE_VALUE-@ndb_init_execute_count
-5
+4
 affected rows: 1
 select * from t1 order by a;
 a	b	c
@@ -94,17 +94,17 @@ a	b	c
 10	1	22
 affected rows: 8
 
-# expected result 4 roundtrips
+# expected result 3 roundtrips
 # 1 - info call
 # 1 - read the rows
-# 1 - update the rows (2 if no bulk update)
-# 1 - commit the transaction
+# 0 - update the rows (2 if no bulk update + 1 deferred to commit)
+# 1 - update + commit the transaction
 
 update t1 set c = 23 where a in (8,10);
 affected rows: 2
 info: Rows matched: 2  Changed: 2  Warnings: 0
 @ndb_execute_count:=VARIABLE_VALUE-@ndb_init_execute_count
-4
+3
 affected rows: 1
 select * from t1 order by a;
 a	b	c
@@ -142,18 +142,18 @@ a	b	c
 10	1	23
 affected rows: 8
 
-# expected result 7 roundtrips
+# expected result 6 roundtrips
 # 1 - info call
 # 2 - read the rows
 # 2 - pk read in rnd_pos
-# 1 - update the rows
-# 1 - commit the transaction
+# 0 - update the rows (deferred to commit)
+# 1 - update + commit the transaction
 
 update t1 set c = 11 where a = 3 or b = 7;
 affected rows: 2
 info: Rows matched: 2  Changed: 2  Warnings: 0
 @ndb_execute_count:=VARIABLE_VALUE-@ndb_init_execute_count
-7
+6
 affected rows: 1
 select * from t1 where a = 3 or b = 7 order by a;
 a	b	c
@@ -202,17 +202,17 @@ select * from t1 where b = 7 order by a;
 a	b	c
 affected rows: 0
 
-# expected result 4 roundtrips
+# expected result 3 roundtrips
 # 1 - info call
 # 1 - read the rows
-# 1 - update the rows
-# 1 - commit the transaction
+# 0 - update the rows (deferred to commit)
+# 1 - update + commit the transaction
 
 update t1 set c = 12, b = 29 where a = 5 and b = 6;
 affected rows: 1
 info: Rows matched: 1  Changed: 1  Warnings: 0
 @ndb_execute_count:=VARIABLE_VALUE-@ndb_init_execute_count
-4
+3
 affected rows: 1
 select * from t1 where b = 19 order by a;
 a	b	c
diff -Nrup a/mysql-test/suite/ndb/t/ndb_update_no_read.test b/mysql-test/suite/ndb/t/ndb_update_no_read.test
--- a/mysql-test/suite/ndb/t/ndb_update_no_read.test	2007-11-01 08:05:42 +01:00
+++ b/mysql-test/suite/ndb/t/ndb_update_no_read.test	2007-11-01 10:27:00 +01:00
@@ -26,11 +26,11 @@ insert into t1 values (1,10,1),(2,9,1),(
 # These ones should use optimisation
 
 --echo
---echo # expected result 4 roundtrips
+--echo # expected result 3 roundtrips
 --echo # 1 - info call
 --echo # 1 - read the row
---echo # 1 - update the row
---echo # 1 - commit the transaction
+--echo # 0 - update the row (deferred to commit)
+--echo # 1 - update + commit the transaction
 --echo
 --source include/ndb_init_execute_count.inc
 update t1 set c = 111, b = 20 where a = 1;
@@ -52,11 +52,11 @@ delete from t1 where a = 1;
 select * from t1 where a = 1 order by a;
 
 --echo
---echo # expected result 4 roundtrips
+--echo # expected result 3 roundtrips
 --echo # 1 - info call
 --echo # 1 - read the rows
---echo # 1 - update the rows
---echo # 1 - commit the transaction
+--echo # 0 - update the row (deferred to commit)
+--echo # 1 - update + commit the transaction
 --echo
 --source include/ndb_init_execute_count.inc
 update t1 set c = 12, b = 19 where b = 2;
@@ -78,11 +78,11 @@ delete from t1 where b = 19;
 select * from t1 where b = 19 order by a;
 
 --echo
---echo # expected result 5 roundtrips
+--echo # expected result 4 roundtrips
 --echo # 1 - info call
---echo # 3 - read the rows
---echo # 0 - update the rows (executed during read)
---echo # 1 - commit the transaction
+--echo # 2 - read the rows
+--echo # 0 - update the rows (deferred to commit)
+--echo # 1 - update + commit the transaction
 --echo
 --source include/ndb_init_execute_count.inc
 update t1 set c = 22 where a = 10 or a >= 10;
@@ -91,11 +91,11 @@ update t1 set c = 22 where a = 10 or a >
 select * from t1 order by a;
 
 --echo
---echo # expected result 4 roundtrips
+--echo # expected result 3 roundtrips
 --echo # 1 - info call
 --echo # 1 - read the rows
---echo # 1 - update the rows (2 if no bulk update)
---echo # 1 - commit the transaction
+--echo # 0 - update the rows (2 if no bulk update + 1 deferred to commit)
+--echo # 1 - update + commit the transaction
 --echo
 --source include/ndb_init_execute_count.inc
 update t1 set c = 23 where a in (8,10);
@@ -119,12 +119,12 @@ select * from t1 order by a;
 # These ones should not use optimisation
 
 --echo
---echo # expected result 7 roundtrips
+--echo # expected result 6 roundtrips
 --echo # 1 - info call
 --echo # 2 - read the rows
 --echo # 2 - pk read in rnd_pos
---echo # 1 - update the rows
---echo # 1 - commit the transaction
+--echo # 0 - update the rows (deferred to commit)
+--echo # 1 - update + commit the transaction
 --echo
 --source include/ndb_init_execute_count.inc
 update t1 set c = 11 where a = 3 or b = 7;
@@ -165,11 +165,11 @@ select * from t1 where b = 19 order by a
 select * from t1 where b = 7 order by a;
 
 --echo
---echo # expected result 4 roundtrips
+--echo # expected result 3 roundtrips
 --echo # 1 - info call
 --echo # 1 - read the rows
---echo # 1 - update the rows
---echo # 1 - commit the transaction
+--echo # 0 - update the rows (deferred to commit)
+--echo # 1 - update + commit the transaction
 --echo
 --source include/ndb_init_execute_count.inc
 update t1 set c = 12, b = 29 where a = 5 and b = 6;
diff -Nrup a/sql/ha_ndbcluster.cc b/sql/ha_ndbcluster.cc
--- a/sql/ha_ndbcluster.cc	2007-11-01 10:00:30 +01:00
+++ b/sql/ha_ndbcluster.cc	2007-11-01 10:27:00 +01:00
@@ -4062,7 +4062,9 @@ int ha_ndbcluster::exec_bulk_update(uint
 {
   DBUG_ENTER("ha_ndbcluster::exec_bulk_update");
   *dup_key_found= 0;
-  if (m_thd_ndb->m_unsent_bytes)
+  if (m_thd_ndb->m_unsent_bytes &&
+      (!m_thd_ndb->m_handler ||
+       m_blobs_pending))
   {
     uint ignore_count= 0;
     if (execute_no_commit(m_thd_ndb, m_thd_ndb->trans, FALSE,
Thread
bk commit into 5.1 tree (tomas:1.2696)tomas1 Nov