1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-30 16:24:05 +03:00

MDEV-9226 SHOW COLUMNS returns wrong column order for tables with large ENUMs

set keep_row_order=true for temporary tables that
hold results of the SHOW command
This commit is contained in:
Sergei Golubchik
2015-12-07 20:25:27 +01:00
parent f18599a129
commit 8fd24b418d
3 changed files with 156 additions and 2 deletions

View File

@ -7371,11 +7371,12 @@ TABLE *create_schema_table(THD *thd, TABLE_LIST *table_list)
tmp_table_param->field_count= field_count;
tmp_table_param->schema_table= 1;
SELECT_LEX *select_lex= thd->lex->current_select;
bool keep_row_order= sql_command_flags[thd->lex->sql_command] & CF_STATUS_COMMAND;
if (!(table= create_tmp_table(thd, tmp_table_param,
field_list, (ORDER*) 0, 0, 0,
(select_lex->options | thd->variables.option_bits |
TMP_TABLE_ALL_COLUMNS),
HA_POS_ERROR, table_list->alias)))
TMP_TABLE_ALL_COLUMNS), HA_POS_ERROR,
table_list->alias, false, keep_row_order)))
DBUG_RETURN(0);
my_bitmap_map* bitmaps=
(my_bitmap_map*) thd->alloc(bitmap_buffer_size(field_count));