Commit a76a884c authored by unknown's avatar unknown

Merge mronstrom@bk-internal.mysql.com:/home/bk/mysql-5.1-new

into  c-870ae253.1238-1-64736c10.cust.bredbandsbolaget.se:/home/pappa/bug19304
parents 2baef06f e86480b5
...@@ -890,6 +890,10 @@ s1 ...@@ -890,6 +890,10 @@ s1
2 2
3 3
drop table t1; drop table t1;
create table t1 (a int)
partition by key (a)
(partition p0 engine = MERGE);
ERROR HY000: MyISAM Merge handler cannot be used in partitioned tables
create table t1 (a int) engine=memory create table t1 (a int) engine=memory
partition by key(a); partition by key(a);
insert into t1 values (1); insert into t1 values (1);
...@@ -922,4 +926,14 @@ CREATE TABLE t1 (a int, index(a)) PARTITION BY KEY(a); ...@@ -922,4 +926,14 @@ CREATE TABLE t1 (a int, index(a)) PARTITION BY KEY(a);
ALTER TABLE t1 DISABLE KEYS; ALTER TABLE t1 DISABLE KEYS;
ALTER TABLE t1 ENABLE KEYS; ALTER TABLE t1 ENABLE KEYS;
DROP TABLE t1; DROP TABLE t1;
create table t1 (a int)
engine=MEMORY
partition by key (a);
REPAIR TABLE t1;
Table Op Msg_type Msg_text
test.t1 repair note The storage engine for the table doesn't support repair
OPTIMIZE TABLE t1;
Table Op Msg_type Msg_text
test.t1 optimize note The storage engine for the table doesn't support optimize
drop table t1;
End of 5.1 tests End of 5.1 tests
...@@ -1023,6 +1023,14 @@ insert into t1 values (1); ...@@ -1023,6 +1023,14 @@ insert into t1 values (1);
create index inx1 on t1(a); create index inx1 on t1(a);
drop table t1; drop table t1;
#
# BUG 19304 Partitions: MERGE handler not allowed in partitioned tables
#
--error ER_PARTITION_MERGE_ERROR
create table t1 (a int)
partition by key (a)
(partition p0 engine = MERGE);
# #
# BUG 19062 Partition clause ignored if CREATE TABLE ... AS SELECT ...; # BUG 19062 Partition clause ignored if CREATE TABLE ... AS SELECT ...;
# #
...@@ -1056,4 +1064,18 @@ ALTER TABLE t1 DISABLE KEYS; ...@@ -1056,4 +1064,18 @@ ALTER TABLE t1 DISABLE KEYS;
ALTER TABLE t1 ENABLE KEYS; ALTER TABLE t1 ENABLE KEYS;
DROP TABLE t1; DROP TABLE t1;
#
# Bug 17455 Partitions: Wrong message and error when using Repair/Optimize
# table on partitioned table
#
create table t1 (a int)
engine=MEMORY
partition by key (a);
REPAIR TABLE t1;
OPTIMIZE TABLE t1;
drop table t1;
>>>>>>>
--echo End of 5.1 tests --echo End of 5.1 tests
...@@ -1108,8 +1108,7 @@ int ha_partition::handle_opt_partitions(THD *thd, HA_CHECK_OPT *check_opt, ...@@ -1108,8 +1108,7 @@ int ha_partition::handle_opt_partitions(THD *thd, HA_CHECK_OPT *check_opt,
part)); part));
if ((error= handle_opt_part(thd, check_opt, m_file[part], flag))) if ((error= handle_opt_part(thd, check_opt, m_file[part], flag)))
{ {
my_error(ER_GET_ERRNO, MYF(0), error); DBUG_RETURN(error);
DBUG_RETURN(TRUE);
} }
} while (++j < no_subparts); } while (++j < no_subparts);
} }
...@@ -1118,8 +1117,7 @@ int ha_partition::handle_opt_partitions(THD *thd, HA_CHECK_OPT *check_opt, ...@@ -1118,8 +1117,7 @@ int ha_partition::handle_opt_partitions(THD *thd, HA_CHECK_OPT *check_opt,
DBUG_PRINT("info", ("Optimize partition %u", i)); DBUG_PRINT("info", ("Optimize partition %u", i));
if ((error= handle_opt_part(thd, check_opt, m_file[i], flag))) if ((error= handle_opt_part(thd, check_opt, m_file[i], flag)))
{ {
my_error(ER_GET_ERRNO, MYF(0), error); DBUG_RETURN(error);
DBUG_RETURN(TRUE);
} }
} }
} }
......
...@@ -432,18 +432,22 @@ char *partition_info::has_unique_names() ...@@ -432,18 +432,22 @@ char *partition_info::has_unique_names()
bool partition_info::check_engine_mix(handlerton **engine_array, uint no_parts) bool partition_info::check_engine_mix(handlerton **engine_array, uint no_parts)
{ {
uint i= 0; uint i= 0;
bool result= FALSE;
DBUG_ENTER("partition_info::check_engine_mix"); DBUG_ENTER("partition_info::check_engine_mix");
do do
{ {
if (engine_array[i] != engine_array[0]) if (engine_array[i] != engine_array[0])
{ {
result= TRUE; my_error(ER_MIX_HANDLER_ERROR, MYF(0));
break; DBUG_RETURN(TRUE);
} }
} while (++i < no_parts); } while (++i < no_parts);
DBUG_RETURN(result); if (engine_array[0] == &myisammrg_hton)
{
my_error(ER_PARTITION_MERGE_ERROR, MYF(0));
DBUG_RETURN(TRUE);
}
DBUG_RETURN(FALSE);
} }
...@@ -757,10 +761,7 @@ bool partition_info::check_partition_info(handlerton **eng_type, ...@@ -757,10 +761,7 @@ bool partition_info::check_partition_info(handlerton **eng_type,
} while (++i < no_parts); } while (++i < no_parts);
} }
if (unlikely(partition_info::check_engine_mix(engine_array, part_count))) if (unlikely(partition_info::check_engine_mix(engine_array, part_count)))
{
my_error(ER_MIX_HANDLER_ERROR, MYF(0));
goto end; goto end;
}
if (eng_type) if (eng_type)
*eng_type= (handlerton*)engine_array[0]; *eng_type= (handlerton*)engine_array[0];
......
...@@ -5846,3 +5846,6 @@ ER_EVENT_MODIFY_QUEUE_ERROR ...@@ -5846,3 +5846,6 @@ ER_EVENT_MODIFY_QUEUE_ERROR
eng "Internal scheduler error %d" eng "Internal scheduler error %d"
ER_EVENT_SET_VAR_ERROR ER_EVENT_SET_VAR_ERROR
eng "Error during starting/stopping of the scheduler. Error code %u" eng "Error during starting/stopping of the scheduler. Error code %u"
ER_PARTITION_MERGE_ERROR
eng "MyISAM Merge handler cannot be used in partitioned tables"
swe "MyISAM Merge kan inte anndas i en partitionerad tabell"
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment