1
0
mirror of https://github.com/MariaDB/server.git synced 2025-08-01 03:47:19 +03:00

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.
This commit is contained in:
holyfoot/hf@mysql.com/hfmain.(none)
2007-03-27 18:39:11 +05:00
parent 188c558a2b
commit 45ac0b6720
4 changed files with 23 additions and 1 deletions

View File

@ -0,0 +1,3 @@
drop table if exists t1;
create table t1 (s1 int) engine=ndbcluster;
ERROR HY000: For the partitioned engine it is necessary to define all partition

View File

@ -0,0 +1 @@
--ndbcluster

View File

@ -0,0 +1,14 @@
disable_query_log;
--require r/true.require
select support = 'Enabled' as `TRUE` from information_schema.engines where engine = 'ndbcluster';
enable_query_log;
--disable_warnings
drop table if exists t1;
--enable_warnings
#
# Bug #27359 Partitions: memory allocation error message
#
--error ER_PARTITION_NOT_DEFINED_ERROR
create table t1 (s1 int) engine=ndbcluster;

View File

@ -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))) if (unlikely(set_up_defaults_for_partitioning(file, info, (uint)0)))
goto end; 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)) if (unlikely(tot_partitions > MAX_PARTITIONS))
{ {
my_error(ER_TOO_MANY_PARTITIONS_ERROR, MYF(0)); my_error(ER_TOO_MANY_PARTITIONS_ERROR, MYF(0));