{
SanityManager.ASSERT(updateColumnList != null, "updateColumnList is null");
}
int columnCount = baseTable.getMaxColumnID();
FormatableBitSet columnMap = new FormatableBitSet(columnCount + 1);
/*
** Add all the changed columns. We don't strictly
** need the before image of the changed column in all cases,
** but it makes life much easier since things are set
** up around the assumption that we have the before
** and after image of the column.
*/
int[] changedColumnIds = updateColumnList.sortMe();
for (int ix = 0; ix < changedColumnIds.length; ix++)
{
columnMap.set(changedColumnIds[ix]);
}
/*
** Get a list of the indexes that need to be
** updated. ColumnMap contains all indexed
** columns where 1 or more columns in the index
** are going to be modified.
*/
DMLModStatementNode.getXAffectedIndexes(baseTable, updateColumnList, columnMap, conglomVector );
/*
** Add all columns needed for constraints. We don't
** need to bother with foreign key/primary key constraints
** because they are added as a side effect of adding
** their indexes above.
*/
baseTable.getAllRelevantConstraints
( StatementType.UPDATE, false, changedColumnIds, needsDeferredProcessing, relevantConstraints );
int rclSize = relevantConstraints.size();
for (int index = 0; index < rclSize; index++)
{
ConstraintDescriptor cd = relevantConstraints.elementAt(index);
if (cd.getConstraintType() != DataDictionary.CHECK_CONSTRAINT)
{
continue;
}
int[] refColumns = ((CheckConstraintDescriptor)cd).getReferencedColumns();
for (int i = 0; i < refColumns.length; i++)
{
columnMap.set(refColumns[i]);
}
}
/*
** If we have any triggers, then get all the columns
** because we don't know what the user will ultimately
** reference.
*/
baseTable.getAllRelevantTriggers( StatementType.UPDATE, changedColumnIds, relevantTriggers );
if ( relevantTriggers.size() > 0 ) { needsDeferredProcessing[0] = true; }
if (relevantTriggers.size() > 0)
{
for (int i = 1; i <= columnCount; i++)
{
columnMap.set(i);
}
}
return columnMap;
}