throw new SqlJetException(SqlJetErrorCode.ERROR, "Virtual table \"" + tableName + "\" exists already");
}
checkNameConflict(SqlJetSchemaObjectType.VIRTUAL_TABLE, tableName);
final ISqlJetBtreeSchemaTable schemaTable = openSchemaTable(true);
final String createVirtualTableSQL = getCreateVirtualTableSql(parseTable);
try {
schemaTable.lock();
try {
db.getOptions().changeSchemaVersion();
final long rowId = schemaTable.insertRecord(TABLE_TYPE, tableName, tableName, page,
createVirtualTableSQL);
tableDef.setPage(page);
tableDef.setRowId(rowId);
virtualTableDefs.put(tableName, tableDef);
return tableDef;
} finally {
schemaTable.unlock();
}
} finally {
schemaTable.close();
}
}