git.postgresql.org Git - postgresql.git/commitdiff

git projects / postgresql.git / commitdiff
? search:
summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: ac33c7e)
Assert that syscache lookups don't happen outside transactions.
2013年7月15日 17:31:36 +0000 (13:31 -0400)
2013年7月15日 17:31:36 +0000 (13:31 -0400)
Andres Freund


diff --git a/src/backend/utils/cache/catcache.c b/src/backend/utils/cache/catcache.c
index d12da7615a1b59147d6a8157230170350a1dc0ed..cca0572a5dc00a87ab7b0aff5cce4400d19af715 100644 (file)
--- a/src/backend/utils/cache/catcache.c
+++ b/src/backend/utils/cache/catcache.c
@@ -21,6 +21,7 @@
#include "access/sysattr.h"
#include "access/tuptoaster.h"
#include "access/valid.h"
+#include "access/xact.h"
#include "catalog/pg_operator.h"
#include "catalog/pg_type.h"
#include "miscadmin.h"
@@ -1067,6 +1068,9 @@ SearchCatCache(CatCache *cache,
SysScanDesc scandesc;
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
*/
This is the main PostgreSQL git repository.
RSS Atom

AltStyle によって変換されたページ (->オリジナル) /