Class DMLWriteResultSet
java.lang.Object
org.apache.derby.impl.sql.execute.NoRowsResultSetImpl
org.apache.derby.impl.sql.execute.DMLWriteResultSet
- All Implemented Interfaces:
ResultSet
- Direct Known Subclasses:
DeleteResultSet
,DMLVTIResultSet
,DMLWriteGeneratedColumnsResultSet
For INSERT/UPDATE/DELETE impls. Used to tag them.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected int[]
protected DataValueDescriptor[]
This array contains data value descriptors that can be used (and reused) to hold the normalized column values.protected WriteCursorConstantAction
protected DynamicCompiledOpenConglomInfo
protected DynamicCompiledOpenConglomInfo[]
private boolean
protected ResultDescription
long
protected int[]
Fields inherited from class org.apache.derby.impl.sql.execute.NoRowsResultSetImpl
activation, beginExecutionTime, beginTime, endExecutionTime, endTime, lcc
Fields inherited from interface org.apache.derby.iapi.sql.ResultSet
CURRENT_RESULTSET_ONLY, ENTIRE_RESULTSET_TREE, ISAFTERLAST, ISBEFOREFIRST, ISFIRST, ISLAST
-
Constructor Summary
ConstructorsConstructorDescriptionDMLWriteResultSet
(Activation activation) ConstructorDMLWriteResultSet
(Activation activation, ConstantAction constantAction) -
Method Summary
Modifier and TypeMethodDescription(package private) int
decodeLockMode
(int lockMode) Decode the update lock mode.(package private) String
getIndexNameFromCID
(long indexCID) get the index name given the conglomerate id of the index.protected ExecRow
getNextRowCore
(NoPutResultSet source) Get next row from the source result set.Returns the description of the inserted rows.protected ExecRow
makeDeferredSparseRow
(ExecRow deferredBaseRow, FormatableBitSet baseRowReadList, LanguageConnectionContext lcc) For deferred update, get a deferred sparse row based on the deferred non-sparse row.final long
Returns zero.protected ExecRow
normalizeRow
(NoPutResultSet sourceResultSet, ExecRow row) Normalize a row as part of the INSERT/UPDATE action of a MERGE statement.private void
objectifyStreams
(ExecRow row) void
rememberConstraint
(UUID cid) Methods inherited from class org.apache.derby.impl.sql.execute.NoRowsResultSetImpl
addWarning, checkRowPosition, clearCurrentRow, close, doesCommit, evaluateGenerationClauses, finish, getAbsoluteRow, getActivation, getAutoGeneratedKeysResultset, getBeginExecutionTimestamp, getCurrentTimeMillis, getCursorName, getEndExecutionTimestamp, getExecuteTime, getFirstRow, getLastRow, getNextRow, getPreviousRow, getQueryPlanText, getRelativeRow, getRowNumber, getSubqueryTrackingArray, getTimeSpent, getWarnings, isClosed, returnsRows, setAfterLastRow, setBeforeFirstRow, setup, toXML
-
Field Details
-
constantAction
-
baseRowReadMap
protected int[] baseRowReadMap -
streamStorableHeapColIds
protected int[] streamStorableHeapColIds -
heapDCOCI
-
indexDCOCIs
-
needToObjectifyStream
private boolean needToObjectifyStream -
rowCount
public long rowCount -
resultDescription
-
cachedDestinations
This array contains data value descriptors that can be used (and reused) to hold the normalized column values.
-
-
Constructor Details
-
DMLWriteResultSet
DMLWriteResultSet(Activation activation) throws StandardException Constructor- Parameters:
activation
- an activation- Throws:
StandardException
- on error
-
DMLWriteResultSet
DMLWriteResultSet(Activation activation, ConstantAction constantAction) throws StandardException - Throws:
StandardException
-
-
Method Details
-
modifiedRowCount
public final long modifiedRowCount()Description copied from class:NoRowsResultSetImpl
Returns zero.- Specified by:
modifiedRowCount
in interfaceResultSet
- Overrides:
modifiedRowCount
in classNoRowsResultSetImpl
- Returns:
- The number of rows affect by the statement, so far.
-
getResultDescription
Returns the description of the inserted rows. REVISIT: Do we want this to return NULL instead?- Specified by:
getResultDescription
in interfaceResultSet
- Overrides:
getResultDescription
in classNoRowsResultSetImpl
- Returns:
- the description of the inserted rows
-
getNextRowCore
Get next row from the source result set.- Parameters:
source
- SourceResultSet Also look at Track#2432/change 12433- Returns:
- The next row in the result set
- Throws:
StandardException
- Standard error policy
-
objectifyStreams
- Throws:
StandardException
-
makeDeferredSparseRow
protected ExecRow makeDeferredSparseRow(ExecRow deferredBaseRow, FormatableBitSet baseRowReadList, LanguageConnectionContext lcc) throws StandardException For deferred update, get a deferred sparse row based on the deferred non-sparse row. Share the underlying columns. If there is no column bit map, make them the same row.- Parameters:
deferredBaseRow
- the deferred non-sparse rowbaseRowReadList
- the columns to include (1-based bit map)lcc
- the language connection context- Returns:
- the deferred sparse row
- Throws:
StandardException
- Thrown on error
-
decodeLockMode
int decodeLockMode(int lockMode) Decode the update lock mode.The value for update lock mode is in the second most significant byte for TransactionControl.SERIALIZABLE_ISOLATION_LEVEL isolation level. Otherwise (REPEATABLE READ, READ COMMITTED, and READ UNCOMMITTED) the lock mode is located in the least significant byte.
This is done to override the optimizer choice to provide maximum concurrency of record level locking except in SERIALIZABLE where table level locking is required in heap scans for correctness.
- Parameters:
lockMode
- the compiled encoded lock mode for this query- Returns:
- the lock mode (record or table) to use to open the result set
- See Also:
-
getIndexNameFromCID
get the index name given the conglomerate id of the index.- Parameters:
indexCID
- conglomerate ID of the index.- Returns:
- index name of given index.
-
normalizeRow
protected ExecRow normalizeRow(NoPutResultSet sourceResultSet, ExecRow row) throws StandardException Normalize a row as part of the INSERT/UPDATE action of a MERGE statement. This applies logic usually found in a NormalizeResultSet, which is missing for the MERGE statement.
- Parameters:
sourceResultSet
- the result set for which this action is to be performedrow
- the row to be normalized- Returns:
- the normalized row
- Throws:
StandardException
- Standard error policy
-
rememberConstraint
- Throws:
StandardException
-