diff --git a/src/common/backend/utils/mmgr/AsanMemoryAllocator.cpp b/src/common/backend/utils/mmgr/AsanMemoryAllocator.cpp index 4084267b59806bfcadc0e49e527464442faac5d9..705a9f4ae76b20ecd6fdd6635826913be668c0cd 100644 --- a/src/common/backend/utils/mmgr/AsanMemoryAllocator.cpp +++ b/src/common/backend/utils/mmgr/AsanMemoryAllocator.cpp @@ -269,7 +269,8 @@ MemoryContext AsanMemoryAllocator::AllocSetContextCreate(MemoryContext parent, c * Don't limit the memory allocation for ErrorContext. * And skip memory tracking memory allocation. */ - if ((strcmp(name, "ErrorContext") != 0) && (strcmp(name, "MemoryTrackMemoryContext") != 0)) { + if ((strcmp(name, "ErrorContext") != 0) && (strcmp(name, "MemoryTrackMemoryContext") != 0) + && (strcmp(name, "DolphinErrorData") != 0)) { value |= IS_PROTECT; } diff --git a/src/common/backend/utils/mmgr/aset.cpp b/src/common/backend/utils/mmgr/aset.cpp index f33d88b1884c69dac186836599d576027e23c8f9..d121787f3b8485d7cd0d4b46b557f551cc93a611 100644 --- a/src/common/backend/utils/mmgr/aset.cpp +++ b/src/common/backend/utils/mmgr/aset.cpp @@ -495,7 +495,7 @@ MemoryContext GenericMemoryAllocator::AllocSetContextCreate(MemoryContext parent * Don't limit the memory allocation for ErrorContext. And skip memory tracking memory allocation. */ if ((0 != strcmp(name, "ErrorContext")) && (0 != strcmp(name, "MemoryTrackMemoryContext")) && - (strcmp(name, "Track MemoryInfo hash") != 0)) + (strcmp(name, "Track MemoryInfo hash") != 0) && (0 != strcmp(name, "DolphinErrorData"))) value |= IS_PROTECT; /* only track the unshared context after t_thrd.mem_cxt.mem_track_mem_cxt is created */ diff --git a/src/common/backend/utils/mmgr/mcxt.cpp b/src/common/backend/utils/mmgr/mcxt.cpp index b2e8a4985fc047e81eaf199dee25d8cf92b74013..4e4adb67f1e9ce23ce84ab6ac6cbb3d1a0d007b4 100644 --- a/src/common/backend/utils/mmgr/mcxt.cpp +++ b/src/common/backend/utils/mmgr/mcxt.cpp @@ -937,7 +937,7 @@ MemoryContext MemoryContextCreate( } /* check if the memory context is out of control */ -#define MEMORY_CONTEXT_CONTROL_LEVEL 3 // ExecutorState +#define MEMORY_CONTEXT_CONTROL_LEVEL (ENABLE_THREAD_POOL ? 5: 3) // ExecutorState void MemoryContextCheckMaxSize(MemoryContext context, Size size, const char* file, int line) { #ifndef ENABLE_MEMORY_CHECK diff --git a/src/test/regress/expected/show_warnings.out b/src/test/regress/expected/show_warnings.out index a118d40eab16ef611e63352a6336b93538ef0b98..6ac3a9860717be42057384d33848afa749e70b63 100644 --- a/src/test/regress/expected/show_warnings.out +++ b/src/test/regress/expected/show_warnings.out @@ -153,5 +153,17 @@ show warnings limit 2, 4; Warning | 64 | you don't own a lock of type ShareLock (2 rows) +show enable_thread_pool; + enable_thread_pool +-------------------- + on +(1 row) + +set query_mem='32MB'; +set query_max_mem='32MB'; +create table aaa(a int,b date,partial cluster key(b)) with (orientation = column); +insert into aaa(a ) select generate_series(1,10000000); +--?ERROR: Session used memory .* Kbytes is beyond the limitation 32768 Kbytes. +--?DETAIL: Session estimated memory is.* \c postgres drop database if exists db_show_warnings; diff --git a/src/test/regress/sql/show_warnings.sql b/src/test/regress/sql/show_warnings.sql index 7637c60d21f27888c04c5f17d8b18c8de56c2b17..ce35dfdb6dbeb36feb433435992a51e574c23efb 100644 --- a/src/test/regress/sql/show_warnings.sql +++ b/src/test/regress/sql/show_warnings.sql @@ -45,5 +45,12 @@ SELECT pg_advisory_unlock(1), pg_advisory_unlock_shared(2), pg_advisory_unlock(1 show warnings; show warnings limit 2, 4; +show enable_thread_pool; +set query_mem='32MB'; +set query_max_mem='32MB'; +create table aaa(a int,b date,partial cluster key(b)) with (orientation = column); +insert into aaa(a ) select generate_series(1,10000000); + + \c postgres drop database if exists db_show_warnings;