OSDN Git Service

Silence some compilers
authorKyotaro Horiguchi <horiguchi.kyotaro@lab.ntt.co.jp>
Fri, 8 Mar 2019 04:58:52 +0000 (13:58 +0900)
committerKyotaro Horiguchi <horiguchi.kyotaro@lab.ntt.co.jp>
Fri, 8 Mar 2019 05:05:11 +0000 (14:05 +0900)
Some compilers seem to complain about the previous patch, that
prev_hint_str is used uninitialized. Actually it is not but move the
initialization code out of the PG_TRY() section so that such compilers
would be quiet.

pg_hint_plan.c

index 233385b..5c344fc 100644 (file)
@@ -3087,19 +3087,19 @@ pg_hint_plan_planner(Query *parse, int cursorOptions, ParamListInfo boundParams)
        }
 
        /*
+        * The planner call below may replace current_hint_str. Store and restore
+        * it so that the subsequent planning in the upper level doesn't get
+        * confused.
+        */
+       recurse_level++;
+       prev_hint_str = current_hint_str;
+       
+       /*
         * Use PG_TRY mechanism to recover GUC parameters and current_hint_state to
         * the state when this planner started when error occurred in planner.
         */
        PG_TRY();
        {
-               /*
-                * The planner call below may replace current_hint_str. Store and
-                * restore it so that the subsequent planning in the upper level
-                * doesn't get confused.
-                */
-               recurse_level++;
-               prev_hint_str = current_hint_str;
-
                if (prev_planner)
                        result = (*prev_planner) (parse, cursorOptions, boundParams);
                else