Skip to content
Snippets Groups Projects
Commit 131926a5 authored by Tom Lane's avatar Tom Lane
Browse files

Remove useless check for NULL subexpression.

Coverity rightly gripes that it's silly to have a test here when
the adjacent ExecEvalExpr() would choke on a NULL expression pointer.

Petr Jelinek
parent 302ac7f2
No related branches found
No related tags found
No related merge requests found
...@@ -103,19 +103,13 @@ tablesample_init(SampleScanState *scanstate, TableSampleClause *tablesample) ...@@ -103,19 +103,13 @@ tablesample_init(SampleScanState *scanstate, TableSampleClause *tablesample)
fcinfo.argnull[1] = false; fcinfo.argnull[1] = false;
} }
/* Rest of the arguments come from user. */ /* Rest of the arguments come from user. */
i = 2; i = 2;
foreach(arg, args) foreach(arg, args)
{ {
Expr *argexpr = (Expr *) lfirst(arg); Expr *argexpr = (Expr *) lfirst(arg);
ExprState *argstate = ExecInitExpr(argexpr, (PlanState *) scanstate); ExprState *argstate = ExecInitExpr(argexpr, (PlanState *) scanstate);
if (argstate == NULL)
{
fcinfo.argnull[i] = true;
fcinfo.arg[i] = (Datum) 0;;
}
fcinfo.arg[i] = ExecEvalExpr(argstate, econtext, fcinfo.arg[i] = ExecEvalExpr(argstate, econtext,
&fcinfo.argnull[i], NULL); &fcinfo.argnull[i], NULL);
i++; i++;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment