{
int count;
- AssertArg(instr);
- AssertArg(outstr);
+ Assert(instr);
+ Assert(outstr);
outstr[SOUNDEX_LEN] = '\0';
/*
* sanity checks
*/
- AssertArg(natts >= 0);
+ Assert(natts >= 0);
/*
* Allocate enough memory for the tuple descriptor, including the
/*
* sanity checks
*/
- AssertArg(PointerIsValid(src));
- AssertArg(PointerIsValid(dst));
- AssertArg(srcAttno >= 1);
- AssertArg(srcAttno <= src->natts);
- AssertArg(dstAttno >= 1);
- AssertArg(dstAttno <= dst->natts);
+ Assert(PointerIsValid(src));
+ Assert(PointerIsValid(dst));
+ Assert(srcAttno >= 1);
+ Assert(srcAttno <= src->natts);
+ Assert(dstAttno >= 1);
+ Assert(dstAttno <= dst->natts);
memcpy(dstAtt, srcAtt, ATTRIBUTE_FIXED_PART_SIZE);
/*
* sanity checks
*/
- AssertArg(PointerIsValid(desc));
- AssertArg(attributeNumber >= 1);
- AssertArg(attributeNumber <= desc->natts);
+ Assert(PointerIsValid(desc));
+ Assert(attributeNumber >= 1);
+ Assert(attributeNumber <= desc->natts);
/*
* initialize the attribute fields
Form_pg_attribute att;
/* sanity checks */
- AssertArg(PointerIsValid(desc));
- AssertArg(attributeNumber >= 1);
- AssertArg(attributeNumber <= desc->natts);
+ Assert(PointerIsValid(desc));
+ Assert(attributeNumber >= 1);
+ Assert(attributeNumber <= desc->natts);
/* initialize the attribute fields */
att = TupleDescAttr(desc, attributeNumber - 1);
/*
* sanity checks
*/
- AssertArg(PointerIsValid(desc));
- AssertArg(attributeNumber >= 1);
- AssertArg(attributeNumber <= desc->natts);
+ Assert(PointerIsValid(desc));
+ Assert(attributeNumber >= 1);
+ Assert(attributeNumber <= desc->natts);
TupleDescAttr(desc, attributeNumber - 1)->attcollation = collationid;
}
bool need_cids = RelationIsAccessibleInLogicalDecoding(relation);
/* currently not needed (thus unsupported) for heap_multi_insert() */
- AssertArg(!(options & HEAP_INSERT_NO_LOGICAL));
+ Assert(!(options & HEAP_INSERT_NO_LOGICAL));
needwal = RelationNeedsWAL(relation);
saveFreeSpace = RelationGetTargetPageFreeSpace(relation,
/* Abbreviation is not supported here */
sortKey->abbreviate = false;
- AssertState(sortKey->ssup_attno != 0);
+ Assert(sortKey->ssup_attno != 0);
strategy = (scanKey->sk_flags & SK_BT_DESC) != 0 ?
BTGreaterStrategyNumber : BTLessStrategyNumber;
MultiXactId newMulti;
MultiXactMember members[2];
- AssertArg(TransactionIdIsValid(xid1));
- AssertArg(TransactionIdIsValid(xid2));
+ Assert(TransactionIdIsValid(xid1));
+ Assert(TransactionIdIsValid(xid2));
Assert(!TransactionIdEquals(xid1, xid2) || (status1 != status2));
int i;
int j;
- AssertArg(MultiXactIdIsValid(multi));
- AssertArg(TransactionIdIsValid(xid));
+ Assert(MultiXactIdIsValid(multi));
+ Assert(TransactionIdIsValid(xid));
/* MultiXactIdSetOldestMember() must have been called already. */
Assert(MultiXactIdIsValid(OldestMemberMXactId[MyBackendId]));
s->savepointLevel = savepointLevel;
/* This is the same as TBLOCK_SUBBEGIN case */
- AssertState(s->blockState == TBLOCK_SUBBEGIN);
+ Assert(s->blockState == TBLOCK_SUBBEGIN);
StartSubTransaction();
s->blockState = TBLOCK_SUBINPROGRESS;
}
s->savepointLevel = savepointLevel;
/* This is the same as TBLOCK_SUBBEGIN case */
- AssertState(s->blockState == TBLOCK_SUBBEGIN);
+ Assert(s->blockState == TBLOCK_SUBBEGIN);
StartSubTransaction();
s->blockState = TBLOCK_SUBINPROGRESS;
}
CleanupSubTransaction();
s = CurrentTransactionState; /* changed by pop */
- AssertState(s->blockState == TBLOCK_SUBINPROGRESS ||
+ Assert(s->blockState == TBLOCK_SUBINPROGRESS ||
s->blockState == TBLOCK_INPROGRESS ||
s->blockState == TBLOCK_IMPLICIT_INPROGRESS ||
s->blockState == TBLOCK_STARTED);
Oid typinput;
Oid typoutput;
- AssertArg(i >= 0 && i < MAXATTR);
+ Assert(i >= 0 && i < MAXATTR);
elog(DEBUG4, "inserting column %d value \"%s\"", i, value);
MyProc->tempNamespaceId = namespaceId;
/* It should not be done already. */
- AssertState(myTempNamespaceSubID == InvalidSubTransactionId);
+ Assert(myTempNamespaceSubID == InvalidSubTransactionId);
myTempNamespaceSubID = GetCurrentSubTransactionId();
baseSearchPathValid = false; /* need to rebuild list */
ObjectAddress myself,
referenced;
- AssertArg(collname);
- AssertArg(collnamespace);
- AssertArg(collowner);
- AssertArg((collcollate && collctype) || colliculocale);
+ Assert(collname);
+ Assert(collnamespace);
+ Assert(collowner);
+ Assert((collcollate && collctype) || colliculocale);
/*
* Make sure there is no existing collation of same name & encoding.
bool result = false;
Relation relation;
- AssertArg(name);
+ Assert(name);
/* Caller may wish to grab a better lock on pg_database beforehand... */
relation = table_open(DatabaseRelationId, AccessShareLock);
* This matches the options enforced by the grammar, where the object name
* is optional for DATABASE and SYSTEM.
*/
- AssertArg(objectName || objectKind != REINDEX_OBJECT_SCHEMA);
+ Assert(objectName || objectKind != REINDEX_OBJECT_SCHEMA);
if (objectKind == REINDEX_OBJECT_SYSTEM &&
(params->options & REINDEXOPT_CONCURRENTLY) != 0)
/*
* sanity checks
*/
- AssertArg(PortalIsValid(portal));
- AssertArg(portal->cleanup == PortalCleanup);
+ Assert(PortalIsValid(portal));
+ Assert(portal->cleanup == PortalCleanup);
/*
* Shut down executor, if still running. We skip this during error abort,
/*
* sanity checks
*/
- AssertArg(OidIsValid(relationId));
+ Assert(OidIsValid(relationId));
if (supers == NIL)
return;
Form_pg_constraint con;
ObjectAddress address;
- AssertArg(!myrelid || !mytypid);
+ Assert(!myrelid || !mytypid);
if (mytypid)
{
Oid insertTriggerOid,
updateTriggerOid;
- AssertArg(OidIsValid(parentConstr));
+ Assert(OidIsValid(parentConstr));
if (rel->rd_rel->relkind == RELKIND_FOREIGN_TABLE)
ereport(ERROR,
{
struct stat st;
- AssertArg(name != NULL);
+ Assert(name != NULL);
if (stat(name, &st) == 0)
return !S_ISDIR(st.st_mode);
int i;
Oid ofTypeId;
- AssertArg(ofTypename);
+ Assert(ofTypename);
tuple = typenameType(NULL, ofTypename, NULL);
check_of_type(tuple);
TransactionId xidForceLimit;
MultiXactId multiForceLimit;
- AssertArg(classForm != NULL);
- AssertArg(OidIsValid(relid));
+ Assert(classForm != NULL);
+ Assert(OidIsValid(relid));
/*
* Determine vacuum/analyze equation parameters. We have two possible
ReorderBufferTXN *txn;
bool is_new;
- AssertArg(snap != NULL);
+ Assert(snap != NULL);
/*
* Fetch the transaction to operate on. If we know it's a subtransaction,
ReplicationSlot *s;
int active_pid;
- AssertArg(name != NULL);
+ Assert(name != NULL);
retry:
Assert(MyReplicationSlot == NULL);
{
uint32 old_state;
- AssertArg(mode == LW_EXCLUSIVE || mode == LW_SHARED);
+ Assert(mode == LW_EXCLUSIVE || mode == LW_SHARED);
/*
* Read once outside the loop, later iterations will get the newer value
lwstats = get_lwlock_stats_entry(lock);
#endif
- AssertArg(mode == LW_SHARED || mode == LW_EXCLUSIVE);
+ Assert(mode == LW_SHARED || mode == LW_EXCLUSIVE);
PRINT_LWDEBUG("LWLockAcquire", lock, mode);
{
bool mustwait;
- AssertArg(mode == LW_SHARED || mode == LW_EXCLUSIVE);
+ Assert(mode == LW_SHARED || mode == LW_EXCLUSIVE);
PRINT_LWDEBUG("LWLockConditionalAcquire", lock, mode);
bool idle_in_transaction_timeout_enabled = false;
bool idle_session_timeout_enabled = false;
- AssertArg(dbname != NULL);
- AssertArg(username != NULL);
+ Assert(dbname != NULL);
+ Assert(username != NULL);
SetProcessingMode(InitProcessing);
QueryDesc *queryDesc;
int myeflags;
- AssertArg(PortalIsValid(portal));
- AssertState(portal->status == PORTAL_DEFINED);
+ Assert(PortalIsValid(portal));
+ Assert(portal->status == PORTAL_DEFINED);
/*
* Set up global portal context pointers.
MemoryContext savePortalContext;
MemoryContext saveMemoryContext;
- AssertArg(PortalIsValid(portal));
+ Assert(PortalIsValid(portal));
TRACE_POSTGRESQL_QUERY_EXECUTE_START();
MemoryContext savePortalContext;
MemoryContext oldContext;
- AssertArg(PortalIsValid(portal));
+ Assert(PortalIsValid(portal));
/*
* Check for improper portal use, and mark portal active.
/* should be called from backends */
Assert(IsUnderPostmaster || !IsPostmasterEnvironment);
- AssertArg(!kind_info->fixed_amount);
+ Assert(!kind_info->fixed_amount);
pgstat_prep_snapshot();
void
pgstat_snapshot_fixed(PgStat_Kind kind)
{
- AssertArg(pgstat_is_kind_valid(kind));
- AssertArg(pgstat_get_kind_info(kind)->fixed_amount);
+ Assert(pgstat_is_kind_valid(kind));
+ Assert(pgstat_get_kind_info(kind)->fixed_amount);
if (pgstat_fetch_consistency == PGSTAT_FETCH_CONSISTENCY_SNAPSHOT)
pgstat_build_snapshot();
const PgStat_KindInfo *
pgstat_get_kind_info(PgStat_Kind kind)
{
- AssertArg(pgstat_is_kind_valid(kind));
+ Assert(pgstat_is_kind_valid(kind));
return &pgstat_kind_infos[kind];
}
{
ReplicationSlot *slot;
- AssertArg(name != NULL);
+ Assert(name != NULL);
/* Check if the slot exits with the given name. */
slot = SearchNamedReplicationSlot(name, true);
{
ReplicationSlot *slot;
- AssertArg(name != NULL);
+ Assert(name != NULL);
slot = SearchNamedReplicationSlot(name, true);
* passing in created_entry only makes sense if we possibly could create
* entry.
*/
- AssertArg(create || created_entry == NULL);
+ Assert(create || created_entry == NULL);
pgstat_assert_is_up();
Assert(pgStatLocal.shared_hash != NULL);
Assert(!pgStatLocal.shmem->is_shutdown);
{
TimestampTz ts = GetCurrentTimestamp();
- AssertArg(name != NULL);
+ Assert(name != NULL);
pgstat_reset_slru_counter_internal(pgstat_get_slru_index(name), ts);
}
const char *name;
const char *ident;
- AssertArg(MemoryContextIsValid(context));
+ Assert(MemoryContextIsValid(context));
name = context->name;
ident = context->ident;
XmlTableBuilderData *xtCxt;
xmlChar *xstr;
- AssertArg(PointerIsValid(path));
+ Assert(PointerIsValid(path));
xtCxt = GetXmlTableBuilderPrivateData(state, "XmlTableSetColumnFilter");
bool has_not_null;
bool nailit;
- AssertArg(natts >= 0);
+ Assert(natts >= 0);
/*
* check for creation of a rel that must be nailed in cache.
{
struct stat st;
- AssertArg(name != NULL);
+ Assert(name != NULL);
if (stat(name, &st) == 0)
return !S_ISDIR(st.st_mode);
char *new;
char *full;
- AssertArg(name);
+ Assert(name);
have_slash = (first_dir_separator(name) != NULL);
{
const char *sep_ptr;
- AssertArg(name != NULL);
+ Assert(name != NULL);
/* Currently, we only recognize $libdir at the start of the string */
if (name[0] != '$')
const char *p;
size_t baselen;
- AssertArg(basename != NULL);
- AssertArg(first_dir_separator(basename) == NULL);
- AssertState(Dynamic_library_path != NULL);
+ Assert(basename != NULL);
+ Assert(first_dir_separator(basename) == NULL);
+ Assert(Dynamic_library_path != NULL);
p = Dynamic_library_path;
if (strlen(p) == 0)
{
char *new;
- AssertArg(dir);
+ Assert(dir);
/* If presented path is relative, convert to absolute */
new = make_absolute_path(dir);
void
ChangeToDataDir(void)
{
- AssertState(DataDir);
+ Assert(DataDir);
if (chdir(DataDir) < 0)
ereport(FATAL,
Oid
GetUserId(void)
{
- AssertState(OidIsValid(CurrentUserId));
+ Assert(OidIsValid(CurrentUserId));
return CurrentUserId;
}
Oid
GetOuterUserId(void)
{
- AssertState(OidIsValid(OuterUserId));
+ Assert(OidIsValid(OuterUserId));
return OuterUserId;
}
static void
SetOuterUserId(Oid userid)
{
- AssertState(SecurityRestrictionContext == 0);
- AssertArg(OidIsValid(userid));
+ Assert(SecurityRestrictionContext == 0);
+ Assert(OidIsValid(userid));
OuterUserId = userid;
/* We force the effective user ID to match, too */
Oid
GetSessionUserId(void)
{
- AssertState(OidIsValid(SessionUserId));
+ Assert(OidIsValid(SessionUserId));
return SessionUserId;
}
static void
SetSessionUserId(Oid userid, bool is_superuser)
{
- AssertState(SecurityRestrictionContext == 0);
- AssertArg(OidIsValid(userid));
+ Assert(SecurityRestrictionContext == 0);
+ Assert(OidIsValid(userid));
SessionUserId = userid;
SessionUserIsSuperuser = is_superuser;
SetRoleIsActive = false;
Oid
GetAuthenticatedUserId(void)
{
- AssertState(OidIsValid(AuthenticatedUserId));
+ Assert(OidIsValid(AuthenticatedUserId));
return AuthenticatedUserId;
}
* Don't do scans if we're bootstrapping, none of the system catalogs
* exist yet, and they should be owned by postgres anyway.
*/
- AssertState(!IsBootstrapProcessingMode());
+ Assert(!IsBootstrapProcessingMode());
/* call only once */
- AssertState(!OidIsValid(AuthenticatedUserId));
+ Assert(!OidIsValid(AuthenticatedUserId));
/*
* Make sure syscache entries are flushed for recent catalog changes. This
* This function should only be called in single-user mode, in autovacuum
* workers, and in background workers.
*/
- AssertState(!IsUnderPostmaster || IsAutoVacuumWorkerProcess() || IsBackgroundWorker);
+ Assert(!IsUnderPostmaster || IsAutoVacuumWorkerProcess() || IsBackgroundWorker);
/* call only once */
- AssertState(!OidIsValid(AuthenticatedUserId));
+ Assert(!OidIsValid(AuthenticatedUserId));
AuthenticatedUserId = BOOTSTRAP_SUPERUSERID;
AuthenticatedUserIsSuperuser = true;
SetSessionAuthorization(Oid userid, bool is_superuser)
{
/* Must have authenticated already, else can't make permission check */
- AssertState(OidIsValid(AuthenticatedUserId));
+ Assert(OidIsValid(AuthenticatedUserId));
if (userid != AuthenticatedUserId &&
!AuthenticatedUserIsSuperuser)
}
else
{
- AssertState(DataDir);
+ Assert(DataDir);
join_path_components(abs_path, DataDir, location);
canonicalize_path(abs_path);
}
size_t equal_pos;
char *cp;
- AssertArg(string);
- AssertArg(name);
- AssertArg(value);
+ Assert(string);
+ Assert(name);
+ Assert(value);
equal_pos = strcspn(string, "=");
AllocBlock block;
Size keepersize PG_USED_FOR_ASSERTS_ONLY;
- AssertArg(AllocSetIsValid(set));
+ Assert(AllocSetIsValid(set));
#ifdef MEMORY_CONTEXT_CHECKING
/* Check for corruption and leaks before freeing */
AllocBlock block = set->blocks;
Size keepersize PG_USED_FOR_ASSERTS_ONLY;
- AssertArg(AllocSetIsValid(set));
+ Assert(AllocSetIsValid(set));
#ifdef MEMORY_CONTEXT_CHECKING
/* Check for corruption and leaks before freeing */
Size chunk_size;
Size blksize;
- AssertArg(AllocSetIsValid(set));
+ Assert(AllocSetIsValid(set));
/*
* If requested size exceeds maximum for chunks, allocate an entire block
* Future field experience may show that these Asserts had better
* become regular runtime test-and-elog checks.
*/
- AssertArg(AllocBlockIsValid(block));
+ Assert(AllocBlockIsValid(block));
set = block->aset;
fidx = MemoryChunkGetValue(chunk);
* field experience may show that these Asserts had better become regular
* runtime test-and-elog checks.
*/
- AssertArg(AllocBlockIsValid(block));
+ Assert(AllocBlockIsValid(block));
set = block->aset;
fidx = MemoryChunkGetValue(chunk);
else
block = (AllocBlock) MemoryChunkGetBlock(chunk);
- AssertArg(AllocBlockIsValid(block));
+ Assert(AllocBlockIsValid(block));
set = block->aset;
return &set->header;
{
AllocBlock block = ExternalChunkGetBlock(chunk);
- AssertArg(AllocBlockIsValid(block));
+ Assert(AllocBlockIsValid(block));
return block->endptr - (char *) chunk;
}
bool
AllocSetIsEmpty(MemoryContext context)
{
- AssertArg(AllocSetIsValid(context));
+ Assert(AllocSetIsValid(context));
/*
* For now, we say "empty" only if the context is new or just reset. We
AllocBlock block;
int fidx;
- AssertArg(AllocSetIsValid(set));
+ Assert(AllocSetIsValid(set));
/* Include context header in totalspace */
totalspace = MAXALIGN(sizeof(AllocSetContext));
GenerationContext *set = (GenerationContext *) context;
dlist_mutable_iter miter;
- AssertArg(GenerationIsValid(set));
+ Assert(GenerationIsValid(set));
#ifdef MEMORY_CONTEXT_CHECKING
/* Check for corruption and leaks before freeing */
Size chunk_size;
Size required_size;
- AssertArg(GenerationIsValid(set));
+ Assert(GenerationIsValid(set));
#ifdef MEMORY_CONTEXT_CHECKING
/* ensure there's always space for the sentinel byte */
* block is good. Future field experience may show that this Assert
* had better become a regular runtime test-and-elog check.
*/
- AssertArg(GenerationBlockIsValid(block));
+ Assert(GenerationBlockIsValid(block));
#if defined(MEMORY_CONTEXT_CHECKING) || defined(CLOBBER_FREED_MEMORY)
chunksize = MemoryChunkGetValue(chunk);
* block is good. Future field experience may show that this Assert
* had better become a regular runtime test-and-elog check.
*/
- AssertArg(GenerationBlockIsValid(block));
+ Assert(GenerationBlockIsValid(block));
oldsize = MemoryChunkGetValue(chunk);
}
else
block = (GenerationBlock *) MemoryChunkGetBlock(chunk);
- AssertArg(GenerationBlockIsValid(block));
+ Assert(GenerationBlockIsValid(block));
return &block->context->header;
}
{
GenerationBlock *block = ExternalChunkGetBlock(chunk);
- AssertArg(GenerationBlockIsValid(block));
+ Assert(GenerationBlockIsValid(block));
chunksize = block->endptr - (char *) pointer;
}
else
GenerationContext *set = (GenerationContext *) context;
dlist_iter iter;
- AssertArg(GenerationIsValid(set));
+ Assert(GenerationIsValid(set));
dlist_foreach(iter, &set->blocks)
{
Size freespace = 0;
dlist_iter iter;
- AssertArg(GenerationIsValid(set));
+ Assert(GenerationIsValid(set));
/* Include context header in totalspace */
totalspace = MAXALIGN(sizeof(GenerationContext));
void
MemoryContextInit(void)
{
- AssertState(TopMemoryContext == NULL);
+ Assert(TopMemoryContext == NULL);
/*
* First, initialize TopMemoryContext, which is the parent of all others.
void
MemoryContextReset(MemoryContext context)
{
- AssertArg(MemoryContextIsValid(context));
+ Assert(MemoryContextIsValid(context));
/* save a function call in common case where there are no children */
if (context->firstchild != NULL)
void
MemoryContextResetOnly(MemoryContext context)
{
- AssertArg(MemoryContextIsValid(context));
+ Assert(MemoryContextIsValid(context));
/* Nothing to do if no pallocs since startup or last reset */
if (!context->isReset)
{
MemoryContext child;
- AssertArg(MemoryContextIsValid(context));
+ Assert(MemoryContextIsValid(context));
for (child = context->firstchild; child != NULL; child = child->nextchild)
{
void
MemoryContextDelete(MemoryContext context)
{
- AssertArg(MemoryContextIsValid(context));
+ Assert(MemoryContextIsValid(context));
/* We had better not be deleting TopMemoryContext ... */
Assert(context != TopMemoryContext);
/* And not CurrentMemoryContext, either */
void
MemoryContextDeleteChildren(MemoryContext context)
{
- AssertArg(MemoryContextIsValid(context));
+ Assert(MemoryContextIsValid(context));
/*
* MemoryContextDelete will delink the child from me, so just iterate as
MemoryContextRegisterResetCallback(MemoryContext context,
MemoryContextCallback *cb)
{
- AssertArg(MemoryContextIsValid(context));
+ Assert(MemoryContextIsValid(context));
/* Push onto head so this will be called before older registrants. */
cb->next = context->reset_cbs;
void
MemoryContextSetIdentifier(MemoryContext context, const char *id)
{
- AssertArg(MemoryContextIsValid(context));
+ Assert(MemoryContextIsValid(context));
context->ident = id;
}
void
MemoryContextSetParent(MemoryContext context, MemoryContext new_parent)
{
- AssertArg(MemoryContextIsValid(context));
- AssertArg(context != new_parent);
+ Assert(MemoryContextIsValid(context));
+ Assert(context != new_parent);
/* Fast path if it's got correct parent already */
if (new_parent == context->parent)
/* And relink */
if (new_parent)
{
- AssertArg(MemoryContextIsValid(new_parent));
+ Assert(MemoryContextIsValid(new_parent));
context->parent = new_parent;
context->prevchild = NULL;
context->nextchild = new_parent->firstchild;
void
MemoryContextAllowInCriticalSection(MemoryContext context, bool allow)
{
- AssertArg(MemoryContextIsValid(context));
+ Assert(MemoryContextIsValid(context));
context->allowInCritSection = allow;
}
MemoryContext
MemoryContextGetParent(MemoryContext context)
{
- AssertArg(MemoryContextIsValid(context));
+ Assert(MemoryContextIsValid(context));
return context->parent;
}
bool
MemoryContextIsEmpty(MemoryContext context)
{
- AssertArg(MemoryContextIsValid(context));
+ Assert(MemoryContextIsValid(context));
/*
* For now, we consider a memory context nonempty if it has any children;
{
Size total = context->mem_allocated;
- AssertArg(MemoryContextIsValid(context));
+ Assert(MemoryContextIsValid(context));
if (recurse)
{
MemoryContext child;
int ichild;
- AssertArg(MemoryContextIsValid(context));
+ Assert(MemoryContextIsValid(context));
/* Examine the context itself */
context->methods->stats(context,
{
MemoryContext child;
- AssertArg(MemoryContextIsValid(context));
+ Assert(MemoryContextIsValid(context));
context->methods->check(context);
for (child = context->firstchild; child != NULL; child = child->nextchild)
{
void *ret;
- AssertArg(MemoryContextIsValid(context));
+ Assert(MemoryContextIsValid(context));
AssertNotInCriticalSection(context);
if (!AllocSizeIsValid(size))
{
void *ret;
- AssertArg(MemoryContextIsValid(context));
+ Assert(MemoryContextIsValid(context));
AssertNotInCriticalSection(context);
if (!AllocSizeIsValid(size))
{
void *ret;
- AssertArg(MemoryContextIsValid(context));
+ Assert(MemoryContextIsValid(context));
AssertNotInCriticalSection(context);
if (!AllocSizeIsValid(size))
{
void *ret;
- AssertArg(MemoryContextIsValid(context));
+ Assert(MemoryContextIsValid(context));
AssertNotInCriticalSection(context);
if (!((flags & MCXT_ALLOC_HUGE) != 0 ? AllocHugeSizeIsValid(size) :
void *ret;
MemoryContext context = CurrentMemoryContext;
- AssertArg(MemoryContextIsValid(context));
+ Assert(MemoryContextIsValid(context));
AssertNotInCriticalSection(context);
if (!AllocSizeIsValid(size))
void *ret;
MemoryContext context = CurrentMemoryContext;
- AssertArg(MemoryContextIsValid(context));
+ Assert(MemoryContextIsValid(context));
AssertNotInCriticalSection(context);
if (!AllocSizeIsValid(size))
void *ret;
MemoryContext context = CurrentMemoryContext;
- AssertArg(MemoryContextIsValid(context));
+ Assert(MemoryContextIsValid(context));
AssertNotInCriticalSection(context);
if (!((flags & MCXT_ALLOC_HUGE) != 0 ? AllocHugeSizeIsValid(size) :
{
void *ret;
- AssertArg(MemoryContextIsValid(context));
+ Assert(MemoryContextIsValid(context));
AssertNotInCriticalSection(context);
if (!AllocHugeSizeIsValid(size))
{
Portal portal;
- AssertArg(PointerIsValid(name));
+ Assert(PointerIsValid(name));
portal = GetPortalByName(name);
if (PortalIsValid(portal))
List *stmts,
CachedPlan *cplan)
{
- AssertArg(PortalIsValid(portal));
- AssertState(portal->status == PORTAL_NEW);
+ Assert(PortalIsValid(portal));
+ Assert(portal->status == PORTAL_NEW);
- AssertArg(sourceText != NULL);
- AssertArg(commandTag != CMDTAG_UNKNOWN || stmts == NIL);
+ Assert(sourceText != NULL);
+ Assert(commandTag != CMDTAG_UNKNOWN || stmts == NIL);
portal->prepStmtName = prepStmtName;
portal->sourceText = sourceText;
void
PortalDrop(Portal portal, bool isTopCommit)
{
- AssertArg(PortalIsValid(portal));
+ Assert(PortalIsValid(portal));
/*
* Don't allow dropping a pinned portal, it's still needed by whoever
SlabContext *slab = (SlabContext *) context;
int i;
- AssertArg(SlabIsValid(slab));
+ Assert(SlabIsValid(slab));
#ifdef MEMORY_CONTEXT_CHECKING
/* Check for corruption and leaks before freeing */
MemoryChunk *chunk;
int idx;
- AssertArg(SlabIsValid(slab));
+ Assert(SlabIsValid(slab));
Assert((slab->minFreeChunks >= 0) &&
(slab->minFreeChunks < slab->chunksPerBlock));
* Future field experience may show that this Assert had better become a
* regular runtime test-and-elog check.
*/
- AssertArg(SlabBlockIsValid(block));
+ Assert(SlabBlockIsValid(block));
slab = block->slab;
#ifdef MEMORY_CONTEXT_CHECKING
MemoryChunk *chunk = PointerGetMemoryChunk(pointer);
SlabBlock *block = MemoryChunkGetBlock(chunk);
- AssertArg(SlabBlockIsValid(block));
+ Assert(SlabBlockIsValid(block));
return &block->slab->header;
}
SlabBlock *block = MemoryChunkGetBlock(chunk);
SlabContext *slab;
- AssertArg(SlabBlockIsValid(block));
+ Assert(SlabBlockIsValid(block));
slab = block->slab;
return slab->fullChunkSize;
{
SlabContext *slab = (SlabContext *) context;
- AssertArg(SlabIsValid(slab));
+ Assert(SlabIsValid(slab));
return (slab->nblocks == 0);
}
Size freespace = 0;
int i;
- AssertArg(SlabIsValid(slab));
+ Assert(SlabIsValid(slab));
/* Include context header in totalspace */
totalspace = slab->headerSize;
int i;
const char *name = slab->header.name;
- AssertArg(SlabIsValid(slab));
+ Assert(SlabIsValid(slab));
Assert(slab->chunksPerBlock > 0);
/* walk all the freelists */
oldcontext = MemoryContextSwitchTo(base->maincontext);
- AssertArg(nkeys > 0);
+ Assert(nkeys > 0);
#ifdef TRACE_SORT
if (trace_sort)
{
SortSupport sortKey = base->sortKeys + i;
- AssertArg(attNums[i] != 0);
- AssertArg(sortOperators[i] != 0);
+ Assert(attNums[i] != 0);
+ Assert(sortOperators[i] != 0);
sortKey->ssup_cxt = CurrentMemoryContext;
sortKey->ssup_collation = sortCollations[i];
/* Convey if abbreviation optimization is applicable in principle */
sortKey->abbreviate = (i == 0 && base->haveDatum1);
- AssertState(sortKey->ssup_attno != 0);
+ Assert(sortKey->ssup_attno != 0);
strategy = (scanKey->sk_flags & SK_BT_DESC) != 0 ?
BTGreaterStrategyNumber : BTLessStrategyNumber;
/* Convey if abbreviation optimization is applicable in principle */
sortKey->abbreviate = (i == 0 && base->haveDatum1);
- AssertState(sortKey->ssup_attno != 0);
+ Assert(sortKey->ssup_attno != 0);
strategy = (scanKey->sk_flags & SK_BT_DESC) != 0 ?
BTGreaterStrategyNumber : BTLessStrategyNumber;
/* Convey if abbreviation optimization is applicable in principle */
sortKey->abbreviate = (i == 0 && base->haveDatum1);
- AssertState(sortKey->ssup_attno != 0);
+ Assert(sortKey->ssup_attno != 0);
/* Look for a sort support function */
PrepareSortSupportFromGistIndexRel(indexRel, sortKey);
pg_crc32c crc;
int r;
- AssertArg(crc_ok_p);
+ Assert(crc_ok_p);
ControlFile = palloc_object(ControlFileData);
snprintf(ControlFilePath, MAXPGPATH, "%s/global/pg_control", DataDir);
{
int ssl_options = 0;
- AssertArg(version != 0);
+ Assert(version != 0);
/*
* Some OpenSSL versions define TLS*_VERSION macros but not the
#define Assert(condition) ((void)true)
#define AssertMacro(condition) ((void)true)
-#define AssertArg(condition) ((void)true)
-#define AssertState(condition) ((void)true)
#define AssertPointerAlignment(ptr, bndr) ((void)true)
#elif defined(FRONTEND)
#include <assert.h>
#define Assert(p) assert(p)
#define AssertMacro(p) ((void) assert(p))
-#define AssertArg(condition) assert(condition)
-#define AssertState(condition) assert(condition)
#define AssertPointerAlignment(ptr, bndr) ((void)true)
#else /* USE_ASSERT_CHECKING && !FRONTEND */
((void) ((condition) || \
(ExceptionalCondition(#condition, __FILE__, __LINE__), 0)))
-/*
- * AssertArg and AssertState are identical to Assert. Some places use them
- * to indicate that the complaint is specifically about a bad argument or
- * unexpected state, but this usage is largely obsolescent.
- */
-#define AssertArg(condition) Assert(condition)
-#define AssertState(condition) Assert(condition)
-
/*
* Check that `ptr' is `bndr' aligned.
*/
static inline bool
slot_attisnull(TupleTableSlot *slot, int attnum)
{
- AssertArg(attnum > 0);
+ Assert(attnum > 0);
if (attnum > slot->tts_nvalid)
slot_getsomeattrs(slot, attnum);
slot_getattr(TupleTableSlot *slot, int attnum,
bool *isnull)
{
- AssertArg(attnum > 0);
+ Assert(attnum > 0);
if (attnum > slot->tts_nvalid)
slot_getsomeattrs(slot, attnum);
static inline Datum
slot_getsysattr(TupleTableSlot *slot, int attnum, bool *isnull)
{
- AssertArg(attnum < 0); /* caller error */
+ Assert(attnum < 0); /* caller error */
if (attnum == TableOidAttributeNumber)
{
ExecCopySlot(TupleTableSlot *dstslot, TupleTableSlot *srcslot)
{
Assert(!TTS_EMPTY(srcslot));
- AssertArg(srcslot != dstslot);
+ Assert(srcslot != dstslot);
dstslot->tts_ops->copyslot(dstslot, srcslot);
#define SetProcessingMode(mode) \
do { \
- AssertArg((mode) == BootstrapProcessing || \
+ Assert((mode) == BootstrapProcessing || \
(mode) == InitProcessing || \
(mode) == NormalProcessing); \
Mode = (mode); \
static inline int
pgstat_cmp_hash_key(const void *a, const void *b, size_t size, void *arg)
{
- AssertArg(size == sizeof(PgStat_HashKey) && arg == NULL);
+ Assert(size == sizeof(PgStat_HashKey) && arg == NULL);
return memcmp(a, b, sizeof(PgStat_HashKey));
}
const PgStat_HashKey *key = (PgStat_HashKey *) d;
uint32 hash;
- AssertArg(size == sizeof(PgStat_HashKey) && arg == NULL);
+ Assert(size == sizeof(PgStat_HashKey) && arg == NULL);
hash = murmurhash32(key->kind);
hash = hash_combine(hash, murmurhash32(key->dboid));