firtst release
Revision | 0a27fc8da0a5475be04a285d291ebb6152d1c1e9 (tree) |
---|---|
Time | 2022-01-18 16:03:03 |
Author | mikecaat <righttoleft1134@gmai...> |
Commiter | Kyotaro Horiguchi |
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.
@@ -2921,7 +2921,7 @@ get_current_hint_string(Query *query, const char *query_str, | ||
2921 | 2921 | |
2922 | 2922 | if (debug_level > 1) |
2923 | 2923 | { |
2924 | - if (debug_level == 1 && query_str && debug_query_string && | |
2924 | + if (debug_level == 2 && query_str && debug_query_string && | |
2925 | 2925 | strcmp(query_str, debug_query_string)) |
2926 | 2926 | ereport(pg_hint_plan_debug_message_level, |
2927 | 2927 | (errmsg("hints in comment=\"%s\"", |
@@ -3570,7 +3570,7 @@ restrict_indexes(PlannerInfo *root, ScanMethodHint *hint, RelOptInfo *rel, | ||
3570 | 3570 | pfree(indexname); |
3571 | 3571 | } |
3572 | 3572 | |
3573 | - if (debug_level == 1) | |
3573 | + if (debug_level > 0) | |
3574 | 3574 | { |
3575 | 3575 | StringInfoData rel_buf; |
3576 | 3576 | char *disprelname = ""; |