List:Commits« Previous MessageNext Message »
From:Sunny Bains Date:May 19 2011 9:22am
Subject:bzr push into mysql-trunk-innodb branch (Sunny.Bains:3633 to 3634)
View as plain text  
 3634 Sunny Bains	2011-05-19
      Bug 12552164 - TRANSACTION CAN NOT SEE OLD VERSION ROWS THAT BEING UPDATED
      
      The code was checking for the purge limit using a cached value of
      purge_sys->iter.trx_no. The value was cached in a local variable.
      Fix is to use the value directly.
      
      rb://664 Approved by Jimmy Yang.

    added:
      mysql-test/suite/innodb/r/innodb-bug12552164.result
      mysql-test/suite/innodb/t/innodb-bug12552164.test
    modified:
      storage/innobase/trx/trx0purge.c
 3633 Sunny Bains	2011-05-18
      Whitespace fix, non-functional change.

    modified:
      storage/innobase/include/trx0purge.h
=== added file 'mysql-test/suite/innodb/r/innodb-bug12552164.result'
--- a/mysql-test/suite/innodb/r/innodb-bug12552164.result	1970-01-01 00:00:00 +0000
+++ b/mysql-test/suite/innodb/r/innodb-bug12552164.result	revid:sunny.bains@stripped
@@ -0,0 +1,57 @@
+CREATE TABLE worklog5743 (col_1_CHAR CHAR(255) , col_2_CHAR CHAR(255) ,
+PRIMARY KEY (col_1_CHAR)) engine = innodb;
+INSERT INTO worklog5743 VALUES(repeat("a", 200) , repeat("o", 200));
+SELECT col_1_CHAR = repeat("a", 200) , col_2_CHAR  = repeat("o", 200) FROM
+worklog5743;
+col_1_CHAR = repeat("a", 200)	col_2_CHAR  = repeat("o", 200)
+1	1
+"In connection 1"
+SELECT col_1_CHAR = repeat("a", 200) , col_2_CHAR = repeat("o", 200) FROM
+worklog5743;
+col_1_CHAR = repeat("a", 200)	col_2_CHAR = repeat("o", 200)
+1	1
+SELECT COUNT(*) FROM worklog5743;
+COUNT(*)
+1
+"In connection 2"
+START TRANSACTION;
+INSERT INTO worklog5743 VALUES(repeat("b", 200) , repeat("o", 200));
+UPDATE worklog5743 SET col_1_CHAR = repeat("d", 200) WHERE col_1_CHAR =
+repeat("a", 200) AND col_2_CHAR = repeat("o", 200);
+SELECT col_1_CHAR = repeat("a", 200) , col_2_CHAR  = repeat("o", 200) FROM
+worklog5743;
+col_1_CHAR = repeat("a", 200)	col_2_CHAR  = repeat("o", 200)
+0	1
+0	1
+"In connection 1"
+SELECT col_1_CHAR = repeat("b", 200) , col_2_CHAR = repeat("o", 200) FROM
+worklog5743;
+col_1_CHAR = repeat("b", 200)	col_2_CHAR = repeat("o", 200)
+0	1
+START TRANSACTION;
+SELECT col_1_CHAR = repeat("a", 200) , col_2_CHAR = repeat("o", 200) FROM
+worklog5743;
+col_1_CHAR = repeat("a", 200)	col_2_CHAR = repeat("o", 200)
+1	1
+SELECT COUNT(*) FROM worklog5743;
+COUNT(*)
+1
+"In connection 2"
+COMMIT;
+SELECT sleep(5);
+sleep(5)
+0
+"In connection 1"
+SELECT col_1_CHAR = repeat("b", 200) , col_2_CHAR = repeat("o", 200) FROM
+worklog5743;
+col_1_CHAR = repeat("b", 200)	col_2_CHAR = repeat("o", 200)
+0	1
+SELECT col_1_CHAR = repeat("a", 200) , col_2_CHAR = repeat("o", 200) FROM
+worklog5743;
+col_1_CHAR = repeat("a", 200)	col_2_CHAR = repeat("o", 200)
+1	1
+SELECT COUNT(*) FROM worklog5743;
+COUNT(*)
+1
+COMMIT;
+DROP TABLE worklog5743;

=== added file 'mysql-test/suite/innodb/t/innodb-bug12552164.test'
--- a/mysql-test/suite/innodb/t/innodb-bug12552164.test	1970-01-01 00:00:00 +0000
+++ b/mysql-test/suite/innodb/t/innodb-bug12552164.test	revid:sunny.bains@stripped
@@ -0,0 +1,50 @@
+CREATE TABLE worklog5743 (col_1_CHAR CHAR(255) , col_2_CHAR CHAR(255) ,
+PRIMARY KEY (col_1_CHAR)) engine = innodb;
+INSERT INTO worklog5743 VALUES(repeat("a", 200) , repeat("o", 200));
+SELECT col_1_CHAR = repeat("a", 200) , col_2_CHAR  = repeat("o", 200) FROM
+worklog5743;
+
+--echo "In connection 1"
+--connect (con1,localhost,root,,)
+SELECT col_1_CHAR = repeat("a", 200) , col_2_CHAR = repeat("o", 200) FROM
+worklog5743;
+SELECT COUNT(*) FROM worklog5743;
+
+
+--echo "In connection 2"
+--connect (con2,localhost,root,,)
+START TRANSACTION;
+INSERT INTO worklog5743 VALUES(repeat("b", 200) , repeat("o", 200));
+UPDATE worklog5743 SET col_1_CHAR = repeat("d", 200) WHERE col_1_CHAR =
+repeat("a", 200) AND col_2_CHAR = repeat("o", 200);
+SELECT col_1_CHAR = repeat("a", 200) , col_2_CHAR  = repeat("o", 200) FROM
+worklog5743;
+
+
+--echo "In connection 1"
+--connection con1
+SELECT col_1_CHAR = repeat("b", 200) , col_2_CHAR = repeat("o", 200) FROM
+worklog5743;
+
+START TRANSACTION;
+
+SELECT col_1_CHAR = repeat("a", 200) , col_2_CHAR = repeat("o", 200) FROM
+worklog5743;
+SELECT COUNT(*) FROM worklog5743;
+
+--echo "In connection 2"
+--connection con2
+COMMIT;
+SELECT sleep(5);
+
+--echo "In connection 1"
+--connection con1
+SELECT col_1_CHAR = repeat("b", 200) , col_2_CHAR = repeat("o", 200) FROM
+worklog5743;
+SELECT col_1_CHAR = repeat("a", 200) , col_2_CHAR = repeat("o", 200) FROM
+worklog5743;
+SELECT COUNT(*) FROM worklog5743;
+COMMIT;
+
+--connection default
+DROP TABLE worklog5743; 

=== modified file 'storage/innobase/trx/trx0purge.c'
--- a/storage/innobase/trx/trx0purge.c	revid:sunny.bains@stripped
+++ b/storage/innobase/trx/trx0purge.c	revid:sunny.bains@stripped
@@ -818,6 +818,7 @@ trx_purge_get_next_rec(
 	mtr_t		mtr;
 
 	ut_ad(purge_sys->next_stored);
+	ut_ad(purge_sys->iter.trx_no < purge_sys->view->low_limit_no);
 
 	space = purge_sys->rseg->space;
 	zip_size = purge_sys->rseg->zip_size;
@@ -935,9 +936,6 @@ trx_purge_fetch_next_rec(
 					handled */
 	mem_heap_t*	heap)		/*!< in: memory heap where copied */
 {
-	const read_view_t*	view = purge_sys->view;
-	const purge_iter_t	iter = purge_sys->iter;
-
 	if (!purge_sys->next_stored) {
 		trx_purge_choose_next_log();
 
@@ -953,7 +951,7 @@ trx_purge_fetch_next_rec(
 		}
 	}
 
-	if (iter.trx_no >= view->low_limit_no) {
+	if (purge_sys->iter.trx_no >= purge_sys->view->low_limit_no) {
 
 		return(NULL);
 	}
@@ -965,8 +963,6 @@ trx_purge_fetch_next_rec(
 		FALSE, purge_sys->rseg->id,
 		purge_sys->page_no, purge_sys->offset);
 
-	ut_ad(iter.trx_no < view->low_limit_no);
-
 	/* The following call will advance the stored values of the
 	purge iterator. */
 

No bundle (reason: useless for push emails).
Thread
bzr push into mysql-trunk-innodb branch (Sunny.Bains:3633 to 3634) Sunny Bains19 May