diff options
author | unknown <mikael@c-870ae253.1238-1-64736c10.cust.bredbandsbolaget.se> | 2006-05-29 14:51:46 -0400 |
---|---|---|
committer | unknown <mikael@c-870ae253.1238-1-64736c10.cust.bredbandsbolaget.se> | 2006-05-29 14:51:46 -0400 |
commit | 0146929f09969ce4c08556b756273ec4eb508ed7 (patch) | |
tree | b4e6194c26575b2dd46f05720082124ade12f2a0 /storage/archive | |
parent | e05d55de5ff6c95143fb1096da8019ab5fb7c6a2 (diff) | |
download | mariadb-git-0146929f09969ce4c08556b756273ec4eb508ed7.tar.gz |
BUG#17310: Archive error for drop database
mysql-test/r/partition.result:
Added new test case
mysql-test/t/partition.test:
Added new test case
storage/archive/ha_archive.cc:
Moved some code to avoid that ha_archive::create leaves files after error in create
There are still cases where this occurs but now only on file creation errors.
Diffstat (limited to 'storage/archive')
-rw-r--r-- | storage/archive/ha_archive.cc | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/storage/archive/ha_archive.cc b/storage/archive/ha_archive.cc index f3f20f6b103..03710b7c380 100644 --- a/storage/archive/ha_archive.cc +++ b/storage/archive/ha_archive.cc @@ -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); |