List:Commits« Previous MessageNext Message »
From:tomas Date:January 13 2006 2:17am
Subject:bk commit into 5.1 tree (tomas:1.2049)
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
  1.2049 06/01/13 03:17:09 tomas@stripped +5 -0
  Merge tulin@stripped:/home/bk/mysql-5.1-new
  into  poseidon.ndb.mysql.com:/home/tomas/v7

  mysql-test/t/disabled.def
    1.39 06/01/13 03:17:03 tomas@stripped +0 -0
    SCCS merged

  sql/handler.h
    1.179 06/01/13 03:15:39 tomas@stripped +0 -0
    Auto merged

  sql/handler.cc
    1.210 06/01/13 03:15:39 tomas@stripped +0 -0
    Auto merged

  mysql-test/t/mysqltest.test
    1.30 06/01/13 03:15:39 tomas@stripped +0 -0
    Auto merged

  include/my_base.h
    1.80 06/01/13 03:15:39 tomas@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:	tomas
# Host:	poseidon.ndb.mysql.com
# Root:	/home/tomas/v7/RESYNC

--- 1.79/include/my_base.h	2006-01-12 10:04:53 +01:00
+++ 1.80/include/my_base.h	2006-01-13 03:15:39 +01:00
@@ -154,7 +154,14 @@
     to overwrite entire row.
   */
   HA_EXTRA_KEYREAD_PRESERVE_FIELDS,
-  HA_EXTRA_MMAP
+  HA_EXTRA_MMAP,
+  /* 
+    Ignore if the a tuple is not found, continue processing the
+    transaction and ignore that 'row'.  Needed for idempotency
+    handling on the slave
+  */
+  HA_EXTRA_IGNORE_NO_KEY,
+  HA_EXTRA_NO_IGNORE_NO_KEY
 };
 
 	/* The following is parameter to ha_panic() */

--- 1.209/sql/handler.cc	2006-01-12 10:04:54 +01:00
+++ 1.210/sql/handler.cc	2006-01-13 03:15:39 +01:00
@@ -2425,6 +2425,132 @@
   DBUG_RETURN(error);
 }
 
+#ifdef HAVE_NDB_BINLOG
+/*
+  TODO: change this into a dynamic struct
+  List<handlerton> does not work as
+  1. binlog_end is called when MEM_ROOT is gone
+  2. cannot work with thd MEM_ROOT as memory should be freed
+*/
+#define MAX_HTON_LIST_ST 63
+struct hton_list_st
+{
+  handlerton *hton[MAX_HTON_LIST_ST];
+  uint sz;
+};
+
+struct binlog_func_st
+{
+  enum_binlog_func fn;
+  void *arg;
+};
+
+/*
+  Listing handlertons first to avoid recursive calls and deadlock
+*/
+static my_bool binlog_func_list(THD *thd, st_plugin_int *plugin, void *arg)
+{
+  hton_list_st *hton_list= (hton_list_st *)arg;
+  handlerton *hton= (handlerton *) plugin->plugin->info;
+  if (hton->state == SHOW_OPTION_YES && hton->binlog_func)
+  {
+    uint sz= hton_list->sz;
+    if (sz == MAX_HTON_LIST_ST-1)
+    {
+      /* list full */
+      return FALSE;
+    }
+    hton_list->hton[sz]= hton;
+    hton_list->sz= sz+1;
+  }
+  return FALSE;
+}
+
+static my_bool binlog_func_foreach(THD *thd, binlog_func_st *bfn)
+{
+  handlerton *hton;
+  hton_list_st hton_list;
+  hton_list.sz= 0;
+  plugin_foreach(thd, binlog_func_list,
+                 MYSQL_STORAGE_ENGINE_PLUGIN, &hton_list);
+
+  uint i= 0, sz= hton_list.sz;
+  while(i < sz)
+    hton_list.hton[i++]->binlog_func(thd, bfn->fn, bfn->arg);
+  return FALSE;
+}
+
+int ha_reset_logs(THD *thd)
+{
+  binlog_func_st bfn= {BFN_RESET_LOGS, 0};
+  binlog_func_foreach(thd, &bfn);
+  return 0;
+}
+
+void ha_reset_slave(THD* thd)
+{
+  binlog_func_st bfn= {BFN_RESET_SLAVE, 0};
+  binlog_func_foreach(thd, &bfn);
+}
+
+void ha_binlog_wait(THD* thd)
+{
+  binlog_func_st bfn= {BFN_BINLOG_WAIT, 0};
+  binlog_func_foreach(thd, &bfn);
+}
+
+int ha_binlog_end(THD* thd)
+{
+  binlog_func_st bfn= {BFN_BINLOG_END, 0};
+  binlog_func_foreach(thd, &bfn);
+  return 0;
+}
+
+int ha_binlog_index_purge_file(THD *thd, const char *file)
+{
+  binlog_func_st bfn= {BFN_BINLOG_PURGE_FILE, (void *)file};
+  binlog_func_foreach(thd, &bfn);
+}
+
+struct binlog_log_query_st
+{
+  enum_binlog_command binlog_command;
+  const char *query;
+  uint query_length;
+  const char *db;
+  const char *table_name;
+};
+
+static my_bool binlog_log_query_handlerton(THD *thd,
+                                           st_plugin_int *plugin,
+                                           void *args)
+{
+  struct binlog_log_query_st *b= (struct binlog_log_query_st*)args;
+  handlerton *hton= (handlerton *) plugin->plugin->info;
+  if (hton->state == SHOW_OPTION_YES && hton->binlog_log_query)
+    hton->binlog_log_query(thd,
+                           b->binlog_command,
+                           b->query,
+                           b->query_length,
+                           b->db,
+                           b->table_name);
+  return FALSE;
+}
+
+void ha_binlog_log_query(THD *thd, enum_binlog_command binlog_command,
+                         const char *query, uint query_length,
+                         const char *db, const char *table_name)
+{
+  struct binlog_log_query_st b;
+  b.binlog_command= binlog_command;
+  b.query= query;
+  b.query_length= query_length;
+  b.db= db;
+  b.table_name= table_name;
+  plugin_foreach(thd, binlog_log_query_handlerton,
+                 MYSQL_STORAGE_ENGINE_PLUGIN, &b);
+}
+#endif
 
 /*
   Read the first row of a multi-range set.
@@ -2846,6 +2972,8 @@
                                               const byte *before_record,
                                               const byte *after_record)
 {
+  if (table->file->is_injective())
+    return 0;
   bool error= 0;
   THD *const thd= current_thd;
 

--- 1.178/sql/handler.h	2006-01-12 10:04:54 +01:00
+++ 1.179/sql/handler.h	2006-01-13 03:15:39 +01:00
@@ -216,6 +216,24 @@
 		ROW_TYPE_DYNAMIC, ROW_TYPE_COMPRESSED,
 		ROW_TYPE_REDUNDANT, ROW_TYPE_COMPACT };
 
+enum enum_binlog_func {
+  BFN_RESET_LOGS=        1,
+  BFN_RESET_SLAVE=       2,
+  BFN_BINLOG_WAIT=       3,
+  BFN_BINLOG_END=        4,
+  BFN_BINLOG_PURGE_FILE= 5
+};
+
+enum enum_binlog_command {
+  LOGCOM_CREATE_TABLE,
+  LOGCOM_ALTER_TABLE,
+  LOGCOM_RENAME_TABLE,
+  LOGCOM_DROP_TABLE,
+  LOGCOM_CREATE_DB,
+  LOGCOM_ALTER_DB,
+  LOGCOM_DROP_DB
+};
+
 /* struct to hold information about the table that should be created */
 
 /* Bits in used_fields */
@@ -431,7 +449,8 @@
     handlerton structure version
    */
   const int interface_version;
-#define MYSQL_HANDLERTON_INTERFACE_VERSION 0x0000
+/* last version change: 0x0001 in 5.1.6 */
+#define MYSQL_HANDLERTON_INTERFACE_VERSION 0x0001
 
 
   /*
@@ -523,6 +542,15 @@
    bool (*show_status)(THD *thd, stat_print_fn *print, enum ha_stat_type stat);
    int (*alter_tablespace)(THD *thd, st_alter_tablespace *ts_info);
    uint32 flags;                                /* global handler flags */
+   /* 
+      Handlerton functions are not set in the different storage
+      engines static initialization.  They are initialized at handler init.
+      Thus, leave them last in the struct.
+   */
+   int (*binlog_func)(THD *thd, enum_binlog_func fn, void *arg);
+   void (*binlog_log_query)(THD *thd, enum_binlog_command binlog_command,
+                            const char *query, uint query_length,
+                            const char *db, const char *table_name);
 } handlerton;
 
 extern const handlerton default_hton;
@@ -1206,6 +1234,12 @@
   virtual int ha_update_row(const byte * old_data, byte * new_data);
   virtual int ha_delete_row(const byte * buf);
   /*
+    If the handler does it's own injection of the rows, this member function
+    should return 'true'.
+  */
+  virtual bool is_injective() const { return false; }
+  
+  /*
     SYNOPSIS
       start_bulk_update()
     RETURN
@@ -1718,3 +1752,21 @@
 int ha_repl_report_sent_binlog(THD *thd, char *log_file_name,
                                my_off_t end_offset);
 int ha_repl_report_replication_stop(THD *thd);
+
+#ifdef HAVE_NDB_BINLOG
+int ha_reset_logs(THD *thd);
+int ha_binlog_index_purge_file(THD *thd, const char *file);
+void ha_reset_slave(THD *thd);
+void ha_binlog_log_query(THD *thd, enum_binlog_command binlog_command,
+                         const char *query, uint query_length,
+                         const char *db, const char *table_name);
+void ha_binlog_wait(THD *thd);
+int ha_binlog_end(THD *thd);
+#else
+#define ha_reset_logs(a) 0
+#define ha_binlog_index_purge_file(a,b) 0
+#define ha_reset_slave(a)
+#define ha_binlog_log_query(a,b,c,d,e,f);
+#define ha_binlog_wait(a)
+#define ha_binlog_end(a) 0
+#endif

--- 1.38/mysql-test/t/disabled.def	2006-01-12 21:27:16 +01:00
+++ 1.39/mysql-test/t/disabled.def	2006-01-13 03:17:03 +01:00
@@ -18,6 +18,11 @@
 innodb_concurrent : Results are not deterministic, Elliot will fix (BUG#3300)
 subselect       : Bug#15706
 type_time       : Bug#15805
+ps_7ndb         : dbug assert in RBR mode when executing test suite
 rpl_ddl         : Bug#15963 SBR does not show "Definer" correctly
 events          : Affects flush test case. A table lock not released somewhere
+ndb_autodiscover : TBF with CR
+ndb_autodiscover2 : TBF with CR
+ndb_binlog_basic   : Results are not deterministic, Tomas will fix
+rpl_ndb_basic   : Bug#16228
 rpl_sp          : Bug #16456

--- 1.29/mysql-test/t/mysqltest.test	2006-01-12 18:21:30 +01:00
+++ 1.30/mysql-test/t/mysqltest.test	2006-01-13 03:15:39 +01:00
@@ -519,9 +519,6 @@
 --exec echo "let $=hi;" | $MYSQL_TEST  2>&1
 
 --error 1
---exec echo "let hi=hi;" | $MYSQL_TEST  2>&1
-
---error 1
 --exec echo "let $1 hi;" | $MYSQL_TEST  2>&1
 
 --error 1
Thread
bk commit into 5.1 tree (tomas:1.2049)tomas13 Jan