summaryrefslogtreecommitdiff
path: root/storage/maria
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 /storage/maria
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 'storage/maria')
-rw-r--r--storage/maria/ha_maria.cc3
1 files changed, 3 insertions, 0 deletions
diff --git a/storage/maria/ha_maria.cc b/storage/maria/ha_maria.cc
index c0163473f3a..23d2becbb04 100644
--- a/storage/maria/ha_maria.cc
+++ b/storage/maria/ha_maria.cc
@@ -2440,6 +2440,9 @@ int ha_maria::info(uint flag)
MARIA_INFO maria_info;
char name_buff[FN_REFLEN];
+ if (!table)
+ return 0;
+
(void) maria_status(file, &maria_info, flag);
if (flag & HA_STATUS_VARIABLE)
{