From: gni Date: March 20 2008 10:55am Subject: bk commit into 5.1 tree (gni:1.2660) BUG#31853 List-Archive: http://lists.mysql.com/commits/44279 X-Bug: 31853 Message-Id: <200803201055.m2KAtAp6029701@dev3-221.dev.cn.tlan> 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-20 18:55:03+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-20 18:54:59+08:00, gni@stripped +5 -0 if not connected to ndb cluster, will return HA_ERR_NO_CONNECTION error to user sql/partition_info.cc@stripped, 2008-03-20 18:55:00+08:00, gni@stripped +19 -4 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-20 18:55:00+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-20 18:54:59 +08:00 @@ -9596,6 +9596,11 @@ int ha_ndbcluster::get_default_no_partit uint reported_frags; uint no_fragments= get_no_fragments(max_rows >= min_rows ? max_rows : min_rows); + if (unlikely(g_ndb_cluster_connection->get_no_ready() <= 0)) + { + my_error(HA_ERR_NO_CONNECTION, MYF(0)); + return -1; + } uint no_nodes= g_ndb_cluster_connection->no_db_nodes(); if (adjusted_frag_count(no_fragments, no_nodes, reported_frags)) { 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-20 18:55:00 +08:00 @@ -189,8 +189,16 @@ bool partition_info::set_up_default_part goto end; } - if ((no_parts == 0) && - ((no_parts= file->get_default_no_partitions(info)) == 0)) + int no_parts_tmp; + if (no_parts == 0) + { + if ((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 +267,15 @@ bool partition_info::set_up_default_subp List_iterator part_it(partitions); DBUG_ENTER("partition_info::set_up_default_subpartitions"); - if (no_subparts == 0) - no_subparts= file->get_default_no_partitions(info); + int no_subparts_tmp; + if (no_subparts == 0) + { + if ((no_subparts_tmp= file->get_default_no_partitions(info)) < 0) + goto end; + + 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-20 18:55:00 +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)