summaryrefslogtreecommitdiff
path: root/sql/table.cc
diff options
context:
space:
mode:
authorVicențiu Ciorbaru <vicentiu@mariadb.org>2018-06-12 18:55:27 +0300
committerVicențiu Ciorbaru <vicentiu@mariadb.org>2018-06-12 18:55:27 +0300
commitaa59ecec89d89a29f7272352471a4064aa6db28c (patch)
treea8b2b53ce4913adc27291105fbbe5389333607eb /sql/table.cc
parent7bbe324fc17d9734833f717921629c36d1d0c996 (diff)
parent170bec36c0da1fb0269a063094a546022ed0888f (diff)
downloadmariadb-git-aa59ecec89d89a29f7272352471a4064aa6db28c.tar.gz
Merge branch '10.0' into 10.1
Diffstat (limited to 'sql/table.cc')
-rw-r--r--sql/table.cc10
1 files changed, 10 insertions, 0 deletions
diff --git a/sql/table.cc b/sql/table.cc
index d053e9b5670..f6a27b1b1b3 100644
--- a/sql/table.cc
+++ b/sql/table.cc
@@ -5426,6 +5426,8 @@ Item *create_view_field(THD *thd, TABLE_LIST *view, Item **field_ref,
Item_direct_view_ref(thd, &view->view->select_lex.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.
@@ -7356,7 +7358,15 @@ int TABLE_LIST::fetch_number_of_rows()
{
int error= 0;
if (jtbm_subselect)
+ {
+ if (jtbm_subselect->is_jtbm_merged)
+ {
+ table->file->stats.records= 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)
{