List:Commits« Previous MessageNext Message »
From:tomas Date:January 31 2006 12:37am
Subject:bk commit into 5.1 tree (tomas:1.2099) BUG#16851
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.2099 06/01/31 01:37:48 tomas@stripped +3 -0
  Bug #16851, log floods with ndb discover messages
  + fix crashing bug when discovering ndb tables outside select context

  sql/ha_ndbcluster_binlog.h
    1.3 06/01/31 01:37:42 tomas@stripped +2 -1
    Bug #16851, log floods with ndb discover messages
    + fix crashing bug when discovering ndb tables outside select context

  sql/ha_ndbcluster_binlog.cc
    1.5 06/01/31 01:37:42 tomas@stripped +1 -1
    Bug #16851, log floods with ndb discover messages
    + fix crashing bug when discovering ndb tables outside select context

  sql/ha_ndbcluster.cc
    1.246 06/01/31 01:37:41 tomas@stripped +23 -4
    Bug #16851, log floods with ndb discover messages
    + fix crashing bug when discovering ndb tables outside select context

# 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/mysql51

--- 1.245/sql/ha_ndbcluster.cc	2006-01-27 20:26:03 +01:00
+++ 1.246/sql/ha_ndbcluster.cc	2006-01-31 01:37:41 +01:00
@@ -5388,6 +5388,18 @@
 /*
   find all tables in ndb and discover those needed
 */
+int ndb_create_table_from_engine(THD *thd, const char *db,
+                                 const char *table_name)
+{
+  LEX *old_lex= thd->lex, newlex;
+  thd->lex= &newlex;
+  newlex.current_select= NULL;
+  lex_start(thd, (const uchar*) "", 0);
+  int res= ha_create_table_from_engine(thd, db, table_name);
+  thd->lex= old_lex;
+  return res;
+}
+
 int ndbcluster_find_all_files(THD *thd)
 {
   DBUG_ENTER("ndbcluster_find_all_files");
@@ -5440,8 +5452,15 @@
       if (ndbtab->getFrmLength() == 0)
         continue;
     
-      strxnmov(key, FN_LEN-1, mysql_data_home, "/",
-               elmt.database, "/", elmt.name, NullS);
+      /* check if database exists */
+      char *end= strxnmov(key, FN_LEN-1, mysql_data_home, "/",
+                          elmt.database, NullS);
+      if (my_access(key, F_OK))
+      {
+        /* no such database defined, skip table */
+        continue;
+      }
+      strxnmov(end, FN_LEN-1-(key-end), "/", elmt.name, NullS);
       const void *data= 0, *pack_data= 0;
       uint length, pack_length;
       int discover= 0;
@@ -5471,7 +5490,7 @@
       {
         /* ToDo 4.1 database needs to be created if missing */
         pthread_mutex_lock(&LOCK_open);
-        if (ha_create_table_from_engine(thd, elmt.database, elmt.name))
+        if (ndb_create_table_from_engine(thd, elmt.database, elmt.name))
         {
           /* ToDo 4.1 handle error */
         }
@@ -5699,7 +5718,7 @@
   while ((file_name=it2++))
   {  
     DBUG_PRINT("info", ("Table %s need discovery", file_name));
-    if (ha_create_table_from_engine(thd, db, file_name) == 0)
+    if (ndb_create_table_from_engine(thd, db, file_name) == 0)
       files->push_back(thd->strdup(file_name)); 
   }
 

--- 1.4/sql/ha_ndbcluster_binlog.cc	2006-01-25 22:00:26 +01:00
+++ 1.5/sql/ha_ndbcluster_binlog.cc	2006-01-31 01:37:42 +01:00
@@ -1314,7 +1314,7 @@
           /* fall through */
         case SOT_ALTER_TABLE:
           pthread_mutex_lock(&LOCK_open);
-          if (ha_create_table_from_engine(thd, schema->db, schema->name))
+          if (ndb_create_table_from_engine(thd, schema->db, schema->name))
           {
             sql_print_error("Could not discover table '%s.%s' from "
                             "binlog schema event '%s' from node %d",

--- 1.2/sql/ha_ndbcluster_binlog.h	2006-01-20 12:54:56 +01:00
+++ 1.3/sql/ha_ndbcluster_binlog.h	2006-01-31 01:37:42 +01:00
@@ -90,7 +90,8 @@
                                  NDB_SHARE *share);
 void ndb_rep_event_name(String *event_name,
                         const char *db, const char *tbl);
-
+int ndb_create_table_from_engine(THD *thd, const char *db,
+                                 const char *table_name);
 int ndbcluster_binlog_start();
 pthread_handler_t ndb_binlog_thread_func(void *arg);
 
Thread
bk commit into 5.1 tree (tomas:1.2099) BUG#16851tomas31 Jan