Search in sources :

Example 16 with Grantee

use of org.hsqldb_voltpatches.rights.Grantee in project voltdb by VoltDB.

the class StatementSchema method dropUser.

private static void dropUser(Session session, HsqlName name, boolean cascade) {
    Grantee grantee = session.database.getUserManager().get(name.name);
    if (session.database.getSessionManager().isUserActive(name.name)) {
        throw Error.error(ErrorCode.X_42539);
    }
    if (!cascade && session.database.schemaManager.hasSchemas(grantee)) {
        HsqlArrayList list = session.database.schemaManager.getSchemas(grantee);
        Schema schema = (Schema) list.get(0);
        throw Error.error(ErrorCode.X_42502, schema.getName().statementName);
    }
    session.database.schemaManager.dropSchemas(grantee, cascade);
    session.database.getUserManager().dropUser(name.name);
}
Also used : Grantee(org.hsqldb_voltpatches.rights.Grantee) HsqlArrayList(org.hsqldb_voltpatches.lib.HsqlArrayList)

Aggregations

Grantee (org.hsqldb_voltpatches.rights.Grantee)16 HsqlName (org.hsqldb_voltpatches.HsqlNameManager.HsqlName)12 SchemaObject (org.hsqldb_voltpatches.SchemaObject)8 Table (org.hsqldb_voltpatches.Table)8 Iterator (org.hsqldb_voltpatches.lib.Iterator)8 WrapperIterator (org.hsqldb_voltpatches.lib.WrapperIterator)8 PersistentStore (org.hsqldb_voltpatches.persist.PersistentStore)8 Constraint (org.hsqldb_voltpatches.Constraint)6 TextTable (org.hsqldb_voltpatches.TextTable)6 OrderedHashSet (org.hsqldb_voltpatches.lib.OrderedHashSet)6 Right (org.hsqldb_voltpatches.rights.Right)5 HsqlException (org.hsqldb_voltpatches.HsqlException)4 HsqlArrayList (org.hsqldb_voltpatches.lib.HsqlArrayList)3 Routine (org.hsqldb_voltpatches.Routine)1 RoutineSchema (org.hsqldb_voltpatches.RoutineSchema)1 User (org.hsqldb_voltpatches.rights.User)1