List:Commits« Previous MessageNext Message »
From:Lars Thalmann Date:December 20 2005 2:22pm
Subject:bk commit into 5.1 tree (lars:1.1967)
View as plain text  
Below is the list of changes that have just been committed into a local
5.1 repository of lthalmann. When lthalmann 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.1967 05/12/20 15:22:29 lars@stripped +5 -0
  Merge mysql.com:/users/lthalmann/bkroot/mysql-5.1-wl1012-v3
  into  mysql.com:/users/lthalmann/bk/mysql-5.1-wl1012-v3-wl2321-max

  sql/sql_class.h
    1.279 05/12/20 15:22:19 lars@stripped +0 -0
    Auto merged

  sql/sql_class.cc
    1.232 05/12/20 15:22:18 lars@stripped +0 -0
    Auto merged

  sql/sql_base.cc
    1.283 05/12/20 15:22:18 lars@stripped +0 -0
    Auto merged

  sql/log_event.h
    1.148 05/12/20 15:22:17 lars@stripped +0 -0
    Auto merged

  sql/log_event.cc
    1.204 05/12/20 15:22:17 lars@stripped +0 -0
    Auto merged

# 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:	lars
# Host:	dl145h.mysql.com
# Root:	/users/lthalmann/bk/mysql-5.1-wl1012-v3-wl2321-max/RESYNC

--- 1.203/sql/log_event.cc	2005-12-20 01:12:03 +01:00
+++ 1.204/sql/log_event.cc	2005-12-20 15:22:17 +01:00
@@ -5354,10 +5354,6 @@
       case HA_ERR_RECORD_CHANGED:
       case HA_ERR_KEY_NOT_FOUND:	/* Idempotency support: OK if
                                            tuple does not exist */
-	/*
-          ToDo: clear and warnings/errors that has been pushed to the
-          thread?
-        */
 	error= 0;
       case 0:
 	break;
@@ -5439,7 +5435,18 @@
     rli->transaction_end(thd);
 
     if (error == 0)
+    {
+      /*
+        Clear any errors pushed in thd->net.last_err* if for example "no key
+        found" (as this is allowed). This is a safety measure; apparently
+        those errors (e.g. when executing a Delete_rows_log_event of a
+        non-existing row, like in rpl_row_mystery22.test,
+        thd->net.last_error = "Can't find record in 't1'" and last_errno=1032)
+        do not become visible. We still prefer to wipe them out.
+      */
+      thd->clear_error();
       error= Log_event::exec_event(rli);
+    }
     else
       slave_print_msg(ERROR_LEVEL, rli, error,
                       "Error in %s event: commit of row events failed, "
@@ -5497,6 +5504,7 @@
   }
 
   DBUG_ASSERT(error == 0);
+  thd->clear_error();
   rli->inc_event_relay_log_pos();
   
   DBUG_RETURN(0);
@@ -6036,10 +6044,7 @@
   */
   thd->lex->sql_command= SQLCOM_REPLACE;
 
-  // needed for ndbcluster
-  table->file->extra(HA_EXTRA_IGNORE_DUP_KEY);
-  /* TODO: Ensure that myisam allow write_row() with duplicate key. */
-
+  table->file->extra(HA_EXTRA_IGNORE_DUP_KEY);   // needed for ndbcluster
   /*
     TODO: the cluster team (Tomas?) says that it's better if the engine knows
     how many rows are going to be inserted, then it can allocate needed memory

--- 1.147/sql/log_event.h	2005-12-14 23:36:38 +01:00
+++ 1.148/sql/log_event.h	2005-12-20 15:22:17 +01:00
@@ -1999,10 +1999,6 @@
 
 private:
   virtual Log_event_type get_type_code() { return (Log_event_type)TYPE_CODE; }
-  /*
-    TODO: it should not always return 1 but rather perform checks on the event
-    (could all members be alloced etc).
-  */
 
 #ifdef MYSQL_CLIENT
   void print(FILE *file, PRINT_EVENT_INFO *print_event_info);

--- 1.231/sql/sql_class.cc	2005-12-20 01:12:05 +01:00
+++ 1.232/sql/sql_class.cc	2005-12-20 15:22:18 +01:00
@@ -2116,12 +2116,6 @@
   inserted/updated/deleted.
 */
 
-/*
-  Sounds strange to have ifndef MYSQL_CLIENT, as we don't put a copy of
-  sql_class.cc in client/. But this may happen in the future (for mysqlbinlog
-  to be able to "execute" row-based binlog events, so Mats has already put the
-  ifndef.
-*/
 #ifndef MYSQL_CLIENT
 #ifdef HAVE_ROW_BASED_REPLICATION
 
@@ -2512,21 +2506,29 @@
                       char const *query, ulong query_len,
                       bool is_trans, bool suppress_use)
 {
+  DBUG_ENTER("THD::binlog_query");
   DBUG_ASSERT(query && mysql_bin_log.is_open());
+  int error= binlog_flush_pending_rows_event(true);
   switch (qtype)
   {
   case THD::ROW_QUERY_TYPE:
     if (binlog_row_based)
-      return prepare_for_commit();
-    /* otherwise we fall through */
+      DBUG_RETURN(error);
+    /* Otherwise, we fall through */
   case THD::STMT_QUERY_TYPE:
+    /*
+       Most callers of binlog_query() ignore the error code, assuming
+       that the statement will always be written to the binlog.  In
+       case of error above, we therefore just continue and write the
+       statement to the binary log.
+     */
     {
       Query_log_event qinfo(this, query, query_len, is_trans, suppress_use);
       qinfo.flags|= LOG_EVENT_UPDATE_TABLE_MAP_VERSION_F;
-      return mysql_bin_log.write(&qinfo);
+      DBUG_RETURN(mysql_bin_log.write(&qinfo));
     }
   }
-  return 0;
+  DBUG_RETURN(0);
 }
 
 #endif /* !defined(MYSQL_CLIENT) */

--- 1.278/sql/sql_class.h	2005-12-20 01:12:05 +01:00
+++ 1.279/sql/sql_class.h	2005-12-20 15:22:19 +01:00
@@ -897,10 +897,6 @@
   void *ha_data[MAX_HA];
 
 #ifdef HAVE_ROW_BASED_REPLICATION
-/*
-  When mysqlbinlog is made to understand Rows events, we may have
-  to include sql_class.h in client/ so Mats already put the ifndef below.
-*/
 #ifndef MYSQL_CLIENT
 
   /*
Thread
bk commit into 5.1 tree (lars:1.1967)Lars Thalmann20 Dec