Examples of ExecRow


Examples of org.apache.derby.iapi.sql.execute.ExecRow

  public Hashtable hashAllTableDescriptorsByTableId(TransactionController tc)
    throws StandardException
  {
    Hashtable ht = new Hashtable();
    ScanController        scanController;
    ExecRow           outRow;
    TabInfoImpl          ti = coreInfo[SYSTABLES_CORE_NUM];
    SYSTABLESRowFactory
          rf = (SYSTABLESRowFactory) ti.getCatalogRowFactory();

    outRow = rf.makeEmptyRow();

    scanController = tc.openScan(
        ti.getHeapConglomerate(),       // sys.systable
        false,                          // don't hold open across commit
        0,                              // for read
                TransactionController.MODE_RECORD,// scans whole table.
                TransactionController.ISOLATION_READ_UNCOMMITTED,
        (FormatableBitSet) null,                 // all fields as objects
        (DataValueDescriptor[])null,    // start position - first row
        ScanController.GE,              // startSearchOperation
        (ScanQualifier[][])null,        //scanQualifier,
        (DataValueDescriptor[])null,    //stop position-through last row
        ScanController.GT);             // stopSearchOperation

        // it is important for read uncommitted scans to use fetchNext() rather
        // than fetch, so that the fetch happens while latch is held, otherwise
        // the next() might position the scan on a row, but the subsequent
        // fetch() may find the row deleted or purged from the table.
    while(scanController.fetchNext(outRow.getRowArray()))
    {
      TableDescriptor td = (TableDescriptor)
        rf.buildDescriptor(outRow, (TupleDescriptor)null,
                   this);
      ht.put(td.getUUID(), td);
View Full Code Here

Examples of org.apache.derby.iapi.sql.execute.ExecRow

                    long conglomerateNumber)
                    throws StandardException
    {
      ScanController        scanController;
      TransactionController    tc;
      ExecRow           outRow;
      DataValueDescriptor      conglomNumberOrderable = null;
      TabInfoImpl            ti = coreInfo[SYSCONGLOMERATES_CORE_NUM];
      SYSCONGLOMERATESRowFactory  rf = (SYSCONGLOMERATESRowFactory) ti.getCatalogRowFactory();

      conglomNumberOrderable =
View Full Code Here

Examples of org.apache.derby.iapi.sql.execute.ExecRow

    /* Set up the start/stop position for the scan */
    keyRow = (ExecIndexRow) exFactory.getIndexableRow(1);
    keyRow.setColumn(1, schemaNameOrderable);

    SYSSCHEMASRowFactory  rf = (SYSSCHEMASRowFactory) ti.getCatalogRowFactory();
    ExecRow row = rf.makeEmptyRow();

    row.setColumn(SYSSCHEMASRowFactory.SYSSCHEMAS_SCHEMAAID,
            new SQLVarchar(authorizationId));

    boolean[] bArray = {false, false};

    int[] colsToUpdate = {SYSSCHEMASRowFactory.SYSSCHEMAS_SCHEMAAID};
View Full Code Here

Examples of org.apache.derby.iapi.sql.execute.ExecRow

                       long conglomerateNumber,
                       TransactionController tc)
    throws StandardException
  {
    ExecIndexRow        keyRow1 = null;
    ExecRow             row;
    DataValueDescriptor      conglomIDOrderable;
    TabInfoImpl            ti = coreInfo[SYSCONGLOMERATES_CORE_NUM];
    SYSCONGLOMERATESRowFactory  rf = (SYSCONGLOMERATESRowFactory) ti.getCatalogRowFactory();
    boolean[] bArray = {false, false, false};
View Full Code Here

Examples of org.apache.derby.iapi.sql.execute.ExecRow

  public List getAllDependencyDescriptorsList()
        throws StandardException
  {
    ScanController         scanController;
    TransactionController      tc;
    ExecRow              outRow;
    ExecRow             templateRow;
    List            ddl = newSList();
    TabInfoImpl            ti = getNonCoreTI(SYSDEPENDS_CATALOG_NUM);
    SYSDEPENDSRowFactory    rf = (SYSDEPENDSRowFactory) ti.getCatalogRowFactory();

View Full Code Here

Examples of org.apache.derby.iapi.sql.execute.ExecRow

    int          columnID;
    SystemColumn    currentColumn;
    ColumnDescriptor  cd;

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

Examples of org.apache.derby.iapi.sql.execute.ExecRow

    int[]          newColumnIDs,
    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

Examples of org.apache.derby.iapi.sql.execute.ExecRow

                   TransactionController tc)
        throws StandardException
  {
    ConglomerateController  heapCC;
    ExecIndexRow        indexRow1;
    ExecRow          row;
    DataValueDescriptor      schemaIDOrderable;
    DataValueDescriptor    tableNameOrderable;
    ScanController      scanController;
    TabInfoImpl          ti = coreInfo[SYSTABLES_CORE_NUM];
        SYSTABLESRowFactory    rf = (SYSTABLESRowFactory) ti.getCatalogRowFactory();

    // We only want the 1st column from the heap
    row = exFactory.getValueRow(1);

    /* Use tableNameOrderable and schemaIdOrderable in both start
     * and stop position for scan.
     */
    tableNameOrderable = new SQLVarchar(tableName);
    schemaIDOrderable = new SQLChar(schemaUUID);

    /* Set up the start/stop position for the scan */
    ExecIndexRow keyRow = exFactory.getIndexableRow(2);
    keyRow.setColumn(1, tableNameOrderable);
    keyRow.setColumn(2, schemaIDOrderable);

    heapCC = tc.openConglomerate(
                ti.getHeapConglomerate(), false, 0,
                TransactionController.MODE_RECORD,
                TransactionController.ISOLATION_REPEATABLE_READ);

    ExecRow indexTemplateRow = rf.buildEmptyIndexRow( SYSTABLESRowFactory.SYSTABLES_INDEX1_ID, heapCC.newRowLocationTemplate() );

    /* Scan the index and go to the data pages for qualifying rows to
     * build the column descriptor.
     */
    scanController = tc.openScan(
        ti.getIndexConglomerate(SYSTABLESRowFactory.SYSTABLES_INDEX1_ID)// conglomerate to open
        false, // don't hold open across commit
        0,
                TransactionController.MODE_RECORD,
                TransactionController.ISOLATION_REPEATABLE_READ,
        (FormatableBitSet) null,         // all fields as objects
        keyRow.getRowArray(),   // start position - first row
        ScanController.GE,      // startSearchOperation
        (ScanQualifier[][]) null, //scanQualifier,
        keyRow.getRowArray(),   // stop position - through last row
        ScanController.GT);     // stopSearchOperation

        /* OK to fetch into the template row,
         * since we won't be doing a next.
         */
    if (scanController.fetchNext(indexTemplateRow.getRowArray()))
    {
      RowLocation  baseRowLocation;


      baseRowLocation = (RowLocationindexTemplateRow.getColumn(
                        indexTemplateRow.nColumns());
 
      /* 1st column is TABLEID (UUID - char(36)) */
      row.setColumn(SYSTABLESRowFactory.SYSTABLES_TABLEID, new SQLChar());
      FormatableBitSet bi = new FormatableBitSet(1);
      bi.set(0);
View Full Code Here

Examples of org.apache.derby.iapi.sql.execute.ExecRow

        FormatableBitSet(SYSCOLUMNSRowFactory.SYSCOLUMNS_COLUMN_COUNT);
      int columnNum = SYSCOLUMNSRowFactory.SYSCOLUMNS_AUTOINCREMENTVALUE;
    TabInfoImpl ti = coreInfo[SYSCOLUMNS_CORE_NUM];
      ConglomerateController heapCC = null;
    SYSCOLUMNSRowFactory  rf = (SYSCOLUMNSRowFactory) ti.getCatalogRowFactory();
    ExecRow row = rf.makeEmptyRow();

      FormatableBitSet  columnToRead = new
        FormatableBitSet(SYSCOLUMNSRowFactory.SYSCOLUMNS_COLUMN_COUNT);
   
    // FormatableBitSet is 0 based.
      columnToRead.set(columnNum - 1); // current value.
    columnToRead.set(columnNum);     // start value.
    columnToRead.set(columnNum + 1); // increment value.

        try
        {
      /* if wait is true then we need to do a wait while trying to
         open/fetch from the conglomerate. note we use wait both to
         open as well as fetch from the conglomerate.
      */
            heapCC =
                tc.openConglomerate(
                    ti.getHeapConglomerate(),
                    false,
                    (TransactionController.OPENMODE_FORUPDATE |
                     ((wait) ? 0 : TransactionController.OPENMODE_LOCK_NOWAIT)),
                    TransactionController.MODE_RECORD,
                    TransactionController.ISOLATION_REPEATABLE_READ);

            boolean baseRowExists =
                heapCC.fetch(rl, row.getRowArray(), columnToRead, wait);

            columnToUpdate.set(columnNum - 1); // current value.

            // while the Row interface is 1 based.
            NumberDataValue currentAI = (NumberDataValue)row.getColumn(columnNum);
            long currentAIValue = currentAI.getLong();
            NumberDataValue increment = (NumberDataValue)row.getColumn(columnNum + 2);
           
            if (doUpdate)
            {
                // we increment and store the new value in SYSCOLUMNS
                currentAI = currentAI.plus(currentAI, increment, currentAI);
                row.setColumn(columnNum, currentAI);
                heapCC.replace(rl, row.getRowArray(), columnToUpdate);
            }
               
            // but we return the "currentAIValue"-- i.e the value before
            // incrementing it.
            if (newValue != null)
View Full Code Here

Examples of org.apache.derby.iapi.sql.execute.ExecRow

    )
    throws StandardException
  {
    boolean            isUnique;
    ConglomerateController    cc;
    ExecRow            baseRow;
    ExecIndexRow        indexableRow;
    int              numColumns;
    long            conglomId;
    RowLocation          rl;
    CatalogRowFactory      rf = ti.getCatalogRowFactory();
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.