diff options
author | Sergei Golubchik <serg@mariadb.org> | 2018-06-21 23:47:39 +0200 |
---|---|---|
committer | Sergei Golubchik <serg@mariadb.org> | 2018-06-21 23:47:39 +0200 |
commit | b942aa34c10ddfa3fe4977ae60afed5cbdc51083 (patch) | |
tree | 0a1a934ca7b728e3ffb81cd2f7c6a858524726d4 /sql/table.cc | |
parent | fe3f9fa9183ea3d10397b6f7f4d422ae9bba00a4 (diff) | |
parent | c09a8b5b36edb494e2bcc93074c06e26cd9f2b92 (diff) | |
download | mariadb-git-b942aa34c10ddfa3fe4977ae60afed5cbdc51083.tar.gz |
Merge branch '10.1' into 10.2
Diffstat (limited to 'sql/table.cc')
-rw-r--r-- | sql/table.cc | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/sql/table.cc b/sql/table.cc index f7aee3eae7d..917d194047c 100644 --- a/sql/table.cc +++ b/sql/table.cc @@ -1795,7 +1795,8 @@ int TABLE_SHARE::init_from_binary_frm_image(THD *thd, bool write, if ((uchar)field_type == (uchar)MYSQL_TYPE_VIRTUAL) { - DBUG_ASSERT(interval_nr); // Expect non-null expression + if (!interval_nr) // Expect non-null expression + goto err; /* MariaDB version 10.0 version. The interval_id byte in the .frm file stores the length of the @@ -5824,6 +5825,8 @@ Item *create_view_field(THD *thd, TABLE_LIST *view, Item **field_ref, Item *item= (new (thd->mem_root) Item_direct_view_ref(thd, context, field_ref, view->alias, name, view)); + if (!item) + return NULL; /* Force creation of nullable item for the result tmp table for outer joined views/derived tables. @@ -8092,7 +8095,15 @@ int TABLE_LIST::fetch_number_of_rows() { int error= 0; if (jtbm_subselect) + { + if (jtbm_subselect->is_jtbm_merged) + { + table->file->stats.records= (ha_rows)jtbm_subselect->jtbm_record_count; + set_if_bigger(table->file->stats.records, 2); + table->used_stat_records= table->file->stats.records; + } return 0; + } if (is_materialized_derived() && !fill_me) { |