mirror of
https://github.com/MariaDB/server.git
synced 2025-12-04 17:23:46 +03:00
#4476 more HCAD progress on 5.6 refs[t:4476]
git-svn-id: file:///svn/mysql/tokudb-engine/tokudb-engine@43893 c7de825b-a66e-492c-adef-691d508d4ae1
This commit is contained in:
committed by
Yoni Fogel
parent
570256806a
commit
f7f060bbf9
@@ -398,23 +398,6 @@ static int poll_fun(void *extra, float progress) {
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
struct hot_poll_fun_extra {
|
|
||||||
uint current_table;
|
|
||||||
uint num_tables;
|
|
||||||
};
|
|
||||||
|
|
||||||
static int hot_poll_fun(void *extra, float progress) {
|
|
||||||
HOT_OPTIMIZE_CONTEXT context = (HOT_OPTIMIZE_CONTEXT)extra;
|
|
||||||
if (context->thd->killed) {
|
|
||||||
sprintf(context->write_status_msg, "The process has been killed, aborting hot optimize.");
|
|
||||||
return ER_ABORTING_CONNECTION;
|
|
||||||
}
|
|
||||||
sprintf(context->write_status_msg, "Optimization of index %u of %u about %.lf%% done", context->current_table + 1, context->num_tables, progress*100);
|
|
||||||
thd_proc_info(context->thd, context->write_status_msg);
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
static void loader_ai_err_fun(DB *db, int i, int err, DBT *key, DBT *val, void *error_extra) {
|
static void loader_ai_err_fun(DB *db, int i, int err, DBT *key, DBT *val, void *error_extra) {
|
||||||
LOADER_CONTEXT context = (LOADER_CONTEXT)error_extra;
|
LOADER_CONTEXT context = (LOADER_CONTEXT)error_extra;
|
||||||
assert(context->ha);
|
assert(context->ha);
|
||||||
|
|||||||
@@ -44,6 +44,22 @@ int ha_tokudb::analyze(THD * thd, HA_CHECK_OPT * check_opt) {
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
struct hot_poll_fun_extra {
|
||||||
|
uint current_table;
|
||||||
|
uint num_tables;
|
||||||
|
};
|
||||||
|
|
||||||
|
static int hot_poll_fun(void *extra, float progress) {
|
||||||
|
HOT_OPTIMIZE_CONTEXT context = (HOT_OPTIMIZE_CONTEXT)extra;
|
||||||
|
if (context->thd->killed) {
|
||||||
|
sprintf(context->write_status_msg, "The process has been killed, aborting hot optimize.");
|
||||||
|
return ER_ABORTING_CONNECTION;
|
||||||
|
}
|
||||||
|
sprintf(context->write_status_msg, "Optimization of index %u of %u about %.lf%% done", context->current_table + 1, context->num_tables, progress*100);
|
||||||
|
thd_proc_info(context->thd, context->write_status_msg);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
volatile int ha_tokudb_optimize_wait = 0; // debug
|
volatile int ha_tokudb_optimize_wait = 0; // debug
|
||||||
|
|
||||||
// flatten all DB's in this table, to do so, just do a full scan on every DB
|
// flatten all DB's in this table, to do so, just do a full scan on every DB
|
||||||
|
|||||||
@@ -1161,7 +1161,7 @@ cleanup:
|
|||||||
|
|
||||||
static bool
|
static bool
|
||||||
column_rename_supported(
|
column_rename_supported(
|
||||||
Alter_info* alter_info,
|
Alter_inplace_info *ha_alter_info,
|
||||||
TABLE* orig_table,
|
TABLE* orig_table,
|
||||||
TABLE* new_table
|
TABLE* new_table
|
||||||
)
|
)
|
||||||
@@ -1174,12 +1174,10 @@ column_rename_supported(
|
|||||||
retval = false;
|
retval = false;
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
}
|
}
|
||||||
#if 0 // TODO
|
if (ha_alter_info->handler_flags & Alter_inplace_info::ALTER_COLUMN_ORDER) {
|
||||||
if (alter_info->contains_first_or_after) {
|
|
||||||
retval = false;
|
retval = false;
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
for (uint i = 0; i < orig_table->s->fields; i++) {
|
for (uint i = 0; i < orig_table->s->fields; i++) {
|
||||||
Field* orig_field = orig_table->field[i];
|
Field* orig_field = orig_table->field[i];
|
||||||
Field* new_field = new_table->field[i];
|
Field* new_field = new_table->field[i];
|
||||||
@@ -1311,7 +1309,7 @@ ha_tokudb::check_if_supported_inplace_alter(TABLE *altered_table, Alter_inplace_
|
|||||||
// now need to verify that one and only one column
|
// now need to verify that one and only one column
|
||||||
// has changed only its name. If we find anything to
|
// has changed only its name. If we find anything to
|
||||||
// the contrary, we don't allow it, also check indexes
|
// the contrary, we don't allow it, also check indexes
|
||||||
bool cr_supported = column_rename_supported(ha_alter_info->alter_info, table, altered_table);
|
bool cr_supported = column_rename_supported(ha_alter_info, table, altered_table);
|
||||||
if (cr_supported)
|
if (cr_supported)
|
||||||
result = HA_ALTER_INPLACE_NO_LOCK;
|
result = HA_ALTER_INPLACE_NO_LOCK;
|
||||||
}
|
}
|
||||||
@@ -1332,7 +1330,8 @@ ha_tokudb::check_if_supported_inplace_alter(TABLE *altered_table, Alter_inplace_
|
|||||||
result = HA_ALTER_INPLACE_EXCLUSIVE_LOCK;;
|
result = HA_ALTER_INPLACE_EXCLUSIVE_LOCK;;
|
||||||
} else
|
} else
|
||||||
// add column
|
// add column
|
||||||
if (ha_alter_info->handler_flags == Alter_inplace_info::ADD_COLUMN) {
|
if (ha_alter_info->handler_flags == Alter_inplace_info::ADD_COLUMN ||
|
||||||
|
ha_alter_info->handler_flags == Alter_inplace_info::ADD_COLUMN + Alter_inplace_info::ALTER_COLUMN_ORDER) {
|
||||||
u_int32_t added_columns[altered_table->s->fields];
|
u_int32_t added_columns[altered_table->s->fields];
|
||||||
u_int32_t num_added_columns = 0;
|
u_int32_t num_added_columns = 0;
|
||||||
int r = find_changed_columns(added_columns, &num_added_columns, table, altered_table);
|
int r = find_changed_columns(added_columns, &num_added_columns, table, altered_table);
|
||||||
@@ -1348,7 +1347,8 @@ ha_tokudb::check_if_supported_inplace_alter(TABLE *altered_table, Alter_inplace_
|
|||||||
}
|
}
|
||||||
} else
|
} else
|
||||||
// drop column
|
// drop column
|
||||||
if (ha_alter_info->handler_flags == Alter_inplace_info::DROP_COLUMN) {
|
if (ha_alter_info->handler_flags == Alter_inplace_info::DROP_COLUMN ||
|
||||||
|
ha_alter_info->handler_flags == Alter_inplace_info::DROP_COLUMN + Alter_inplace_info::ALTER_COLUMN_ORDER) {
|
||||||
u_int32_t dropped_columns[table->s->fields];
|
u_int32_t dropped_columns[table->s->fields];
|
||||||
u_int32_t num_dropped_columns = 0;
|
u_int32_t num_dropped_columns = 0;
|
||||||
int r = find_changed_columns(dropped_columns, &num_dropped_columns, altered_table, table);
|
int r = find_changed_columns(dropped_columns, &num_dropped_columns, altered_table, table);
|
||||||
@@ -1395,8 +1395,8 @@ ha_tokudb::inplace_alter_table(TABLE *altered_table, Alter_inplace_info *ha_alte
|
|||||||
ha_alter_info->handler_flags == Alter_inplace_info::DROP_UNIQUE_INDEX) {
|
ha_alter_info->handler_flags == Alter_inplace_info::DROP_UNIQUE_INDEX) {
|
||||||
error = alter_table_drop_index(altered_table, ha_alter_info);
|
error = alter_table_drop_index(altered_table, ha_alter_info);
|
||||||
} else
|
} else
|
||||||
if (ha_alter_info->handler_flags == Alter_inplace_info::ADD_COLUMN ||
|
if (ha_alter_info->handler_flags & Alter_inplace_info::ADD_COLUMN ||
|
||||||
ha_alter_info->handler_flags == Alter_inplace_info::DROP_COLUMN) {
|
ha_alter_info->handler_flags & Alter_inplace_info::DROP_COLUMN) {
|
||||||
error = alter_table_add_or_drop_column(altered_table, ha_alter_info);
|
error = alter_table_add_or_drop_column(altered_table, ha_alter_info);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -51,8 +51,8 @@ void get_var_field_info(
|
|||||||
}
|
}
|
||||||
|
|
||||||
*start_offset = data_start_offset;
|
*start_offset = data_start_offset;
|
||||||
|
assert(data_end_offset >= data_start_offset);
|
||||||
*field_len = data_end_offset - data_start_offset;
|
*field_len = data_end_offset - data_start_offset;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void get_blob_field_info(
|
void get_blob_field_info(
|
||||||
|
|||||||
Reference in New Issue
Block a user