summaryrefslogtreecommitdiff
path: root/sql/set_var.cc
diff options
context:
space:
mode:
authorSergei Golubchik <serg@mariadb.org>2020-08-01 13:12:50 +0200
committerSergei Golubchik <serg@mariadb.org>2020-10-23 13:37:26 +0200
commite64084d5a3a72462fa6263d1d0a86e72c0ba0d47 (patch)
tree123beda4bb88dbce9a4f3fe3ab4b659a95caeef6 /sql/set_var.cc
parent6cefe7d31ef43cadb905d71be743462825c7b4ff (diff)
downloadmariadb-git-e64084d5a3a72462fa6263d1d0a86e72c0ba0d47.tar.gz
MDEV-21201 No records produced in information_schema query, depending on projection
Reimplement MDEV-14275 Improving memory utilization for information schema Postpone temp table instantiation until after setup_fields(). Replace all unused (not marked in read_set) columns in an I_S table with CHAR(0). This can drastically reduce the footprint of a MEMORY table (a TABLE_CATALOG alone is 1538 bytes per row). This does not change the engine. If the table was decided to be Aria (because of, say, blobs) then after optimization it'll stay Aria even if all blobs were removed. Note 1: when transforming table structure, share->blob_fields is preserved, otherwise Aria might switch from DYNAMIC to STATIC row format and expect a special field for a deleted mark, which create_tmp_tabe didn't provide. Note 2: optimizer was doing handler::info() (to know the number of rows) before the temp table is populated. That didn't make much sense. Now it's done before the table is even instantiated. Preserve the old behavior and report 0 rows. This reverts e2664ee8362 and a8458a2345e
Diffstat (limited to 'sql/set_var.cc')
-rw-r--r--sql/set_var.cc3
1 files changed, 0 insertions, 3 deletions
diff --git a/sql/set_var.cc b/sql/set_var.cc
index eb2b9234db3..58b6b392449 100644
--- a/sql/set_var.cc
+++ b/sql/set_var.cc
@@ -1068,7 +1068,6 @@ static void store_var(Field *field, sys_var *var, enum_var_type scope,
int fill_sysvars(THD *thd, TABLE_LIST *tables, COND *cond)
{
char name_buffer[NAME_CHAR_LEN];
- enum_check_fields save_count_cuted_fields= thd->count_cuted_fields;
bool res= 1;
CHARSET_INFO *scs= system_charset_info;
StringBuffer<STRING_BUFFER_USUAL_SIZE> strbuf(scs);
@@ -1078,7 +1077,6 @@ int fill_sysvars(THD *thd, TABLE_LIST *tables, COND *cond)
DBUG_ASSERT(tables->table->in_use == thd);
cond= make_cond_for_info_schema(thd, cond, tables);
- thd->count_cuted_fields= CHECK_FIELD_WARN;
mysql_prlock_rdlock(&LOCK_system_variables_hash);
for (uint i= 0; i < system_variable_hash.records; i++)
@@ -1243,7 +1241,6 @@ int fill_sysvars(THD *thd, TABLE_LIST *tables, COND *cond)
res= 0;
end:
mysql_prlock_unlock(&LOCK_system_variables_hash);
- thd->count_cuted_fields= save_count_cuted_fields;
return res;
}