]> granicus.if.org Git - postgresql/commitdiff
Try and silence spurious Coverity warning.
authorAndrew Gierth <rhodiumtoad@postgresql.org>
Mon, 3 Apr 2017 22:30:24 +0000 (23:30 +0100)
committerAndrew Gierth <rhodiumtoad@postgresql.org>
Mon, 3 Apr 2017 22:30:24 +0000 (23:30 +0100)
gset_data (aka gd) in planner.c is always non-null if and only if
parse->groupingSets is non-null, but Coverity doesn't know that and
complains.  Feed it an assertion to see if that keeps it happy.

src/backend/optimizer/plan/planner.c

index f99257b59939bc1c23eaa0423a869e7562eff028..9d1a98220a7fce62bae6101cb845d05bf2602956 100644 (file)
@@ -3362,6 +3362,8 @@ get_number_of_groups(PlannerInfo *root,
                        ListCell   *lc;
                        ListCell   *lc2;
 
+                       Assert(gd);  /* keep Coverity happy */
+
                        dNumGroups = 0;
 
                        foreach(lc, gd->rollups)