diff options
author | unknown <sanja@askmonty.org> | 2013-12-04 16:54:33 +0200 |
---|---|---|
committer | unknown <sanja@askmonty.org> | 2013-12-04 16:54:33 +0200 |
commit | b78f721460de41e1a749f78e064f42a8e2953247 (patch) | |
tree | eb8f6f3069ac9115a8b3e641ca4bc72936d04d45 /sql/table.cc | |
parent | 62e959437ee5bf64e89c7b16233ab2ca0fd8507c (diff) | |
download | mariadb-git-b78f721460de41e1a749f78e064f42a8e2953247.tar.gz |
MDEV-5353: server crash on subselect if WHERE applied to some result field
Correct processing of view/derived with no tables added.
Diffstat (limited to 'sql/table.cc')
-rw-r--r-- | sql/table.cc | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/sql/table.cc b/sql/table.cc index 9e1c53f7b22..066eb506835 100644 --- a/sql/table.cc +++ b/sql/table.cc @@ -4487,10 +4487,8 @@ TABLE *TABLE_LIST::get_real_join_table() */ for (TABLE_LIST *t= ti++; t; t= ti++) tbl= t; - /* - It is impossible that the list is empty - so tbl can't be NULL after above loop. - */ + if (!tbl) + return NULL; // view/derived with no tables if (!tbl->nested_join) break; /* go deeper if we've found nested join */ |