summaryrefslogtreecommitdiff
path: root/sql/sql_show.cc
diff options
context:
space:
mode:
Diffstat (limited to 'sql/sql_show.cc')
-rw-r--r--sql/sql_show.cc20
1 files changed, 12 insertions, 8 deletions
diff --git a/sql/sql_show.cc b/sql/sql_show.cc
index 7b2f8922fa0..00972c98dcb 100644
--- a/sql/sql_show.cc
+++ b/sql/sql_show.cc
@@ -8405,25 +8405,29 @@ TABLE *create_schema_table(THD *thd, TABLE_LIST *table_list)
ST_FIELD_INFO *fields= schema_table->fields_info;
bool need_all_fieds= table_list->schema_table_reformed || // SHOW command
thd->lex->only_view_structure(); // need table structure
+ SELECT_LEX *select_lex;
+ bool keep_row_order;
+ TMP_TABLE_PARAM *tmp_table_param;
+ my_bitmap_map *bitmaps;
DBUG_ENTER("create_schema_table");
for (; !fields->end_marker(); fields++)
field_count++;
- TMP_TABLE_PARAM *tmp_table_param = new (thd->mem_root) TMP_TABLE_PARAM;
+ tmp_table_param = new (thd->mem_root) TMP_TABLE_PARAM;
tmp_table_param->init();
tmp_table_param->table_charset= system_charset_info;
- tmp_table_param->field_count= field_count;
+ tmp_table_param->field_count= tmp_table_param->func_count= field_count;
tmp_table_param->schema_table= 1;
- SELECT_LEX *select_lex= table_list->select_lex;
- bool keep_row_order= is_show_command(thd);
+ select_lex= table_list->select_lex;
+ keep_row_order= is_show_command(thd);
if (!(table= create_tmp_table_for_schema(thd, tmp_table_param, *schema_table,
- (select_lex->options | thd->variables.option_bits | TMP_TABLE_ALL_COLUMNS),
+ (select_lex->options | thd->variables.option_bits |
+ TMP_TABLE_ALL_COLUMNS),
table_list->alias, !need_all_fieds, keep_row_order)))
DBUG_RETURN(0);
- my_bitmap_map* bitmaps=
- (my_bitmap_map*) thd->alloc(bitmap_buffer_size(field_count));
- my_bitmap_init(&table->def_read_set, (my_bitmap_map*) bitmaps, field_count);
+ bitmaps= (my_bitmap_map*) thd->alloc(bitmap_buffer_size(field_count));
+ my_bitmap_init(&table->def_read_set, bitmaps, field_count);
table->read_set= &table->def_read_set;
bitmap_clear_all(table->read_set);
table_list->schema_table_param= tmp_table_param;