1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-27 18:02:13 +03:00

merge with mysql-5.5.30 minus few incorrect or not applicable changesets

This commit is contained in:
Sergei Golubchik
2013-02-28 18:42:49 +01:00
178 changed files with 3572 additions and 2050 deletions

View File

@ -739,6 +739,11 @@ send_result_message:
case HA_ADMIN_TRY_ALTER:
{
uint save_flags;
Alter_info *alter_info= &lex->alter_info;
/* Store the original value of alter_info->flags */
save_flags= alter_info->flags;
/*
This is currently used only by InnoDB. ha_innobase::optimize() answers
"try with alter", so here we close the table, do an ALTER TABLE,
@ -746,10 +751,19 @@ send_result_message:
We have to end the row, so analyze could return more rows.
*/
protocol->store(STRING_WITH_LEN("note"), system_charset_info);
protocol->store(STRING_WITH_LEN(
"Table does not support optimize, doing recreate + analyze instead"),
system_charset_info);
if (protocol->write())
if(alter_info->flags & ALTER_ADMIN_PARTITION)
{
protocol->store(STRING_WITH_LEN(
"Table does not support optimize on partitions. All partitions "
"will be rebuilt and analyzed."),system_charset_info);
}
else
{
protocol->store(STRING_WITH_LEN(
"Table does not support optimize, doing recreate + analyze instead"),
system_charset_info);
}
if (protocol->write())
goto err;
DBUG_PRINT("info", ("HA_ADMIN_TRY_ALTER, trying analyze..."));
TABLE_LIST *save_next_local= table->next_local,
@ -768,6 +782,11 @@ send_result_message:
table->mdl_request.ticket= NULL;
DEBUG_SYNC(thd, "ha_admin_open_ltable");
table->mdl_request.set_type(MDL_SHARED_WRITE);
/*
Reset the ALTER_ADMIN_PARTITION bit in alter_info->flags
to force analyze on all partitions.
*/
alter_info->flags &= ~(ALTER_ADMIN_PARTITION);
if ((table->table= open_ltable(thd, table, lock_type, 0)))
{
result_code= table->table->file->ha_analyze(thd, check_opt);
@ -778,6 +797,7 @@ send_result_message:
}
else
result_code= -1; // open failed
alter_info->flags= save_flags;
}
/* Start a new row for the final status row */
protocol->prepare_for_resend();