}
}
void processAlterDomain() {
HsqlName schema = session.getSchemaHsqlName(token.namePrefix);
checkSchemaUpdateAuthorisation(schema);
Type domain = database.schemaManager.getDomain(token.tokenString,
schema.name, true);
read();
switch (token.tokenType) {
case Tokens.RENAME : {
read();
readThis(Tokens.TO);
HsqlName newName =
readNewSchemaObjectName(SchemaObject.DOMAIN);
newName.setSchemaIfNull(schema);
if (domain.getSchemaName() != newName.schema) {
throw Error.error(ErrorCode.X_42505, newName.schema.name);
}
checkSchemaUpdateAuthorisation(schema);
database.schemaManager.renameSchemaObject(domain.getName(),
newName);
return;
}
case Tokens.DROP : {
read();
if (token.tokenType == Tokens.DEFAULT) {
read();
domain.userTypeModifier.removeDefaultClause();
return;
} else if (token.tokenType == Tokens.CONSTRAINT) {
read();
checkIsSchemaObjectName();
HsqlName name = database.schemaManager.getSchemaObjectName(
domain.getSchemaName(), token.tokenString,
SchemaObject.CONSTRAINT, true);
read();