List:Commits« Previous MessageNext Message »
From:tomas Date:April 3 2007 5:26am
Subject:bk commit into 5.1 tree (tomas:1.2515)
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:25:53+02:00, tomas@stripped +7 -0
  Merge whalegate.ndb.mysql.com:/home/tomas/mysql-5.1-single-user
  into  whalegate.ndb.mysql.com:/home/tomas/mysql-5.1-telco
  MERGE: 1.2494.1.45

  BitKeeper/etc/ignore@stripped, 2007-04-03 07:25:44+02:00, tomas@stripped +1 -1
    auto-union
    MERGE: 1.276.1.8

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

  sql/ha_ndbcluster.cc@stripped, 2007-04-03 07:25:48+02:00, tomas@stripped +0 -0
    Auto merged
    MERGE: 1.408.1.21

  sql/ha_ndbcluster.h@stripped, 2007-04-03 07:25:48+02:00, tomas@stripped +0 -0
    Auto merged
    MERGE: 1.170.3.1

  sql/ha_ndbcluster_binlog.cc@stripped, 2007-04-03 07:25:48+02:00, tomas@stripped +0 -0
    Auto merged
    MERGE: 1.104.3.1

  sql/ha_ndbcluster_binlog.h@stripped, 2007-04-03 07:25:48+02:00, tomas@stripped +0 -0
    Auto merged
    MERGE: 1.22.2.1

  sql/mysqld.cc@stripped, 2007-04-03 07:25:49+02:00, tomas@stripped +0 -0
    Auto merged
    MERGE: 1.622.6.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:	tomas
# Host:	whalegate.ndb.mysql.com
# Root:	/home/tomas/mysql-5.1-telco/RESYNC

--- 1.437/sql/ha_ndbcluster.cc	2007-04-02 22:37:31 +02:00
+++ 1.438/sql/ha_ndbcluster.cc	2007-04-03 07:25:48 +02:00
@@ -4143,6 +4143,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;
@@ -4193,6 +4245,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 
@@ -4209,6 +4262,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);
 
           /*
@@ -4249,7 +4303,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;
@@ -4391,6 +4448,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.173/sql/ha_ndbcluster.h	2007-04-02 22:32:55 +02:00
+++ 1.174/sql/ha_ndbcluster.h	2007-04-03 07:25:48 +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;
@@ -621,6 +626,7 @@
   NdbTransaction *stmt;
   int error;
   uint32 options;
+  uint32 trans_options;
   List<NDB_SHARE> changed_tables;
   uint query_state;
   HASH open_tables;

--- 1.282/BitKeeper/etc/ignore	2007-03-22 11:33:52 +01:00
+++ 1.283/BitKeeper/etc/ignore	2007-04-03 07:25:44 +02:00
@@ -379,6 +379,7 @@
 client/mysqltestmanagerc
 client/mysys_priv.h
 client/readline.cpp
+client/rpl_constants.h
 client/select_test
 client/sql_string.cpp
 client/ssl_test

--- 1.109/sql/ha_ndbcluster_binlog.cc	2007-04-02 22:32:55 +02:00
+++ 1.110/sql/ha_ndbcluster_binlog.cc	2007-04-03 07:25:48 +02:00
@@ -973,8 +973,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())
   {

--- 1.24/sql/ha_ndbcluster_binlog.h	2007-04-02 22:32:55 +02:00
+++ 1.25/sql/ha_ndbcluster_binlog.h	2007-04-03 07:25:48 +02:00
@@ -183,6 +183,8 @@
 
 void ndb_unpack_record(TABLE *table, NdbValue *value,
                        MY_BITMAP *defined, byte *buf);
+char *ndb_pack_varchar(const NDBCOL *col, char *buf,
+                       const char *str, int sz);
 
 NDB_SHARE *ndbcluster_get_share(const char *key,
                                 TABLE *table,
Thread
bk commit into 5.1 tree (tomas:1.2515)tomas3 Apr