List:Commits« Previous MessageNext Message »
From:gni Date:March 14 2008 2:39am
Subject:bk commit into 5.1 tree (gni:1.2660) BUG#31853
View as plain text  
Below is the list of changes that have just been committed into a local
5.1 repository of gni.  When gni 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, 2008-03-14 10:39:06+08:00, gni@stripped +3 -0
  BUG#31853 Wrong error message on failed cluster create table after after mysqld (re)start

  sql/ha_ndbcluster.cc@stripped, 2008-03-14 10:39:03+08:00, gni@stripped +5 -0
    if can't connect to ndb cluster, will return HA_ERR_NO_CONNECTION error to user

  sql/partition_info.cc@stripped, 2008-03-14 10:39:03+08:00, gni@stripped +12 -3
    if the return value of the member function get_default_no_partition() is less than 0, it means error happens

  sql/sql_table.cc@stripped, 2008-03-14 10:39:03+08:00, gni@stripped +4 -1
    if the return value of the member function get_default_no_partition() is less than 0, it means error happens

diff -Nrup a/sql/ha_ndbcluster.cc b/sql/ha_ndbcluster.cc
--- a/sql/ha_ndbcluster.cc	2008-01-23 21:52:19 +08:00
+++ b/sql/ha_ndbcluster.cc	2008-03-14 10:39:03 +08:00
@@ -9597,6 +9597,11 @@ int ha_ndbcluster::get_default_no_partit
   uint no_fragments=
     get_no_fragments(max_rows >= min_rows ? max_rows : min_rows);
   uint no_nodes= g_ndb_cluster_connection->no_db_nodes();
+  if (unlikely(g_ndb_cluster_connection->connect(0,0,0)))
+  {
+    my_error(HA_ERR_NO_CONNECTION, MYF(0));
+    return -1;
+  }
   if (adjusted_frag_count(no_fragments, no_nodes, reported_frags))
   {
     push_warning(current_thd,
diff -Nrup a/sql/partition_info.cc b/sql/partition_info.cc
--- a/sql/partition_info.cc	2007-12-12 00:51:35 +08:00
+++ b/sql/partition_info.cc	2008-03-14 10:39:03 +08:00
@@ -188,9 +188,13 @@ bool partition_info::set_up_default_part
     my_error(ER_PARTITIONS_MUST_BE_DEFINED_ERROR, MYF(0), error_string);
     goto end;
   }
-
+  int no_parts_tmp;
   if ((no_parts == 0) &&
-      ((no_parts= file->get_default_no_partitions(info)) == 0))
+      ((no_parts_tmp= file->get_default_no_partitions(info)) < 0 ))
+    goto end;
+
+  no_parts= no_parts_tmp;
+  if (no_parts == 0)
   {
     my_error(ER_PARTITION_NOT_DEFINED_ERROR, MYF(0), "partitions");
     goto end;
@@ -259,8 +263,13 @@ bool partition_info::set_up_default_subp
   List_iterator<partition_element> part_it(partitions);
   DBUG_ENTER("partition_info::set_up_default_subpartitions");
 
+  int no_subparts_tmp;
+  if ((no_subparts == 0) &&
+      ((no_subparts_tmp= file->get_default_no_partitions(info)) < 0))
+    goto end;
+
   if (no_subparts == 0)
-    no_subparts= file->get_default_no_partitions(info);
+    no_subparts= no_subparts_tmp;
   if (unlikely((no_parts * no_subparts) > MAX_PARTITIONS))
   {
     my_error(ER_TOO_MANY_PARTITIONS_ERROR, MYF(0));
diff -Nrup a/sql/sql_table.cc b/sql/sql_table.cc
--- a/sql/sql_table.cc	2007-12-17 20:39:54 +08:00
+++ b/sql/sql_table.cc	2008-03-14 10:39:03 +08:00
@@ -3349,7 +3349,10 @@ bool mysql_create_table_no_lock(THD *thd
                  file->get_default_no_partitions(create_info))
       {
         DBUG_ASSERT(thd->lex->sql_command != SQLCOM_CREATE_TABLE);
-        part_info->no_subparts= file->get_default_no_partitions(create_info);
+        int no_parts_tmp;
+        if (unlikely((no_parts_tmp= file->get_default_no_partitions(create_info)) < 0))
+        goto err;
+        part_info->no_subparts= no_parts_tmp;
       }
     }
     else if (create_info->db_type != engine_type)
Thread
bk commit into 5.1 tree (gni:1.2660) BUG#31853gni14 Mar