{
TableDescriptor td;
UUID toid;
SchemaDescriptor schemaDescriptor;
ColumnDescriptor columnDescriptor;
ExecRow template;
LanguageConnectionContext lcc = activation.getLanguageConnectionContext();
DataDictionary dd = lcc.getDataDictionary();
DependencyManager dm = dd.getDependencyManager();
TransactionController tc = lcc.getTransactionExecute();
/* Mark the activation as being for create table */
activation.setForCreateTable();
// setup for create conglomerate call:
// o create row template to tell the store what type of rows this
// table holds.
// o create array of collation id's to tell collation id of each
// column in table.
template = RowUtil.getEmptyValueRow(columnInfo.length, lcc);
int[] collation_ids = new int[columnInfo.length];
for (int ix = 0; ix < columnInfo.length; ix++)
{
ColumnInfo col_info = columnInfo[ix];
// Get a template value for each column
if (col_info.defaultValue != null)
{
/* If there is a default value, use it, otherwise use null */
template.setColumn(ix + 1, col_info.defaultValue);
}
else
{
template.setColumn(ix + 1, col_info.dataType.getNull());
}
// get collation info for each column.
collation_ids[ix] = col_info.dataType.getCollationType();
}
/* create the conglomerate to hold the table's rows
* RESOLVE - If we ever have a conglomerate creator
* that lets us specify the conglomerate number then
* we will need to handle it here.
*/
long conglomId = tc.createConglomerate(
"heap", // we're requesting a heap conglomerate
template.getRowArray(), // row template
null, //column sort order - not required for heap
collation_ids,
properties, // properties
tableType == TableDescriptor.GLOBAL_TEMPORARY_TABLE_TYPE ?
(TransactionController.IS_TEMPORARY |