Below is the list of changes that have just been committed into a local
5.1 repository of mikron. When mikron 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
1.1831 05/05/17 18:04:33 mronstrom@stripped +4 -0
Lots of test changes + bug fixes on problems found
sql/table.cc
1.185 05/05/17 18:04:23 mronstrom@stripped +79 -39
Bug fix
sql/sql_yacc.yy
1.359 05/05/17 18:04:23 mronstrom@stripped +6 -4
Bug fix
sql/ha_partition.cc
1.38 05/05/17 18:04:23 mronstrom@stripped +1 -1
Bug fix
mysql-test/t/partition.test
1.8 05/05/17 18:04:23 mronstrom@stripped +43 -418
Lots of changes to tests
# This is a BitKeeper patch. What follows are the unified diffs for the
# set of deltas contained in the patch. The rest of the patch, the part
# that BitKeeper cares about, is below these diffs.
# User: mronstrom
# Host: mikael-ronstr-ms-dator.local
# Root: /Users/mikron/wl1354
--- 1.358/sql/sql_yacc.yy Fri May 13 15:23:00 2005
+++ 1.359/sql/sql_yacc.yy Tue May 17 18:04:23 2005
@@ -2633,7 +2633,9 @@
part_field_item:
ident
- { Lex->part_info->part_field_list.push_back($1.str); };
+ {
+ Lex->part_info->part_field_list.push_back($1.str);
+ };
part_func:
'(' part_func_expr ')'
@@ -2751,7 +2753,7 @@
PARTITION_SYM
{
LEX *lex= Lex;
- partition_info *part_info;
+ partition_info *part_info= lex->part_info;
partition_element *p_elem= new partition_element();
if (!p_elem)
{
@@ -2761,7 +2763,7 @@
part_info->curr_part_elem= p_elem;
part_info->current_partition= p_elem;
part_info->partitions.push_back(p_elem);
- p_elem->engine_type= DB_TYPE_UNKNOWN;
+ p_elem->engine_type= DB_TYPE_UNKNOWN;
part_info->count_curr_parts++;
}
part_name {}
@@ -2912,7 +2914,7 @@
| opt_part_option_list {};
opt_part_option_list:
- opt_part_option_list ',' opt_part_option {}
+ opt_part_option_list opt_part_option {}
| opt_part_option {};
opt_part_option:
--- 1.184/sql/table.cc Thu May 12 16:15:53 2005
+++ 1.185/sql/table.cc Tue May 17 18:04:23 2005
@@ -39,7 +39,8 @@
static bool fix_partition_func(THD *thd, const char* name,
TABLE *table);
static bool fix_fields_part_func(THD *thd,TABLE_LIST *tables,
- Item* func_expr, partition_info *part_info);
+ Item* func_expr, partition_info *part_info,
+ bool sub_part);
static bool handle_list_of_fields(List_iterator<char> it,
uint no_fields,
TABLE *table,
@@ -822,7 +823,7 @@
partition_info *part_info,
bool subpart)
{
- Field *field_ref, **field_array;
+ Field *field, **field_array;
uint i, size_field_array;
DBUG_ENTER("handle_list_of_fields");
@@ -836,9 +837,12 @@
char *field_name;
for (uint i= 0; (field_name= it++); i++)
{
- field_ref= find_field_in_table_sef(table, field_name);
- if (field_ref)
- field_array[i]= field_ref;
+ field= find_field_in_table_sef(table, field_name);
+ if (field)
+ {
+ field->flags|= FIELD_IN_PART_FUNC_FLAG;
+ field_array[i]= field;
+ }
else
{
my_error(ER_FIELD_NOT_FOUND_PART_ERROR, MYF(0));
@@ -859,43 +863,30 @@
DBUG_RETURN(FALSE);
}
-static bool fix_fields_part_func(THD *thd, TABLE_LIST *tables,
- Item* func_expr, partition_info *part_info)
+static int set_up_field_array(TABLE *table,
+ bool sub_part)
{
- bool ret_val= FALSE;
- TABLE *table= tables->table;
- uint no_part_fields= 0, size_field_array;
- Field *field, **ptr, **field_array;
- DBUG_ENTER("fix_fields_part_func");
- table->map= 1; //To ensure correct calculation of const item
- table->get_fields_in_item_tree= TRUE;
- if (func_expr->fix_fields(thd, tables, (Item**)0))
- {
- /*
- Is this not the case where the partition function contains fields
- that are not in the table. Where is the error code of this error
- handled ??
- */
- ret_val= TRUE;
- }
- if (!ret_val && func_expr->const_item())
+ Field **ptr, *field, **field_array;
+ uint no_fields= 0, size_field_array, i= 0;
+ partition_info *part_info= table->s->part_info;
+ int ret_val= 0;
+ for (ptr= table->field; *ptr; ptr++)
+ if ((*ptr)->flags & GET_FIXED_FIELDS_FLAG)
+ no_fields++;
+ size_field_array= (no_fields+1)*sizeof(Field*);
+ field_array= (Field**)sql_alloc(size_field_array);
+ if (!field_array)
{
- my_error(ER_CONST_EXPR_IN_PARTITION_FUNC_ERROR, MYF(0));
+ my_error(ER_OUTOFMEMORY, MYF(0), size_field_array);
ret_val= TRUE;
}
- /*
- Calculate the number of fields in the partition function.
- Use it allocate memory for array of Field pointers.
- Initialise array of field pointers. Use information set one
- calling fix_fields and reset it immediately after.
- The get_fields_in_item_tree activates setting of bit in flags
- on the field object.
- */
for (ptr= table->field, field= *ptr; *ptr; ptr++, field=*ptr)
{
if (field->flags & GET_FIXED_FIELDS_FLAG)
{
field->flags&= ~GET_FIXED_FIELDS_FLAG;
+ field->flags|= FIELD_IN_PART_FUNC_FLAG;
+ field_array[i++]= field;
if (!ret_val)
{
/*
@@ -918,11 +909,57 @@
my_error(ER_FIELD_IN_PART_FUNC_NULLABLE, MYF(0));
ret_val= TRUE;
}
- field->flags|= FIELD_IN_PART_FUNC_FLAG;
}
}
}
-end:
+ field_array[no_fields]= 0;
+ if (!sub_part)
+ {
+ part_info->part_field_array= field_array;
+ part_info->no_part_fields= no_fields;
+ }
+ else
+ {
+ part_info->subpart_field_array= field_array;
+ part_info->no_subpart_fields= no_fields;
+ }
+ return ret_val;
+}
+
+static bool fix_fields_part_func(THD *thd, TABLE_LIST *tables,
+ Item* func_expr, partition_info *part_info,
+ bool sub_part)
+{
+ /*
+ Calculate the number of fields in the partition function.
+ Use it allocate memory for array of Field pointers.
+ Initialise array of field pointers. Use information set when
+ calling fix_fields and reset it immediately after.
+ The get_fields_in_item_tree activates setting of bit in flags
+ on the field object.
+ */
+ bool ret_val= FALSE;
+ TABLE *table= tables->table;
+ uint no_part_fields= 0, size_field_array;
+ Field *field, **ptr, **field_array;
+ DBUG_ENTER("fix_fields_part_func");
+ table->map= 1; //To ensure correct calculation of const item
+ table->get_fields_in_item_tree= TRUE;
+ if (func_expr->fix_fields(thd, tables, (Item**)0))
+ {
+ /*
+ Is this not the case where the partition function contains fields
+ that are not in the table. Where is the error code of this error
+ handled ??
+ */
+ ret_val= TRUE;
+ }
+ if (!ret_val && func_expr->const_item())
+ {
+ my_error(ER_CONST_EXPR_IN_PARTITION_FUNC_ERROR, MYF(0));
+ ret_val= TRUE;
+ }
+ ret_val+= set_up_field_array(table, sub_part);
table->get_fields_in_item_tree= FALSE;
table->map= 0; //Restore old value
DBUG_RETURN(ret_val);
@@ -1169,7 +1206,7 @@
else
{
if (fix_fields_part_func(thd, &tables,
- part_info->subpart_expr, part_info))
+ part_info->subpart_expr, part_info, TRUE))
DBUG_RETURN(TRUE);
if (part_info->subpart_expr->result_type() != INT_RESULT)
{
@@ -1206,7 +1243,8 @@
my_error(ER_SINGLE_PARTITION_NOT_ALLOWED_ERROR, MYF(0), "HASH");
DBUG_RETURN(TRUE);
}
- if (fix_fields_part_func(thd, &tables, part_info->part_expr, part_info))
+ if (fix_fields_part_func(thd, &tables, part_info->part_expr,
+ part_info, FALSE))
DBUG_RETURN(TRUE);
if (part_info->part_expr->result_type() != INT_RESULT)
{
@@ -1225,7 +1263,8 @@
}
if (part_info->list_of_part_fields)
goto list_of_fields_error;
- if (fix_fields_part_func(thd, &tables, part_info->part_expr, part_info))
+ if (fix_fields_part_func(thd, &tables, part_info->part_expr,
+ part_info, FALSE))
DBUG_RETURN(TRUE);
if (check_range_constants(part_info))
DBUG_RETURN(TRUE);
@@ -1239,7 +1278,8 @@
}
if (part_info->list_of_part_fields)
goto list_of_fields_error;
- if (fix_fields_part_func(thd, &tables, part_info->part_expr, part_info))
+ if (fix_fields_part_func(thd, &tables, part_info->part_expr,
+ part_info, FALSE))
DBUG_RETURN(TRUE);
if (check_list_constants(part_info))
DBUG_RETURN(TRUE);
--- 1.7/mysql-test/t/partition.test Thu Mar 3 20:36:20 2005
+++ 1.8/mysql-test/t/partition.test Tue May 17 18:04:23 2005
@@ -11,6 +11,7 @@
#
# Partition by key no partition defined => OK
#
+--error 1427
CREATE TABLE t1 (
a int not null,
b int not null,
@@ -18,11 +19,12 @@
primary key(a,b))
partition by key (a);
-drop table t1;
+drop table if exists t1;
#
# Partition by key no partition, list of fields
#
+--error 1427
CREATE TABLE t1 (
a int not null,
b int not null,
@@ -30,7 +32,7 @@
primary key(a,b))
partition by key (a, b);
-drop table t1;
+drop table if exists t1;
#
# Partition by key specified 3 partitions and defined 3 => ok
@@ -70,9 +72,9 @@
primary key(a,b))
partition by key (a)
partitions 3
-(partition x1 engine ndb,
- partition x2 engine ndb,
- partition x3 engine ndb);
+(partition x1 engine myisam,
+ partition x2 engine myisam,
+ partition x3 engine myisam);
drop table if exists t1;
#
@@ -105,21 +107,6 @@
partition x3 tablespace ts3);
drop table if exists t1;
-#
-# Partition by range, basic
-#
-CREATE TABLE t1 (
-a int not null,
-b int not null,
-c int not null,
-primary key(a,b))
-partition by range (a)
-partitions 3
-(partition x1 values less than (5) tablespace ts1,
- partition x2 values less than (10) tablespace ts2,
- partition x3 values less than maxvalue tablespace ts3);
-
-drop table if exists t1;
#
# Partition by key list, basic
@@ -144,7 +131,7 @@
b int not null,
c int not null,
primary key(a,b))
-partition by list (b*c)
+partition by list (b*a)
partitions 3
(partition x1 values in (1,2,9,4) tablespace ts1,
partition x2 values in (3, 11, 5, 7) tablespace ts2,
@@ -160,7 +147,7 @@
b int not null,
c int not null,
primary key(a,b))
-partition by list (b*c)
+partition by list (b*a)
(partition x1 values in (1) tablespace ts1,
partition x2 values in (3, 11, 5, 7) tablespace ts2,
partition x3 values in (16, 8, 5+19, 70-43) tablespace ts3);
@@ -180,7 +167,7 @@
#
# Partition by list, only one partition => error
#
---error 1416
+--error 1420
CREATE TABLE t1 (
a int not null,
b int not null,
@@ -192,7 +179,7 @@
#
# Partition by list, no partition => error
#
---error 1416
+--error 1427
CREATE TABLE t1 (
a int not null,
b int not null,
@@ -200,33 +187,11 @@
primary key(a,b))
partition by list (a);
-#
-# Partition by range, only one partition => error
-#
---error 1416
-CREATE TABLE t1 (
-a int not null,
-b int not null,
-c int not null,
-primary key(a,b))
-partition by range (a)
-(partition x1 values less than (1));
-
-#
-# Partition by range, no partition => error
-#
---error 1416
-CREATE TABLE t1 (
-a int not null,
-b int not null,
-c int not null,
-primary key(a,b))
-partition by range (a);
#
# Partition by hash, only one partition => error
#
---error 1421
+--error 1425
CREATE TABLE t1 (
a int not null,
b int not null,
@@ -238,7 +203,7 @@
#
# Partition by hash, only one partition => error
#
---error 1421
+--error 1425
CREATE TABLE t1 (
a int not null,
b int not null,
@@ -263,7 +228,7 @@
#
# Partition by key list, wrong result type
#
---error 1415
+--error 1419
CREATE TABLE t1 (
a int not null,
b int not null,
@@ -308,7 +273,7 @@
#
# Partition by key, invalid field in field list
#
---error 1412
+--error 1416
CREATE TABLE t1 (
a int not null,
b int not null,
@@ -337,7 +302,7 @@
#
# Partition by hash, invalid result type
#
---error 1415
+--error 1419
CREATE TABLE t1 (
a int not null,
b int not null,
@@ -350,51 +315,9 @@
partition x3 tablespace ts3);
#
-# Partition by range, invalid field in function
-#
---error 1054
-CREATE TABLE t1 (
-a int not null,
-b int not null,
-c int not null,
-primary key(a,b))
-partition by range (a+d)
-partitions 2
-(partition x1 values less than (4) tablespace ts1,
- partition x2 values less than (8) tablespace ts2);
-
-#
-# Partition by range, inconsistent partition function and constants
-#
---error 1418
-CREATE TABLE t1 (
-a int not null,
-b int not null,
-c int not null,
-primary key(a,b))
-partition by range (a)
-partitions 2
-(partition x1 values less than (4.0) tablespace ts1,
- partition x2 values less than (8) tablespace ts2);
-
-#
-# Partition by range, constant partition function not allowed
-#
---error 1410
-CREATE TABLE t1 (
-a int not null,
-b int not null,
-c int not null,
-primary key(a,b))
-partition by range (3+4)
-partitions 2
-(partition x1 values less than (4) tablespace ts1,
- partition x2 values less than (8) tablespace ts2);
-
-#
# Partition by list, constant partition function not allowed
#
---error 1410
+--error 1414
CREATE TABLE t1 (
a int not null,
b int not null,
@@ -472,23 +395,9 @@
(partition x1 values in (1), partition x2 values in (2));
#
-# Partition by range, no values less than definition
-#
---error 1401
-CREATE TABLE t1 (
-a int not null,
-b int not null,
-c int not null,
-primary key(a,b))
-partition by range (a)
-partitions 2
-(partition x1 values less than (4),
- partition x2);
-
-#
# Partition by list, no values in definition
#
---error 1401
+--error 1408
CREATE TABLE t1 (
a int not null,
b int not null,
@@ -500,37 +409,9 @@
partition x2);
#
-# Partition by range, no values in definition allowed
-#
---error 1402
-CREATE TABLE t1 (
-a int not null,
-b int not null,
-c int not null,
-primary key(a,b))
-partition by range (a)
-partitions 2
-(partition x1 values in (4),
- partition x2 );
-
-#
-# Partition by range, values in error
-#
---error 1402
-CREATE TABLE t1 (
-a int not null,
-b int not null,
-c int not null,
-primary key(a,b))
-partition by range (a)
-partitions 2
-(partition x1 values in (4),
- partition x2 values less than (5));
-
-#
# Partition by list, values less than error
#
---error 1402
+--error 1409
CREATE TABLE t1 (
a int not null,
b int not null,
@@ -544,7 +425,7 @@
#
# Partition by hash, values less than error
#
---error 1402
+--error 1409
CREATE TABLE t1 (
a int not null,
b int not null,
@@ -558,7 +439,7 @@
#
# Partition by hash, values in error
#
---error 1402
+--error 1409
CREATE TABLE t1 (
a int not null,
b int not null,
@@ -572,7 +453,7 @@
#
# Partition by hash, values in error
#
---error 1402
+--error 1409
CREATE TABLE t1 (
a int not null,
b int not null,
@@ -587,7 +468,7 @@
#
# Partition by list, no values in definition
#
---error 1401
+--error 1408
CREATE TABLE t1 (
a int not null,
b int not null,
@@ -599,93 +480,9 @@
partition x2);
#
-# Partition by list, missing parenthesis
-#
---error 1064
-CREATE TABLE t1 (
-a int not null,
-b int not null,
-c int not null,
-primary key(a,b))
-partition by list (a)
-partitions 2
-(partition x1 values in 4,
- partition x2 values in (5));
-
-#
-# Partition by range, missing parenthesis
-#
---error 1064
-CREATE TABLE t1 (
-a int not null,
-b int not null,
-c int not null,
-primary key(a,b))
-partition by range (a)
-partitions 2
-(partition x1 values less than 4,
- partition x2 values less than (5));
-
-#
-# Partition by range, maxvalue in wrong place
-#
---error 1064
-CREATE TABLE t1 (
-a int not null,
-b int not null,
-c int not null,
-primary key(a,b))
-partition by range (a)
-partitions 2
-(partition x1 values less than maxvalue,
- partition x2 values less than (5));
-
-#
-# Partition by range, maxvalue in several places
-#
---error 1064
-CREATE TABLE t1 (
-a int not null,
-b int not null,
-c int not null,
-primary key(a,b))
-partition by range (a)
-partitions 2
-(partition x1 values less than maxvalue,
- partition x2 values less than maxvalue);
-
-#
-# Partition by range, not increasing ranges
-#
---error 1417
-CREATE TABLE t1 (
-a int not null,
-b int not null,
-c int not null,
-primary key(a,b))
-partition by range (a)
-partitions 2
-(partition x1 values less than (4),
- partition x2 values less than (3));
-
-#
-# Partition by range, wrong result type of partition function
-#
---error 1415
-CREATE TABLE t1 (
-a int not null,
-b int not null,
-c int not null,
-primary key(a,b))
-partition by range (sin(a))
-partitions 2
-(partition x1 values less than (4),
- partition x2 values less than (5));
-
-#
# Partition by list, duplicate values
#
---error 1419
+--error 1423
CREATE TABLE t1 (
a int not null,
b int not null,
@@ -699,7 +496,7 @@
#
# Partition by list, wrong constant result type (not INT)
#
---error 1418
+--error 1422
CREATE TABLE t1 (
a int not null,
b int not null,
@@ -713,6 +510,7 @@
#
# Subpartition by key, no partitions defined, single field
#
+--error 1427
CREATE TABLE t1 (
a int not null,
b int not null,
@@ -726,6 +524,7 @@
#
# Subpartition by key, no partitions defined, list of fields
#
+--error 1427
CREATE TABLE t1 (
a int not null,
b int not null,
@@ -739,6 +538,7 @@
#
# Subpartition by hash, no partitions defined
#
+--error 1427
CREATE TABLE t1 (
a int not null,
b int not null,
@@ -752,6 +552,7 @@
#
# Subpartition by key, no partitions defined, single field
#
+--error 1427
CREATE TABLE t1 (
a int not null,
b int not null,
@@ -765,6 +566,7 @@
#
# Subpartition by key, no partitions defined, list of fields
#
+--error 1427
CREATE TABLE t1 (
a int not null,
b int not null,
@@ -778,6 +580,7 @@
#
# Subpartition by hash, no partitions defined
#
+--error 1427
CREATE TABLE t1 (
a int not null,
b int not null,
@@ -790,145 +593,6 @@
#
# Subpartition by hash, two partitions and two subpartitions
-#
-CREATE TABLE t1 (
-a int not null,
-b int not null,
-c int not null,
-primary key (a,b))
-partition by key (a)
-subpartition by hash (a+b)
-( partition x1
- ( subpartition x11,
- subpartition x12),
- partition x2
- ( subpartition x21,
- subpartition x22)
-);
-drop table if exists t1;
-
-#
-# Subpartition by hash, two partitions and two subpartitions
-# Defined tablespace, engine and node group
-#
-CREATE TABLE t1 (
-a int not null,
-b int not null,
-c int not null,
-primary key (a,b))
-partition by key (a)
-subpartition by hash (a+b)
-( partition x1
- ( subpartition x11 tablespace t1 engine myisam nodegroup 0,
- subpartition x12 tablespace t2 engine myisam nodegroup 1),
- partition x2
- ( subpartition x21 tablespace t1 engine myisam nodegroup 0,
- subpartition x22 tablespace t2 engine myisam nodegroup 1)
-);
-drop table if exists t1;
-
-#
-# Subpartition by hash, two partitions and two subpartitions
-# Defined tablespace, node group
-#
-CREATE TABLE t1 (
-a int not null,
-b int not null,
-c int not null,
-primary key (a,b))
-partition by key (a)
-subpartition by hash (a+b)
-( partition x1
- ( subpartition x11 tablespace t1 nodegroup 0,
- subpartition x12 tablespace t2 nodegroup 1),
- partition x2
- ( subpartition x21 tablespace t1 nodegroup 0,
- subpartition x22 tablespace t2 nodegroup 1)
-);
-drop table if exists t1;
-
-#
-# Subpartition by hash, two partitions and two subpartitions
-# Defined engine and node group
-#
-CREATE TABLE t1 (
-a int not null,
-b int not null,
-c int not null,
-primary key (a,b))
-partition by key (a)
-subpartition by hash (a+b)
-( partition x1
- ( subpartition x11 engine myisam nodegroup 0,
- subpartition x12 engine myisam nodegroup 1),
- partition x2
- ( subpartition x21 engine myisam nodegroup 0,
- subpartition x22 engine myisam nodegroup 1)
-);
-drop table if exists t1;
-
-#
-# Subpartition by hash, two partitions and two subpartitions
-# Defined tablespace, engine
-#
-CREATE TABLE t1 (
-a int not null,
-b int not null,
-c int not null,
-primary key (a,b))
-partition by key (a)
-subpartition by hash (a+b)
-( partition x1
- ( subpartition x11 tablespace t1 engine myisam,
- subpartition x12 tablespace t2 engine myisam),
- partition x2
- ( subpartition x21 tablespace t1 engine myisam,
- subpartition x22 tablespace t2 engine myisam)
-);
-drop table if exists t1;
-
-#
-# Subpartition by hash, two partitions and two subpartitions
-# Defined tablespace
-#
-CREATE TABLE t1 (
-a int not null,
-b int not null,
-c int not null,
-primary key (a,b))
-partition by key (a)
-subpartition by hash (a+b)
-( partition x1
- ( subpartition x11 tablespace t1,
- subpartition x12 tablespace t2),
- partition x2
- ( subpartition x21 tablespace t1,
- subpartition x22 tablespace t2)
-);
-drop table if exists t1;
-
-#
-# Subpartition by hash, two partitions and two subpartitions
-# Defined engine
-#
-CREATE TABLE t1 (
-a int not null,
-b int not null,
-c int not null,
-primary key (a,b))
-partition by key (a)
-subpartition by hash (a+b)
-( partition x1
- ( subpartition x11 engine myisam,
- subpartition x12 engine myisam),
- partition x2
- ( subpartition x21 engine myisam,
- subpartition x22 engine myisam)
-);
-drop table if exists t1;
-
-#
-# Subpartition by hash, two partitions and two subpartitions
# Defined node group
#
CREATE TABLE t1 (
@@ -936,12 +600,12 @@
b int not null,
c int not null,
primary key (a,b))
-partition by key (a)
+partition by list (a)
subpartition by hash (a+b)
-( partition x1
+( partition x1 values in (1,2,3)
( subpartition x11 nodegroup 0,
subpartition x12 nodegroup 1),
- partition x2
+ partition x2 values in (4,5,6)
( subpartition x21 nodegroup 0,
subpartition x22 nodegroup 1)
);
@@ -956,13 +620,13 @@
b int not null,
c int not null,
primary key (a,b))
-partition by key (a)
+partition by list (a)
subpartition by hash (a+b)
subpartitions 3
-( partition x1
+( partition x1 values in (1,2,4)
( subpartition x11 nodegroup 0,
subpartition x12 nodegroup 1),
- partition x2
+ partition x2 values in (3,5,6)
( subpartition x21 nodegroup 0,
subpartition x22 nodegroup 1)
);
@@ -976,56 +640,18 @@
b int not null,
c int not null,
primary key (a,b))
-partition by key (a)
+partition by list (a)
subpartition by hash (a+b)
-( partition x1
+( partition x1 values in (1)
( subpartition x11 nodegroup 0,
subpartition xextra,
subpartition x12 nodegroup 1),
- partition x2
+ partition x2 values in (2)
( subpartition x21 nodegroup 0,
subpartition x22 nodegroup 1)
);
#
-# Subpartition by range => error
-#
---error 1064
-CREATE TABLE t1 (
-a int not null,
-b int not null,
-c int not null,
-primary key (a,b))
-partition by key (a)
-subpartition by range (a+b)
-( partition x1
- ( subpartition x11 engine myisam,
- subpartition x12 engine myisam),
- partition x2
- ( subpartition x21 engine myisam,
- subpartition x22 engine myisam)
-);
-
-#
-# Subpartition by range => error
-#
---error 1064
-CREATE TABLE t1 (
-a int not null,
-b int not null,
-c int not null,
-primary key (a,b))
-partition by key (a)
-subpartition by range (a+b)
-( partition x1
- ( subpartition x11 engine myisam values less than (0),
- subpartition x12 engine myisam values less than (1)),
- partition x2
- ( subpartition x21 engine myisam values less than (0),
- subpartition x22 engine myisam values less than (1))
-);
-
-#
# Subpartition by list => error
#
--error 1064
@@ -1078,7 +704,7 @@
#
# Subpartition by hash, no partitions defined, wrong subpartition function
#
---error 1415
+--error 1419
CREATE TABLE t1 (
a int not null,
b int not null,
@@ -1102,7 +728,7 @@
#
# Subpartition by hash, no partitions defined, wrong subpartition function
#
---error 1412
+--error 1416
CREATE TABLE t1 (
a int not null,
b int not null,
@@ -1114,7 +740,7 @@
#
# Subpartition by hash, no partitions defined, wrong subpartition function
#
---error 1410
+--error 1414
CREATE TABLE t1 (
a int not null,
b int not null,
@@ -1134,4 +760,3 @@
primary key (a,b))
partition by key (a)
subpartition by hash (a+d);
-
--- 1.37/sql/ha_partition.cc Thu May 12 12:26:19 2005
+++ 1.38/sql/ha_partition.cc Tue May 17 18:04:23 2005
@@ -629,7 +629,7 @@
partition_element *part_elem, *subpart_elem;
DBUG_ENTER("ha_partition::new_handlers_from_part_info");
List_iterator<partition_element> part_it(m_part_info->partitions);
- if (!(m_file= (handler**)my_malloc(m_tot_parts * sizeof(handler*),
+ if (!(m_file= (handler**)my_malloc((m_tot_parts+1) * sizeof(handler*),
MYF(MY_ZEROFILL))))
DBUG_RETURN(TRUE);
for (i= 0; i < m_part_info->no_parts; i++)
| Thread |
|---|
| • bk commit into 5.1 tree (mronstrom:1.1831) | mikael | 17 May |