/* Resolve the view, if this is a view */
if (tableDescriptor.getTableType() == TableDescriptor.VIEW_TYPE)
{
FromTable fsq;
ResultSetNode rsn;
ViewDescriptor vd;
CreateViewNode cvn;
SchemaDescriptor compSchema;
SchemaDescriptor prevCompSchema;
/* Get the associated ViewDescriptor so that we can get
* the view definition text.
*/
vd = dataDictionary.getViewDescriptor(tableDescriptor);
/*
** Set the default compilation schema to be whatever
** this schema this view was originally compiled against.
** That way we pick up the same tables no matter what
** schema we are running against.
*/
compSchema = dataDictionary.getSchemaDescriptor(vd.getCompSchemaId(), null);
prevCompSchema = compilerContext.setCompilationSchema(compSchema);
try
{
/* This represents a view - query is dependent on the ViewDescriptor */
compilerContext.createDependency(vd);
if (SanityManager.DEBUG)
{
SanityManager.ASSERT(vd != null,
"vd not expected to be null for " + tableName);
}
cvn = (CreateViewNode)
parseStatement(vd.getViewText(), false);
rsn = cvn.getParsedQueryExpression();
/* If the view contains a '*' then we mark the views derived column list
* so that the view will still work, and return the expected results,