summaryrefslogtreecommitdiff
path: root/storage/myisam
diff options
context:
space:
mode:
authorSergei Golubchik <serg@mariadb.org>2017-05-20 19:14:06 +0200
committerSergei Golubchik <serg@mariadb.org>2017-05-24 11:59:04 +0200
commitfc89f5fd40d7be54f1d4f7017a8f46f3be9fa902 (patch)
tree4f774c5a5e58d6e45c9be2cf47344abec92b43eb /storage/myisam
parentc65dd3668ba7146afdd1c0222555508c1b4aeecb (diff)
downloadmariadb-git-fc89f5fd40d7be54f1d4f7017a8f46f3be9fa902.tar.gz
MDEV-11335 Changing delay_key_write option for MyISAM table should not copy rows
Don't rebuild the table for ALTER TABLE delay_key_write changes. After that, delay_key_write value in .frm may differ from the value in .MYI. We'll do what .frm says.
Diffstat (limited to 'storage/myisam')
-rw-r--r--storage/myisam/ha_myisam.cc10
1 files changed, 6 insertions, 4 deletions
diff --git a/storage/myisam/ha_myisam.cc b/storage/myisam/ha_myisam.cc
index 4427db79da1..b335d360379 100644
--- a/storage/myisam/ha_myisam.cc
+++ b/storage/myisam/ha_myisam.cc
@@ -825,6 +825,10 @@ int ha_myisam::open(const char *name, int mode, uint test_if_locked)
/* Count statistics of usage for newly open normal files */
if (file->s->reopen == 1 && ! (test_if_locked & HA_OPEN_TMP_TABLE))
{
+ /* use delay_key_write from .frm, not .MYI */
+ file->s->delay_key_write= delay_key_write_options == DELAY_KEY_WRITE_ALL ||
+ (delay_key_write_options == DELAY_KEY_WRITE_ON &&
+ table->s->db_create_options & HA_OPTION_DELAY_KEY_WRITE);
if (file->s->delay_key_write)
feature_files_opened_with_delayed_keys++;
}
@@ -2269,10 +2273,8 @@ bool ha_myisam::check_if_incompatible_data(HA_CREATE_INFO *create_info,
table_changes & IS_EQUAL_PACK_LENGTH) // Not implemented yet
return COMPATIBLE_DATA_NO;
- if ((options & (HA_OPTION_PACK_RECORD | HA_OPTION_CHECKSUM |
- HA_OPTION_DELAY_KEY_WRITE)) !=
- (create_info->table_options & (HA_OPTION_PACK_RECORD | HA_OPTION_CHECKSUM |
- HA_OPTION_DELAY_KEY_WRITE)))
+ if ((options & (HA_OPTION_PACK_RECORD | HA_OPTION_CHECKSUM)) !=
+ (create_info->table_options & (HA_OPTION_PACK_RECORD | HA_OPTION_CHECKSUM)))
return COMPATIBLE_DATA_NO;
return COMPATIBLE_DATA_YES;
}