aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorvvvv <vvvv@ydb.tech>2023-05-26 19:31:54 +0300
committervvvv <vvvv@ydb.tech>2023-05-26 19:31:54 +0300
commitf84ae981531f53b5c4634fbf8340d4a185b50dde (patch)
treede5c0112b9bf958a54ef4f1d5298ad89c72d5d2b
parentb9ecca1fb6edc7910b784daa6eb8e24a67325e6e (diff)
downloadydb-f84ae981531f53b5c4634fbf8340d4a185b50dde.tar.gz
Configure PG stack checks
-rw-r--r--ydb/library/yql/parser/pg_wrapper/comp_factory.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/ydb/library/yql/parser/pg_wrapper/comp_factory.cpp b/ydb/library/yql/parser/pg_wrapper/comp_factory.cpp
index f21137024b9..5cb4fc78d65 100644
--- a/ydb/library/yql/parser/pg_wrapper/comp_factory.cpp
+++ b/ydb/library/yql/parser/pg_wrapper/comp_factory.cpp
@@ -40,6 +40,7 @@ extern "C" {
#include "nodes/execnodes.h"
#include "executor/executor.h"
#include "lib/stringinfo.h"
+#include "miscadmin.h"
#include "thread_inits.h"
#undef Abs
@@ -78,6 +79,7 @@ struct TMainContext {
MemoryContext PrevCurrentMemoryContext = nullptr;
MemoryContext PrevErrorContext = nullptr;
TimestampTz StartTimestamp;
+ pg_stack_base_t PrevStackBase;
};
NUdf::TUnboxedValue CreatePgString(i32 typeLen, ui32 targetTypeId, TStringBuf data) {
@@ -3291,6 +3293,7 @@ void PgAcquireThreadContext(void* ctx) {
main->PrevErrorContext = ErrorContext;
CurrentMemoryContext = ErrorContext = (MemoryContext)&main->Data;
SetParallelStartTimestamps(main->StartTimestamp, main->StartTimestamp);
+ main->PrevStackBase = set_stack_base();
}
}
@@ -3299,6 +3302,7 @@ void PgReleaseThreadContext(void* ctx) {
auto main = (TMainContext*)ctx;
CurrentMemoryContext = main->PrevCurrentMemoryContext;
ErrorContext = main->PrevErrorContext;
+ restore_stack_base(main->PrevStackBase);
}
}