Commit 2d9fc138 authored by unknown's avatar unknown
Browse files

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 c43f0664 0146929f
Loading
Loading
Loading
Loading
+12 −0
Original line number Diff line number Diff line
@@ -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
+17 −0
Original line number Diff line number Diff line
@@ -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
+9 −8
Original line number Diff line number Diff line
@@ -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);