Division by zero in planner.c:grouping_planner() - Mailing list pgsql-hackers

From Piotr Stefaniak
Subject Division by zero in planner.c:grouping_planner()
Date
Msg-id BLU436-SMTP73C3D863C3D43CA54AAD7AF28C0@phx.gbl
Whole thread Raw
Responses Re: Division by zero in planner.c:grouping_planner()
List pgsql-hackers
Hello,

with the change below, make installcheck fails -- at the updatable_views
step, I believe. Apparently it's the "SELECT * FROM v1 WHERE a=3;" that
triggers this.

diff --git a/src/backend/optimizer/plan/planner.c 
b/src/backend/optimizer/plan/planner.c
index 6ee411e..cbdee7c 100644
--- a/src/backend/optimizer/plan/planner.c
+++ b/src/backend/optimizer/plan/planner.c
@@ -1661,6 +1661,7 @@ grouping_planner(PlannerInfo *root, double 
tuple_fraction)                         * Plain non-grouped, non-aggregated query: an 
absolute tuple                         * fraction can be divided by the number of tuples.                         */
+                       Assert(path_rows != 0);                        if (tuple_fraction >= 1.0)
        tuple_fraction /= path_rows;                }
 



pgsql-hackers by date:

Previous
From: Corey Huinker
Date:
Subject: Re: dblink: add polymorphic functions.
Next
From: Robert Haas
Date:
Subject: Re: Remaining 'needs review' patchs in July commitfest