summaryrefslogtreecommitdiff
path: root/sql/sql_show.cc
diff options
context:
space:
mode:
authorMarko Mäkelä <marko.makela@mariadb.com>2023-03-06 13:37:12 +0200
committerMarko Mäkelä <marko.makela@mariadb.com>2023-03-06 13:37:12 +0200
commit669a0c6efb89cd5df4eb117c9c44694a9fbeb52c (patch)
tree93af8832773ce9f91db2c961bb2d2f4d49d3b027 /sql/sql_show.cc
parent550b8d76b3be360b1c7984a2531e094cd4c37f8c (diff)
parent25c048066a9557d1aa506220316c6fa57be5da91 (diff)
downloadmariadb-git-669a0c6efb89cd5df4eb117c9c44694a9fbeb52c.tar.gz
Merge 10.6 into 10.8
Diffstat (limited to 'sql/sql_show.cc')
-rw-r--r--sql/sql_show.cc23
1 files changed, 15 insertions, 8 deletions
diff --git a/sql/sql_show.cc b/sql/sql_show.cc
index 87cd0889df9..ccc4438c39c 100644
--- a/sql/sql_show.cc
+++ b/sql/sql_show.cc
@@ -8239,27 +8239,34 @@ TABLE *create_schema_table(THD *thd, TABLE_LIST *table_list)
TABLE *table;
ST_SCHEMA_TABLE *schema_table= table_list->schema_table;
ST_FIELD_INFO *fields= schema_table->fields_info;
- bool need_all_fieds= table_list->schema_table_reformed || // SHOW command
+ bool need_all_fields= table_list->schema_table_reformed || // SHOW command
thd->lex->only_view_structure(); // need table structure
+ bool keep_row_order;
+ TMP_TABLE_PARAM *tmp_table_param;
+ SELECT_LEX *select_lex;
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->schema_table= 1;
- SELECT_LEX *select_lex= table_list->select_lex;
- bool 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),
- table_list->alias, !need_all_fieds, keep_row_order)))
+ 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),
+ table_list->alias, !need_all_fields,
+ 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);
+ 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;