Merge c-3d08e253.1238-1-64736c10.cust.bredbandsbolaget.se:/home/pappa/bug17310

into  c-3d08e253.1238-1-64736c10.cust.bredbandsbolaget.se:/home/pappa/bug18198
parents f1337d3e 7dae459d
......@@ -936,4 +936,16 @@ 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;
create database db99;
use db99;
create table t1 (a int not null)
engine=archive
partition by list (a)
(partition p0 values in (1), partition p1 values in (2));
insert into t1 values (1), (2);
create index inx on t1 (a);
alter table t1 add partition (partition p2 values in (3));
alter table t1 drop partition p2;
use test;
drop database db99;
End of 5.1 tests
......@@ -1077,4 +1077,21 @@ OPTIMIZE TABLE t1;
drop table t1;
#
# Bug 17310 Partitions: Bugs with archived partitioned tables
#
create database db99;
use db99;
create table t1 (a int not null)
engine=archive
partition by list (a)
(partition p0 values in (1), partition p1 values in (2));
insert into t1 values (1), (2);
--error 0, 1005
create index inx on t1 (a);
alter table t1 add partition (partition p2 values in (3));
alter table t1 drop partition p2;
use test;
drop database db99;
--echo End of 5.1 tests
......@@ -701,14 +701,6 @@ int ha_archive::create(const char *name, TABLE *table_arg,
create_info->auto_increment_value -1 :
(ulonglong) 0);
if ((create_file= my_create(fn_format(name_buff,name,"",ARM,
MY_REPLACE_EXT|MY_UNPACK_FILENAME),0,
O_RDWR | O_TRUNC,MYF(MY_WME))) < 0)
{
error= my_errno;
goto error;
}
for (uint key= 0; key < table_arg->s->keys; key++)
{
KEY *pos= table_arg->key_info+key;
......@@ -722,11 +714,20 @@ int ha_archive::create(const char *name, TABLE *table_arg,
if (!(field->flags & AUTO_INCREMENT_FLAG))
{
error= -1;
DBUG_PRINT("info", ("Index error in creating archive table"));
goto error;
}
}
}
if ((create_file= my_create(fn_format(name_buff,name,"",ARM,
MY_REPLACE_EXT|MY_UNPACK_FILENAME),0,
O_RDWR | O_TRUNC,MYF(MY_WME))) < 0)
{
error= my_errno;
goto error;
}
write_meta_file(create_file, 0, auto_increment_value, 0,
(char *)create_info->data_file_name,
FALSE);
......
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