diff options
author | Igor Babaev <igor@askmonty.org> | 2018-07-15 18:40:25 -0700 |
---|---|---|
committer | Igor Babaev <igor@askmonty.org> | 2018-07-15 18:40:25 -0700 |
commit | b75d819604bbb6c461e6363e331bd6bd1ba7a787 (patch) | |
tree | 300a1f237cf381270569f0d9697c759e11979f3d /sql/field.cc | |
parent | ae0eb507bda858a13475faef4476dd496c4dbc01 (diff) | |
download | mariadb-git-b75d819604bbb6c461e6363e331bd6bd1ba7a787.tar.gz |
MDEV-16711 Crash in Field_blob::store() while reading statistics
for the small InnoDB table
This bug was introduced by the patch 6c414fcf89510215d6d3466eb9992d444eadae89.
The patch has not taken into account that some objects of the Field_* types
are created only for TABLE_SHARE and the field 'table' is set to NULL
for them. In particular such are objects created to store statistical
min/max values for columns.
Diffstat (limited to 'sql/field.cc')
-rw-r--r-- | sql/field.cc | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/sql/field.cc b/sql/field.cc index 64c51677c0f..71fc5684d92 100644 --- a/sql/field.cc +++ b/sql/field.cc @@ -7942,7 +7942,13 @@ int Field_blob::store(const char *from,uint length,CHARSET_INFO *cs) return 0; } - if (table->blob_storage) // GROUP_CONCAT with ORDER BY | DISTINCT + /* + For min/max fields of statistical data 'table' is set to NULL. + It could not be otherwise as this data is shared by many instances + of the same base table. + */ + + if (table && table->blob_storage) // GROUP_CONCAT with ORDER BY | DISTINCT { DBUG_ASSERT(!f_is_hex_escape(flags)); DBUG_ASSERT(field_charset == cs); |