use of org.hsqldb_voltpatches.HsqlNameManager.HsqlName in project voltdb by VoltDB.
the class SchemaManager method recompileDependentObjects.
void recompileDependentObjects(OrderedHashSet tableSet) {
OrderedHashSet set = new OrderedHashSet();
for (int i = 0; i < tableSet.size(); i++) {
Table table = (Table) tableSet.get(i);
set.addAll(getReferencingObjects(table.getName()));
}
Session session = database.sessionManager.getSysSession();
for (int i = 0; i < set.size(); i++) {
HsqlName name = (HsqlName) set.get(i);
switch(name.type) {
case SchemaObject.VIEW:
case SchemaObject.CONSTRAINT:
case SchemaObject.ASSERTION:
SchemaObject object = getSchemaObject(name);
object.compile(session);
break;
}
}
}
use of org.hsqldb_voltpatches.HsqlNameManager.HsqlName in project voltdb by VoltDB.
the class SchemaManager method removeReferencingObject.
private void removeReferencingObject(SchemaObject object) {
OrderedHashSet set = object.getReferences();
if (set == null) {
return;
}
for (int i = 0; i < set.size(); i++) {
HsqlName referenced = (HsqlName) set.get(i);
referenceMap.remove(referenced, object.getName());
}
}
use of org.hsqldb_voltpatches.HsqlNameManager.HsqlName in project voltdb by VoltDB.
the class SchemaManager method removeSchemaObjects.
void removeSchemaObjects(OrderedHashSet set) {
for (int i = 0; i < set.size(); i++) {
HsqlName name = (HsqlName) set.get(i);
removeSchemaObject(name);
}
}
use of org.hsqldb_voltpatches.HsqlNameManager.HsqlName in project voltdb by VoltDB.
the class SchemaManager method addSchemaObject.
void addSchemaObject(SchemaObject object) {
HsqlName name = object.getName();
Schema schema = (Schema) schemaMap.get(name.schema.name);
SchemaObjectSet set = getSchemaObjectSet(schema, name.type);
switch(name.type) {
case SchemaObject.PROCEDURE:
case SchemaObject.FUNCTION:
RoutineSchema routine = (RoutineSchema) set.getObject(name.name);
if (routine == null) {
routine = new RoutineSchema(name.type, name);
routine.addSpecificRoutine(database, (Routine) object);
set.add(routine);
} else {
((Routine) object).setName(routine.getName());
routine.addSpecificRoutine(database, (Routine) object);
}
addReferences(object);
return;
}
set.add(object);
addReferences(object);
}
use of org.hsqldb_voltpatches.HsqlNameManager.HsqlName in project voltdb by VoltDB.
the class DatabaseInformationFull method ROLE_ROUTINE_GRANTS.
Table ROLE_ROUTINE_GRANTS() {
Table t = sysTables[ROLE_ROUTINE_GRANTS];
if (t == null) {
t = createBlankTable(sysTableHsqlNames[ROLE_ROUTINE_GRANTS]);
// not null
addColumn(t, "GRANTOR", SQL_IDENTIFIER);
// not null
addColumn(t, "GRANTEE", SQL_IDENTIFIER);
addColumn(t, "SPECIFIC_CATALOG", SQL_IDENTIFIER);
addColumn(t, "SPECIFIC_SCHEMA", SQL_IDENTIFIER);
// not null
addColumn(t, "SPECIFIC_NAME", SQL_IDENTIFIER);
addColumn(t, "ROUTINE_CATALOG", SQL_IDENTIFIER);
addColumn(t, "ROUTINE_SCHEMA", SQL_IDENTIFIER);
addColumn(t, "ROUTINE_NAME", SQL_IDENTIFIER);
addColumn(t, "PRIVILEGE_TYPE", CHARACTER_DATA);
addColumn(t, "IS_GRANTABLE", YES_OR_NO);
HsqlName name = HsqlNameManager.newInfoSchemaObjectName(sysTableHsqlNames[ROLE_ROUTINE_GRANTS].name, false, SchemaObject.INDEX);
t.createPrimaryKey(name, new int[] { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 }, false);
return t;
}
PersistentStore store = database.persistentStoreCollection.getStore(t);
Session sys = database.sessionManager.newSysSession(SqlInvariants.INFORMATION_SCHEMA_HSQLNAME, session.getUser());
Result rs = sys.executeDirectStatement("SELECT GRANTOR, GRANTEE, SPECIFIC_CATALOG, SPECIFIC_SCHEMA, " + "SPECIFIC_NAME, ROUTINE_CATALOG, ROUTINE_SCHEMA, ROUTINE_NAME, " + "PRIVILEGE_TYPE, IS_GRANTABLE, 'NO' " + "FROM INFORMATION_SCHEMA.ROUTINE_PRIVILEGES " + "JOIN INFORMATION_SCHEMA.APPLICABLE_ROLES ON GRANTEE = ROLE_NAME;");
t.insertSys(store, rs);
sys.close();
// Column number mappings
final int grantor = 0;
final int grantee = 1;
final int table_name = 2;
final int specific_catalog = 3;
final int specific_schema = 4;
final int specific_name = 5;
final int routine_catalog = 6;
final int routine_schema = 7;
final int routine_name = 8;
final int privilege_type = 9;
final int is_grantable = 10;
//
return t;
}
Aggregations