* @return an updatable schema
* @throws T2DBException
*/
private UpdatableSchema getSchema(Database database, RawSchema rawSchema, Set<Integer> cycleDetector) throws T2DBException {
UpdatableSchema schema = null;
if (cycleDetector == null)
cycleDetector = new HashSet<Integer>();
boolean cycleDetected = !cycleDetector.add(rawSchema.getId());
String name = rawSchema.getName();
UpdatableSchema base = null;
if (rawSchema.getParent() > 0 && !cycleDetected) {
Surrogate parentKey = makeSurrogate(database, DBObjectType.SCHEMA, rawSchema.getParent());
RawSchema rawBaseSchema = getRawSchema(parentKey);
if (rawBaseSchema == null)
throw T2DBMsg.exception(E.E30116, rawSchema.getParent(), name);