Examples of DataValueDescriptor


Examples of org.apache.derby.iapi.types.DataValueDescriptor


  boolean  collectAffectedRows() throws StandardException
 

    DataValueDescriptor    rlColumn;
    RowLocation  baseRowLocation;
    boolean rowsFound = false;

    if(cascadeDelete)
      row = getNextRowCore(source);
View Full Code Here

Examples of org.apache.derby.iapi.types.DataValueDescriptor

  //delete the rows that in case deferred case and
  //during cascade delete (All deletes are deferred during cascade action)
  void deleteDeferredRows() throws StandardException
  {
   
    DataValueDescriptor    rlColumn;
     RowLocation  baseRowLocation;
    ExecRow    deferredRLRow = null;

    deferredBaseCC = tc.openCompiledConglomerate(false,
                           tc.OPENMODE_FORUPDATE|tc.OPENMODE_SECONDARY_LOCKED,
View Full Code Here

Examples of org.apache.derby.iapi.types.DataValueDescriptor

    int size = aiCounters.size();
    for (int i = 0; i < size; i++)
    {
      AutoincrementCounter aic =
        (AutoincrementCounter)aiCounters.elementAt(i);
      DataValueDescriptor dvd = afterRow.getColumn(aic.getColumnPosition());
      aic.update(dvd.getLong());
    }
  }
View Full Code Here

Examples of org.apache.derby.iapi.types.DataValueDescriptor

  private boolean sameGroupingValues(ExecRow currRow, ExecRow newRow)
    throws StandardException
  {
    for (int index = 0; index < order.length; index++)
    {
      DataValueDescriptor currOrderable = currRow.getColumn(order[index].getColumnId() + 1);
      DataValueDescriptor newOrderable = newRow.getColumn(order[index].getColumnId() + 1);
      if (! (currOrderable.compare(DataValueDescriptor.ORDER_OP_EQUALS, newOrderable, true, true)))
      {
        return false;
      }
    }
View Full Code Here

Examples of org.apache.derby.iapi.types.DataValueDescriptor

      SanityManager.ASSERT(
        row.nColumns() == SYSSTATISTICS_COLUMN_COUNT,
        "Wrong number of columns for a SYSSTATISTICS row");
    }

    DataValueDescriptor col;
    String scratch;
    UUIDFactory uuidFactory = getUUIDFactory();
    UUID statUUID, statReferenceUUID, statTableUUID;
    String statName;
   
    /* 1st column is UUID */
    col = row.getColumn(SYSSTATISTICS_ID);
    scratch = col.getString();
    statUUID = uuidFactory.recreateUUID(scratch);

    /* 2nd column is reference UUID */
    col = row.getColumn(SYSSTATISTICS_REFERENCEID);
    scratch = col.getString();
    statReferenceUUID = uuidFactory.recreateUUID(scratch);

    /* 3rd column is table UUID */
    col = row.getColumn(SYSSTATISTICS_TABLEID);
    scratch = col.getString();
    statTableUUID = uuidFactory.recreateUUID(scratch);

    /* 4th column is timestamp */
    col = row.getColumn(SYSSTATISTICS_TIMESTAMP);
    Timestamp updateTime = (Timestamp) col.getObject();

    /* 5th column is stat type -- string */
    col = row.getColumn(SYSSTATISTICS_TYPE);
    String statType = col.getString();

    /* 6th column is stat valid -- boolean */
    col = row.getColumn(SYSSTATISTICS_VALID);
    boolean valid = col.getBoolean();

    /* 7th column is column count */
    col = row.getColumn(SYSSTATISTICS_COLCOUNT);
    int columnCount = col.getInt();

    /* 8th column is statistics itself */
    col = row.getColumn(SYSSTATISTICS_STAT);
    Statistics stat = (Statistics)col.getObject();

    return new StatisticsDescriptor(dd, statUUID, statReferenceUUID,
                       statTableUUID, // statName, colMap,
                       statType, stat, columnCount);
  }     
View Full Code Here

Examples of org.apache.derby.iapi.types.DataValueDescriptor

            break;

          case UNIQUE_CARDINALITY_CHECK:
            candidateRow = candidateRow.getClone();
            secondRow = source.getNextRowCore();
            DataValueDescriptor orderable1 = candidateRow.getColumn(1);
            while (secondRow != null)
            {
              DataValueDescriptor orderable2 = secondRow.getColumn(1);
              if (! (orderable1.compare(DataValueDescriptor.ORDER_OP_EQUALS, orderable2, true, true)))
              {
                close();
                StandardException se = StandardException.newException(SQLState.LANG_SCALAR_SUBQUERY_CARDINALITY_VIOLATION);
                throw se;
View Full Code Here

Examples of org.apache.derby.iapi.types.DataValueDescriptor

  public ExecRow makeRow(TupleDescriptor td, TupleDescriptor parent)
    throws StandardException
  {
    DataTypeDescriptor    dtd;
    ExecRow            row;
    DataValueDescriptor    col;
    String          name = null;
    UUID          uuid = null
    UUID          suuid = null;      // schema 
    UUID          tuuid = null;      // referenced table 
    UUID          actionSPSID = null;    // action sps uuid string
View Full Code Here

Examples of org.apache.derby.iapi.types.DataValueDescriptor

    ExecRow          row,
    TupleDescriptor      parentTupleDescriptor,
    DataDictionary       dd
  ) throws StandardException
  {
    DataValueDescriptor    col;
    String          name;
    char          theChar;
    String          uuidStr;
    String          triggerDefinition;
    String          oldReferencingName;
    String          newReferencingName;
    UUID          uuid; 
    UUID          suuid;          // schema 
    UUID          tuuid;          // referenced table 
    UUID          actionSPSID = null;    // action sps uuid string
    UUID          whenSPSID = null;    // when clause sps uuid string
    Timestamp        createTime;
    int            eventMask = 0;
    boolean          isBefore;
    boolean          isRow;
    boolean          isEnabled;
    boolean          referencingOld;
    boolean          referencingNew;
    ReferencedColumns rcd;
    TriggerDescriptor    descriptor;
    DataDescriptorGenerator  ddg = dd.getDataDescriptorGenerator();

    if (SanityManager.DEBUG)
    {
      SanityManager.ASSERT(row.nColumns() == SYSTRIGGERS_COLUMN_COUNT,
                 "Wrong number of columns for a SYSTRIGGERS row");
    }

    // 1st column is TRIGGERID (UUID - char(36))
    col = row.getColumn(1);
    uuidStr = col.getString();
    uuid = getUUIDFactory().recreateUUID(uuidStr);

    // 2nd column is TRIGGERNAME (varchar(128))
    col = row.getColumn(2);
    name = col.getString();

    // 3rd column is SCHEMAID (UUID - char(36))
    col = row.getColumn(3);
    uuidStr = col.getString();
    suuid = getUUIDFactory().recreateUUID(uuidStr);

    // 4th column is CREATIONTIMESTAMP (TIMESTAMP)
    col = row.getColumn(4);
    createTime = (Timestamp) col.getObject();

    // 5th column is EVENT (char(1))
    col = row.getColumn(5);
    theChar = col.getString().charAt(0);
    switch (theChar)
    {
      case 'U':
            eventMask = TriggerDescriptor.TRIGGER_EVENT_UPDATE;
            break;

      case 'I':
            eventMask = TriggerDescriptor.TRIGGER_EVENT_INSERT;
            break;

      case 'D':
            eventMask = TriggerDescriptor.TRIGGER_EVENT_DELETE;
            break;

      default:
          if (SanityManager.DEBUG
          {
            SanityManager.THROWASSERT("bad event mask: "+theChar);
          }
    }
   
    // 6th column is FIRINGTIME (char(1))
    isBefore = getCharBoolean(row.getColumn(6), 'B', 'A');

    // 7th column is TYPE (char(1))
    isRow = getCharBoolean(row.getColumn(7), 'R', 'S');

    // 8th column is STATE (char(1))
    isEnabled = getCharBoolean(row.getColumn(8), 'E', 'D');

    // 9th column is TABLEID (UUID - char(36))
    col = row.getColumn(9);
    uuidStr = col.getString();
    tuuid = getUUIDFactory().recreateUUID(uuidStr);

    // 10th column is WHENSTMTID (UUID - char(36))
    col = row.getColumn(10);
    uuidStr = col.getString();
    if (uuidStr != null)
      whenSPSID = getUUIDFactory().recreateUUID(uuidStr);

    // 11th column is ACTIONSTMTID (UUID - char(36))
    col = row.getColumn(11);
    uuidStr = col.getString();
    if (uuidStr != null)
      actionSPSID = getUUIDFactory().recreateUUID(uuidStr);

    // 12th column is REFERENCEDCOLUMNS user type org.apache.derby.catalog.ReferencedColumns
    col = row.getColumn(12);
    rcd = (ReferencedColumns) col.getObject();

    // 13th column is TRIGGERDEFINITION (longvarhar)
    col = row.getColumn(13);
    triggerDefinition = col.getString();

    // 14th column is REFERENCINGOLD (boolean)
    col = row.getColumn(14);
    referencingOld = col.getBoolean();

    // 15th column is REFERENCINGNEW (boolean)
    col = row.getColumn(15);
    referencingNew = col.getBoolean();

    // 16th column is REFERENCINGNAME (varchar(128))
    col = row.getColumn(16);
    oldReferencingName = col.getString();

    // 17th column is REFERENCINGNAME (varchar(128))
    col = row.getColumn(17);
    newReferencingName = col.getString();

    descriptor = new TriggerDescriptor(
                  dd,
                  dd.getSchemaDescriptor(suuid, null),
                  uuid,
View Full Code Here

Examples of org.apache.derby.iapi.types.DataValueDescriptor

            Qualifier q = qual_list[0][i];

            // Get the column from the possibly partial row, of the
            // q.getColumnId()'th column in the full row.
            DataValueDescriptor columnValue = row[q.getColumnId()];

            row_qualifies =
                columnValue.compare(
                    q.getOperator(),
                    q.getOrderable(),
                    q.getOrderedNulls(),
                    q.getUnknownRV());

            if (q.negateCompareResult())
                row_qualifies = !row_qualifies;

            // Once an AND fails the whole Qualification fails - do a return!
            if (!row_qualifies)
                return(false);
        }

        // all the qual[0] and terms passed, now process the OR clauses

        for (int and_idx = 1; and_idx < qual_list.length; and_idx++)
        {
            // loop through each of the "and" clause.

            row_qualifies = false;

            if (SanityManager.DEBUG)
            {
                // Each OR clause must be non-empty.
                SanityManager.ASSERT(qual_list[and_idx].length > 0);
            }

            for (int or_idx = 0; or_idx < qual_list[and_idx].length; or_idx++)
            {
                // Apply one qualifier to the row.
                Qualifier q      = qual_list[and_idx][or_idx];
                int       col_id = q.getColumnId();

                if (SanityManager.DEBUG)
                {
                    SanityManager.ASSERT(
                        (col_id < row.length),
                        "Qualifier is referencing a column not in the row.");
                }

                // Get the column from the possibly partial row, of the
                // q.getColumnId()'th column in the full row.
                DataValueDescriptor columnValue = row[q.getColumnId()];

                if (SanityManager.DEBUG)
                {
                    if (columnValue == null)
                        SanityManager.THROWASSERT(
                            "1:row = " + RowUtil.toString(row) +
                            "row.length = " + row.length +
                            ";q.getColumnId() = " + q.getColumnId());
                }

                // do the compare between the column value and value in the
                // qualifier.
                row_qualifies =
                    columnValue.compare(
                            q.getOperator(),
                            q.getOrderable(),
                            q.getOrderedNulls(),
                            q.getUnknownRV());
View Full Code Here

Examples of org.apache.derby.iapi.types.DataValueDescriptor

          if (map == null)
            k = basePos - 1;
          else
            k =  map[basePos - 1];

          DataValueDescriptor key;
          /* We need to compare with saved most-forward cursor scan key if we
           * are reading records from the saved RowLocation temp table (instead
           * of the old column value) because we only care if new update value
           * jumps forward the most-forward scan key.
           */
          if (tableScan.compareToLastKey)
            key = tableScan.lastCursorKey.getColumn(i + 1);
          else
            key = row[k];

          /* Starting from the first index key column forward, we see if the direction
           * of the update change is consistent with the direction of index scan.
           * If so, we save it in hash table.
           */
          if ((ascending && key.greaterThan(newBaseRow[k], key).equals(true)) ||
            (!ascending && key.lessThan(newBaseRow[k], key).equals(true)))
            placedForward = true;
          else if (key.equals(newBaseRow[k], key).equals(true))
          {
            decided = false;
            overlap = true;
          }
          break;
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.