List:Commits« Previous MessageNext Message »
From:tomas Date:April 3 2007 7:33am
Subject:bk commit into 5.1 tree (tomas:1.2539)
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-04-03 07:33:29+02:00, tomas@stripped +6 -0
  Merge tulin@stripped:/home/bk/mysql-5.1-new-rpl
  into  whalegate.ndb.mysql.com:/home/tomas/mysql-5.1-new-rpl
  MERGE: 1.2534.1.14

  client/Makefile.am@stripped, 2007-04-03 07:33:24+02:00, tomas@stripped +0 -0
    Auto merged
    MERGE: 1.86.1.1

  mysql-test/r/rpl_ndb_basic.result@stripped, 2007-04-03 07:33:24+02:00,
tomas@stripped +0 -0
    Auto merged
    MERGE: 1.5.1.1

  sql/ha_ndbcluster.cc@stripped, 2007-04-03 07:33:24+02:00, tomas@stripped +0
-0
    Auto merged
    MERGE: 1.422.1.2

  sql/ha_ndbcluster.h@stripped, 2007-04-03 07:33:24+02:00, tomas@stripped +0
-0
    Auto merged
    MERGE: 1.170.1.1

  sql/ha_ndbcluster_binlog.cc@stripped, 2007-04-03 07:33:24+02:00,
tomas@stripped +0 -0
    Auto merged
    MERGE: 1.105.1.1

  sql/mysqld.cc@stripped, 2007-04-03 07:33:24+02:00, tomas@stripped +0 -0
    Auto merged
    MERGE: 1.622.1.4

# 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:	tomas
# Host:	whalegate.ndb.mysql.com
# Root:	/home/tomas/mysql-5.1-new-rpl/RESYNC

--- 1.425/sql/ha_ndbcluster.cc	2007-03-30 12:35:03 +02:00
+++ 1.426/sql/ha_ndbcluster.cc	2007-04-03 07:33:24 +02:00
@@ -4123,6 +4123,58 @@
   - refresh list of the indexes for the table if needed (if altered)
  */
 
+#ifdef HAVE_NDB_BINLOG
+extern MASTER_INFO *active_mi;
+static int ndbcluster_update_apply_status(THD *thd, int do_update)
+{
+  Thd_ndb *thd_ndb= get_thd_ndb(thd);
+  Ndb *ndb= thd_ndb->ndb;
+  NDBDICT *dict= ndb->getDictionary();
+  const NDBTAB *ndbtab;
+  NdbTransaction *trans= thd_ndb->all ? thd_ndb->all : thd_ndb->stmt;
+  ndb->setDatabaseName(NDB_REP_DB);
+  Ndb_table_guard ndbtab_g(dict, NDB_APPLY_TABLE);
+  if (!(ndbtab= ndbtab_g.get_table()))
+  {
+    return -1;
+  }
+  NdbOperation *op= 0;
+  int r= 0;
+  r|= (op= trans->getNdbOperation(ndbtab)) == 0;
+  DBUG_ASSERT(r == 0);
+  if (do_update)
+    r|= op->updateTuple();
+  else
+    r|= op->writeTuple();
+  DBUG_ASSERT(r == 0);
+  // server_id
+  r|= op->equal(0u, (Uint64)thd->server_id);
+  DBUG_ASSERT(r == 0);
+  if (!do_update)
+  {
+    // epoch
+    r|= op->setValue(1u, (Uint64)0);
+    DBUG_ASSERT(r == 0);
+  }
+  // log_name
+  char tmp_buf[FN_REFLEN];
+  ndb_pack_varchar(ndbtab->getColumn(2u), tmp_buf,
+                   active_mi->rli.group_master_log_name,
+                   strlen(active_mi->rli.group_master_log_name));
+  r|= op->setValue(2u, tmp_buf);
+  DBUG_ASSERT(r == 0);
+  // start_pos
+  r|= op->setValue(3u, (Uint64)active_mi->rli.group_master_log_pos);
+  DBUG_ASSERT(r == 0);
+  // end_pos
+  r|= op->setValue(4u, (Uint64)active_mi->rli.group_master_log_pos + 
+                   ((Uint64)active_mi->rli.future_event_relay_log_pos -
+                    (Uint64)active_mi->rli.group_relay_log_pos));
+  DBUG_ASSERT(r == 0);
+  return 0;
+}
+#endif /* HAVE_NDB_BINLOG */
+
 int ha_ndbcluster::external_lock(THD *thd, int lock_type)
 {
   int error=0;
@@ -4173,6 +4225,7 @@
         thd_ndb->init_open_tables();
         thd_ndb->stmt= trans;
 	thd_ndb->query_state&= NDB_QUERY_NORMAL;
+        thd_ndb->trans_options= 0;
         trans_register_ha(thd, FALSE, ndbcluster_hton);
       } 
       else 
@@ -4189,6 +4242,7 @@
           thd_ndb->init_open_tables();
           thd_ndb->all= trans; 
 	  thd_ndb->query_state&= NDB_QUERY_NORMAL;
+          thd_ndb->trans_options= 0;
           trans_register_ha(thd, TRUE, ndbcluster_hton);
 
           /*
@@ -4229,7 +4283,10 @@
     // Start of transaction
     m_rows_changed= 0;
     m_ops_pending= 0;
-
+#ifdef HAVE_NDB_BINLOG
+    if (m_share == ndb_apply_status_share && thd->slave_thread)
+      thd_ndb->trans_options|= TNTO_INJECTED_APPLY_STATUS;
+#endif
     // TODO remove double pointers...
     m_thd_ndb_share= thd_ndb->get_open_table(thd, m_table);
     m_table_info= &m_thd_ndb_share->stat;
@@ -4371,6 +4428,11 @@
                             trans == thd_ndb->stmt ?
                             "stmt" : "all"));
   DBUG_ASSERT(ndb && trans);
+
+#ifdef HAVE_NDB_BINLOG
+  if (thd->slave_thread)
+    ndbcluster_update_apply_status(thd, thd_ndb->trans_options &
TNTO_INJECTED_APPLY_STATUS);
+#endif /* HAVE_NDB_BINLOG */
 
   if (execute_commit(thd,trans) != 0)
   {

--- 1.172/sql/ha_ndbcluster.h	2007-03-30 12:35:03 +02:00
+++ 1.173/sql/ha_ndbcluster.h	2007-04-03 07:33:24 +02:00
@@ -593,6 +593,11 @@
   TNO_NO_LOG_SCHEMA_OP= 1 << 0
 };
 
+enum THD_NDB_TRANS_OPTIONS
+{
+  TNTO_INJECTED_APPLY_STATUS= 1 << 0
+};
+
 struct Ndb_local_table_statistics {
   int no_uncommitted_rows_count;
   ulong last_count;
@@ -620,6 +625,7 @@
   NdbTransaction *stmt;
   int error;
   uint32 options;
+  uint32 trans_options;
   List<NDB_SHARE> changed_tables;
   uint query_state;
   HASH open_tables;

--- 1.106/sql/ha_ndbcluster_binlog.cc	2007-03-29 18:52:28 +02:00
+++ 1.107/sql/ha_ndbcluster_binlog.cc	2007-04-03 07:33:24 +02:00
@@ -953,8 +953,8 @@
 /*
   helper function to pack a ndb varchar
 */
-static char *ndb_pack_varchar(const NDBCOL *col, char *buf,
-                              const char *str, int sz)
+char *ndb_pack_varchar(const NDBCOL *col, char *buf,
+                       const char *str, int sz)
 {
   switch (col->getArrayType())
   {
Thread
bk commit into 5.1 tree (tomas:1.2539)tomas3 Apr