Examples of ExecRow


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

  protected void populateSYSDUMMY1(
              TransactionController tc)
    throws StandardException
  {
    TabInfoImpl            ti = getNonCoreTI(SYSDUMMY1_CATALOG_NUM);
    ExecRow row = ti.getCatalogRowFactory().makeRow(null, null);

    int insertRetCode = ti.insertRow(row, tc, true);
  }
View Full Code Here

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

  {
    CatalogRowFactory    rf = ti.getCatalogRowFactory();
    ConglomerateController  heapCC;
    ExecIndexRow        indexRow1;
    ExecIndexRow      indexTemplateRow;
    ExecRow         outRow;
    RowLocation        baseRowLocation;
    ScanController      scanController;
    TransactionController  tc;
    TupleDescriptor      td = null;

    // Get the current transaction controller
    tc = getTransactionCompile();

    outRow = rf.makeEmptyRow();

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

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

    while (scanController.next())
    {
       // create an index row template
      indexRow1 = getIndexRowFromHeapRow(
                  ti.getIndexRowGenerator(indexId),
                  heapCC.newRowLocationTemplate(),
                  outRow);

      scanController.fetch(indexRow1.getRowArray());

      baseRowLocation = (RowLocationindexRow1.getColumn(
                        indexRow1.nColumns());

            // RESOLVE paulat - remove the try catch block when track 3677 is fixed
            // just leave the contents of the try block
            // adding to get more info on track 3677

            boolean base_row_exists = false;
            try
            {
          base_row_exists =
                    heapCC.fetch(
                        baseRowLocation, outRow.getRowArray(), (FormatableBitSet) null);
            }
            catch (RuntimeException re)
            {
                if (SanityManager.DEBUG)
                {
View Full Code Here

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

            List list)
      throws StandardException
  {
    CatalogRowFactory    rf = ti.getCatalogRowFactory();
    ConglomerateController  heapCC;
    ExecRow         outRow;
    ScanController      scanController;
    TransactionController  tc;
    TupleDescriptor      td = null;

    // Get the current transaction controller
    tc = getTransactionCompile();

    outRow = rf.makeEmptyRow();

    /*
    ** Table scan
    */
    scanController = tc.openScan(
        ti.getHeapConglomerate()// conglomerate to open
        false,             // don't hold open across commit
        0,               // for read
        TransactionController.MODE_TABLE,
                TransactionController.ISOLATION_REPEATABLE_READ,
        (FormatableBitSet) null,         // all fields as objects
        (DataValueDescriptor[]) null,    // start position - first row
        0,              // startSearchOperation - none
        scanQualifiers,     // scanQualifier,
        (DataValueDescriptor[]) null,    // stop position - through last row
        0);             // stopSearchOperation - none

    while (scanController.fetchNext(outRow.getRowArray()))
    {
      td = rf.buildDescriptor(outRow, parentTupleDescriptor, this);

      /* If dList is null, then caller only wants a single descriptor - we're done
       * else just add the current descriptor to the list.
View Full Code Here

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

    keyRow = (ExecIndexRow)exFactory.getIndexableRow(2);
    keyRow.setColumn(1, getIDValueAsCHAR(tableUUID));
      keyRow.setColumn(2, new SQLChar(columnName));
   
    SYSCOLUMNSRowFactory  rf = (SYSCOLUMNSRowFactory) ti.getCatalogRowFactory();
    ExecRow row = rf.makeEmptyRow();

    boolean[] bArray = new boolean[2];
    for (int index = 0; index < 2; index++)
    {
      bArray[index] = false;
    }
   
    int[] colsToUpdate = new int[1];
   
    colsToUpdate[0] = SYSCOLUMNSRowFactory.SYSCOLUMNS_AUTOINCREMENTVALUE;

    if (incrementNeeded)
    {
      ExecRow readRow = ti.getRow(tc, keyRow,
                  SYSCOLUMNSRowFactory.SYSCOLUMNS_INDEX1_ID);
      NumberDataValue increment =
        (NumberDataValue)readRow.getColumn(SYSCOLUMNSRowFactory.SYSCOLUMNS_AUTOINCREMENTINC);
      aiValue += increment.getLong();
    }
    row.setColumn(SYSCOLUMNSRowFactory.SYSCOLUMNS_AUTOINCREMENTVALUE,
            dvf.getDataValue(aiValue));
View Full Code Here

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

                      String columnName)
    throws StandardException                 
  {
    TabInfoImpl ti = coreInfo[SYSCOLUMNS_CORE_NUM];
    ExecIndexRow keyRow = null;
    ExecRow row;
    UUID tableUUID = td.getUUID();

    keyRow = (ExecIndexRow)exFactory.getIndexableRow(2);
    keyRow.setColumn(1, getIDValueAsCHAR(tableUUID));
      keyRow.setColumn(2, new SQLChar(columnName));
View Full Code Here

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

        {
            heapCC.close();
            heapCC = null;
        }
        ExecIndexRow key = rf.buildIndexKeyRow( primaryIndexNumber, perm);
        ExecRow existingRow = ti.getRow( tc, key, primaryIndexNumber);
        if( existingRow == null)
        {
            if( ! add)
              //we didn't find an entry in system catalog and this is revoke
              //so that means there is nothing to revoke. Simply return.
              //No need to reset permission descriptor's uuid because
              //no row was ever found in system catalog for the given
              //permission and hence uuid can't be non-null
                return false;
            //We didn't find an entry in system catalog and this is grant so
            //so that means we have to enter a new row in system catalog for
            //this grant.
            ExecRow row = ti.getCatalogRowFactory().makeRow( perm, (TupleDescriptor) null);
            int insertRetCode = ti.insertRow(row, tc, true /* wait */);
            if( SanityManager.DEBUG)
                SanityManager.ASSERT( insertRetCode == TabInfoImpl.ROWNOTDUPLICATE,
                                      "Race condition in inserting table privilege.");
        }
View Full Code Here

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

   *
   * @return the next row in the result
   */
  public ExecRow  getNextRowCore() throws StandardException {

      ExecRow candidateRow = null;
      ExecRow result = null;
      boolean restrict = false;
      DataValueDescriptor restrictBoolean;
    long  beginRT = 0;

    /* Return null if open was short circuited by false constant expression */
 
View Full Code Here

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

   */
  /* RESOLVE - this should return activation.getCurrentRow(resultSetNumber),
   * once there is such a method.  (currentRow is redundant)
   */
  public ExecRow getCurrentRow() throws StandardException {
      ExecRow candidateRow = null;
      ExecRow result = null;
      boolean restrict = false;
      DataValueDescriptor restrictBoolean;

    if (SanityManager.DEBUG)
      SanityManager.ASSERT(isOpen, "PRRS is expected to be open");
View Full Code Here

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

       */
      setCurrentRow(projRow);
      return projRow;
    }

    ExecRow result;

    // Use reflection to do as much of projection as required
    if (projection != null)
    {
          result = (ExecRow) projection.invoke(activation);
    }
    else
    {
      result = mappedResultRow;
    }

    // Copy any mapped columns from the source
    for (int index = 0; index < projectMapping.length; index++)
    {
      if (projectMapping[index] != -1)
      {
        result.setColumn(index + 1, sourceRow.getColumn(projectMapping[index]));
      }
    }

    /* We need to reSet the current row after doing the projection */
    setCurrentRow(result);
 
View Full Code Here

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

   *
    * @exception StandardException thrown on failure
   */
  public ExecRow  getNextRowCore() throws StandardException
  {
    ExecRow result = null;

    beginTime = getCurrentTimeMillis();
    if (!isOpen)
      throw StandardException.newException(SQLState.LANG_RESULT_SET_NOT_OPEN, "next");

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.