mirror of https://github.com/citusdata/citus.git
Fix self-strncmp in ConstrIsFKToReferenceTable
Make the function do what I assume was intended.pull/2669/head
parent
885d48f87d
commit
1125fc9da0
|
@ -42,7 +42,7 @@ static bool HeapTupleOfForeignConstraintIncludesColumn(HeapTuple heapTuple, Oid
|
||||||
* of them is a foreign key referencing to a reference table.
|
* of them is a foreign key referencing to a reference table.
|
||||||
*/
|
*/
|
||||||
bool
|
bool
|
||||||
ConstraintIsAForeignKeyToReferenceTable(char *constraintName, Oid relationId)
|
ConstraintIsAForeignKeyToReferenceTable(char *constraintNameInput, Oid relationId)
|
||||||
{
|
{
|
||||||
Relation pgConstraint = NULL;
|
Relation pgConstraint = NULL;
|
||||||
SysScanDesc scanDescriptor = NULL;
|
SysScanDesc scanDescriptor = NULL;
|
||||||
|
@ -66,7 +66,7 @@ ConstraintIsAForeignKeyToReferenceTable(char *constraintName, Oid relationId)
|
||||||
Form_pg_constraint constraintForm = (Form_pg_constraint) GETSTRUCT(heapTuple);
|
Form_pg_constraint constraintForm = (Form_pg_constraint) GETSTRUCT(heapTuple);
|
||||||
char *constraintName = (constraintForm->conname).data;
|
char *constraintName = (constraintForm->conname).data;
|
||||||
|
|
||||||
if (strncmp(constraintName, constraintName, NAMEDATALEN) != 0 ||
|
if (strncmp(constraintNameInput, constraintName, NAMEDATALEN) != 0 ||
|
||||||
constraintForm->conrelid != relationId)
|
constraintForm->conrelid != relationId)
|
||||||
{
|
{
|
||||||
heapTuple = systable_getnext(scanDescriptor);
|
heapTuple = systable_getnext(scanDescriptor);
|
||||||
|
|
Loading…
Reference in New Issue