newResultColumn.setExpressionToNullNode();
}
else
{
// column position is 1-based, index is 0-based.
ColumnDescriptor colDesc = targetTD.getColumnDescriptor(columnNumber);
DataTypeDescriptor colType = colDesc.getType();
// Check for defaults
DefaultInfoImpl defaultInfo = (DefaultInfoImpl) colDesc.getDefaultInfo();
//Column has constant default value ,
//if it have defaultInfo and not be autoincrement.
if (defaultInfo != null && ! colDesc.isAutoincrement())
{
//RESOLVEPARAMETER - skip the tree if we have the value
/*
if (defaultInfo.getDefaultValue() != null)
{
}
else
*/
{
if ( colDesc.hasGenerationClause() )
{
// later on we will revisit the generated columns and bind
// their generation clauses
newResultColumn = createGeneratedColumn( targetTD, colDesc );
}
else
{
// Generate the tree for the default
String defaultText = defaultInfo.getDefaultText();
ValueNode defaultTree = parseDefault(defaultText);
defaultTree = defaultTree.bindExpression
(getFromList(), (SubqueryList) null, (Vector) null);
newResultColumn = (ResultColumn) getNodeFactory().getNode
( C_NodeTypes.RESULT_COLUMN, defaultTree.getTypeServices(), defaultTree, getContextManager());
}
DefaultDescriptor defaultDescriptor = colDesc.getDefaultDescriptor(dataDictionary);
if (SanityManager.DEBUG)
{
SanityManager.ASSERT(defaultDescriptor != null,
"defaultDescriptor expected to be non-null");
}
getCompilerContext().createDependency(defaultDescriptor);
}
}
else if (colDesc.isAutoincrement())
{
newResultColumn =
(ResultColumn)getNodeFactory().getNode(
C_NodeTypes.RESULT_COLUMN,
colDesc, null,