Remove useless check for NULL subexpression.
authorTom Lane <[email protected]>
Tue, 30 Jun 2015 16:53:54 +0000 (12:53 -0400)
committerTom Lane <[email protected]>
Tue, 30 Jun 2015 16:53:54 +0000 (12:53 -0400)
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

src/backend/access/tablesample/tablesample.c

index 44a24340f6b2d925e6cfbc9e54114f2d44ecb579..f21d42c8e38ca04b82579967f54c613fd84290ee 100644 (file)
@@ -103,19 +103,13 @@ tablesample_init(SampleScanState *scanstate, TableSampleClause *tablesample)
        fcinfo.argnull[1] = false;
    }
 
-   /* Rest of the arguments come from user.  */
+   /* Rest of the arguments come from user. */
    i = 2;
    foreach(arg, args)
    {
        Expr       *argexpr = (Expr *) lfirst(arg);
        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.argnull[i], NULL);
        i++;