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,
false, //deferable,
false, //initiallyDeferred,
genColumnPositions(td, false), //int[],
constraintId,
indexId,
sd,
referencedConstraint,
enabled,
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(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;
default:
if (SanityManager.DEBUG)