List:Commits« Previous MessageNext Message »
From:dlenev Date:January 15 2007 9:40am
Subject:bk commit into 5.1 tree (dlenev:1.2391)
View as plain text  
Below is the list of changes that have just been committed into a local
5.1 repository of dlenev. When dlenev 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-01-15 12:40:07+03:00, dlenev@stripped +3 -0
  Merge mockturtle.local:/home/dlenev/src/mysql-5.0-bg20390-2
  into  mockturtle.local:/home/dlenev/src/mysql-5.1-bg20390
  MERGE: 1.1810.2435.1

  mysql-test/r/ndb_lock.result@stripped, 2007-01-15 12:40:04+03:00, dlenev@stripped +32 -32
    Manual merge.
    MERGE: 1.5.7.2

  mysql-test/t/ndb_lock.test@stripped, 2007-01-15 12:36:38+03:00, dlenev@stripped +0 -1
    Auto merged
    MERGE: 1.7.7.2

  sql/sql_select.cc@stripped, 2007-01-15 12:36:38+03:00, dlenev@stripped +0 -0
    Auto merged
    MERGE: 1.312.119.1

# This is a BitKeeper patch.  What follows are the unified diffs for the
# set of deltas contained in the patch.  The rest of the patch, the part
# that BitKeeper cares about, is below these diffs.
# User:	dlenev
# Host:	mockturtle.local
# Root:	/home/dlenev/src/mysql-5.1-bg20390/RESYNC

--- 1.478/sql/sql_select.cc	2007-01-15 12:40:12 +03:00
+++ 1.479/sql/sql_select.cc	2007-01-15 12:40:12 +03:00
@@ -10646,6 +10646,7 @@
     */
     join->examined_rows++;
     join->thd->row_count++;
+    join_tab->read_record.file->unlock_row();
   }
   return NESTED_LOOP_OK;
 }

--- 1.16/mysql-test/r/ndb_lock.result	2007-01-15 12:40:12 +03:00
+++ 1.17/mysql-test/r/ndb_lock.result	2007-01-15 12:40:12 +03:00
@@ -87,11 +87,27 @@
 rollback;
 commit;
 begin;
+select * from t1 where y = 'one' or y = 'three' for update;
+x	y	z
+#	#	#
+#	#	#
+begin;
+select * from t1 where x = 2 for update;
+x	y	z
+2	two	2
+select * from t1 where x = 1 for update;
+ERROR HY000: Lock wait timeout exceeded; try restarting transaction
+rollback;
+commit;
+begin;
 select * from t1 where y = 'one' or y = 'three' order by x for update;
 x	y	z
 1	one	1
 3	three	3
 begin;
+select * from t1 where x = 2 for update;
+x	y	z
+2	two	2
 select * from t1 where x = 1 for update;
 ERROR HY000: Lock wait timeout exceeded; try restarting transaction
 rollback;
@@ -124,6 +140,22 @@
 rollback;
 commit;
 begin;
+select * from t1 where y = 'one' or y = 'three' lock in share mode;
+x	y	z
+#	#	#
+#	#	#
+begin;
+select * from t1 where y = 'one' lock in share mode;
+x	y	z
+1	one	1
+select * from t1 where x = 2 for update;
+x	y	z
+2	two	2
+select * from t1 where x = 1 for update;
+ERROR HY000: Lock wait timeout exceeded; try restarting transaction
+rollback;
+commit;
+begin;
 select * from t1 where y = 'one' or y = 'three' order by x lock in share mode;
 x	y	z
 1	one	1
@@ -132,6 +164,9 @@
 select * from t1 where y = 'one' lock in share mode;
 x	y	z
 1	one	1
+select * from t1 where x = 2 for update;
+x	y	z
+2	two	2
 select * from t1 where x = 1 for update;
 ERROR HY000: Lock wait timeout exceeded; try restarting transaction
 rollback;

--- 1.15/mysql-test/t/ndb_lock.test	2007-01-15 12:40:12 +03:00
+++ 1.16/mysql-test/t/ndb_lock.test	2007-01-15 12:40:12 +03:00
@@ -102,16 +102,36 @@
 commit;
 
 # table scan
+#
+# Note that there are two distinct execution paths in which we unlock
+# non-matching rows inspected during table scan - one that is used in
+# case of filesort and one that used in rest of cases. Below we cover
+# the latter (Bug #20390 "SELECT FOR UPDATE does not release locks of
+# untouched rows in full table scans").
 connection con1;
 begin;
-select * from t1 where y = 'one' or y = 'three' order by x for update;
+# We can't use "order by x" here as it will cause filesort
+--replace_column 1 # 2 # 3 #
+select * from t1 where y = 'one' or y = 'three' for update;
 
 connection con2;
 begin;
 # Have to check with pk access here since scans take locks on
 # all rows and then release them in chunks
-# Bug #20390 SELECT FOR UPDATE does not release locks of untouched rows in full table scans
-#select * from t1 where x = 2 for update;
+select * from t1 where x = 2 for update;
+--error 1205
+select * from t1 where x = 1 for update;
+rollback;
+
+connection con1;
+commit;
+
+# And now the test for case with filesort
+begin;
+select * from t1 where y = 'one' or y = 'three' order by x for update;
+connection con2;
+begin;
+select * from t1 where x = 2 for update;
 --error 1205
 select * from t1 where x = 1 for update;
 rollback;
@@ -157,15 +177,32 @@
 # table scan
 connection con1;
 begin;
-select * from t1 where y = 'one' or y = 'three' order by x lock in share mode;
+# We can't use "order by x" here as it will cause filesort
+--replace_column 1 # 2 # 3 #
+select * from t1 where y = 'one' or y = 'three' lock in share mode;
 
 connection con2;
 begin;
 select * from t1 where y = 'one' lock in share mode;
 # Have to check with pk access here since scans take locks on
 # all rows and then release them in chunks
-# Bug #20390 SELECT FOR UPDATE does not release locks of untouched rows in full table scans
-#select * from t1 where x = 2 for update;
+select * from t1 where x = 2 for update;
+--error 1205
+select * from t1 where x = 1 for update;
+rollback;
+
+connection con1;
+commit;
+
+# And the same test for case with filesort
+connection con1;
+begin;
+select * from t1 where y = 'one' or y = 'three' order by x lock in share mode;
+
+connection con2;
+begin;
+select * from t1 where y = 'one' lock in share mode;
+select * from t1 where x = 2 for update;
 --error 1205
 select * from t1 where x = 1 for update;
 rollback;
Thread
bk commit into 5.1 tree (dlenev:1.2391)dlenev15 Jan