* @exception StandardException Standard error policy.
*/
public QueryTreeNode bind( HashMap dependencies, List grantees, boolean isGrant ) throws StandardException
{
Provider dependencyProvider = null;
SchemaDescriptor sd = null;
switch( objectType)
{
case TABLE_PRIVILEGES:
TableName tableName = (TableName) objectOfPrivilege;
sd = getSchemaDescriptor( tableName.getSchemaName(), true);
if (sd.isSystemSchema())
throw StandardException.newException(SQLState.AUTH_GRANT_REVOKE_NOT_ALLOWED, tableName.getFullTableName());
TableDescriptor td = getTableDescriptor( tableName.getTableName(), sd);
if( td == null)
throw StandardException.newException( SQLState.LANG_TABLE_NOT_FOUND, tableName);
// Don't allow authorization on SESSION schema tables. Causes confusion if
// a temporary table is created later with same name.
if (isSessionSchema(sd.getSchemaName()))
throw StandardException.newException(SQLState.LANG_OPERATION_NOT_ALLOWED_ON_SESSION_SCHEMA_TABLES);
if (td.getTableType() != TableDescriptor.BASE_TABLE_TYPE &&
td.getTableType() != TableDescriptor.VIEW_TYPE)
throw StandardException.newException(SQLState.AUTH_GRANT_REVOKE_NOT_ALLOWED, tableName.getFullTableName());
// Can not grant/revoke permissions from self
if (grantees.contains(sd.getAuthorizationId()))
throw StandardException.newException(SQLState.AUTH_GRANT_REVOKE_NOT_ALLOWED,
td.getQualifiedName());
specificPrivileges.bind( td, isGrant);
dependencyProvider = td;
break;
case ROUTINE_PRIVILEGES:
RoutineDesignator rd = (RoutineDesignator) objectOfPrivilege;
sd = getSchemaDescriptor( rd.name.getSchemaName(), true);
if (!sd.isSchemaWithGrantableRoutines())
throw StandardException.newException(SQLState.AUTH_GRANT_REVOKE_NOT_ALLOWED, rd.name.getFullTableName());
AliasDescriptor proc = null;
RoutineAliasInfo routineInfo = null;
java.util.List list = getDataDictionary().getRoutineList(
sd.getUUID().toString(), rd.name.getTableName(),
rd.isFunction ? AliasInfo.ALIAS_NAME_SPACE_FUNCTION_AS_CHAR : AliasInfo.ALIAS_NAME_SPACE_PROCEDURE_AS_CHAR
);
// Can not grant/revoke permissions from self
if (grantees.contains(sd.getAuthorizationId()))
throw StandardException.newException(SQLState.AUTH_GRANT_REVOKE_NOT_ALLOWED,
rd.name.getFullTableName());
if( rd.paramTypeList == null)
{