if (rc.isDefaultColumn())
{
// DefaultNode defaultNode = (DefaultNode) rc.getExpression();
// Get ColumnDescriptor by name or by position?
ColumnDescriptor cd;
if (tcl == null)
{
cd = ttd.getColumnDescriptor(index + 1);
}
else
{
ResultColumn trc = (ResultColumn) tcl.elementAt(index);
cd = ttd.getColumnDescriptor(trc.getName());
}
// Too many RCs if no ColumnDescriptor
if (cd == null)
{
throw StandardException.newException(SQLState.LANG_TOO_MANY_RESULT_COLUMNS,
ttd.getQualifiedName());
}
if (cd.isAutoincrement())
{
rc.setAutoincrementGenerated();
} // end of if ()
DefaultInfoImpl defaultInfo = (DefaultInfoImpl) cd.getDefaultInfo();
//
// For generated columns, we don't have enough context at this
// point to bind the generation clause (the default) and
// unfortunately that step occurs very soon after defaults are substituted in. The
// parsing and binding of generation clauses happens considerably
// later on. At this juncture, we can be patient and just plug
// in a NULL literal as a placeholder. For generated columns,
// the generation clause tree is plugged in in DMLModStatementNode.parseAndBindGenerationClauses().
//
if ( (defaultInfo != null) && !defaultInfo.isGeneratedColumn() )
{
/* Query is dependent on the DefaultDescriptor */
DefaultDescriptor defaultDescriptor = cd.getDefaultDescriptor(getDataDictionary());
getCompilerContext().createDependency(defaultDescriptor);
rc.setExpression(
DefaultNode.parseDefault(
defaultInfo.getDefaultText(),