]> granicus.if.org Git - postgresql/commitdiff
Assert that syscache lookups don't happen outside transactions.
authorRobert Haas <rhaas@postgresql.org>
Mon, 15 Jul 2013 17:31:36 +0000 (13:31 -0400)
committerRobert Haas <rhaas@postgresql.org>
Mon, 15 Jul 2013 17:31:36 +0000 (13:31 -0400)
Andres Freund

src/backend/utils/cache/catcache.c

index d12da7615a1b59147d6a8157230170350a1dc0ed..cca0572a5dc00a87ab7b0aff5cce4400d19af715 100644 (file)
@@ -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
         */