|
50 | 50 | #include "foreign/fdwapi.h"
|
51 | 51 | #include "mb/pg_wchar.h"
|
52 | 52 | #include "miscadmin.h"
|
| 53 | +#include "nodes/queryjumble.h" |
53 | 54 | #include "parser/parse_relation.h"
|
54 | 55 | #include "rewrite/rewriteHandler.h"
|
55 | 56 | #include "tcop/utility.h"
|
@@ -295,6 +296,9 @@ ExecutorRun(QueryDesc *queryDesc,
|
295 | 296 | ScanDirection direction, uint64 count,
|
296 | 297 | bool execute_once)
|
297 | 298 | {
|
| 299 | + /* If enabled, the query ID should be set. */ |
| 300 | + Assert(!IsQueryIdEnabled() || pgstat_get_my_query_id() != 0); |
| 301 | + |
298 | 302 | if (ExecutorRun_hook)
|
299 | 303 | (*ExecutorRun_hook) (queryDesc, direction, count, execute_once);
|
300 | 304 | else
|
@@ -403,6 +407,9 @@ standard_ExecutorRun(QueryDesc *queryDesc,
|
403 | 407 | void
|
404 | 408 | ExecutorFinish(QueryDesc *queryDesc)
|
405 | 409 | {
|
| 410 | + /* If enabled, the query ID should be set. */ |
| 411 | + Assert(!IsQueryIdEnabled() || pgstat_get_my_query_id() != 0); |
| 412 | + |
406 | 413 | if (ExecutorFinish_hook)
|
407 | 414 | (*ExecutorFinish_hook) (queryDesc);
|
408 | 415 | else
|
@@ -463,6 +470,9 @@ standard_ExecutorFinish(QueryDesc *queryDesc)
|
463 | 470 | void
|
464 | 471 | ExecutorEnd(QueryDesc *queryDesc)
|
465 | 472 | {
|
| 473 | + /* If enabled, the query ID should be set. */ |
| 474 | + Assert(!IsQueryIdEnabled() || pgstat_get_my_query_id() != 0); |
| 475 | + |
466 | 476 | if (ExecutorEnd_hook)
|
467 | 477 | (*ExecutorEnd_hook) (queryDesc);
|
468 | 478 | else
|
|
0 commit comments