• R/O
  • HTTP
  • SSH
  • HTTPS

pg_hint_plan: Commit

firtst release


Commit MetaInfo

Revision0a27fc8da0a5475be04a285d291ebb6152d1c1e9 (tree)
Time2022-01-18 16:03:03
Authormikecaat <righttoleft1134@gmai...>
CommiterKyotaro Horiguchi

Log Message

Fix behavior for pg_hint_plan.debug_print

It was a kind of broken that some debug code paths are never visited
or that higher debug_level doesn't offer detailed messages.
Fix some debug messages' debug_level condition so that we can see the
proper messages for every debug_level.

Change Summary

Incremental Difference

--- a/pg_hint_plan.c
+++ b/pg_hint_plan.c
@@ -2921,7 +2921,7 @@ get_current_hint_string(Query *query, const char *query_str,
29212921
29222922 if (debug_level > 1)
29232923 {
2924- if (debug_level == 1 && query_str && debug_query_string &&
2924+ if (debug_level == 2 && query_str && debug_query_string &&
29252925 strcmp(query_str, debug_query_string))
29262926 ereport(pg_hint_plan_debug_message_level,
29272927 (errmsg("hints in comment=\"%s\"",
@@ -3570,7 +3570,7 @@ restrict_indexes(PlannerInfo *root, ScanMethodHint *hint, RelOptInfo *rel,
35703570 pfree(indexname);
35713571 }
35723572
3573- if (debug_level == 1)
3573+ if (debug_level > 0)
35743574 {
35753575 StringInfoData rel_buf;
35763576 char *disprelname = "";
Show on old repository browser