diff --git a/src/dsql/StmtNodes.cpp b/src/dsql/StmtNodes.cpp index 84008b4c3c5..75f7b8b1257 100644 --- a/src/dsql/StmtNodes.cpp +++ b/src/dsql/StmtNodes.cpp @@ -10971,7 +10971,7 @@ static ReturningClause* dsqlProcessReturning(DsqlCompilerScratch* dsqlScratch, d auto inputFirst = input->first; - if (!inputFirst) + if (inputFirst->items.isEmpty()) { // Process RETURNING * inputFirst = FB_NEW_POOL(pool) ValueListNode(pool, 0u); diff --git a/src/dsql/parse.y b/src/dsql/parse.y index d8c6344d276..58df2a5cf0c 100644 --- a/src/dsql/parse.y +++ b/src/dsql/parse.y @@ -6042,7 +6042,7 @@ query_spec rse->dsqlFirst = $2 ? $2->items[1] : NULL; rse->dsqlSkip = $2 ? $2->items[0] : NULL; rse->dsqlDistinct = $3; - rse->dsqlSelectList = $4; + rse->dsqlSelectList = $4->items.hasData() ? $4 : nullptr; rse->dsqlFrom = $5; rse->dsqlWhere = $6; rse->dsqlGroup = $7; @@ -6077,14 +6077,14 @@ skip_clause %type distinct_clause distinct_clause - : DISTINCT { $$ = newNode(0); } + : DISTINCT { $$ = newNode(0u); } | all_noise { $$ = NULL; } ; %type select_list select_list : select_items { $$ = $1; } - | '*' { $$ = NULL; } + | '*' { $$ = newNode(0u); } ; %type select_items