Assert that syscache lookups don't happen outside transactions.

Andres Freund
This commit is contained in:
Robert Haas 2013-07-15 13:31:36 -04:00
parent ac33c7e2c1
commit 42c80c696e
1 changed files with 4 additions and 0 deletions

View 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
*/