Package org.apache.derby.iapi.sql.dictionary

Examples of org.apache.derby.iapi.sql.dictionary.SchemaDescriptor


    if (this.getObjectName().equals(targetSchema, targetTable))
      throw StandardException.newException(SQLState.LANG_SYNONYM_CIRCULAR,
            this.getFullName(),
            targetSchema+"."+targetTable);

    SchemaDescriptor targetSD = getSchemaDescriptor(targetSchema, false);
    if ((targetSD != null) && isSessionSchema(targetSD))
      throw StandardException.newException(SQLState.LANG_OPERATION_NOT_ALLOWED_ON_SESSION_SCHEMA_TABLES);

    return this;
  }
View Full Code Here


     * @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)
            {
View Full Code Here

        addSystemSchema(
            SchemaDescriptor.STD_SYSTEM_UTIL_SCHEMA_NAME,
            SchemaDescriptor.SYSCS_UTIL_SCHEMA_UUID, tc);

      //Add the APP schema
      SchemaDescriptor appSchemaDesc = new SchemaDescriptor(this,
                                        SchemaDescriptor.STD_DEFAULT_SCHEMA_NAME,
                                        SchemaDescriptor.DEFAULT_USER_NAME,
                                        uuidFactory.recreateUUID( SchemaDescriptor.DEFAULT_SCHEMA_UUID),
                                        false);
 
View Full Code Here

    String                  schema_uuid,
    TransactionController   tc)
    throws StandardException
    {
    // create the descriptor
    SchemaDescriptor schema_desc =
            new SchemaDescriptor(
                this,
                schema_name,
                authorizationDatabaseOwner,
                uuidFactory.recreateUUID(schema_uuid),
                true);
View Full Code Here

                     TransactionController tc)
    throws StandardException
  {
    SystemColumn    theColumn;
    SystemColumn[]    columns = rowFactory.buildColumnList();
    SchemaDescriptor  sd = getSystemSchemaDescriptor();
    String columnName;

    TableDescriptor td = getTableDescriptor(rowFactory.getCatalogName(), sd);

    theColumn = columns[columnNumber - 1]// from 1 to 0 based
View Full Code Here

    ColumnDescriptor  cd;

    SystemColumn[]    columns = rowFactory.buildColumnList();
    ExecRow        templateRow = rowFactory.makeEmptyRow();
    int          columnCount = newColumnIDs.length;
    SchemaDescriptor  sd = getSystemSchemaDescriptor();
    TableDescriptor    td;
    long        conglomID;

    // Special case when adding a column to systables or syscolumns,
    // since we can't go to systables/syscolumns to get the
    // table/column descriptor until after we add and populate the new column.
    if (rowFactory instanceof SYSTABLESRowFactory)
    {
      td = dataDescriptorGenerator.newTableDescriptor(
            "SYSTABLES",
            sd,
            TableDescriptor.BASE_TABLE_TYPE,
            TableDescriptor.ROW_LOCK_GRANULARITY);
      td.setUUID(getUUIDForCoreTable("SYSTABLES", sd.getUUID().toString(), tc));
      conglomID = coreInfo[SYSTABLES_CORE_NUM].getHeapConglomerate();
    }
    else if (rowFactory instanceof SYSCOLUMNSRowFactory)
    {
      td = dataDescriptorGenerator.newTableDescriptor(
            "SYSCOLUMNS",
            sd,
            TableDescriptor.BASE_TABLE_TYPE,
            TableDescriptor.ROW_LOCK_GRANULARITY);
      td.setUUID(getUUIDForCoreTable("SYSCOLUMNS", sd.getUUID().toString(), tc));
      conglomID = coreInfo[SYSCOLUMNS_CORE_NUM].getHeapConglomerate();
    }
    else
    {
      td = getTableDescriptor( rowFactory.getCatalogName(), sd );
View Full Code Here

    TransactionController  tc
    )
    throws StandardException
  {
    ExecRow        templateRow = rowFactory.makeEmptyRow();
    SchemaDescriptor  sd = getSystemSchemaDescriptor( );
    long        conglomID = getTableDescriptor( rowFactory.getCatalogName(), sd ).getHeapConglomerateId();

    widenConglomerate( templateRow, newColumnIDs, conglomID, tc );
  }
View Full Code Here

    int            indexNumber,
    long          heapConglomerateNumber
    )
    throws StandardException
  {
    SchemaDescriptor    sd = getSystemSchemaDescriptor( );
    DataDescriptorGenerator ddg = getDataDescriptorGenerator();
    long          indexConglomerateNumber;

    ConglomerateDescriptor  conglomerateDescriptor = bootstrapOneIndex
      ( sd, tc, ddg, ti, indexNumber, heapConglomerateNumber );
View Full Code Here

    private SchemaDescriptor newSystemSchemaDesc(
    String  name,
    String  uuid)
    {
        return new SchemaDescriptor(
                this,
                name,
                authorizationDatabaseOwner,
                uuidFactory.recreateUUID(uuid),
                true);
View Full Code Here

                true);
    }

    private SchemaDescriptor newDeclaredGlobalTemporaryTablesSchemaDesc( String name)
    {
        return new SchemaDescriptor(this,
                                        name,
                                        authorizationDatabaseOwner,
                                        (UUID) null,
                                        false);
    }
View Full Code Here

TOP

Related Classes of org.apache.derby.iapi.sql.dictionary.SchemaDescriptor

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.