• R/O
  • HTTP
  • SSH

pg_hint_plan: List of commits

firtst release

Rev. Time Author
4e63a22 PG95 2020-02-17 21:08:43 Kyotaro Horiguchi

Restore current hint state when returned from non-hinted query planning.

If no hint is given for the current level query, pg_hint_plan_planner
calls the next level of planner after erasing the
current_hint_state. But it forgot to restore the state before the
planning of the rest part of the current-level query. It is broken by
the commit 958c60d but overlooked among vast amount of behavioral
changes.. Get back the behavior by restoring current_hint_state after
returned from the lower level planner with unhinted query.

Issue: https://github.com/ossc-db/pg_hint_plan/issues/30
Reported-by: higuchi-daisuke

52d9acd 2020-02-17 14:55:03 Kyotaro Horiguchi

Fix Rows hint parsing

This is a long standing bug that Rows hint with no parameter causees a
crash. Fixed the Rows hint parser.

ceb5af4 2020-02-14 15:43:50 Kyotaro Horiguchi

Fix crash bug caused by plancache invalidation


After plancache is invalidated then revaliated, get_query_string
accesses query_list of invalid plansource then crash. Ignore invalid
plancache and get the correct hint string and Query node at the next
planning time during revalidation.

On the way fixing this, a bug related to planner reentrance is
fixed. That fix causes behavioral change for nested
planning. Previously outer-level hint (wrongly) overrides inner-level
query but currenlty outer-level hint no longer affects inner-level

99aece7 2020-02-13 20:01:47 LittleWuCoding

Fix compiling error on Solaris

The 'LDFLAGS+=-Wl,--build-id' option is for rpm building in Linux like
OS. The SunOS is not native support the option
'LDFLAGS+=-Wl,--build-id' . So, we disable this option in SunOS while

Committed a bit tweaked version from the orignal.

fc1926d 2020-02-13 19:39:37 Kyotaro Horiguchi

Stabilize regression test and catching-up to the core.

Further unstability is found about stats reset. Inserted more 1 second
sleeps to stabilize it. Some planner fix (maybe 72a626e688) seems to
have changed its behvavior. The commit 041ad9a66d changes the result
of A-8-4-10 in ut-A. The commit 88275ac199, which changed the category
of client_min_messages, affected ut-A's result. Follow the changes.

Most of this fix is comes from the pull request
https://github.com/ossc-db/pg_hint_plan/pull/28 by Dagouhan (smoon

53c74fb 2020-02-13 14:51:51 Kyotaro Horiguchi

Do null-check of error_context_stack before use

The variable is accessed without null checking when planner is called
in the context of pl/pgsql. Fix it. Back-patched up to pg_hint_plan94.

Reporter: egashira-yusuke
Issue: https://github.com/ossc-db/pg_hint_plan/issues/42
Original-Author: sun-wei <30999182+Dagouhan@users.noreply.github.com>
Original-patch: https://github.com/ossc-db/pg_hint_plan/pull/45/commits/8fe092ef73a9af6cfb41e20717d7cb35aa74fce2

a912bba 2019-08-29 16:57:04 LittleWuCoding

fix spelling mistakes in file pg_hint_plan.html

92b3545 REL95_1_1_8 2019-01-17 16:41:33 Kyotaro Horiguchi

Change version to 1.1.8

Version bumped to 1.1.8. SPEC file is updated.

dbbc864 2019-01-17 16:41:33 Kyotaro Horiguchi

Fix reverse link of hint_list.html

pg_hint_plan.html and hint_list.html pointed to the Japanese version
of main document. Fixed it.

4b0dd9c 2019-01-17 15:22:39 Kyotaro Horiguchi

Fix documentation

Fix wrong or stale descriptions in documentation and fix style.

8754e19 2019-01-17 14:16:50 Kyotaro Horiguchi

Do make install for rpmbuild

Use make install to build in prmbuild directory instaed of using
install command to individual file to reduce maintenance labor.

6a19ed7 2019-01-17 14:16:50 Kyotaro Horiguchi

Include all pg_hint_plan--*.sql files in installation

Glob installation/upgrade SQL scripts instead of spcifying
individually to reduce maintenance labor.

c9e7416 2019-01-17 14:16:50 Kyotaro Horiguchi

Change copyright year to 2019

With some minor fixes in the document.

29972b1 2019-01-09 09:56:21 Kyotaro Horiguchi

Call standrad_ProcessUtility when no hook is set

The last commit 6973627 forgot the case of no previous hook function
in the ProcessUtility hook function. Fix it.

6973627 2019-01-07 19:07:39 Kyotaro Horiguchi

Support prepared statements on extended protocol

However pg_hint_plan doesn't fully consider the extended protocol,
commit 64ab47b accidentially broke the case where an analyzed prepared
statement is executed on extended protocol. This patch fixes that only
for the hints-in-comment case. Hint-table still doesn't work in the
case since query-normalization needs Query, which is not available in

f1f3627 2019-01-07 19:07:39 Kyotaro Horiguchi

Remove an useless variable

commit 64ab47b made the variable stmt_name useless. Remove it.

37f3c8c 2018-12-05 17:32:29 Kyotaro Horiguchi

Fix for union-on-inheritance case

setup_hint_enforcement may pick up a wrong hint when multiple
subqueries access inheritance tables. This leads to failure to apply
hints on other than the first subquery.

72333a3 2018-12-05 17:32:21 Kyotaro Horiguchi

Don't reset plpgsql nest level at every command end

Clean up code for global exit is forgetting about loops that run
hinted commands multiple times. This leads to pg_hint_plan's failure
to affect after the first execution of the inner commands.
The hint below worked only for the first time.

FOR outer IN EXECUTE 'outer-command' LOOP
FOR inner IN EXECUTE '/*+ hint */ inner-command' LOOP

9e354ac REL95_1_1_7 2018-11-13 16:54:21 Kyotaro Horiguchi

Changed version to 1.1.7

Previously parse_messages and message_level were binded to the same
internal variable. Separate the two GUCs. On the way doing this some
mssages that did not honor the variable were fixed. Default behavior
is not changed but the the two variables works differently from the
previous version, perhaps closer to expected.

2ac79df 2018-11-13 16:54:21 Kyotaro Horiguchi

Fix debug output level control

Previously parse_messages and message_level were binded to the same
internal variable. Separate the two GUCs. On the way doing this some
mssages that did not honor the variable were fixed. Default behavior
is not changed but the the two variables works differently from the
previous version, perhaps closer to expected.

fd64e6b REL95_1_1_6 2018-06-08 14:12:56 Kyotaro Horiguchi

Change version to 1.1.6.

1.1.5 has a crash bug in Describe message of extended protocol
path. If server receives the message after invalidation of
corresponding query cache, pg_hint_plan crashes.

On the way fixing it, this version took in the following commit of

80e12a6218 Change more places to be less trusting of RestrictInfo.is_pushed_down.

066f064 2018-06-08 14:12:56 Kyotaro Horiguchi

Took in core improvement.

Took in the following commit of core.

80e12a6218 Change more places to be less trusting of RestrictInfo.is_pushed_down.

Fixed typos and removed useless include on the way.

5c6296e 2018-06-08 10:02:10 Kyotaro Horiguchi

Fix a crash bug in case debug_query_string is NULL

pg_hint_plan believed that debug_query_string cannot be null when
parse_analyze is called, but for example in the case under
exec_describe_statement_message, it is not. We see the query string in
pstate even in the case, so use it instead in the case. Since pstate
is storing the query of the lowermost level, we should use
debug_query_string in other cases.

6ea8db1 2017-11-06 15:10:46 Kyotaro Horiguchi

Added and removed some entries in .gitignore

Removed core.c, that is not appropriate.
Added .deps and RPMS.

9d13568 2017-11-06 14:01:27 Kyotaro Horiguchi

Use pg_strcasecmp instead of strcasecmp for the sake of portability

04011fe 2017-10-10 12:42:13 Kyotaro Horiguchi

Added a notice in the manual.

Added an item that explains about letter case handling of object names
in hints.

cdb7a47 REL95_1_1_5 2017-07-27 19:20:05 Kyotaro Horiguchi

Change version to 1.1.5

1.1.4 has an assertion failure bug raised by DECLARE CURSOR with
enabling table hint. Fixed it.

de44994 2017-07-27 19:19:57 Kyotaro Horiguchi

Fixed a crash bug by DECLARE CURSOR and enable_hint_table = on

The previous version causes assertion failure by DECLARE CURSOR syntax
when table hint is activated. The cause is that the version forgot the
fact that DelcareCursorStmt is in a bit strange shape. Add support of
DECLARE CURSOR and regression test for table hinting.

00256f9 REL95_1_1_4 2017-05-19 13:53:54 Kyotaro Horiguchi

Change version to 1.1.4

1.1.3 has a crash bug raised by queries in specific shape involving
complex views and/or SQL functions.

It is fixed in this version.

82f6021 2017-05-19 10:39:44 Kyotaro Horiguchi

Fix a bug of target query retrieval

The previous patch leaves a bug that get_query_string returns a Query
that JumbleQuery doesn't accept. This fixes that bug.

Show on old repository browser