storeConstraintDependenciesOnPrivileges
(activation, conDesc, null, providerInfo);
break;
case DataDictionary.FOREIGNKEY_CONSTRAINT:
ReferencedKeyConstraintDescriptor referencedConstraint = DDUtils.locateReferencedConstraint
( dd, td, constraintName, columnNames, otherConstraintInfo );
DDUtils.validateReferentialActions(dd, td, constraintName, otherConstraintInfo,columnNames);
conDesc = ddg.newForeignKeyConstraintDescriptor(
td, constraintName,
characteristics[0], //deferable,
characteristics[1], //initiallyDeferred,
genColumnPositions(td, false), //int[],
constrId,
indexId,
sd,
referencedConstraint,
characteristics[2],
otherConstraintInfo.getReferentialActionDeleteRule(),
otherConstraintInfo.getReferentialActionUpdateRule()
);
// try to create the constraint first, because it
// is expensive to do the bulk check, find obvious
// errors first
dd.addConstraintDescriptor(conDesc, tc);
/* No need to do check if we're creating a
* table.
*/
if ( (! forCreateTable) &&
dd.activeConstraint( conDesc ) )
{
validateFKConstraint(activation,
tc,
dd,
(ForeignKeyConstraintDescriptor)conDesc,
referencedConstraint,
((CreateIndexConstantAction)indexAction).getIndexTemplateRow());
}
/* Create stored dependency on the referenced constraint */
dm.addDependency(conDesc, referencedConstraint, lcc.getContextManager());
//store constraint's dependency on REFERENCES privileges in the dependeny system
storeConstraintDependenciesOnPrivileges
(activation,
conDesc,
referencedConstraint.getTableId(),
providerInfo);
break;
case DataDictionary.MODIFY_CONSTRAINT:
throw StandardException.newException(SQLState.NOT_IMPLEMENTED,