MySQL Lists are EOL. Please join:

List:Commits« Previous MessageNext Message »
From:tomas Date:August 30 2007 9:46am
Subject:bk commit into 5.1 tree (tomas:1.2548) BUG#20872
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-08-30 11:46:30+02:00, tomas@stripped +3 -0
  Bug#20872 master*.err: miscellaneous error messages

  sql/ha_ndbcluster.cc@stripped, 2007-08-30 11:46:27+02:00, tomas@stripped +9 -1
    Bug#20872 master*.err: miscellaneous error messages
    - only allocate share if fully successfull

  sql/ha_ndbcluster_binlog.cc@stripped, 2007-08-30 11:46:27+02:00, tomas@stripped +7 -10
    Bug#20872 master*.err: miscellaneous error messages
    - only allocate share if fully successfull
    - no need to print error, my_errno is set

  sql/ha_ndbcluster_binlog.h@stripped, 2007-08-30 11:46:28+02:00, tomas@stripped +1 -1
    Bug#20872 master*.err: miscellaneous error messages
    - only allocate share if fully successfull

diff -Nrup a/sql/ha_ndbcluster.cc b/sql/ha_ndbcluster.cc
--- a/sql/ha_ndbcluster.cc	2007-08-30 10:42:19 +02:00
+++ b/sql/ha_ndbcluster.cc	2007-08-30 11:46:27 +02:00
@@ -8277,7 +8277,15 @@ NDB_SHARE *ndbcluster_get_share(const ch
       share->table_name= share->db + strlen(share->db) + 1;
       ha_ndbcluster::set_tabname(key, share->table_name);
 #ifdef HAVE_NDB_BINLOG
-      ndbcluster_binlog_init_share(share, table);
+      if (ndbcluster_binlog_init_share(share, table))
+      {
+        DBUG_PRINT("error", ("get_share: %s could not init share", key));
+        ndbcluster_real_free_share(&share);
+        *root_ptr= old_root;
+        if (!have_lock)
+          pthread_mutex_unlock(&ndbcluster_mutex);
+        DBUG_RETURN(0);
+      }
 #endif
       *root_ptr= old_root;
     }
diff -Nrup a/sql/ha_ndbcluster_binlog.cc b/sql/ha_ndbcluster_binlog.cc
--- a/sql/ha_ndbcluster_binlog.cc	2007-08-30 10:41:16 +02:00
+++ b/sql/ha_ndbcluster_binlog.cc	2007-08-30 11:46:27 +02:00
@@ -265,7 +265,7 @@ static void run_query(THD *thd, char *bu
     Thd_ndb *thd_ndb= get_thd_ndb(thd);
     for (i= 0; no_print_error[i]; i++)
       if ((thd_ndb->m_error_code == no_print_error[i]) ||
-          (thd->net.last_errno == no_print_error[i]))
+          (thd->net.last_errno == (unsigned)no_print_error[i]))
         break;
     if (!no_print_error[i])
       sql_print_error("NDB: %s: error %s %d(ndb: %d) %d %d",
@@ -325,18 +325,14 @@ ndbcluster_binlog_open_table(THD *thd, N
                        share->key);
   if ((error= open_table_def(thd, table_share, 0)))
   {
-    sql_print_error("Unable to get table share for %s, error=%d",
-                    share->key, error);
-    DBUG_PRINT("error", ("open_table_def failed %d", error));
+    DBUG_PRINT("error", ("open_table_def failed: %d my_errno: %d", error, my_errno));
     free_table_share(table_share);
     DBUG_RETURN(error);
   }
   if ((error= open_table_from_share(thd, table_share, "", 0 /* fon't allocate buffers */, 
                                     (uint) READ_ALL, 0, table, FALSE)))
   {
-    sql_print_error("Unable to open table for %s, error=%d(%d)",
-                    share->key, error, my_errno);
-    DBUG_PRINT("error", ("open_table_from_share failed %d", error));
+    DBUG_PRINT("error", ("open_table_from_share failed %d my_errno: %d", error, my_errno));
     free_table_share(table_share);
     DBUG_RETURN(error);
   }
@@ -382,11 +378,12 @@ ndbcluster_binlog_open_table(THD *thd, N
 /*
   Initialize the binlog part of the NDB_SHARE
 */
-void ndbcluster_binlog_init_share(NDB_SHARE *share, TABLE *_table)
+int ndbcluster_binlog_init_share(NDB_SHARE *share, TABLE *_table)
 {
   THD *thd= current_thd;
   MEM_ROOT *mem_root= &share->mem_root;
   int do_event_op= ndb_binlog_running;
+  int error= 0;
   DBUG_ENTER("ndbcluster_binlog_init_share");
 
   share->connect_count= g_ndb_cluster_connection->get_connect_count();
@@ -429,7 +426,7 @@ void ndbcluster_binlog_init_share(NDB_SH
     {
       share->flags|= NSF_NO_BINLOG;
     }
-    DBUG_VOID_RETURN;
+    DBUG_RETURN(error);
   }
   while (1) 
   {
@@ -456,7 +453,7 @@ void ndbcluster_binlog_init_share(NDB_SH
       share->flags|= NSF_BLOB_FLAG;
     break;
   }
-  DBUG_VOID_RETURN;
+  DBUG_RETURN(error);
 }
 
 /*****************************************************************
diff -Nrup a/sql/ha_ndbcluster_binlog.h b/sql/ha_ndbcluster_binlog.h
--- a/sql/ha_ndbcluster_binlog.h	2007-05-10 11:59:27 +02:00
+++ b/sql/ha_ndbcluster_binlog.h	2007-08-30 11:46:28 +02:00
@@ -124,7 +124,7 @@ void ndbcluster_binlog_init_handlerton()
 /*
   Initialize the binlog part of the NDB_SHARE
 */
-void ndbcluster_binlog_init_share(NDB_SHARE *share, TABLE *table);
+int ndbcluster_binlog_init_share(NDB_SHARE *share, TABLE *table);
 
 bool ndbcluster_check_if_local_table(const char *dbname, const char *tabname);
 bool ndbcluster_check_if_local_tables_in_db(THD *thd, const char *dbname);
Thread
bk commit into 5.1 tree (tomas:1.2548) BUG#20872tomas30 Aug