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

Commite1eb41a

Browse files
committed
Change hook order in aqo_copy_generic_path_info().
Add checking the convention: any extension that sets had_path is alsoresponsible for setting path_clauses, path_jointype, path_relids,path_parallel_workers, and was_parameterized.
1 parent57fb3a7 commite1eb41a

File tree

1 file changed

+23
-4
lines changed

1 file changed

+23
-4
lines changed

‎postprocessing.c

Lines changed: 23 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -326,10 +326,26 @@ aqo_copy_generic_path_info(PlannerInfo *root, Plan *dest, Path *src)
326326
{
327327
boolis_join_path;
328328

329+
if (prev_copy_generic_path_info_hook)
330+
prev_copy_generic_path_info_hook(root,dest,src);
331+
329332
is_join_path= (src->type==T_NestPath||src->type==T_MergePath||
330333
src->type==T_HashPath);
331334

332-
dest->had_path= true;
335+
if (dest->had_path)
336+
{
337+
/*
338+
* The convention is that any extension that sets had_path is also
339+
* responsible for setting path_clauses, path_jointype, path_relids,
340+
* path_parallel_workers, and was_parameterized.
341+
*/
342+
Assert(dest->path_clauses&&dest->path_jointype&&
343+
dest->path_relids&&dest->path_parallel_workers);
344+
return;
345+
}
346+
else
347+
dest->had_path= true;
348+
333349
if (is_join_path)
334350
{
335351
dest->path_clauses= ((JoinPath*)src)->joinrestrictinfo;
@@ -343,12 +359,10 @@ aqo_copy_generic_path_info(PlannerInfo *root, Plan *dest, Path *src)
343359
);
344360
dest->path_jointype=JOIN_INNER;
345361
}
362+
346363
dest->path_relids=get_list_of_relids(root,src->parent->relids);
347364
dest->path_parallel_workers=src->parallel_workers;
348365
dest->was_parametrized= (src->param_info!=NULL);
349-
350-
if (prev_copy_generic_path_info_hook)
351-
prev_copy_generic_path_info_hook(root,dest,src);
352366
}
353367

354368
/*
@@ -442,4 +456,9 @@ learn_query_stat(QueryDesc *queryDesc)
442456
prev_ExecutorEnd_hook(queryDesc);
443457
else
444458
standard_ExecutorEnd(queryDesc);
459+
460+
/*
461+
* standard_ExecutorEnd clears the queryDesc->planstate. After this point no
462+
* one operation with the plan can be made.
463+
*/
445464
}

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp