Commit 5709a777 authored by Marko Mäkelä's avatar Marko Mäkelä

MDEV-19956: Do not dereference an uninitialized pointer

LEX::parsed_select_expr_cont(): Replace a condition with an
assertion DBUG_ASSERT(!s2->next_select()), and always
initialize sel1=s2, because all subsequent code paths will
assign to sel1->first_nested.

This was flagged by GCC reporting -Wmaybe-uninitialized
for the statement last->link_neighbour(sel1).
parent eb0a10b0
......@@ -9114,9 +9114,8 @@ SELECT_LEX_UNIT *LEX::parsed_select_expr_cont(SELECT_LEX_UNIT *unit,
enum sub_select_type unit_type,
bool distinct, bool oracle)
{
SELECT_LEX *sel1;
if (!s2->next_select())
sel1= s2;
DBUG_ASSERT(!s2->next_select());
SELECT_LEX *sel1= s2;
SELECT_LEX *last= unit->pre_last_parse->next_select();
int cmp= oracle? 0 : cmp_unit_op(unit_type, last->get_linkage());
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment