]> granicus.if.org Git - postgresql/commitdiff
Fix creative, but unportable, spelling of "ptr != NULL".
authorTom Lane <tgl@sss.pgh.pa.us>
Mon, 12 Dec 2016 16:23:23 +0000 (11:23 -0500)
committerTom Lane <tgl@sss.pgh.pa.us>
Mon, 12 Dec 2016 16:23:23 +0000 (11:23 -0500)
Or at least I suppose that's what was really meant here.  But even
aside from the not-per-project-style use of "0" to mean "NULL",
I doubt it's safe to assume that all valid pointers are > NULL.
Per buildfarm member pademelon.

src/backend/commands/tablecmds.c

index c77b216d4f775ecaed21db596af1d7db6436e5e8..5856e729180907b873c5a1770d42be27f21232df 100644 (file)
@@ -13167,7 +13167,7 @@ ATExecAttachPartition(List **wqueue, Relation rel, PartitionCmd *cmd)
        tupleDesc = RelationGetDescr(attachRel);
        attachRel_constr = tupleDesc->constr;
        existConstraint = NIL;
-       if (attachRel_constr > 0)
+       if (attachRel_constr != NULL)
        {
                int                     num_check = attachRel_constr->num_check;
                int                     i;