diff options
author | unknown <holyfoot/hf@mysql.com/hfmain.(none)> | 2007-03-27 18:39:11 +0500 |
---|---|---|
committer | unknown <holyfoot/hf@mysql.com/hfmain.(none)> | 2007-03-27 18:39:11 +0500 |
commit | b9a3f5ed88d5de183f699cc868eeb55b8224ecef (patch) | |
tree | ecfccfd7ca9db5bfa9bdff3bdc66bced3c3ed383 /sql/partition_info.cc | |
parent | 4ed83d4abb347f93ad36813a6f6d361655a69533 (diff) | |
download | mariadb-git-b9a3f5ed88d5de183f699cc868eeb55b8224ecef.tar.gz |
Bug #27359 Partition: memory allocation error message
if ndbcluster's nodes aren't set, the handlerton can return zero partitions
in the partitioned table. So we should check for that.
sql/partition_info.cc:
check for zero return added
mysql-test/r/ndb_partition_error2.result:
New BitKeeper file ``mysql-test/r/ndb_partition_error2.result''
mysql-test/t/ndb_partition_error2-master.opt:
New BitKeeper file ``mysql-test/t/ndb_partition_error2-master.opt''
mysql-test/t/ndb_partition_error2.test:
New BitKeeper file ``mysql-test/t/ndb_partition_error2.test''
Diffstat (limited to 'sql/partition_info.cc')
-rw-r--r-- | sql/partition_info.cc | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/sql/partition_info.cc b/sql/partition_info.cc index a7f9bd413c6..39aa3a6db92 100644 --- a/sql/partition_info.cc +++ b/sql/partition_info.cc @@ -753,7 +753,11 @@ bool partition_info::check_partition_info(THD *thd, handlerton **eng_type, } if (unlikely(set_up_defaults_for_partitioning(file, info, (uint)0))) goto end; - tot_partitions= get_tot_partitions(); + if (!(tot_partitions= get_tot_partitions())) + { + my_error(ER_PARTITION_NOT_DEFINED_ERROR, MYF(0), "partitions"); + goto end; + } if (unlikely(tot_partitions > MAX_PARTITIONS)) { my_error(ER_TOO_MANY_PARTITIONS_ERROR, MYF(0)); |