List:Commits« Previous MessageNext Message »
From:gni Date:March 13 2008 6:10am
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-13 14:10:09+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-13 14:10:06+08:00, gni@stripped +5 -0
    if the number of nodes is 0, will return HA_ERR_NO_CONNECTION error to user

  sql/partition_info.cc@stripped, 2008-03-13 14:10:06+08:00, gni@stripped +7 -0
    if the member function get_default_no_partition() of handler return -1, it means error happens

  sql/sql_table.cc@stripped, 2008-03-13 14:10:06+08:00, gni@stripped +2 -0
    if the member function get_default_no_partition() of handler return -1, 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-13 14:10:06 +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(!no_nodes))
+  {
+    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-13 14:10:06 +08:00
@@ -188,6 +188,9 @@ bool partition_info::set_up_default_part
     my_error(ER_PARTITIONS_MUST_BE_DEFINED_ERROR, MYF(0), error_string);
     goto end;
   }
+  if ((no_parts == 0) &&
+      (file->get_default_no_partitions(info) == -1))
+    goto end;
 
   if ((no_parts == 0) &&
       ((no_parts= file->get_default_no_partitions(info)) == 0))
@@ -258,6 +261,10 @@ bool partition_info::set_up_default_subp
   partition_element *part_elem;
   List_iterator<partition_element> part_it(partitions);
   DBUG_ENTER("partition_info::set_up_default_subpartitions");
+
+  if ((no_subparts == 0) &&
+      (file->get_default_no_partitions(info) == -1))
+    goto end;
 
   if (no_subparts == 0)
     no_subparts= file->get_default_no_partitions(info);
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-13 14:10:06 +08:00
@@ -3349,6 +3349,8 @@ bool mysql_create_table_no_lock(THD *thd
                  file->get_default_no_partitions(create_info))
       {
         DBUG_ASSERT(thd->lex->sql_command != SQLCOM_CREATE_TABLE);
+        if (unlikely(file->get_default_no_partitions(create_info) == -1))
+        goto err;
         part_info->no_subparts= file->get_default_no_partitions(create_info);
       }
     }
Thread
bk commit into 5.1 tree (gni:1.2660) BUG#31853gni13 Mar