List:Commits« Previous MessageNext Message »
From:tomas Date:October 29 2007 7:58pm
Subject:bk commit into 5.1 tree (tomas:1.2685)
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-10-29 19:58:00+01:00, tomas@stripped +2 -0
  add execute count trace with expected behaviour explanation

  mysql-test/suite/ndb/r/ndb_update_no_read.result@stripped, 2007-10-29 19:57:57+01:00,
tomas@stripped +162 -0
    add execute count trace with expected behaviour explanation

  mysql-test/suite/ndb/t/ndb_update_no_read.test@stripped, 2007-10-29 19:57:57+01:00,
tomas@stripped +115 -0
    add execute count trace with expected behaviour explanation

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-10-26 11:42:30 +02:00
+++ b/mysql-test/suite/ndb/r/ndb_update_no_read.result	2007-10-29 19:57:57 +01:00
@@ -4,20 +4,84 @@ unique index_b (b) using hash)
 engine ndb;
 insert into t1 values (1,10,1),(2,9,1),(3,8,1),(4,7,1),(5,6,1),(6,5,2),(7,4,2),(8,3,2),
 (9,2,2),(10,1,2);
+affected rows: 10
+info: Records: 10  Duplicates: 0  Warnings: 0
+
+# expected result 4 roundtrips
+# 1 - info call
+# 1 - read the row
+# 1 - update the row
+# 1 - 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
+affected rows: 1
 select * from t1 where a = 1 order by a;
 a	b	c
 1	20	111
+affected rows: 1
+
+# expected result 4 roundtrips
+# 1 - info call
+# 1 - read the row
+# 1 - delete the row
+# 1 - commit the transaction
+
 delete from t1 where a = 1;
+affected rows: 1
+@ndb_execute_count:=VARIABLE_VALUE-@ndb_init_execute_count
+4
+affected rows: 1
 select * from t1 where a = 1 order by a;
 a	b	c
+affected rows: 0
+
+# expected result 4 roundtrips
+# 1 - info call
+# 1 - read the rows
+# 1 - update the rows
+# 1 - 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
+affected rows: 1
 select * from t1 where b = 2 order by a;
 a	b	c
+affected rows: 0
+
+# expected result 4 roundtrips
+# 1 - info call
+# 1 - read the row
+# 1 - delete the row
+# 1 - commit the transaction
+
 delete from t1 where b = 19;
+affected rows: 1
+@ndb_execute_count:=VARIABLE_VALUE-@ndb_init_execute_count
+4
+affected rows: 1
 select * from t1 where b = 19 order by a;
 a	b	c
+affected rows: 0
+
+# expected result 5 roundtrips
+# 1 - info call
+# 3 - read the rows
+# 0 - update the rows (executed during read)
+# 1 - 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
+affected rows: 1
 select * from t1 order by a;
 a	b	c
 2	9	1
@@ -28,7 +92,20 @@ a	b	c
 7	4	2
 8	3	2
 10	1	22
+affected rows: 8
+
+# expected result 4 roundtrips
+# 1 - info call
+# 1 - read the rows
+# 1 - update the rows (2 if no bulk update)
+# 1 - 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
+affected rows: 1
 select * from t1 order by a;
 a	b	c
 2	9	1
@@ -39,7 +116,20 @@ a	b	c
 7	4	2
 8	3	23
 10	1	23
+affected rows: 8
+
+# expected result 5 roundtrips
+# 1 - info call
+# 3 - read the rows
+# 0 - update the rows (executed during read)
+# 1 - commit the transaction
+
 update t1 set c = 23 where a in (7,8) or a >= 10;
+affected rows: 3
+info: Rows matched: 3  Changed: 3  Warnings: 0
+@ndb_execute_count:=VARIABLE_VALUE-@ndb_init_execute_count
+5
+affected rows: 1
 select * from t1 order by a;
 a	b	c
 2	9	1
@@ -50,26 +140,98 @@ a	b	c
 7	4	23
 8	3	23
 10	1	23
+affected rows: 8
+
+# expected result 7 roundtrips
+# 1 - info call
+# 2 - read the rows
+# 2 - pk read in rnd_pos
+# 1 - update the rows
+# 1 - 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
+affected rows: 1
 select * from t1 where a = 3 or b = 7 order by a;
 a	b	c
 3	8	11
 4	7	11
+affected rows: 2
+
+# expected result 6 roundtrips
+# 1 - info call
+# 1 - read the rows
+# 1 - read the row _again_ in complemented read
+# 1 - delete the row (pk update)
+# 1 - insert the row (pk update)
+# 1 - commit the transaction
+
 update t1 set a = 13, b = 20 where a = 3;
+affected rows: 1
+info: Rows matched: 1  Changed: 1  Warnings: 0
+@ndb_execute_count:=VARIABLE_VALUE-@ndb_init_execute_count
+6
+affected rows: 1
 select * from t1 where a = 13 order by a;
 a	b	c
 13	20	11
+affected rows: 1
+
+# expected result 6 roundtrips
+# 1 - info call
+# 1 - read the rows
+# 1 - read the row _again_ in complemented read
+# 1 - delete the row (pk update)
+# 1 - insert the row (pk update)
+# 1 - commit the transaction
+
 update t1 set a = 12, b = 19 where b = 7;
+affected rows: 1
+info: Rows matched: 1  Changed: 1  Warnings: 0
+@ndb_execute_count:=VARIABLE_VALUE-@ndb_init_execute_count
+6
+affected rows: 1
 select * from t1 where b = 19 order by a;
 a	b	c
 12	19	11
+affected rows: 1
 select * from t1 where b = 7 order by a;
 a	b	c
+affected rows: 0
+
+# expected result 4 roundtrips
+# 1 - info call
+# 1 - read the rows
+# 1 - update the rows
+# 1 - 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
+affected rows: 1
 select * from t1 where b = 19 order by a;
 a	b	c
 12	19	11
+affected rows: 1
+
+# expected result 3 roundtrips
+# 1 - info call
+# 1 - read the rows
+# 0 - delete the rows (no row found)
+# 1 - commit the transaction
+
 delete from t1 where b = 6 and c = 12;
+affected rows: 0
+@ndb_execute_count:=VARIABLE_VALUE-@ndb_init_execute_count
+3
+affected rows: 1
 select * from t1 where b = 6 order by a;
 a	b	c
+affected rows: 0
 drop table t1;
+affected rows: 0
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-10-26 11:42:30 +02:00
+++ b/mysql-test/suite/ndb/t/ndb_update_no_read.test	2007-10-29 19:57:57 +01:00
@@ -17,61 +17,176 @@ DROP TABLE IF EXISTS t1;
 create table t1 (a int not null primary key, b int not null, c int,
                  unique index_b (b) using hash)
 engine ndb;
+# to see rows found and changed
+--enable_info
 
 insert into t1 values (1,10,1),(2,9,1),(3,8,1),(4,7,1),(5,6,1),(6,5,2),(7,4,2),(8,3,2),
             (9,2,2),(10,1,2);
 
 # These ones should use optimisation
 
+--echo
+--echo # expected result 4 roundtrips
+--echo # 1 - info call
+--echo # 1 - read the row
+--echo # 1 - update the row
+--echo # 1 - commit the transaction
+--echo
+--source include/ndb_init_execute_count.inc
 update t1 set c = 111, b = 20 where a = 1;
+--source include/ndb_execute_count.inc
 
 select * from t1 where a = 1 order by a;
 
+--echo
+--echo # expected result 4 roundtrips
+--echo # 1 - info call
+--echo # 1 - read the row
+--echo # 1 - delete the row
+--echo # 1 - commit the transaction
+--echo
+--source include/ndb_init_execute_count.inc
 delete from t1 where a = 1;
+--source include/ndb_execute_count.inc
 
 select * from t1 where a = 1 order by a;
 
+--echo
+--echo # expected result 4 roundtrips
+--echo # 1 - info call
+--echo # 1 - read the rows
+--echo # 1 - update the rows
+--echo # 1 - commit the transaction
+--echo
+--source include/ndb_init_execute_count.inc
 update t1 set c = 12, b = 19 where b = 2;
+--source include/ndb_execute_count.inc
 
 select * from t1 where b = 2 order by a;
 
+--echo
+--echo # expected result 4 roundtrips
+--echo # 1 - info call
+--echo # 1 - read the row
+--echo # 1 - delete the row
+--echo # 1 - commit the transaction
+--echo
+--source include/ndb_init_execute_count.inc
 delete from t1 where b = 19;
+--source include/ndb_execute_count.inc
 
 select * from t1 where b = 19 order by a;
 
+--echo
+--echo # expected result 5 roundtrips
+--echo # 1 - info call
+--echo # 3 - read the rows
+--echo # 0 - update the rows (executed during read)
+--echo # 1 - commit the transaction
+--echo
+--source include/ndb_init_execute_count.inc
 update t1 set c = 22 where a = 10 or a >= 10;
+--source include/ndb_execute_count.inc
 
 select * from t1 order by a;
 
+--echo
+--echo # expected result 4 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
+--source include/ndb_init_execute_count.inc
 update t1 set c = 23 where a in (8,10);
+--source include/ndb_execute_count.inc
 
 select * from t1 order by a;
 
+--echo
+--echo # expected result 5 roundtrips
+--echo # 1 - info call
+--echo # 3 - read the rows
+--echo # 0 - update the rows (executed during read)
+--echo # 1 - commit the transaction
+--echo
+--source include/ndb_init_execute_count.inc
 update t1 set c = 23 where a in (7,8) or a >= 10;
+--source include/ndb_execute_count.inc
 
 select * from t1 order by a;
 
 # These ones should not use optimisation
 
+--echo
+--echo # expected result 7 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
+--source include/ndb_init_execute_count.inc
 update t1 set c = 11 where a = 3 or b = 7;
+--source include/ndb_execute_count.inc
 
 select * from t1 where a = 3 or b = 7 order by a;
 
+--echo
+--echo # expected result 6 roundtrips
+--echo # 1 - info call
+--echo # 1 - read the rows
+--echo # 1 - read the row _again_ in complemented read
+--echo # 1 - delete the row (pk update)
+--echo # 1 - insert the row (pk update)
+--echo # 1 - commit the transaction
+--echo
+--source include/ndb_init_execute_count.inc
 update t1 set a = 13, b = 20 where a = 3;
+--source include/ndb_execute_count.inc
 
 select * from t1 where a = 13 order by a;
 
+--echo
+--echo # expected result 6 roundtrips
+--echo # 1 - info call
+--echo # 1 - read the rows
+--echo # 1 - read the row _again_ in complemented read
+--echo # 1 - delete the row (pk update)
+--echo # 1 - insert the row (pk update)
+--echo # 1 - commit the transaction
+--echo
+--source include/ndb_init_execute_count.inc
 update t1 set a = 12, b = 19 where b = 7;
+--source include/ndb_execute_count.inc
 
 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 # 1 - info call
+--echo # 1 - read the rows
+--echo # 1 - update the rows
+--echo # 1 - commit the transaction
+--echo
+--source include/ndb_init_execute_count.inc
 update t1 set c = 12, b = 29 where a = 5 and b = 6;
+--source include/ndb_execute_count.inc
 
 select * from t1 where b = 19 order by a;
 
+--echo
+--echo # expected result 3 roundtrips
+--echo # 1 - info call
+--echo # 1 - read the rows
+--echo # 0 - delete the rows (no row found)
+--echo # 1 - commit the transaction
+--echo
+--source include/ndb_init_execute_count.inc
 delete from t1 where b = 6 and c = 12;
+--source include/ndb_execute_count.inc
 
 select * from t1 where b = 6 order by a;
 
Thread
bk commit into 5.1 tree (tomas:1.2685)tomas29 Oct