diff options
author | Marko Mäkelä <marko.makela@mariadb.com> | 2021-03-11 20:09:34 +0200 |
---|---|---|
committer | Marko Mäkelä <marko.makela@mariadb.com> | 2021-03-11 20:09:34 +0200 |
commit | a4b7232b2cfd504057c26f9b40a2dacf064dca73 (patch) | |
tree | 9a33e1d13f7b7b716da89fe41f3ffdd3bf6221ba /sql/sql_show.cc | |
parent | a8650b64ede7330e83e84226cccd77ba8e05fa29 (diff) | |
parent | 1ea6ac3c953f847da033254d5df67f57987a1884 (diff) | |
download | mariadb-git-a4b7232b2cfd504057c26f9b40a2dacf064dca73.tar.gz |
Merge 10.4 into 10.5
Diffstat (limited to 'sql/sql_show.cc')
-rw-r--r-- | sql/sql_show.cc | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/sql/sql_show.cc b/sql/sql_show.cc index b043f83c72c..7acbc73bc3b 100644 --- a/sql/sql_show.cc +++ b/sql/sql_show.cc @@ -8492,14 +8492,19 @@ end: bool optimize_schema_tables_memory_usage(List<TABLE_LIST> &tables) { + DBUG_ENTER("optimize_schema_tables_memory_usage"); + List_iterator<TABLE_LIST> tli(tables); while (TABLE_LIST *table_list= tli++) { + if (!table_list->schema_table) + continue; + TABLE *table= table_list->table; THD *thd=table->in_use; - if (!table_list->schema_table || !thd->fill_information_schema_tables()) + if (!thd->fill_information_schema_tables()) continue; if (!table->is_created()) @@ -8539,6 +8544,7 @@ bool optimize_schema_tables_memory_usage(List<TABLE_LIST> &tables) { /* all fields were optimized away. Force a non-0-length row */ table->s->reclength= to_recinfo->length= 1; + to_recinfo->type= FIELD_NORMAL; to_recinfo++; } p->recinfo= to_recinfo; @@ -8546,10 +8552,10 @@ bool optimize_schema_tables_memory_usage(List<TABLE_LIST> &tables) // TODO switch from Aria to Memory if all blobs were optimized away? if (instantiate_tmp_table(table, p->keyinfo, p->start_recinfo, &p->recinfo, table_list->select_lex->options | thd->variables.option_bits)) - return 1; + DBUG_RETURN(1); } } - return 0; + DBUG_RETURN(0); } |