#At file:///home/ngb/mysql/bzr/telco6.2-bug31853/
2648 Guangbao Ni 2008-08-12
BUG#31853 Wrong error message on failed cluster create table after after mysqld
(re)start
modified:
sql/ha_ndbcluster.cc
sql/partition_info.cc
sql/sql_table.cc
per-file messages:
sql/ha_ndbcluster.cc
if not connected to ndb cluster, will return HA_ERR_NO_CONNECTION error to user
sql/partition_info.cc
if the return value of the member function get_default_no_partition() is less than 0,
it means error happens.
sql/sql_table.cc
if the return value of the member function get_default_no_partition() is less than 0,
it means error happens
=== modified file 'sql/ha_ndbcluster.cc'
--- a/sql/ha_ndbcluster.cc 2008-08-12 15:54:32 +0000
+++ b/sql/ha_ndbcluster.cc 2008-08-12 18:46:19 +0000
@@ -10014,6 +10014,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))
{
=== modified file 'sql/partition_info.cc'
--- a/sql/partition_info.cc 2008-03-20 11:22:02 +0000
+++ b/sql/partition_info.cc 2008-08-12 18:46:19 +0000
@@ -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))
+ if (no_parts == 0)
+ {
+ int no_parts_tmp;
+ 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<partition_element> part_it(partitions);
DBUG_ENTER("partition_info::set_up_default_subpartitions");
- if (no_subparts == 0)
- no_subparts= file->get_default_no_partitions(info);
+ if (no_subparts == 0)
+ {
+ int no_subparts_tmp;
+ 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));
=== modified file 'sql/sql_table.cc'
--- a/sql/sql_table.cc 2008-08-07 13:56:42 +0000
+++ b/sql/sql_table.cc 2008-08-12 18:46:19 +0000
@@ -3385,7 +3385,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 |
|---|
| • bzr commit into mysql-5.1 branch (gni:2648) Bug#31853 | Guangbao Ni | 12 Aug |