• R/O
  • HTTP
  • SSH
  • HTTPS

pg_hint_plan: Commit

firtst release


Commit MetaInfo

Revisionbeb606750700a71618beee99a8cb65e9d81fab51 (tree)
Time2017-02-13 17:01:49
AuthorKyotaro Horiguchi <horiguchi.kyotaro@lab....>
CommiterKyotaro Horiguchi

Log Message

Don't set_plain_rel_pathlist for other than RTE_RELATION.

pg_hint_plan_set_rel_pathlist can call set_plain_rel_pathlist for
relations other than RTE_RELATION and this results in a crash.

Change Summary

Incremental Difference

--- a/pg_hint_plan.c
+++ b/pg_hint_plan.c
@@ -4348,8 +4348,9 @@ pg_hint_plan_set_rel_pathlist(PlannerInfo * root, RelOptInfo *rel,
43484348 if (!setup_hint_enforcement(root, rel))
43494349 {
43504350 /*
4351- * No enforcement requested, but we might have to generate gather
4352- * path on this relation
4351+ * No enforcement requested, but we might have to generate gather path
4352+ * on this relation. We could regenerate gather for relations not
4353+ * getting enforcement or even relations other than ordinary ones.
43534354 */
43544355
43554356 /* If no need of a gather path, just return */
@@ -4373,6 +4374,10 @@ pg_hint_plan_set_rel_pathlist(PlannerInfo * root, RelOptInfo *rel,
43734374 return;
43744375 }
43754376
4377+ /* Don't touch other than ordinary relation hereafter */
4378+ if (rte->rtekind != RTE_RELATION)
4379+ return;
4380+
43764381 /* Here, we regenerate paths with the current hint restriction */
43774382
43784383 /* Remove prviously generated paths */
Show on old repository browser