summaryrefslogtreecommitdiff
path: root/sql/sql_select.cc
diff options
context:
space:
mode:
authorAlexander Barkov <bar@mariadb.org>2017-08-07 21:35:34 +0400
committerAlexander Barkov <bar@mariadb.org>2017-08-07 21:35:34 +0400
commit988a9daa945ce86737397e65757a85213abbb206 (patch)
tree4e21eec3dee2d7b87bdd3d6cc00988e98eba59f1 /sql/sql_select.cc
parent0f1cadd9a5e6e8aa2103100502b0a5b4227e8d7b (diff)
parent30c36b2c150d6bf52e56abfbef755119fbc773f9 (diff)
downloadmariadb-git-988a9daa945ce86737397e65757a85213abbb206.tar.gz
Merge remote-tracking branch 'origin/10.2' into bb-10.2-ext
Conflicts: mysql-test/r/func_json.result mysql-test/r/win.result mysql-test/t/func_json.test mysql-test/t/win.test sql/share/errmsg-utf8.txt storage/rocksdb/ha_rocksdb.cc storage/rocksdb/mysql-test/rocksdb/r/tbl_opt_data_index_dir.result
Diffstat (limited to 'sql/sql_select.cc')
-rw-r--r--sql/sql_select.cc8
1 files changed, 6 insertions, 2 deletions
diff --git a/sql/sql_select.cc b/sql/sql_select.cc
index 210d0bbba9a..f8aa520932b 100644
--- a/sql/sql_select.cc
+++ b/sql/sql_select.cc
@@ -8634,7 +8634,7 @@ JOIN_TAB *first_top_level_tab(JOIN *join, enum enum_with_const_tables const_tbls
JOIN_TAB *tab= join->join_tab;
if (const_tbls == WITHOUT_CONST_TABLES)
{
- if (join->const_tables == join->table_count)
+ if (join->const_tables == join->table_count || !tab)
return NULL;
tab += join->const_tables;
}
@@ -8657,6 +8657,10 @@ JOIN_TAB *first_linear_tab(JOIN *join,
enum enum_with_const_tables const_tbls)
{
JOIN_TAB *first= join->join_tab;
+
+ if (!first)
+ return NULL;
+
if (const_tbls == WITHOUT_CONST_TABLES)
first+= join->const_tables;
@@ -8743,7 +8747,7 @@ JOIN_TAB *first_depth_first_tab(JOIN* join)
{
JOIN_TAB* tab;
/* This means we're starting the enumeration */
- if (join->const_tables == join->top_join_tab_count)
+ if (join->const_tables == join->top_join_tab_count || !join->join_tab)
return NULL;
tab= join->join_tab + join->const_tables;