List:Commits« Previous MessageNext Message »
From:tomas Date:January 9 2006 2:07pm
Subject:bk commit into 5.1 tree (tomas:1.2028)
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.2028 06/01/09 15:07:29 tomas@stripped +12 -0
  Merge tulin@stripped:/home/bk/mysql-5.1-new
  into  poseidon.ndb.mysql.com:/home/tomas/mysql-5.1-wl2325-v6

  mysql-test/t/disabled.def
    1.35 06/01/09 15:07:24 tomas@stripped +2 -2
    manual merge

  sql/sql_parse.cc
    1.506 06/01/09 15:05:24 tomas@stripped +0 -0
    Auto merged

  sql/sql_base.cc
    1.295 06/01/09 15:05:23 tomas@stripped +0 -0
    Auto merged

  sql/set_var.cc
    1.157 06/01/09 15:05:23 tomas@stripped +0 -0
    Auto merged

  sql/mysqld.cc
    1.515 06/01/09 15:05:23 tomas@stripped +0 -0
    Auto merged

  sql/mysql_priv.h
    1.364 06/01/09 15:05:22 tomas@stripped +0 -0
    Auto merged

  sql/log_event.cc
    1.194 06/01/09 15:05:22 tomas@stripped +0 -0
    Auto merged

  sql/handler.h
    1.176 06/01/09 15:05:22 tomas@stripped +0 -0
    Auto merged

  sql/handler.cc
    1.203 06/01/09 15:05:22 tomas@stripped +0 -0
    Auto merged

  sql/ha_ndbcluster.h
    1.102 06/01/09 15:05:22 tomas@stripped +0 -0
    Auto merged

  sql/ha_ndbcluster.cc
    1.233 06/01/09 15:05:22 tomas@stripped +0 -0
    Auto merged

  scripts/mysql_create_system_tables.sh
    1.27 06/01/09 15:05:21 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/mysql-5.1-wl2325-v6/RESYNC

--- 1.202/sql/handler.cc	2006-01-05 12:55:42 +01:00
+++ 1.203/sql/handler.cc	2006-01-09 15:05:22 +01:00
@@ -1178,14 +1178,6 @@
 #ifdef WITH_INNOBASE_STORAGE_ENGINE
   innobase_release_temporary_latches(thd);
 #endif
-}
-
-
-int ha_update_statistics()
-{
-#ifdef WITH_INNOBASE_STORAGE_ENGINE
-  innodb_export_status();
-#endif
   return 0;
 }
 
@@ -2083,7 +2075,8 @@
       is an optimization hint that storage engine is free to ignore.
       So, let's commit an open transaction (if any) now.
     */
-    error= end_trans(thd, COMMIT);
+    if (!(error= ha_commit_stmt(thd)))
+      error= end_trans(thd, COMMIT);
   }
   DBUG_RETURN(error);
 }
@@ -2911,13 +2904,18 @@
 */
 
 #ifdef HAVE_ROW_BASED_REPLICATION
-static bool check_table_binlog_row_based(THD *thd, TABLE *table)
-{
-  return
-    binlog_row_based &&
-    thd && (thd->options & OPTION_BIN_LOG) &&
-    (table->s->tmp_table == NO_TMP_TABLE) &&
-    binlog_filter->db_ok(table->s->db.str);
+/* The Sun compiler cannot instantiate the template below if this is
+   declared static, but it works by putting it into an anonymous
+   namespace. */
+namespace {
+  bool check_table_binlog_row_based(THD *thd, TABLE *table)
+  {
+    return
+      binlog_row_based &&
+      thd && (thd->options & OPTION_BIN_LOG) &&
+      (table->s->tmp_table == NO_TMP_TABLE) &&
+      binlog_filter->db_ok(table->s->db.str);
+  }
 }
 
 template<class RowsEventT> int binlog_log_row(handler *h, TABLE* table,

--- 1.175/sql/handler.h	2006-01-02 15:40:59 +01:00
+++ 1.176/sql/handler.h	2006-01-09 15:05:22 +01:00
@@ -435,6 +435,15 @@
    bool (*flush_logs)();
    bool (*show_status)(THD *thd, stat_print_fn *print, enum ha_stat_type stat);
    uint32 flags;                                /* global handler flags */
+   int (*reset_logs)(THD *thd);
+   int (*binlog_index_purge_file)(THD *thd, const char *file);
+   void (*reset_slave)(THD *thd);
+   void (*binlog_wait)(THD *thd);
+   int (*binlog_end)(THD *thd);
+   int (*create_database)(THD *thd, const char *db, const char *query,
+                          int query_length);
+   int (*alter_database)(THD *thd, const char *db, const char *query,
+                         int query_length);
 } handlerton;
 
 extern const handlerton default_hton;
@@ -1105,6 +1114,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
@@ -1613,3 +1628,23 @@
 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_ROW_BASED_REPLICATION
+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_wait(THD *thd);
+int ha_binlog_end(THD *thd);
+int ha_create_database(THD *thd, const char *db, const char *query,
+                       int query_length);
+int ha_alter_database(THD *thd, const char *db, const char *query,
+                      int query_length);
+#else
+#define ha_reset_logs(a) 0
+#define ha_binlog_index_purge_file(a,b) 0
+#define ha_reset_slave(a)
+#define ha_binlog_wait(a)
+#define ha_binlog_end(a) 0
+#define ha_create_database(a,b,c,d) 0
+#define ha_alter_database(a,b,c,d) 0
+#endif

--- 1.193/sql/log_event.cc	2006-01-05 12:01:57 +01:00
+++ 1.194/sql/log_event.cc	2006-01-09 15:05:22 +01:00
@@ -131,13 +131,24 @@
 
 
 /*
-  slave_load_file_stem()
+  Creates a temporary name for load data infile:
+
+  SYNOPSIS
+    slave_load_file_stem()
+    buf		      Store new filename here
+    file_id	      File_id (part of file name)
+    event_server_id   Event_id (part of file name)
+    ext		      Extension for file name
+
+  RETURN
+    Pointer to start of extension
 */
 
 #if defined(HAVE_REPLICATION) && !defined(MYSQL_CLIENT)
-static inline char* slave_load_file_stem(char*buf, uint file_id,
-					 int event_server_id)
+static char *slave_load_file_stem(char *buf, uint file_id,
+                                  int event_server_id, const char *ext)
 {
+  char *res;
   fn_format(buf,"SQL_LOAD-",slave_load_tmpdir, "", MY_UNPACK_FILENAME);
   to_unix_path(buf);
 
@@ -146,7 +157,9 @@
   *buf++ = '-';
   buf = int10_to_str(event_server_id, buf, 10);
   *buf++ = '-';
-  return int10_to_str(file_id, buf, 10);
+  res= int10_to_str(file_id, buf, 10);
+  strmov(res, ext);                             // Add extension last
+  return res;                                   // Pointer to extension
 }
 #endif
 
@@ -941,7 +954,6 @@
     /* Pretty-print event common header if header is exactly 19 bytes */
     if (print_event_info->common_header_len == LOG_EVENT_MINIMAL_HEADER_LEN)
     {
-      DBUG_ASSERT(hexdump_from == (unsigned long) hexdump_from);
       fprintf(file, "# Position  Timestamp   Type   Master ID        "
 	      "Size      Master Pos    Flags \n");
       fprintf(file, "# %8.8lx %02x %02x %02x %02x   %02x   "
@@ -967,7 +979,6 @@
 
       if (i % 16 == 15)
       {
-        DBUG_ASSERT(hexdump_from == (unsigned long) hexdump_from);
 	fprintf(file, "# %8.8lx %-48.48s |%16s|\n",
 		(unsigned long) (hexdump_from + (i & 0xfffffff0)),
                 hex_string, char_string);
@@ -981,12 +992,10 @@
     *c= '\0';
 
     /* Non-full last line */
-    if (hex_string[0]) {
-      DBUG_ASSERT(hexdump_from == (unsigned long) hexdump_from);
+    if (hex_string[0])
       fprintf(file, "# %8.8lx %-48.48s |%s|\n# ",
 	     (unsigned long) (hexdump_from + (i & 0xfffffff0)),
              hex_string, char_string);
-    }
   }
 }
 
@@ -4251,16 +4260,15 @@
 #if defined(HAVE_REPLICATION) && !defined(MYSQL_CLIENT)
 int Create_file_log_event::exec_event(struct st_relay_log_info* rli)
 {
-  char proc_info[17+FN_REFLEN+10], *fname_buf= proc_info+17;
-  char *p;
+  char proc_info[17+FN_REFLEN+10], *fname_buf;
+  char *ext;
   int fd = -1;
   IO_CACHE file;
   int error = 1;
 
   bzero((char*)&file, sizeof(file));
-  p = slave_load_file_stem(fname_buf, file_id, server_id);
-  strmov(p, ".info");			// strmov takes less code than memcpy
-  strnmov(proc_info, STRING_WITH_LEN("Making temp file ")); // no end 0
+  fname_buf= strmov(proc_info, "Making temp file ");
+  ext= slave_load_file_stem(fname_buf, file_id, server_id, ".info");
   thd->proc_info= proc_info;
   my_delete(fname_buf, MYF(0)); // old copy may exist already
   if ((fd= my_create(fname_buf, CREATE_MODE,
@@ -4275,12 +4283,11 @@
   }
   
   // a trick to avoid allocating another buffer
-  strmov(p, ".data");
-  fname = fname_buf;
-  fname_len = (uint)(p-fname) + 5;
+  fname= fname_buf;
+  fname_len= (uint) (strmov(ext, ".data") - fname);
   if (write_base(&file))
   {
-    strmov(p, ".info"); // to have it right in the error message
+    strmov(ext, ".info"); // to have it right in the error message
     slave_print_msg(ERROR_LEVEL, rli, my_errno,
                     "Error in Create_file event: could not write to file '%s'",
                     fname_buf);
@@ -4426,13 +4433,12 @@
 int Append_block_log_event::exec_event(struct st_relay_log_info* rli)
 {
   char proc_info[17+FN_REFLEN+10], *fname= proc_info+17;
-  char *p= slave_load_file_stem(fname, file_id, server_id);
   int fd;
   int error = 1;
   DBUG_ENTER("Append_block_log_event::exec_event");
 
-  memcpy(p, ".data", 6);
-  strnmov(proc_info, STRING_WITH_LEN("Making temp file ")); // no end 0
+  fname= strmov(proc_info, "Making temp file ");
+  slave_load_file_stem(fname, file_id, server_id, ".data");
   thd->proc_info= proc_info;
   if (get_create_or_append())
   {
@@ -4558,10 +4564,9 @@
 int Delete_file_log_event::exec_event(struct st_relay_log_info* rli)
 {
   char fname[FN_REFLEN+10];
-  char *p= slave_load_file_stem(fname, file_id, server_id);
-  memcpy(p, ".data", 6);
+  char *ext= slave_load_file_stem(fname, file_id, server_id, ".data");
   (void) my_delete(fname, MYF(MY_WME));
-  memcpy(p, ".info", 6);
+  strmov(ext, ".info");
   (void) my_delete(fname, MYF(MY_WME));
   return Log_event::exec_event(rli);
 }
@@ -4654,13 +4659,13 @@
 int Execute_load_log_event::exec_event(struct st_relay_log_info* rli)
 {
   char fname[FN_REFLEN+10];
-  char *p= slave_load_file_stem(fname, file_id, server_id);
+  char *ext;
   int fd;
-  int error = 1;
+  int error= 1;
   IO_CACHE file;
-  Load_log_event* lev = 0;
+  Load_log_event *lev= 0;
 
-  memcpy(p, ".info", 6);
+  ext= slave_load_file_stem(fname, file_id, server_id, ".info");
   if ((fd = my_open(fname, O_RDONLY | O_BINARY | O_NOFOLLOW,
                     MYF(MY_WME))) < 0 ||
       init_io_cache(&file, fd, IO_SIZE, READ_CACHE, (my_off_t)0, 0,
@@ -4721,7 +4726,7 @@
     fd= -1;
   }
   (void) my_delete(fname, MYF(MY_WME));
-  memcpy(p, ".data", 6);
+  memcpy(ext, ".data", 6);
   (void) my_delete(fname, MYF(MY_WME));
   error = 0;
 
@@ -4919,11 +4924,10 @@
   memcpy(p, query, fn_pos_start);
   p+= fn_pos_start;
   fname= (p= strmake(p, STRING_WITH_LEN(" INFILE \'")));
-  p= slave_load_file_stem(p, file_id, server_id);
-  fname_end= (p= strmake(p, STRING_WITH_LEN(".data")));
+  p= slave_load_file_stem(p, file_id, server_id, ".data");
+  fname_end= p= strend(p);                      // Safer than p=p+5
   *(p++)='\'';
-  switch (dup_handling)
-  {
+  switch (dup_handling) {
   case LOAD_DUP_IGNORE:
     p= strmake(p, STRING_WITH_LEN(" IGNORE"));
     break;

--- 1.363/sql/mysql_priv.h	2006-01-05 12:55:42 +01:00
+++ 1.364/sql/mysql_priv.h	2006-01-09 15:05:22 +01:00
@@ -292,7 +292,7 @@
 #define OPTION_SETUP_TABLES_DONE        (LL(1) << 30) // intern
 /* If not set then the thread will ignore all warnings with level notes. */
 #define OPTION_SQL_NOTES                (LL(1) << 31) // THD, user
-/* 
+/*
   Force the used temporary table to be a MyISAM table (because we will use
   fulltext functions when reading from it.
 */
@@ -322,7 +322,7 @@
 #define MODE_DB2			2048
 #define MODE_MAXDB			4096
 #define MODE_NO_KEY_OPTIONS             8192
-#define MODE_NO_TABLE_OPTIONS           16384 
+#define MODE_NO_TABLE_OPTIONS           16384
 #define MODE_NO_FIELD_OPTIONS           32768
 #define MODE_MYSQL323                   65536
 #define MODE_MYSQL40                    (MODE_MYSQL323*2)
@@ -513,13 +513,11 @@
 void cleanup_items(Item *item);
 class THD;
 void close_thread_tables(THD *thd, bool locked=0, bool skip_derived=0);
-bool check_one_table_access(THD *thd, ulong privilege,
-			   TABLE_LIST *tables);
+bool check_one_table_access(THD *thd, ulong privilege, TABLE_LIST *tables);
 bool check_routine_access(THD *thd,ulong want_access,char *db,char *name,
 			  bool is_proc, bool no_errors);
 bool check_some_access(THD *thd, ulong want_access, TABLE_LIST *table);
-bool check_merge_table_access(THD *thd, char *db,
-			      TABLE_LIST *table_list);
+bool check_merge_table_access(THD *thd, char *db, TABLE_LIST *table_list);
 bool check_some_routine_access(THD *thd, const char *db, const char *name, bool is_proc);
 bool multi_update_precheck(THD *thd, TABLE_LIST *tables);
 bool multi_delete_precheck(THD *thd, TABLE_LIST *tables);
@@ -886,6 +884,10 @@
 void append_definer(THD *thd, String *buffer, const LEX_STRING *definer_user,
                     const LEX_STRING *definer_host);
 
+int add_status_vars(SHOW_VAR *list);
+void remove_status_vars(SHOW_VAR *list);
+void init_status_vars();
+void free_status_vars();
 
 /* information schema */
 extern LEX_STRING information_schema_name;
@@ -1271,7 +1273,7 @@
 extern MY_BITMAP temp_pool;
 extern String my_empty_string;
 extern const String my_null_string;
-extern SHOW_VAR init_vars[],status_vars[], internal_vars[];
+extern SHOW_VAR init_vars[], status_vars[], internal_vars[];
 extern struct system_variables global_system_variables;
 extern struct system_variables max_system_variables;
 extern struct system_status_var global_status_var;

--- 1.514/sql/mysqld.cc	2006-01-07 14:49:40 +01:00
+++ 1.515/sql/mysqld.cc	2006-01-09 15:05:23 +01:00
@@ -416,6 +416,8 @@
 ulong opt_ndb_cache_check_time;
 const char *opt_ndb_mgmd;
 ulong opt_ndb_nodeid;
+ulong ndb_report_thresh_binlog_epoch_slip;
+ulong ndb_report_thresh_binlog_mem_usage;
 
 extern SHOW_VAR ndb_status_variables[];
 extern const char *ndb_distribution_names[];
@@ -1133,6 +1135,10 @@
 
   mysql_log.cleanup();
   mysql_slow_log.cleanup();
+  /* make sure that handlers finish up
+     what they have that is dependent on the binlog
+  */
+  ha_binlog_end(current_thd);
   mysql_bin_log.cleanup();
 
 #ifdef HAVE_REPLICATION
@@ -3105,11 +3111,15 @@
   }
   if (opt_binlog_format_id == BF_UNSPECIFIED)
   {
-    /*
-      We use statement-based by default, but could change this to be row-based
-      if this is a cluster build (i.e. have_ndbcluster is true)...
-    */
-    opt_binlog_format_id= BF_STMT;
+#ifdef HAVE_ROW_BASED_REPLICATION
+    if (have_ndbcluster == SHOW_OPTION_YES)
+    {
+      rpl_filter->add_ignore_table("cluster_replication.binlog_index");
+      opt_binlog_format_id= BF_ROW;
+    }
+    else
+#endif
+      opt_binlog_format_id= BF_STMT;
   }
 #ifdef HAVE_ROW_BASED_REPLICATION
   if (opt_binlog_format_id == BF_ROW) 
@@ -4642,6 +4652,8 @@
   OPT_NDB_DISTRIBUTION,
   OPT_NDB_INDEX_STAT_ENABLE,
   OPT_NDB_INDEX_STAT_CACHE_ENTRIES, OPT_NDB_INDEX_STAT_UPDATE_FREQ,
+  OPT_NDB_REPORT_THRESH_BINLOG_EPOCH_SLIP,
+  OPT_NDB_REPORT_THRESH_BINLOG_MEM_USAGE,
   OPT_SKIP_SAFEMALLOC,
   OPT_TEMP_POOL, OPT_TX_ISOLATION, OPT_COMPLETION_TYPE,
   OPT_SKIP_STACK_TRACE, OPT_SKIP_SYMLINKS,
@@ -5295,6 +5307,22 @@
    (gptr*) &global_system_variables.ndb_force_send,
    (gptr*) &global_system_variables.ndb_force_send,
    0, GET_BOOL, OPT_ARG, 1, 0, 0, 0, 0, 0},
+  {"ndb-report-thresh-binlog-epoch-slip", OPT_NDB_REPORT_THRESH_BINLOG_EPOCH_SLIP,
+   "Threshold on number of epochs to be behind before reporting binlog status. "
+   "E.g. 3 means that if the difference between what epoch has been received "
+   "from the storage nodes and what has been applied to the binlog is 3 or more, "
+   "a status message will be sent to the cluster log.",
+   (gptr*) &ndb_report_thresh_binlog_epoch_slip,
+   (gptr*) &ndb_report_thresh_binlog_epoch_slip,
+   0, GET_ULONG, REQUIRED_ARG, 3, 0, 256, 0, 0, 0},
+  {"ndb-report-thresh-binlog-mem-usage", OPT_NDB_REPORT_THRESH_BINLOG_MEM_USAGE,
+   "Threshold on percentage of free memory before reporting binlog status. E.g. "
+   "10 means that if amount of available memory for receiving binlog data from "
+   "the storage nodes goes below 10%, "
+   "a status message will be sent to the cluster log.",
+   (gptr*) &ndb_report_thresh_binlog_mem_usage,
+   (gptr*) &ndb_report_thresh_binlog_mem_usage,
+   0, GET_ULONG, REQUIRED_ARG, 10, 0, 100, 0, 0, 0},
   {"ndb-use-exact-count", OPT_NDB_USE_EXACT_COUNT,
    "Use exact records count during query planning and for fast "
    "select count(*), disable for faster queries.",

--- 1.505/sql/sql_parse.cc	2006-01-07 14:49:41 +01:00
+++ 1.506/sql/sql_parse.cc	2006-01-09 15:05:24 +01:00
@@ -78,7 +78,7 @@
   "Connect","Kill","Debug","Ping","Time","Delayed insert","Change user",
   "Binlog Dump","Table Dump",  "Connect Out", "Register Slave",
   "Prepare", "Execute", "Long Data", "Close stmt",
-  "Reset stmt", "Set option", "Fetch",
+  "Reset stmt", "Set option", "Fetch", "Daemon",
   "Error"					// Last command number
 };
 
@@ -148,7 +148,7 @@
   DBUG_RETURN(error);
 }
 
-static bool begin_trans(THD *thd)
+bool begin_trans(THD *thd)
 {
   int error=0;
   if (unlikely(thd->in_sub_stmt))
@@ -6605,6 +6605,8 @@
   I_List_iterator<THD> it(threads);
   while ((tmp=it++))
   {
+    if (tmp->command == COM_DAEMON)
+      continue;
     if (tmp->thread_id == id)
     {
       pthread_mutex_lock(&tmp->LOCK_delete);	// Lock from delete

--- 1.34/mysql-test/t/disabled.def	2006-01-09 09:47:00 +01:00
+++ 1.35/mysql-test/t/disabled.def	2006-01-09 15:07:24 +01:00
@@ -24,3 +24,8 @@
 #ps_7ndb         : Bug#15923 Core dump in RBR mode when executing test suite
 rpl_ddl         : Bug#15963 SBR does not show "Definer" correctly
 mysqlslap       : Bug#16167
+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_ndb_idempotent : TBF with cluster DD push, fails on slave insert of a row that does not exist

--- 1.232/sql/ha_ndbcluster.cc	2006-01-05 17:07:01 +01:00
+++ 1.233/sql/ha_ndbcluster.cc	2006-01-09 15:05:22 +01:00
@@ -168,7 +168,7 @@
   return 0;
 }
 
-struct show_var_st ndb_status_variables[]= {
+SHOW_VAR ndb_status_variables[]= {
   {"cluster_node_id",        (char*) &ndb_cluster_node_id,         SHOW_LONG},
   {"connected_host",         (char*) &ndb_connected_host,      SHOW_CHAR_PTR},
   {"connected_port",         (char*) &ndb_connected_port,          SHOW_LONG},
@@ -312,7 +312,8 @@
   if (ndb)
   {
 #ifndef DBUG_OFF
-    Ndb::Free_list_usage tmp; tmp.m_name= 0;
+    Ndb::Free_list_usage tmp;
+    tmp.m_name= 0;
     while (ndb->get_free_list_usage(&tmp))
     {
       uint leaked= (uint) tmp.m_created - tmp.m_free;
@@ -324,8 +325,8 @@
     }
 #endif
     delete ndb;
+    ndb= NULL;
   }
-  ndb= NULL;
   changed_tables.empty();
 }
 
@@ -3304,6 +3305,10 @@
   if (lock_type != F_UNLCK)
   {
     DBUG_PRINT("info", ("lock_type != F_UNLCK"));
+    if (!thd->transaction.on)
+      m_transaction_on= FALSE;
+    else
+      m_transaction_on= thd->variables.ndb_use_transactions;
     if (!thd_ndb->lock_count++)
     {
       PRINT_OPTION_FLAGS(thd);
@@ -3318,7 +3323,8 @@
           ERR_RETURN(ndb->getNdbError());
         no_uncommitted_rows_reset(thd);
         thd_ndb->stmt= trans;
-        trans_register_ha(thd, FALSE, &ndbcluster_hton);
+        if (m_transaction_on)
+          trans_register_ha(thd, FALSE, &ndbcluster_hton);
       } 
       else 
       { 
@@ -3333,7 +3339,8 @@
             ERR_RETURN(ndb->getNdbError());
           no_uncommitted_rows_reset(thd);
           thd_ndb->all= trans; 
-          trans_register_ha(thd, TRUE, &ndbcluster_hton);
+          if (m_transaction_on)
+            trans_register_ha(thd, TRUE, &ndbcluster_hton);
 
           /*
             If this is the start of a LOCK TABLE, a table look 
@@ -3367,10 +3374,6 @@
     m_ha_not_exact_count= !thd->variables.ndb_use_exact_count;
     m_autoincrement_prefetch= 
       (ha_rows) thd->variables.ndb_autoincrement_prefetch_sz;
-    if (!thd->transaction.on)
-      m_transaction_on= FALSE;
-    else
-      m_transaction_on= thd->variables.ndb_use_transactions;
 
     m_active_trans= thd_ndb->all ? thd_ndb->all : thd_ndb->stmt;
     DBUG_ASSERT(m_active_trans);
@@ -5435,7 +5438,8 @@
   if (g_ndb)
   {
 #ifndef DBUG_OFF
-    Ndb::Free_list_usage tmp; tmp.m_name= 0;
+    Ndb::Free_list_usage tmp;
+    tmp.m_name= 0;
     while (g_ndb->get_free_list_usage(&tmp))
     {
       uint leaked= (uint) tmp.m_created - tmp.m_free;
@@ -5447,10 +5451,9 @@
     }
 #endif
     delete g_ndb;
+    g_ndb= NULL;
   }
-  g_ndb= NULL;
-  if (g_ndb_cluster_connection)
-    delete g_ndb_cluster_connection;
+  delete g_ndb_cluster_connection;
   g_ndb_cluster_connection= NULL;
 
   hash_free(&ndbcluster_open_tables);
@@ -8539,7 +8542,8 @@
   if (get_thd_ndb(thd) && get_thd_ndb(thd)->ndb)
   {
     Ndb* ndb= (get_thd_ndb(thd))->ndb;
-    Ndb::Free_list_usage tmp; tmp.m_name= 0;
+    Ndb::Free_list_usage tmp;
+    tmp.m_name= 0;
     while (ndb->get_free_list_usage(&tmp))
     {
       buflen=

--- 1.101/sql/ha_ndbcluster.h	2006-01-05 12:01:57 +01:00
+++ 1.102/sql/ha_ndbcluster.h	2006-01-09 15:05:22 +01:00
@@ -794,7 +794,7 @@
   Ndb *get_ndb();
 };
 
-extern struct show_var_st ndb_status_variables[];
+extern SHOW_VAR ndb_status_variables[];
 
 int ndbcluster_discover(THD* thd, const char* dbname, const char* name,
                         const void** frmblob, uint* frmlen);

--- 1.156/sql/set_var.cc	2006-01-07 14:49:41 +01:00
+++ 1.157/sql/set_var.cc	2006-01-09 15:05:23 +01:00
@@ -478,6 +478,14 @@
 				  &SV::ndb_autoincrement_prefetch_sz);
 sys_var_thd_bool
 sys_ndb_force_send("ndb_force_send", &SV::ndb_force_send);
+#ifdef HAVE_NDB_BINLOG
+sys_var_long_ptr
+sys_ndb_report_thresh_binlog_epoch_slip("ndb_report_thresh_binlog_epoch_slip",
+                                        &ndb_report_thresh_binlog_epoch_slip);
+sys_var_long_ptr
+sys_ndb_report_thresh_binlog_mem_usage("ndb_report_thresh_binlog_mem_usage",
+                                       &ndb_report_thresh_binlog_mem_usage);
+#endif
 sys_var_thd_bool
 sys_ndb_use_exact_count("ndb_use_exact_count", &SV::ndb_use_exact_count);
 sys_var_thd_bool
@@ -847,6 +855,12 @@
   {sys_ndb_index_stat_cache_entries.name, (char*) &sys_ndb_index_stat_cache_entries, SHOW_SYS},
   {sys_ndb_index_stat_enable.name, (char*) &sys_ndb_index_stat_enable, SHOW_SYS},
   {sys_ndb_index_stat_update_freq.name, (char*) &sys_ndb_index_stat_update_freq, SHOW_SYS},
+#ifdef HAVE_NDB_BINLOG
+  {sys_ndb_report_thresh_binlog_epoch_slip.name,
+   (char*) &sys_ndb_report_thresh_binlog_epoch_slip,                SHOW_SYS},
+  {sys_ndb_report_thresh_binlog_mem_usage.name,
+   (char*) &sys_ndb_report_thresh_binlog_mem_usage,                 SHOW_SYS},
+#endif
   {sys_ndb_use_exact_count.name,(char*) &sys_ndb_use_exact_count,   SHOW_SYS},
   {sys_ndb_use_transactions.name,(char*) &sys_ndb_use_transactions, SHOW_SYS},
   {sys_net_buffer_length.name,(char*) &sys_net_buffer_length,       SHOW_SYS},

--- 1.26/scripts/mysql_create_system_tables.sh	2006-01-04 10:36:34 +01:00
+++ 1.27/scripts/mysql_create_system_tables.sh	2006-01-09 15:05:21 +01:00
@@ -781,5 +781,8 @@
 $c_p
 $c_pp
 
+CREATE DATABASE IF NOT EXISTS cluster_replication;
+CREATE TABLE IF NOT EXISTS cluster_replication.binlog_index (Position BIGINT UNSIGNED NOT NULL, File VARCHAR(255) NOT NULL, epoch BIGINT UNSIGNED NOT NULL, inserts BIGINT UNSIGNED NOT NULL, updates BIGINT UNSIGNED NOT NULL, deletes BIGINT UNSIGNED NOT NULL, schemaops BIGINT UNSIGNED NOT NULL, PRIMARY KEY(epoch)) ENGINE=MYISAM;
+
 END_OF_DATA
 
Thread
bk commit into 5.1 tree (tomas:1.2028)tomas9 Jan