for ( int i = 0; i < changedColumnCount; i++ )
{
ColumnInfo ci = columnInfos[ i ];
// skip this column if it is not a UDT
AliasDescriptor ad = dd.getAliasDescriptorForUDT( tc, columnInfos[ i ].dataType );
if ( ad == null ) { continue; }
String key = ad.getObjectID().toString();
if ( ci.action == ColumnInfo.CREATE )
{
addColumnNames.add( ci.name);
// no need to add the descriptor if it is already on the list
if ( addUdtMap.get( key ) != null ) { continue; }
addUdtMap.put( key, ad );
}
else if ( ci.action == ColumnInfo.DROP )
{
dropColumnNames.add( ci.name );
dropUdtMap.put( key, ad );
}
}
// nothing to do if there are no changed columns of udt type
// and this is not a DROP TABLE command
if ( (!dropWholeTable) && (addUdtMap.size() == 0) && (dropUdtMap.size() == 0) ) { return; }
//
// Now prune from the add list all udt descriptors for which we already have dependencies.
// These are the udts for old columns. This supports the ALTER TABLE ADD COLUMN
// case.
//
// Also prune from the drop list add udt descriptors which will still be
// referenced by the remaining columns.
//
ColumnDescriptorList cdl = td.getColumnDescriptorList();
int totalColumnCount = cdl.size();
for ( int i = 0; i < totalColumnCount; i++ )
{
ColumnDescriptor cd = cdl.elementAt( i );
// skip columns that are being added and dropped. we only want the untouched columns
if (
addColumnNames.contains( cd.getColumnName() ) ||
dropColumnNames.contains( cd.getColumnName() )
) { continue; }
// nothing to do if the old column isn't a UDT
AliasDescriptor ad = dd.getAliasDescriptorForUDT( tc, cd.getType() );
if ( ad == null ) { continue; }
String key = ad.getObjectID().toString();
// ha, it is a UDT.
if ( dropWholeTable ) { dropUdtMap.put( key, ad ); }
else
{