Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitaad50f8

Browse files
committed
pathman_planner_hook(): don't call decr_refcount_parenthood_statuses() if pathman is disabled
1 parentb361af6 commitaad50f8

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

‎src/hooks.c

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -468,10 +468,11 @@ pathman_planner_hook(Query *parse, int cursorOptions, ParamListInfo boundParams)
468468

469469
PlannedStmt*result;
470470
uint32query_id=parse->queryId;
471+
boolpathman_ready=IsPathmanReady();/* in case it changes */
471472

472473
PG_TRY();
473474
{
474-
if (IsPathmanReady())
475+
if (pathman_ready)
475476
{
476477
/* Increment parenthood_statuses refcount */
477478
incr_refcount_parenthood_statuses();
@@ -486,7 +487,7 @@ pathman_planner_hook(Query *parse, int cursorOptions, ParamListInfo boundParams)
486487
else
487488
result=standard_planner(parse,cursorOptions,boundParams);
488489

489-
if (IsPathmanReady())
490+
if (pathman_ready)
490491
{
491492
/* Give rowmark-related attributes correct names */
492493
ExecuteForPlanTree(result,postprocess_lock_rows);
@@ -504,9 +505,13 @@ pathman_planner_hook(Query *parse, int cursorOptions, ParamListInfo boundParams)
504505
/* We must decrease parenthood statuses refcount on ERROR */
505506
PG_CATCH();
506507
{
507-
/* Caught an ERROR, decrease refcount */
508-
decr_refcount_parenthood_statuses();
508+
if (pathman_ready)
509+
{
510+
/* Caught an ERROR, decrease refcount */
511+
decr_refcount_parenthood_statuses();
512+
}
509513

514+
/* Rethrow ERROR further */
510515
PG_RE_THROW();
511516
}
512517
PG_END_TRY();

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp