From 5ef0ce4131c9e5ebd2e09907a6a89b6c9d6c5afe Mon Sep 17 00:00:00 2001 From: Sergei Golubchik Date: Tue, 3 May 2016 13:07:05 +0200 Subject: [PATCH] comments --- sql/handler.h | 4 ++-- sql/sql_admin.cc | 8 +++----- 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/sql/handler.h b/sql/handler.h index 4f30ec6d7ec..92a4e81ddcc 100644 --- a/sql/handler.h +++ b/sql/handler.h @@ -129,7 +129,7 @@ enum enum_alter_inplace_result { */ #define HA_PRIMARY_KEY_REQUIRED_FOR_POSITION (1ULL << 16) #define HA_CAN_RTREEKEYS (1ULL << 17) -#define HA_NOT_DELETE_WITH_CACHE (1ULL << 18) +#define HA_NOT_DELETE_WITH_CACHE (1ULL << 18) /* unused */ /* The following is we need to a primary key to delete (and update) a row. If there is no primary key, all columns needs to be read on update and delete @@ -143,7 +143,7 @@ enum enum_alter_inplace_result { #define HA_HAS_OLD_CHECKSUM (1ULL << 24) /* Table data are stored in separate files (for lower_case_table_names) */ #define HA_FILE_BASED (1ULL << 26) -#define HA_NO_VARCHAR (1ULL << 27) +#define HA_NO_VARCHAR (1ULL << 27) /* unused */ #define HA_CAN_BIT_FIELD (1ULL << 28) /* supports bit fields */ #define HA_NEED_READ_RANGE_BUFFER (1ULL << 29) /* for read_multi_range */ #define HA_ANY_INDEX_MAY_BE_UNIQUE (1ULL << 30) diff --git a/sql/sql_admin.cc b/sql/sql_admin.cc index f27cdcc41f2..73f483bbe90 100644 --- a/sql/sql_admin.cc +++ b/sql/sql_admin.cc @@ -622,16 +622,14 @@ static bool mysql_admin_table(THD* thd, TABLE_LIST* tables, /* Close all instances of the table to allow MyISAM "repair" - to rename files. + (which is internally also used from "optimize") to rename files. @todo: This code does not close all instances of the table. It only closes instances in other connections, but if this connection has LOCK TABLE t1 a READ, t1 b WRITE, both t1 instances will be kept open. There is no need to execute this branch for InnoDB, which does - repair by recreate. There is no need to do it for OPTIMIZE, - which doesn't move files around. - Hence, this code should be moved to prepare_for_repair(), - and executed only for MyISAM engine. + repair by recreate. + Hence, this code should be executed only for MyISAM engine. */ if (lock_type == TL_WRITE && !table->table->s->tmp_table) {