List:Internals« Previous MessageNext Message »
From:Mats Kindahl Date:April 30 2005 11:37am
Subject:bk commit into 5.1 tree (mats:1.1831)
View as plain text  
Below is the list of changes that have just been committed into a local
5.1 repository of mats. When mats 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
  1.1831 05/04/30 13:37:45 mats@stripped +2 -0
  WL#1012: Placed a bound on the number of retries when searching for
  a row on the slave side.

  sql/log_event.cc
    1.187 05/04/30 13:37:36 mats@stripped +28 -19
    Removed some compiler warnings.
    Place a bound on the number of times to search for a row on the slave side.

  mysql-test/r/rpl_row_basic_3innodb.result
    1.8 05/04/30 13:37:36 mats@stripped +9 -9
    XID change (again).

# 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:	mats
# Host:	romeo.kindahl.net
# Root:	/home/bk/w2325-mysql-5.1

--- 1.186/sql/log_event.cc	2005-04-30 07:56:54 +02:00
+++ 1.187/sql/log_event.cc	2005-04-30 13:37:36 +02:00
@@ -5623,16 +5623,18 @@
   if (table->s->keys > 0) 
   {
     DBUG_PRINT("info", ("Fetching row using index"));
-    if (error= table->file->index_read(record_buf, key, 
-				       table->key_info->key_length, 
-				       HA_READ_KEY_EXACT))
+    error= table->file->index_read(record_buf, key, 
+				   table->key_info->key_length, 
+				   HA_READ_KEY_EXACT);
+    if (error)
     {
       DBUG_RETURN(error);
     }
 
     while (record_compare(table, table->record[0], record_buf) != 0)
     {
-      if (error= table->file->index_next(record_buf))
+      error= table->file->index_next(record_buf);
+      if (error)
       {
 	DBUG_RETURN(error);
       }
@@ -5643,23 +5645,30 @@
     DBUG_PRINT("info", ("Fetching row by scanning table"));
 
     // Continue until we find the right record or have made a full loop
+    int restart_count= 0;		// Number of times scanning has restarted from top
     do
     {
-      if (error= table->file->rnd_next(record_buf))
+      error= table->file->rnd_next(record_buf);
+      switch (error) 
       {
-	switch (error) 
-	{
-	case HA_ERR_END_OF_FILE:
+      case 0:
+      case HA_ERR_RECORD_DELETED:
+	break;
+
+      case HA_ERR_END_OF_FILE:
+	if (++restart_count < 2) {
 	  table->file->ha_rnd_init(1);
-	  continue;
-	case HA_ERR_RECORD_DELETED:
-	  continue;
-	default:
-	  DBUG_RETURN(error);
 	}
-      }    
+	break;
+
+      default:
+	DBUG_RETURN(error);
+      }
     }
-    while (record_compare(table, table->record[0], record_buf) != 0);
+    while (restart_count < 2 && record_compare(table, table->record[0], record_buf) != 0);
+
+    DBUG_ASSERT(error == HA_ERR_END_OF_FILE || error == 0);
+    DBUG_RETURN(error);
   }
   
   DBUG_RETURN(0);
@@ -5781,9 +5790,9 @@
   DBUG_PRINT("enter", ("table=%p (%s), rli=%p", 
 		       table, table->s->table_name, rli));
   DBUG_ASSERT(table != NULL);
-  int error;
 
-  if (error= find_and_fetch_row(table, m_key, m_search_record))
+  int error= find_and_fetch_row(table, m_key, m_search_record);
+  if (error)
   {
     /* Idempotency support, ok if tuple does not exist */
     if (error == HA_ERR_KEY_NOT_FOUND)
@@ -5918,9 +5927,9 @@
   DBUG_PRINT("enter", ("table=%p (%s), rli=%p", 
 		       table, table->s->table_name, rli));
   DBUG_ASSERT(table != NULL);
-  int error;
 
-  if (error= find_and_fetch_row(table, m_key, m_search_record))
+  int error= find_and_fetch_row(table, m_key, m_search_record);
+  if (error)
   {
     DBUG_PRINT("return", ("error=%d", error));
     DBUG_RETURN(error);

--- 1.7/mysql-test/r/rpl_row_basic_3innodb.result	2005-04-30 10:43:39 +02:00
+++ 1.8/mysql-test/r/rpl_row_basic_3innodb.result	2005-04-30 13:37:36 +02:00
@@ -21,10 +21,10 @@
 <binlog>	<pos>	Query	1	<end_log_pos>	use `test`; CREATE TABLE t1 (C1 CHAR(1), C2 CHAR(1), INDEX (C1)) ENGINE = 'INNODB'
 <binlog>	<pos>	Table_map	1	<end_log_pos>	
 <binlog>	<pos>	Write_rows	1	<end_log_pos>	
-<binlog>	<pos>	Xid	1	<end_log_pos>	COMMIT /* xid=16 */
+<binlog>	<pos>	Xid	1	<end_log_pos>	COMMIT /* xid=15 */
 <binlog>	<pos>	Table_map	1	<end_log_pos>	
 <binlog>	<pos>	Write_rows	1	<end_log_pos>	
-<binlog>	<pos>	Xid	1	<end_log_pos>	COMMIT /* xid=17 */
+<binlog>	<pos>	Xid	1	<end_log_pos>	COMMIT /* xid=16 */
 SELECT * FROM t1 ORDER BY C1,C2;
 C1	C2
 A	A
@@ -48,13 +48,13 @@
 <binlog>	<pos>	Query	1	<end_log_pos>	use `test`; CREATE TABLE t1 (C1 CHAR(1), C2 CHAR(1), INDEX (C1)) ENGINE = 'INNODB'
 <binlog>	<pos>	Table_map	1	<end_log_pos>	
 <binlog>	<pos>	Write_rows	1	<end_log_pos>	
-<binlog>	<pos>	Xid	1	<end_log_pos>	COMMIT /* xid=16 */
+<binlog>	<pos>	Xid	1	<end_log_pos>	COMMIT /* xid=15 */
 <binlog>	<pos>	Table_map	1	<end_log_pos>	
 <binlog>	<pos>	Write_rows	1	<end_log_pos>	
-<binlog>	<pos>	Xid	1	<end_log_pos>	COMMIT /* xid=17 */
+<binlog>	<pos>	Xid	1	<end_log_pos>	COMMIT /* xid=16 */
 <binlog>	<pos>	Table_map	1	<end_log_pos>	
 <binlog>	<pos>	Delete_rows	1	<end_log_pos>	
-<binlog>	<pos>	Xid	1	<end_log_pos>	COMMIT /* xid=23 */
+<binlog>	<pos>	Xid	1	<end_log_pos>	COMMIT /* xid=21 */
 SELECT * FROM t1 ORDER BY C1,C2;
 C1	C2
 A	B
@@ -74,16 +74,16 @@
 <binlog>	<pos>	Query	1	<end_log_pos>	use `test`; CREATE TABLE t1 (C1 CHAR(1), C2 CHAR(1), INDEX (C1)) ENGINE = 'INNODB'
 <binlog>	<pos>	Table_map	1	<end_log_pos>	
 <binlog>	<pos>	Write_rows	1	<end_log_pos>	
-<binlog>	<pos>	Xid	1	<end_log_pos>	COMMIT /* xid=16 */
+<binlog>	<pos>	Xid	1	<end_log_pos>	COMMIT /* xid=15 */
 <binlog>	<pos>	Table_map	1	<end_log_pos>	
 <binlog>	<pos>	Write_rows	1	<end_log_pos>	
-<binlog>	<pos>	Xid	1	<end_log_pos>	COMMIT /* xid=17 */
+<binlog>	<pos>	Xid	1	<end_log_pos>	COMMIT /* xid=16 */
 <binlog>	<pos>	Table_map	1	<end_log_pos>	
 <binlog>	<pos>	Delete_rows	1	<end_log_pos>	
-<binlog>	<pos>	Xid	1	<end_log_pos>	COMMIT /* xid=23 */
+<binlog>	<pos>	Xid	1	<end_log_pos>	COMMIT /* xid=21 */
 <binlog>	<pos>	Table_map	1	<end_log_pos>	
 <binlog>	<pos>	Update_rows	1	<end_log_pos>	
-<binlog>	<pos>	Xid	1	<end_log_pos>	COMMIT /* xid=29 */
+<binlog>	<pos>	Xid	1	<end_log_pos>	COMMIT /* xid=26 */
 SELECT * FROM t1 ORDER BY C1,C2;
 C1	C2
 A	B
Thread
bk commit into 5.1 tree (mats:1.1831)Mats Kindahl30 Apr