mirror of
https://github.com/postgres/postgres.git
synced 2025-05-21 00:02:53 -04:00
Assert that syscache lookups don't happen outside transactions.
Andres Freund
This commit is contained in:
parent
ac33c7e2c1
commit
42c80c696e
4
src/backend/utils/cache/catcache.c
vendored
4
src/backend/utils/cache/catcache.c
vendored
@ -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
|
||||
*/
|
||||
|
Loading…
x
Reference in New Issue
Block a user