Skip to content

Commit 1d1b32a

Browse files
committed
Address ccvalid/ccnoinherit in TupleDesc support functions.
equalTupleDescs() neglected both of these ConstrCheck fields, and CreateTupleDescCopyConstr() neglected ccnoinherit. At this time, the only known behavior defect resulting from these omissions is constraint exclusion disregarding a CHECK constraint validated by an ALTER TABLE VALIDATE CONSTRAINT statement issued earlier in the same transaction. Back-patch to 9.2, where these fields were introduced.
1 parent ee42d8f commit 1d1b32a

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/backend/access/common/tupdesc.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -203,6 +203,7 @@ CreateTupleDescCopyConstr(TupleDesc tupdesc)
203203
if (constr->check[i].ccbin)
204204
cpy->check[i].ccbin = pstrdup(constr->check[i].ccbin);
205205
cpy->check[i].ccvalid = constr->check[i].ccvalid;
206+
cpy->check[i].ccnoinherit = constr->check[i].ccnoinherit;
206207
}
207208
}
208209

@@ -416,7 +417,9 @@ equalTupleDescs(TupleDesc tupdesc1, TupleDesc tupdesc2)
416417
for (j = 0; j < n; check2++, j++)
417418
{
418419
if (strcmp(check1->ccname, check2->ccname) == 0 &&
419-
strcmp(check1->ccbin, check2->ccbin) == 0)
420+
strcmp(check1->ccbin, check2->ccbin) == 0 &&
421+
check1->ccvalid == check2->ccvalid &&
422+
check1->ccnoinherit == check2->ccnoinherit)
420423
break;
421424
}
422425
if (j >= n)

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy