if ( rc.hasGenerationClause() )
{
ColumnDescriptor colDesc = rc.getTableColumnDescriptor();
DataTypeDescriptor dtd = colDesc.getType();
DefaultInfo di = colDesc.getDefaultInfo();
ValueNode generationClause = parseGenerationClause( di.getDefaultText(), targetTableDescriptor );
// insert CAST in case column data type is not same as the
// resolved type of the generation clause
generationClause = (ValueNode) getNodeFactory().getNode
(
C_NodeTypes.CAST_NODE,
generationClause,
dtd,
getContextManager()
);
//
// Unqualified function references should resolve to the
// current schema at the time that the table was
// created/altered. See DERBY-3945.
//
SchemaDescriptor originalCurrentSchema = getSchemaDescriptor( di.getOriginalCurrentSchema(), true );
compilerContext.pushCompilationSchema( originalCurrentSchema );
try {
bindRowScopedExpression( getNodeFactory(), getContextManager(), targetTableDescriptor, sourceRCL, generationClause );
}