提交 42c80c69 编写于 作者: R Robert Haas

Assert that syscache lookups don't happen outside transactions.

Andres Freund
上级 ac33c7e2
...@@ -21,6 +21,7 @@ ...@@ -21,6 +21,7 @@
#include "access/sysattr.h" #include "access/sysattr.h"
#include "access/tuptoaster.h" #include "access/tuptoaster.h"
#include "access/valid.h" #include "access/valid.h"
#include "access/xact.h"
#include "catalog/pg_operator.h" #include "catalog/pg_operator.h"
#include "catalog/pg_type.h" #include "catalog/pg_type.h"
#include "miscadmin.h" #include "miscadmin.h"
...@@ -1067,6 +1068,9 @@ SearchCatCache(CatCache *cache, ...@@ -1067,6 +1068,9 @@ SearchCatCache(CatCache *cache,
SysScanDesc scandesc; SysScanDesc scandesc;
HeapTuple ntp; HeapTuple ntp;
/* Make sure we're in a xact, even if this ends up being a cache hit */
Assert(IsTransactionState());
/* /*
* one-time startup overhead for each cache * one-time startup overhead for each cache
*/ */
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册