List:Commits« Previous MessageNext Message »
From:tomas Date:January 11 2006 10:31am
Subject:bk commit into 5.1 tree (tomas:1.2031)
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.2031 06/01/11 11:31:11 tomas@stripped +8 -0
  fix bug in gettable returning incomplete data

  storage/ndb/src/ndbapi/NdbDictionaryImpl.cpp
    1.95 06/01/11 11:31:02 tomas@stripped +1 -0
    fix bug in gettable returning incomplete data

  storage/ndb/src/kernel/blocks/dbdict/Dbdict.cpp
    1.64 06/01/11 11:31:02 tomas@stripped +19 -0
    fix bug in gettable returning incomplete data

  sql/set_var.cc
    1.159 06/01/11 11:31:01 tomas@stripped +4 -0
    option to log extra ndb information

  sql/mysqld.cc
    1.518 06/01/11 11:31:01 tomas@stripped +15 -0
    option to log extra ndb information

  sql/handler.cc
    1.209 06/01/11 11:31:01 tomas@stripped +0 -1
    removed debug printout

  sql/ha_ndbcluster_binlog.h
    1.4 06/01/11 11:31:01 tomas@stripped +2 -0
    option to log extra ndb information

  sql/ha_ndbcluster_binlog.cc
    1.8 06/01/11 11:31:01 tomas@stripped +30 -21
    option to log extra ndb information

  sql/ha_ndbcluster.cc
    1.236 06/01/11 11:31:01 tomas@stripped +6 -4
    option to log extra ndb information

# 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

--- 1.208/sql/handler.cc	2006-01-11 08:39:29 +01:00
+++ 1.209/sql/handler.cc	2006-01-11 11:31:01 +01:00
@@ -2817,7 +2817,6 @@
     
     for (ext= file->bas_ext(); *ext; ext++)
     {
-      fprintf(stderr, "%x  %s\n", ext, (char *) *ext);
       while ((old_ext= it++))
       {
         if (!strcmp(old_ext, *ext))

--- 1.517/sql/mysqld.cc	2006-01-10 23:49:49 +01:00
+++ 1.518/sql/mysqld.cc	2006-01-11 11:31:01 +01:00
@@ -416,6 +416,7 @@
 ulong opt_ndb_cache_check_time;
 const char *opt_ndb_mgmd;
 ulong opt_ndb_nodeid;
+ulong ndb_extra_logging;
 #ifdef HAVE_NDB_BINLOG
 ulong ndb_report_thresh_binlog_epoch_slip;
 ulong ndb_report_thresh_binlog_mem_usage;
@@ -4652,6 +4653,7 @@
   OPT_NDB_DISTRIBUTION,
   OPT_NDB_INDEX_STAT_ENABLE,
   OPT_NDB_INDEX_STAT_CACHE_ENTRIES, OPT_NDB_INDEX_STAT_UPDATE_FREQ,
+  OPT_NDB_EXTRA_LOGGING,
   OPT_NDB_REPORT_THRESH_BINLOG_EPOCH_SLIP,
   OPT_NDB_REPORT_THRESH_BINLOG_MEM_USAGE,
   OPT_SKIP_SAFEMALLOC,
@@ -5311,6 +5313,11 @@
    (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-extra-logging", OPT_NDB_EXTRA_LOGGING,
+   "Turn on more logging in the error log.",
+   (gptr*) &ndb_extra_logging,
+   (gptr*) &ndb_extra_logging,
+   0, GET_INT, OPT_ARG, 0, 0, 0, 0, 0, 0},
 #ifdef HAVE_NDB_BINLOG
   {"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. "
@@ -7522,6 +7529,14 @@
       exit(1);
     }
     opt_ndb_distribution_id= (enum ndb_distribution)(id-1);
+    break;
+  case OPT_NDB_EXTRA_LOGGING:
+    if (!argument)
+      ndb_extra_logging++;
+    else if (argument == disabled_my_option)
+      ndb_extra_logging= 0L;
+    else
+      ndb_extra_logging= atoi(argument);
     break;
 #endif
   case OPT_INNODB:

--- 1.63/storage/ndb/src/kernel/blocks/dbdict/Dbdict.cpp	2006-01-05 12:01:59 +01:00
+++ 1.64/storage/ndb/src/kernel/blocks/dbdict/Dbdict.cpp	2006-01-11 11:31:02 +01:00
@@ -448,6 +448,11 @@
       Uint32 count = 2 + data[0] * data[1];
       w.add(DictTabInfo::FragmentDataLen, 2*count);
       w.add(DictTabInfo::FragmentData, data, 2*count);
+      ndbrequire(count > 0);
+    }
+    else
+    {
+      ndbrequire(false);
     }
   }
   
@@ -7039,6 +7044,20 @@
     sendGET_TABINFOREF(signal, req, GetTabInfoRef::TableNotDefined);
     return;
   }//if
+
+  if (DictTabInfo::isTable(objEntry->m_tableType) || 
+      DictTabInfo::isIndex(objEntry->m_tableType))
+  {
+    jam();
+    TableRecordPtr tabPtr;
+    c_tableRecordPool.getPtr(tabPtr, obj_id);
+    if (tabPtr.p->tabState != TableRecord::DEFINED)
+    {
+      jam();
+      sendGET_TABINFOREF(signal, req, GetTabInfoRef::TableNotDefined);
+      return;
+    }
+  }
   
   c_retrieveRecord.busyState = true;
   c_retrieveRecord.blockRef = req->senderRef;

--- 1.94/storage/ndb/src/ndbapi/NdbDictionaryImpl.cpp	2006-01-05 12:01:59 +01:00
+++ 1.95/storage/ndb/src/ndbapi/NdbDictionaryImpl.cpp	2006-01-11 11:31:02 +01:00
@@ -1636,6 +1636,7 @@
   
   * ret = impl;
 
+  DBUG_ASSERT(impl->m_fragmentCount > 0);
   DBUG_RETURN(0);
 }
 

--- 1.235/sql/ha_ndbcluster.cc	2006-01-10 23:33:06 +01:00
+++ 1.236/sql/ha_ndbcluster.cc	2006-01-11 11:31:01 +01:00
@@ -4133,8 +4133,9 @@
 	}
         break;
       }
-      sql_print_information("NDB Binlog: CREATE TABLE Event: %s",
-                            event_name.c_ptr());
+      if (ndb_extra_logging)
+        sql_print_information("NDB Binlog: CREATE TABLE Event: %s",
+                              event_name.c_ptr());
 
       if (share && ndb_binlog_thread_running > 0 &&
           ndbcluster_create_event_ops(share, t, event_name.c_ptr()) < 0)
@@ -4308,8 +4309,9 @@
 
     if (ndbcluster_create_event(ndb, ndbtab, event_name.c_ptr(), share) >= 0)
     {
-      sql_print_information("NDB Binlog: RENAME Event: %s",
-                            event_name.c_ptr());
+      if (ndb_extra_logging)
+        sql_print_information("NDB Binlog: RENAME Event: %s",
+                              event_name.c_ptr());
       if (share)
       {
         if (ndbcluster_create_event_ops(share, ndbtab,

--- 1.158/sql/set_var.cc	2006-01-09 18:04:02 +01:00
+++ 1.159/sql/set_var.cc	2006-01-11 11:31:01 +01:00
@@ -101,6 +101,7 @@
 
 /* WITH_NDBCLUSTER_STORAGE_ENGINE */
 extern ulong ndb_cache_check_time;
+extern ulong ndb_extra_logging;
 #ifdef HAVE_NDB_BINLOG
 extern ulong ndb_report_thresh_binlog_epoch_slip;
 extern ulong ndb_report_thresh_binlog_mem_usage;
@@ -505,6 +506,8 @@
 sys_var_thd_ulong
 sys_ndb_index_stat_update_freq("ndb_index_stat_update_freq",
                                &SV::ndb_index_stat_update_freq);
+sys_var_long_ptr
+sys_ndb_extra_logging("ndb_extra_logging", &ndb_extra_logging);
 
 /* Time/date/datetime formats */
 
@@ -855,6 +858,7 @@
   {sys_ndb_autoincrement_prefetch_sz.name,
    (char*) &sys_ndb_autoincrement_prefetch_sz,                      SHOW_SYS},
   {sys_ndb_cache_check_time.name,(char*) &sys_ndb_cache_check_time, SHOW_SYS},
+  {sys_ndb_extra_logging.name,(char*) &sys_ndb_extra_logging,       SHOW_SYS},
   {sys_ndb_force_send.name,   (char*) &sys_ndb_force_send,          SHOW_SYS},
   {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},

--- 1.7/sql/ha_ndbcluster_binlog.cc	2006-01-11 08:39:29 +01:00
+++ 1.8/sql/ha_ndbcluster_binlog.cc	2006-01-11 11:31:01 +01:00
@@ -568,7 +568,8 @@
 
   char buf[1024], *end;
 
-  sql_print_information("NDB: Creating " NDB_REP_DB "." NDB_APPLY_TABLE);
+  if (ndb_extra_logging)
+    sql_print_information("NDB: Creating " NDB_REP_DB "." NDB_APPLY_TABLE);
 
   /*
     Check if apply status table exists in MySQL "dictionary"
@@ -619,7 +620,8 @@
 
   char buf[1024], *end;
 
-  sql_print_information("NDB: Creating " NDB_REP_DB "." NDB_SCHEMA_TABLE);
+  if (ndb_extra_logging)
+    sql_print_information("NDB: Creating " NDB_REP_DB "." NDB_SCHEMA_TABLE);
 
   /*
     Check if schema table exists in MySQL "dictionary"
@@ -1638,9 +1640,10 @@
     const NDBTAB *ndbtab= dict->getTable(table_name);
     if (ndbtab == 0)
     {
-      sql_print_information("NDB Binlog: Failed to get table %s from ndb: "
-                            "%s, %d", key, dict->getNdbError().message,
-                            dict->getNdbError().code);
+      if (ndb_extra_logging)
+        sql_print_information("NDB Binlog: Failed to get table %s from ndb: "
+                              "%s, %d", key, dict->getNdbError().message,
+                              dict->getNdbError().code);
       break; // error
     }
     String event_name(INJECTOR_EVENT_LEN);
@@ -1658,13 +1661,15 @@
                         event_name.c_ptr());
         break; // error
       }
-      sql_print_information("NDB Binlog: "
-                            "CREATE (DISCOVER) TABLE Event: %s",
-                            event_name.c_ptr());
+      if (ndb_extra_logging)
+        sql_print_information("NDB Binlog: "
+                              "CREATE (DISCOVER) TABLE Event: %s",
+                              event_name.c_ptr());
     }
     else
-      sql_print_information("NDB Binlog: DISCOVER TABLE Event: %s",
-                            event_name.c_ptr());
+      if (ndb_extra_logging)
+        sql_print_information("NDB Binlog: DISCOVER TABLE Event: %s",
+                              event_name.c_ptr());
 
     /*
       create the event operations for receiving logging events
@@ -1939,7 +1944,8 @@
   DBUG_PRINT("info",("%s share->op: 0x%lx, share->use_count: %u",
                      share->key, share->op, share->use_count));
 
-  sql_print_information("NDB Binlog: logging %s", share->key);
+  if (ndb_extra_logging)
+    sql_print_information("NDB Binlog: logging %s", share->key);
   DBUG_RETURN(0);
 }
 
@@ -2017,9 +2023,10 @@
       sql_print_error("NDB delete table: timed out. Ignoring...");
       break;
     }
-    sql_print_information("NDB delete table: "
-                          "waiting max %u sec for drop table %s.",
-                          max_timeout, share->key);
+    if (ndb_extra_logging)
+      sql_print_information("NDB delete table: "
+                            "waiting max %u sec for drop table %s.",
+                            max_timeout, share->key);
   }
   (void) pthread_mutex_unlock(&share->mutex);
 #else
@@ -2101,7 +2108,8 @@
       free_share(&apply_status_share);
       apply_status_share= 0;
     }
-    sql_print_information("NDB Binlog: cluster failure for %s.", share->key);
+    if (ndb_extra_logging)
+      sql_print_information("NDB Binlog: cluster failure for %s.", share->key);
     DBUG_PRINT("info", ("CLUSTER FAILURE EVENT: "
                         "%s  received share: 0x%lx  op: %lx  share op: %lx  "
                         "op_old: %lx",
@@ -2109,10 +2117,11 @@
     break;
   case NDBEVENT::TE_ALTER:
     /* ToDo: remove printout */
-    sql_print_information("NDB Binlog: rename table %s%s/%s -> %s.",
-                          share_prefix, share->table->s->db.str,
-                          share->table->s->table_name.str,
-                          share->key);
+    if (ndb_extra_logging)
+      sql_print_information("NDB Binlog: rename table %s%s/%s -> %s.",
+                            share_prefix, share->table->s->db.str,
+                            share->table->s->table_name.str,
+                            share->key);
     /* do the rename of the table in the share */
     share->table->s->db.str= share->db;
     share->table->s->db.length= strlen(share->db);
@@ -2126,8 +2135,8 @@
       apply_status_share= 0;
     }
     /* ToDo: remove printout */
-    sql_print_information("NDB Binlog: drop table %s.",
-                          share->key);
+    if (ndb_extra_logging)
+      sql_print_information("NDB Binlog: drop table %s.", share->key);
 drop_alter_common:
     row.n_schemaops++;
     DBUG_PRINT("info", ("TABLE %s EVENT: %s  received share: 0x%lx  op: %lx  "

--- 1.3/sql/ha_ndbcluster_binlog.h	2006-01-10 23:30:02 +01:00
+++ 1.4/sql/ha_ndbcluster_binlog.h	2006-01-11 11:31:01 +01:00
@@ -25,6 +25,8 @@
 
 #define IS_TMP_PREFIX(A) (is_prefix(A, tmp_file_prefix) || is_prefix(A, "@0023sql"))
 
+extern ulong ndb_extra_logging;
+
 #ifdef HAVE_NDB_BINLOG
 
 #define INJECTOR_EVENT_LEN 200
Thread
bk commit into 5.1 tree (tomas:1.2031)tomas11 Jan