Commit c31305de authored by Noah Misch's avatar Noah Misch

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.
parent 4c0e97c2
...@@ -204,6 +204,7 @@ CreateTupleDescCopyConstr(TupleDesc tupdesc) ...@@ -204,6 +204,7 @@ CreateTupleDescCopyConstr(TupleDesc tupdesc)
if (constr->check[i].ccbin) if (constr->check[i].ccbin)
cpy->check[i].ccbin = pstrdup(constr->check[i].ccbin); cpy->check[i].ccbin = pstrdup(constr->check[i].ccbin);
cpy->check[i].ccvalid = constr->check[i].ccvalid; cpy->check[i].ccvalid = constr->check[i].ccvalid;
cpy->check[i].ccnoinherit = constr->check[i].ccnoinherit;
} }
} }
...@@ -458,7 +459,9 @@ equalTupleDescs(TupleDesc tupdesc1, TupleDesc tupdesc2) ...@@ -458,7 +459,9 @@ equalTupleDescs(TupleDesc tupdesc1, TupleDesc tupdesc2)
for (j = 0; j < n; check2++, j++) for (j = 0; j < n; check2++, j++)
{ {
if (strcmp(check1->ccname, check2->ccname) == 0 && if (strcmp(check1->ccname, check2->ccname) == 0 &&
strcmp(check1->ccbin, check2->ccbin) == 0) strcmp(check1->ccbin, check2->ccbin) == 0 &&
check1->ccvalid == check2->ccvalid &&
check1->ccnoinherit == check2->ccnoinherit)
break; break;
} }
if (j >= n) if (j >= n)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment