Remove AssertArg and AssertState
authorPeter Eisentraut <peter@eisentraut.org>
Fri, 28 Oct 2022 07:19:06 +0000 (09:19 +0200)
committerPeter Eisentraut <peter@eisentraut.org>
Fri, 28 Oct 2022 07:19:06 +0000 (09:19 +0200)
These don't offer anything over plain Assert, and their usage had
already been declared obsolescent.

Author: Nathan Bossart <nathandbossart@gmail.com>
Reviewed-by: Michael Paquier <michael@paquier.xyz>
Discussion: https://www.postgresql.org/message-id/20221009210148.GA900071@nathanxps13

44 files changed:
contrib/fuzzystrmatch/fuzzystrmatch.c
src/backend/access/common/tupdesc.c
src/backend/access/heap/heapam.c
src/backend/access/nbtree/nbtsort.c
src/backend/access/transam/multixact.c
src/backend/access/transam/xact.c
src/backend/bootstrap/bootstrap.c
src/backend/catalog/namespace.c
src/backend/catalog/pg_collation.c
src/backend/commands/dbcommands.c
src/backend/commands/indexcmds.c
src/backend/commands/portalcmds.c
src/backend/commands/tablecmds.c
src/backend/jit/jit.c
src/backend/parser/parse_utilcmd.c
src/backend/postmaster/autovacuum.c
src/backend/replication/logical/reorderbuffer.c
src/backend/replication/slot.c
src/backend/storage/lmgr/lwlock.c
src/backend/tcop/postgres.c
src/backend/tcop/pquery.c
src/backend/utils/activity/pgstat.c
src/backend/utils/activity/pgstat_replslot.c
src/backend/utils/activity/pgstat_shmem.c
src/backend/utils/activity/pgstat_slru.c
src/backend/utils/adt/mcxtfuncs.c
src/backend/utils/adt/xml.c
src/backend/utils/cache/relcache.c
src/backend/utils/fmgr/dfmgr.c
src/backend/utils/init/miscinit.c
src/backend/utils/misc/guc-file.l
src/backend/utils/misc/guc.c
src/backend/utils/mmgr/aset.c
src/backend/utils/mmgr/generation.c
src/backend/utils/mmgr/mcxt.c
src/backend/utils/mmgr/portalmem.c
src/backend/utils/mmgr/slab.c
src/backend/utils/sort/tuplesortvariants.c
src/common/controldata_utils.c
src/common/protocol_openssl.c
src/include/c.h
src/include/executor/tuptable.h
src/include/miscadmin.h
src/include/utils/pgstat_internal.h

index a04251ace61e2b45b94f3e15916f6110ad862e79..5659cc71ace152252a43b0cbc8c7ea3f70a9ced8 100644 (file)
@@ -724,8 +724,8 @@ _soundex(const char *instr, char *outstr)
 {
        int                     count;
 
-       AssertArg(instr);
-       AssertArg(outstr);
+       Assert(instr);
+       Assert(outstr);
 
        outstr[SOUNDEX_LEN] = '\0';
 
index d6fb261e20162cc0f9fc920cbcf3daea4a46d4a6..b7f918c877bd7c9b62c98b0dbd0c32624877f83b 100644 (file)
@@ -49,7 +49,7 @@ CreateTemplateTupleDesc(int natts)
        /*
         * sanity checks
         */
-       AssertArg(natts >= 0);
+       Assert(natts >= 0);
 
        /*
         * Allocate enough memory for the tuple descriptor, including the
@@ -273,12 +273,12 @@ TupleDescCopyEntry(TupleDesc dst, AttrNumber dstAttno,
        /*
         * 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);
 
@@ -594,9 +594,9 @@ TupleDescInitEntry(TupleDesc desc,
        /*
         * 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
@@ -664,9 +664,9 @@ TupleDescInitBuiltinEntry(TupleDesc desc,
        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);
@@ -767,9 +767,9 @@ TupleDescInitEntryCollation(TupleDesc desc,
        /*
         * 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;
 }
index bd4d85041d333e0c28c383aa796e4bbfd4dd7aac..12be87efed4fef5938afd05bb20f39f0e25c2006 100644 (file)
@@ -2281,7 +2281,7 @@ heap_multi_insert(Relation relation, TupleTableSlot **slots, int ntuples,
        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,
index bd1685c441b14bc92f3270c9348a1d0a2886b838..501e011ce1e5eb4d3910d1a7cc1962db7c625248 100644 (file)
@@ -1226,7 +1226,7 @@ _bt_load(BTWriteState *wstate, BTSpool *btspool, BTSpool *btspool2)
                        /* 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;
index a7383f553b3d96221af8e3b7f1acdbe17797a302..5eff87665be7785366862e672aa9c1e4e2cc40da 100644 (file)
@@ -389,8 +389,8 @@ MultiXactIdCreate(TransactionId xid1, MultiXactStatus status1,
        MultiXactId newMulti;
        MultiXactMember members[2];
 
-       AssertArg(TransactionIdIsValid(xid1));
-       AssertArg(TransactionIdIsValid(xid2));
+       Assert(TransactionIdIsValid(xid1));
+       Assert(TransactionIdIsValid(xid2));
 
        Assert(!TransactionIdEquals(xid1, xid2) || (status1 != status2));
 
@@ -445,8 +445,8 @@ MultiXactIdExpand(MultiXactId multi, TransactionId xid, MultiXactStatus status)
        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]));
index fd5103a78e249c2bd801786fc9211e68c72e044b..6cb7dab124acde404a78e1c08444c32b3af95052 100644 (file)
@@ -3250,7 +3250,7 @@ CommitTransactionCommand(void)
                                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;
                        }
@@ -3278,7 +3278,7 @@ CommitTransactionCommand(void)
                                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;
                        }
@@ -4667,7 +4667,7 @@ RollbackAndReleaseCurrentSubTransaction(void)
        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);
index 58247d826dc3cea69c83dae3bb0dbd5e21103685..661ebacb0c2014229cccd788fc8384c7f1572b94 100644 (file)
@@ -648,7 +648,7 @@ InsertOneValue(char *value, int i)
        Oid                     typinput;
        Oid                     typoutput;
 
-       AssertArg(i >= 0 && i < MAXATTR);
+       Assert(i >= 0 && i < MAXATTR);
 
        elog(DEBUG4, "inserting column %d value \"%s\"", i, value);
 
index 92aed2ff8bd7a75e0b0680dd809c943b72c5c7fe..539df1da94939eec0680bdc8f2831208d2ebdd48 100644 (file)
@@ -4093,7 +4093,7 @@ InitTempTableNamespace(void)
        MyProc->tempNamespaceId = namespaceId;
 
        /* It should not be done already. */
-       AssertState(myTempNamespaceSubID == InvalidSubTransactionId);
+       Assert(myTempNamespaceSubID == InvalidSubTransactionId);
        myTempNamespaceSubID = GetCurrentSubTransactionId();
 
        baseSearchPathValid = false;    /* need to rebuild list */
index 6081bf58c60f6c8cb9eb9db8fb878e015528b76f..aa8fbe1a98028f152b840b3965e6d38251d32664 100644 (file)
@@ -64,10 +64,10 @@ CollationCreate(const char *collname, Oid collnamespace,
        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.
index 96b46cbc020ef8b85b6d54d3d4ca8ad116277832..16e422138bb7eb1358c377036940e72771190582 100644 (file)
@@ -2606,7 +2606,7 @@ get_db_info(const char *name, LOCKMODE lockmode,
        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);
index fd56066c1333c88de16bc62ba8751311ec86ebcb..659e18954945327e0caf30339e57dac2bddd44f8 100644 (file)
@@ -2896,7 +2896,7 @@ ReindexMultipleTables(const char *objectName, ReindexObjectType objectKind,
         * 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)
index 9902c5c5669af4237d7b917787c45862f032671d..09bcfd59be6bdabaf2a071d1841335d38f3d0ca0 100644 (file)
@@ -267,8 +267,8 @@ PortalCleanup(Portal portal)
        /*
         * 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,
index 20135ef1b009a60acc75f3fd8c8d6caea2b755df..bc90185da6bd159e9eb60b827ccd3a15f36f3935 100644 (file)
@@ -3134,7 +3134,7 @@ StoreCatalogInheritance(Oid relationId, List *supers,
        /*
         * sanity checks
         */
-       AssertArg(OidIsValid(relationId));
+       Assert(OidIsValid(relationId));
 
        if (supers == NIL)
                return;
@@ -3651,7 +3651,7 @@ rename_constraint_internal(Oid myrelid,
        Form_pg_constraint con;
        ObjectAddress address;
 
-       AssertArg(!myrelid || !mytypid);
+       Assert(!myrelid || !mytypid);
 
        if (mytypid)
        {
@@ -9731,7 +9731,7 @@ addFkRecurseReferencing(List **wqueue, Constraint *fkconstraint, Relation rel,
        Oid                     insertTriggerOid,
                                updateTriggerOid;
 
-       AssertArg(OidIsValid(parentConstr));
+       Assert(OidIsValid(parentConstr));
 
        if (rel->rd_rel->relkind == RELKIND_FOREIGN_TABLE)
                ereport(ERROR,
index 18d168f1af9f55d5d958906337495f1a7bf42027..91a6b2b63ad9ea1396fe2da96fbaa749c4ec55c7 100644 (file)
@@ -195,7 +195,7 @@ file_exists(const char *name)
 {
        struct stat st;
 
-       AssertArg(name != NULL);
+       Assert(name != NULL);
 
        if (stat(name, &st) == 0)
                return !S_ISDIR(st.st_mode);
index bd068bba05e4c1f5797fced5d5f13dcadf1695b4..8140e79d8f13dc0719e9f3b699f574b3c8314538 100644 (file)
@@ -1463,7 +1463,7 @@ transformOfType(CreateStmtContext *cxt, TypeName *ofTypename)
        int                     i;
        Oid                     ofTypeId;
 
-       AssertArg(ofTypename);
+       Assert(ofTypename);
 
        tuple = typenameType(NULL, ofTypename, NULL);
        check_of_type(tuple);
index 1e90b72b7403062b10230e8b2b4736d05207a08a..601834d4b4edc7ac83ded62e49d8df67227e788d 100644 (file)
@@ -3001,8 +3001,8 @@ relation_needs_vacanalyze(Oid relid,
        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
index c29894041e44e7257418af7225151025716934c4..20c9cd139ab5fa5c13496eaa315c31b7a3a5f646 100644 (file)
@@ -3084,7 +3084,7 @@ ReorderBufferSetBaseSnapshot(ReorderBuffer *rb, TransactionId xid,
        ReorderBufferTXN *txn;
        bool            is_new;
 
-       AssertArg(snap != NULL);
+       Assert(snap != NULL);
 
        /*
         * Fetch the transaction to operate on.  If we know it's a subtransaction,
index b514a4d97c507d5130c9f302377977c7c45b9ebb..c036a2c37b6dc6e44e0747498b85b39bc48e980c 100644 (file)
@@ -452,7 +452,7 @@ ReplicationSlotAcquire(const char *name, bool nowait)
        ReplicationSlot *s;
        int                     active_pid;
 
-       AssertArg(name != NULL);
+       Assert(name != NULL);
 
 retry:
        Assert(MyReplicationSlot == NULL);
index d274c9b1dc95e31a319084458fdc2eac132ab5bf..0fc0cf6ebbd9d896ec606c0ac05c032aa6bd0fff 100644 (file)
@@ -816,7 +816,7 @@ LWLockAttemptLock(LWLock *lock, LWLockMode mode)
 {
        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
@@ -1204,7 +1204,7 @@ LWLockAcquire(LWLock *lock, LWLockMode mode)
        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);
 
@@ -1368,7 +1368,7 @@ LWLockConditionalAcquire(LWLock *lock, LWLockMode mode)
 {
        bool            mustwait;
 
-       AssertArg(mode == LW_SHARED || mode == LW_EXCLUSIVE);
+       Assert(mode == LW_SHARED || mode == LW_EXCLUSIVE);
 
        PRINT_LWDEBUG("LWLockConditionalAcquire", lock, mode);
 
index a9a1851c9466c8c3a65418e98e6b7d9e5dbf4133..3082093d1eabdb8c7aeb61f1a505e0acb2618a7c 100644 (file)
@@ -4050,8 +4050,8 @@ PostgresMain(const char *dbname, const char *username)
        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);
 
index 5aa5a350f387859bd77f2bb542fd122b1b543fae..52e2db6452beca5862deac68812ec30ee842116d 100644 (file)
@@ -440,8 +440,8 @@ PortalStart(Portal portal, ParamListInfo params,
        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.
@@ -694,7 +694,7 @@ PortalRun(Portal portal, long count, bool isTopLevel, bool run_once,
        MemoryContext savePortalContext;
        MemoryContext saveMemoryContext;
 
-       AssertArg(PortalIsValid(portal));
+       Assert(PortalIsValid(portal));
 
        TRACE_POSTGRESQL_QUERY_EXECUTE_START();
 
@@ -1399,7 +1399,7 @@ PortalRunFetch(Portal portal,
        MemoryContext savePortalContext;
        MemoryContext oldContext;
 
-       AssertArg(PortalIsValid(portal));
+       Assert(PortalIsValid(portal));
 
        /*
         * Check for improper portal use, and mark portal active.
index 1b97597f17ce7b91ed8f1983d2791a002a8389bd..1ebe3bbf29f9fafc56425919923366ab8ec33c91 100644 (file)
@@ -785,7 +785,7 @@ pgstat_fetch_entry(PgStat_Kind kind, Oid dboid, Oid objoid)
 
        /* should be called from backends */
        Assert(IsUnderPostmaster || !IsPostmasterEnvironment);
-       AssertArg(!kind_info->fixed_amount);
+       Assert(!kind_info->fixed_amount);
 
        pgstat_prep_snapshot();
 
@@ -901,8 +901,8 @@ pgstat_have_entry(PgStat_Kind kind, Oid dboid, Oid objoid)
 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();
@@ -1219,7 +1219,7 @@ pgstat_is_kind_valid(int ikind)
 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];
 }
index 252d2e4e078d1201e0e5c7ab06b5020f7500e4a1..c6fc3b48bac441ab36eb7d1355a878173bcf0251 100644 (file)
@@ -44,7 +44,7 @@ pgstat_reset_replslot(const char *name)
 {
        ReplicationSlot *slot;
 
-       AssertArg(name != NULL);
+       Assert(name != NULL);
 
        /* Check if the slot exits with the given name. */
        slot = SearchNamedReplicationSlot(name, true);
@@ -213,7 +213,7 @@ get_replslot_index(const char *name)
 {
        ReplicationSlot *slot;
 
-       AssertArg(name != NULL);
+       Assert(name != NULL);
 
        slot = SearchNamedReplicationSlot(name, true);
 
index 9a4f037959edf01f4d7375c4c382b5b117dc2c38..706692862c5300a9935dfa5a2772a8a89d8c1fbe 100644 (file)
@@ -402,7 +402,7 @@ pgstat_get_entry_ref(PgStat_Kind kind, Oid dboid, Oid objoid, bool create,
         * 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);
index 28ef736735f01a410a6ac54864cc9406952b286f..20dd1e6f66afa7df04ca30f95636f5495e813ed2 100644 (file)
@@ -46,7 +46,7 @@ pgstat_reset_slru(const char *name)
 {
        TimestampTz ts = GetCurrentTimestamp();
 
-       AssertArg(name != NULL);
+       Assert(name != NULL);
 
        pgstat_reset_slru_counter_internal(pgstat_get_slru_index(name), ts);
 }
index 04b7aa2a77bcea9fdebd43aecd202db72d1dc7d5..4add2195537b320243204a9fe00ebcebf2fcc8c0 100644 (file)
@@ -46,7 +46,7 @@ PutMemoryContextsStatsTupleStore(Tuplestorestate *tupstore,
        const char *name;
        const char *ident;
 
-       AssertArg(MemoryContextIsValid(context));
+       Assert(MemoryContextIsValid(context));
 
        name = context->name;
        ident = context->ident;
index d32cb11436e7e70e1463491abe3593c04cf61631..e4f2adb1f904399a9849b253afb9439f95223354 100644 (file)
@@ -4500,7 +4500,7 @@ XmlTableSetColumnFilter(TableFuncScanState *state, const char *path, int colnum)
        XmlTableBuilderData *xtCxt;
        xmlChar    *xstr;
 
-       AssertArg(PointerIsValid(path));
+       Assert(PointerIsValid(path));
 
        xtCxt = GetXmlTableBuilderPrivateData(state, "XmlTableSetColumnFilter");
 
index 00dc0f24037b6e04fcb66ff16b3fce06eca22471..bd6cd4e47b508e3ff1fcfbc3a965f31c65057440 100644 (file)
@@ -3474,7 +3474,7 @@ RelationBuildLocalRelation(const char *relname,
        bool            has_not_null;
        bool            nailit;
 
-       AssertArg(natts >= 0);
+       Assert(natts >= 0);
 
        /*
         * check for creation of a rel that must be nailed in cache.
index 6ae6fc1556dedebeb8563c73adf9365abe5d9d38..e4d513c4e4e5316f35779a84206bb41ec6df3cc3 100644 (file)
@@ -405,7 +405,7 @@ file_exists(const char *name)
 {
        struct stat st;
 
-       AssertArg(name != NULL);
+       Assert(name != NULL);
 
        if (stat(name, &st) == 0)
                return !S_ISDIR(st.st_mode);
@@ -434,7 +434,7 @@ expand_dynamic_library_name(const char *name)
        char       *new;
        char       *full;
 
-       AssertArg(name);
+       Assert(name);
 
        have_slash = (first_dir_separator(name) != NULL);
 
@@ -502,7 +502,7 @@ substitute_libpath_macro(const char *name)
 {
        const char *sep_ptr;
 
-       AssertArg(name != NULL);
+       Assert(name != NULL);
 
        /* Currently, we only recognize $libdir at the start of the string */
        if (name[0] != '$')
@@ -534,9 +534,9 @@ find_in_dynamic_libpath(const char *basename)
        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)
index dfdcd3d78eb2c84cdd48c308e9db6e67fb8fad76..eb1046450b335c6bd453838df208bcec4d33909b 100644 (file)
@@ -417,7 +417,7 @@ SetDataDir(const char *dir)
 {
        char       *new;
 
-       AssertArg(dir);
+       Assert(dir);
 
        /* If presented path is relative, convert to absolute */
        new = make_absolute_path(dir);
@@ -435,7 +435,7 @@ SetDataDir(const char *dir)
 void
 ChangeToDataDir(void)
 {
-       AssertState(DataDir);
+       Assert(DataDir);
 
        if (chdir(DataDir) < 0)
                ereport(FATAL,
@@ -496,7 +496,7 @@ static bool SetRoleIsActive = false;
 Oid
 GetUserId(void)
 {
-       AssertState(OidIsValid(CurrentUserId));
+       Assert(OidIsValid(CurrentUserId));
        return CurrentUserId;
 }
 
@@ -507,7 +507,7 @@ GetUserId(void)
 Oid
 GetOuterUserId(void)
 {
-       AssertState(OidIsValid(OuterUserId));
+       Assert(OidIsValid(OuterUserId));
        return OuterUserId;
 }
 
@@ -515,8 +515,8 @@ GetOuterUserId(void)
 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 */
@@ -530,7 +530,7 @@ SetOuterUserId(Oid userid)
 Oid
 GetSessionUserId(void)
 {
-       AssertState(OidIsValid(SessionUserId));
+       Assert(OidIsValid(SessionUserId));
        return SessionUserId;
 }
 
@@ -538,8 +538,8 @@ GetSessionUserId(void)
 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;
@@ -565,7 +565,7 @@ GetSystemUser(void)
 Oid
 GetAuthenticatedUserId(void)
 {
-       AssertState(OidIsValid(AuthenticatedUserId));
+       Assert(OidIsValid(AuthenticatedUserId));
        return AuthenticatedUserId;
 }
 
@@ -719,10 +719,10 @@ InitializeSessionUserId(const char *rolename, Oid roleid)
         * 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
@@ -818,10 +818,10 @@ InitializeSessionUserIdStandalone(void)
         * 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;
@@ -886,7 +886,7 @@ void
 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)
index 721628c0cf11976e0114630beea752e68e233adc..24363963067b3feb2f98bf376967811b599f268c 100644 (file)
@@ -179,7 +179,7 @@ AbsoluteConfigLocation(const char *location, const char *calling_file)
                }
                else
                {
-                       AssertState(DataDir);
+                       Assert(DataDir);
                        join_path_components(abs_path, DataDir, location);
                        canonicalize_path(abs_path);
                }
index 6f21752b844242dc428ab0500bf91210edd559cb..4de14efe87752c3b754009dafef640bdf1c99b19 100644 (file)
@@ -6081,9 +6081,9 @@ ParseLongOption(const char *string, char **name, char **value)
        size_t          equal_pos;
        char       *cp;
 
-       AssertArg(string);
-       AssertArg(name);
-       AssertArg(value);
+       Assert(string);
+       Assert(name);
+       Assert(value);
 
        equal_pos = strcspn(string, "=");
 
index db402e3a4166c946e694fe662711d033479cf240..b6a8bbcd596230750a862480202c10d387503cc9 100644 (file)
@@ -544,7 +544,7 @@ AllocSetReset(MemoryContext context)
        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 */
@@ -614,7 +614,7 @@ AllocSetDelete(MemoryContext context)
        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 */
@@ -713,7 +713,7 @@ AllocSetAlloc(MemoryContext context, Size size)
        Size            chunk_size;
        Size            blksize;
 
-       AssertArg(AllocSetIsValid(set));
+       Assert(AllocSetIsValid(set));
 
        /*
         * If requested size exceeds maximum for chunks, allocate an entire block
@@ -1061,7 +1061,7 @@ AllocSetFree(void *pointer)
                 * 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);
@@ -1237,7 +1237,7 @@ AllocSetRealloc(void *pointer, Size size)
         * 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);
@@ -1368,7 +1368,7 @@ AllocSetGetChunkContext(void *pointer)
        else
                block = (AllocBlock) MemoryChunkGetBlock(chunk);
 
-       AssertArg(AllocBlockIsValid(block));
+       Assert(AllocBlockIsValid(block));
        set = block->aset;
 
        return &set->header;
@@ -1389,7 +1389,7 @@ AllocSetGetChunkSpace(void *pointer)
        {
                AllocBlock      block = ExternalChunkGetBlock(chunk);
 
-               AssertArg(AllocBlockIsValid(block));
+               Assert(AllocBlockIsValid(block));
                return block->endptr - (char *) chunk;
        }
 
@@ -1405,7 +1405,7 @@ AllocSetGetChunkSpace(void *pointer)
 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
@@ -1440,7 +1440,7 @@ AllocSetStats(MemoryContext context,
        AllocBlock      block;
        int                     fidx;
 
-       AssertArg(AllocSetIsValid(set));
+       Assert(AllocSetIsValid(set));
 
        /* Include context header in totalspace */
        totalspace = MAXALIGN(sizeof(AllocSetContext));
index 4cb75f493ff83a2bd99d220d3fa4b7c695e83d99..b432a92be31fa40f79c68aaf6c17406bdd338ed0 100644 (file)
@@ -284,7 +284,7 @@ GenerationReset(MemoryContext context)
        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 */
@@ -354,7 +354,7 @@ GenerationAlloc(MemoryContext context, Size size)
        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 */
@@ -657,7 +657,7 @@ GenerationFree(void *pointer)
                 * 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);
@@ -769,7 +769,7 @@ GenerationRealloc(void *pointer, Size size)
                 * 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);
        }
@@ -888,7 +888,7 @@ GenerationGetChunkContext(void *pointer)
        else
                block = (GenerationBlock *) MemoryChunkGetBlock(chunk);
 
-       AssertArg(GenerationBlockIsValid(block));
+       Assert(GenerationBlockIsValid(block));
        return &block->context->header;
 }
 
@@ -907,7 +907,7 @@ GenerationGetChunkSpace(void *pointer)
        {
                GenerationBlock *block = ExternalChunkGetBlock(chunk);
 
-               AssertArg(GenerationBlockIsValid(block));
+               Assert(GenerationBlockIsValid(block));
                chunksize = block->endptr - (char *) pointer;
        }
        else
@@ -926,7 +926,7 @@ GenerationIsEmpty(MemoryContext context)
        GenerationContext *set = (GenerationContext *) context;
        dlist_iter      iter;
 
-       AssertArg(GenerationIsValid(set));
+       Assert(GenerationIsValid(set));
 
        dlist_foreach(iter, &set->blocks)
        {
@@ -964,7 +964,7 @@ GenerationStats(MemoryContext context,
        Size            freespace = 0;
        dlist_iter      iter;
 
-       AssertArg(GenerationIsValid(set));
+       Assert(GenerationIsValid(set));
 
        /* Include context header in totalspace */
        totalspace = MAXALIGN(sizeof(GenerationContext));
index 012517be5c5f07c8f52ac0658edbd252c2ab19f3..f526ca82c15da5e20c5cdfc7f8fe9308afce82dd 100644 (file)
@@ -258,7 +258,7 @@ BogusGetChunkSpace(void *pointer)
 void
 MemoryContextInit(void)
 {
-       AssertState(TopMemoryContext == NULL);
+       Assert(TopMemoryContext == NULL);
 
        /*
         * First, initialize TopMemoryContext, which is the parent of all others.
@@ -302,7 +302,7 @@ MemoryContextInit(void)
 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)
@@ -321,7 +321,7 @@ MemoryContextReset(MemoryContext context)
 void
 MemoryContextResetOnly(MemoryContext context)
 {
-       AssertArg(MemoryContextIsValid(context));
+       Assert(MemoryContextIsValid(context));
 
        /* Nothing to do if no pallocs since startup or last reset */
        if (!context->isReset)
@@ -354,7 +354,7 @@ MemoryContextResetChildren(MemoryContext context)
 {
        MemoryContext child;
 
-       AssertArg(MemoryContextIsValid(context));
+       Assert(MemoryContextIsValid(context));
 
        for (child = context->firstchild; child != NULL; child = child->nextchild)
        {
@@ -375,7 +375,7 @@ MemoryContextResetChildren(MemoryContext context)
 void
 MemoryContextDelete(MemoryContext context)
 {
-       AssertArg(MemoryContextIsValid(context));
+       Assert(MemoryContextIsValid(context));
        /* We had better not be deleting TopMemoryContext ... */
        Assert(context != TopMemoryContext);
        /* And not CurrentMemoryContext, either */
@@ -420,7 +420,7 @@ MemoryContextDelete(MemoryContext context)
 void
 MemoryContextDeleteChildren(MemoryContext context)
 {
-       AssertArg(MemoryContextIsValid(context));
+       Assert(MemoryContextIsValid(context));
 
        /*
         * MemoryContextDelete will delink the child from me, so just iterate as
@@ -450,7 +450,7 @@ void
 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;
@@ -493,7 +493,7 @@ MemoryContextCallResetCallbacks(MemoryContext context)
 void
 MemoryContextSetIdentifier(MemoryContext context, const char *id)
 {
-       AssertArg(MemoryContextIsValid(context));
+       Assert(MemoryContextIsValid(context));
        context->ident = id;
 }
 
@@ -518,8 +518,8 @@ MemoryContextSetIdentifier(MemoryContext context, const char *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)
@@ -545,7 +545,7 @@ MemoryContextSetParent(MemoryContext context, MemoryContext new_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;
@@ -575,7 +575,7 @@ MemoryContextSetParent(MemoryContext context, MemoryContext new_parent)
 void
 MemoryContextAllowInCriticalSection(MemoryContext context, bool allow)
 {
-       AssertArg(MemoryContextIsValid(context));
+       Assert(MemoryContextIsValid(context));
 
        context->allowInCritSection = allow;
 }
@@ -612,7 +612,7 @@ GetMemoryChunkSpace(void *pointer)
 MemoryContext
 MemoryContextGetParent(MemoryContext context)
 {
-       AssertArg(MemoryContextIsValid(context));
+       Assert(MemoryContextIsValid(context));
 
        return context->parent;
 }
@@ -624,7 +624,7 @@ MemoryContextGetParent(MemoryContext context)
 bool
 MemoryContextIsEmpty(MemoryContext context)
 {
-       AssertArg(MemoryContextIsValid(context));
+       Assert(MemoryContextIsValid(context));
 
        /*
         * For now, we consider a memory context nonempty if it has any children;
@@ -645,7 +645,7 @@ MemoryContextMemAllocated(MemoryContext context, bool recurse)
 {
        Size            total = context->mem_allocated;
 
-       AssertArg(MemoryContextIsValid(context));
+       Assert(MemoryContextIsValid(context));
 
        if (recurse)
        {
@@ -737,7 +737,7 @@ MemoryContextStatsInternal(MemoryContext context, int level,
        MemoryContext child;
        int                     ichild;
 
-       AssertArg(MemoryContextIsValid(context));
+       Assert(MemoryContextIsValid(context));
 
        /* Examine the context itself */
        context->methods->stats(context,
@@ -902,7 +902,7 @@ MemoryContextCheck(MemoryContext context)
 {
        MemoryContext child;
 
-       AssertArg(MemoryContextIsValid(context));
+       Assert(MemoryContextIsValid(context));
 
        context->methods->check(context);
        for (child = context->firstchild; child != NULL; child = child->nextchild)
@@ -995,7 +995,7 @@ MemoryContextAlloc(MemoryContext context, Size size)
 {
        void       *ret;
 
-       AssertArg(MemoryContextIsValid(context));
+       Assert(MemoryContextIsValid(context));
        AssertNotInCriticalSection(context);
 
        if (!AllocSizeIsValid(size))
@@ -1038,7 +1038,7 @@ MemoryContextAllocZero(MemoryContext context, Size size)
 {
        void       *ret;
 
-       AssertArg(MemoryContextIsValid(context));
+       Assert(MemoryContextIsValid(context));
        AssertNotInCriticalSection(context);
 
        if (!AllocSizeIsValid(size))
@@ -1076,7 +1076,7 @@ MemoryContextAllocZeroAligned(MemoryContext context, Size size)
 {
        void       *ret;
 
-       AssertArg(MemoryContextIsValid(context));
+       Assert(MemoryContextIsValid(context));
        AssertNotInCriticalSection(context);
 
        if (!AllocSizeIsValid(size))
@@ -1111,7 +1111,7 @@ MemoryContextAllocExtended(MemoryContext context, Size size, int flags)
 {
        void       *ret;
 
-       AssertArg(MemoryContextIsValid(context));
+       Assert(MemoryContextIsValid(context));
        AssertNotInCriticalSection(context);
 
        if (!((flags & MCXT_ALLOC_HUGE) != 0 ? AllocHugeSizeIsValid(size) :
@@ -1202,7 +1202,7 @@ palloc(Size size)
        void       *ret;
        MemoryContext context = CurrentMemoryContext;
 
-       AssertArg(MemoryContextIsValid(context));
+       Assert(MemoryContextIsValid(context));
        AssertNotInCriticalSection(context);
 
        if (!AllocSizeIsValid(size))
@@ -1233,7 +1233,7 @@ palloc0(Size size)
        void       *ret;
        MemoryContext context = CurrentMemoryContext;
 
-       AssertArg(MemoryContextIsValid(context));
+       Assert(MemoryContextIsValid(context));
        AssertNotInCriticalSection(context);
 
        if (!AllocSizeIsValid(size))
@@ -1266,7 +1266,7 @@ palloc_extended(Size size, int flags)
        void       *ret;
        MemoryContext context = CurrentMemoryContext;
 
-       AssertArg(MemoryContextIsValid(context));
+       Assert(MemoryContextIsValid(context));
        AssertNotInCriticalSection(context);
 
        if (!((flags & MCXT_ALLOC_HUGE) != 0 ? AllocHugeSizeIsValid(size) :
@@ -1406,7 +1406,7 @@ MemoryContextAllocHuge(MemoryContext context, Size size)
 {
        void       *ret;
 
-       AssertArg(MemoryContextIsValid(context));
+       Assert(MemoryContextIsValid(context));
        AssertNotInCriticalSection(context);
 
        if (!AllocHugeSizeIsValid(size))
index c3e95346b60aeb3ac614f33836fafb3c34c810b7..7b1ae6fdcf0bb587cffd5af0bdc461f850b3dc81 100644 (file)
@@ -177,7 +177,7 @@ CreatePortal(const char *name, bool allowDup, bool dupSilent)
 {
        Portal          portal;
 
-       AssertArg(PointerIsValid(name));
+       Assert(PointerIsValid(name));
 
        portal = GetPortalByName(name);
        if (PortalIsValid(portal))
@@ -287,11 +287,11 @@ PortalDefineQuery(Portal 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;
@@ -468,7 +468,7 @@ MarkPortalFailed(Portal portal)
 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
index 1a0b28f9ea12953370658ac17fc46d86afdbdfb4..6df0839b6acdc25e83382fa1d5143b8138ff68d3 100644 (file)
@@ -254,7 +254,7 @@ SlabReset(MemoryContext context)
        SlabContext *slab = (SlabContext *) context;
        int                     i;
 
-       AssertArg(SlabIsValid(slab));
+       Assert(SlabIsValid(slab));
 
 #ifdef MEMORY_CONTEXT_CHECKING
        /* Check for corruption and leaks before freeing */
@@ -313,7 +313,7 @@ SlabAlloc(MemoryContext context, Size size)
        MemoryChunk *chunk;
        int                     idx;
 
-       AssertArg(SlabIsValid(slab));
+       Assert(SlabIsValid(slab));
 
        Assert((slab->minFreeChunks >= 0) &&
                   (slab->minFreeChunks < slab->chunksPerBlock));
@@ -475,7 +475,7 @@ SlabFree(void *pointer)
         * 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
@@ -593,7 +593,7 @@ SlabGetChunkContext(void *pointer)
        MemoryChunk *chunk = PointerGetMemoryChunk(pointer);
        SlabBlock  *block = MemoryChunkGetBlock(chunk);
 
-       AssertArg(SlabBlockIsValid(block));
+       Assert(SlabBlockIsValid(block));
        return &block->slab->header;
 }
 
@@ -609,7 +609,7 @@ SlabGetChunkSpace(void *pointer)
        SlabBlock  *block = MemoryChunkGetBlock(chunk);
        SlabContext *slab;
 
-       AssertArg(SlabBlockIsValid(block));
+       Assert(SlabBlockIsValid(block));
        slab = block->slab;
 
        return slab->fullChunkSize;
@@ -624,7 +624,7 @@ SlabIsEmpty(MemoryContext context)
 {
        SlabContext *slab = (SlabContext *) context;
 
-       AssertArg(SlabIsValid(slab));
+       Assert(SlabIsValid(slab));
 
        return (slab->nblocks == 0);
 }
@@ -651,7 +651,7 @@ SlabStats(MemoryContext context,
        Size            freespace = 0;
        int                     i;
 
-       AssertArg(SlabIsValid(slab));
+       Assert(SlabIsValid(slab));
 
        /* Include context header in totalspace */
        totalspace = slab->headerSize;
@@ -709,7 +709,7 @@ SlabCheck(MemoryContext context)
        int                     i;
        const char *name = slab->header.name;
 
-       AssertArg(SlabIsValid(slab));
+       Assert(SlabIsValid(slab));
        Assert(slab->chunksPerBlock > 0);
 
        /* walk all the freelists */
index f5d72b4752ee36f71a767f819ee384765065d609..dfe132660a75dab7ac814431dff5f3852a7c06db 100644 (file)
@@ -145,7 +145,7 @@ tuplesort_begin_heap(TupleDesc tupDesc,
 
        oldcontext = MemoryContextSwitchTo(base->maincontext);
 
-       AssertArg(nkeys > 0);
+       Assert(nkeys > 0);
 
 #ifdef TRACE_SORT
        if (trace_sort)
@@ -177,8 +177,8 @@ tuplesort_begin_heap(TupleDesc tupDesc,
        {
                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];
@@ -297,7 +297,7 @@ tuplesort_begin_cluster(TupleDesc tupDesc,
                /* 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;
@@ -381,7 +381,7 @@ tuplesort_begin_index_btree(Relation heapRel,
                /* 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;
@@ -501,7 +501,7 @@ tuplesort_begin_index_gist(Relation heapRel,
                /* 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);
index 66168543a6eb80fbf2520d7f3f8e8dd186b14346..2d1f35bbd188d60e17406b739929679aa067aa34 100644 (file)
@@ -57,7 +57,7 @@ get_controlfile(const char *DataDir, bool *crc_ok_p)
        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);
index 8d1da8be3879fa497f834955600eafe6cbcafa08..d8bae488a8dd947db53e63edb59de5cad19f95fd 100644 (file)
@@ -81,7 +81,7 @@ SSL_CTX_set_max_proto_version(SSL_CTX *ctx, int version)
 {
        int                     ssl_options = 0;
 
-       AssertArg(version != 0);
+       Assert(version != 0);
 
        /*
         * Some OpenSSL versions define TLS*_VERSION macros but not the
index e5510e278d1fe73af4c7a37c41d05f2b97c2043a..d70ed84ac58e3367fc60bf50924ff834a193e177 100644 (file)
@@ -793,8 +793,6 @@ typedef NameData *Name;
 
 #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)
@@ -802,8 +800,6 @@ typedef NameData *Name;
 #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 */
@@ -828,14 +824,6 @@ typedef NameData *Name;
        ((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.
  */
index a001e448bad5eaca22adcdcb500611048c9b0c4a..f12922663e5265647531683bbfa59f5a984c0f0e 100644 (file)
@@ -374,7 +374,7 @@ slot_getallattrs(TupleTableSlot *slot)
 static inline bool
 slot_attisnull(TupleTableSlot *slot, int attnum)
 {
-       AssertArg(attnum > 0);
+       Assert(attnum > 0);
 
        if (attnum > slot->tts_nvalid)
                slot_getsomeattrs(slot, attnum);
@@ -389,7 +389,7 @@ static inline Datum
 slot_getattr(TupleTableSlot *slot, int attnum,
                         bool *isnull)
 {
-       AssertArg(attnum > 0);
+       Assert(attnum > 0);
 
        if (attnum > slot->tts_nvalid)
                slot_getsomeattrs(slot, attnum);
@@ -409,7 +409,7 @@ slot_getattr(TupleTableSlot *slot, int 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)
        {
@@ -483,7 +483,7 @@ static inline TupleTableSlot *
 ExecCopySlot(TupleTableSlot *dstslot, TupleTableSlot *srcslot)
 {
        Assert(!TTS_EMPTY(srcslot));
-       AssertArg(srcslot != dstslot);
+       Assert(srcslot != dstslot);
 
        dstslot->tts_ops->copyslot(dstslot, srcslot);
 
index e7ebea4ff444512905ebe6b980b598dbcbd3e84a..795182fa519c08d94c61536e69285ea4d7250def 100644 (file)
@@ -407,7 +407,7 @@ extern PGDLLIMPORT ProcessingMode Mode;
 
 #define SetProcessingMode(mode) \
        do { \
-               AssertArg((mode) == BootstrapProcessing || \
+               Assert((mode) == BootstrapProcessing || \
                                  (mode) == InitProcessing || \
                                  (mode) == NormalProcessing); \
                Mode = (mode); \
index 627c1389e4c7dea16811fb86b4615052a0fe389f..c869533b282451e7fec2953e21b987b57c7bbfd9 100644 (file)
@@ -739,7 +739,7 @@ pgstat_copy_changecounted_stats(void *dst, void *src, size_t len,
 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));
 }
 
@@ -749,7 +749,7 @@ pgstat_hash_hash_key(const void *d, size_t size, void *arg)
        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));