class MergeResultSet extends NoRowsResultSetImpl
Modifier and Type | Field and Description |
---|---|
private MergeConstantAction |
_constants |
private NoPutResultSet |
_drivingLeftJoin |
private int |
_numOpens |
private ExecRow |
_row |
private long |
_rowCount |
private BackingStoreHashtable |
_subjectRowIDs |
private TemporaryRowHolderImpl[] |
_thenRows |
activation, beginExecutionTime, beginTime, endExecutionTime, endTime, lcc
CURRENT_RESULTSET_ONLY, ENTIRE_RESULTSET_TREE, ISAFTERLAST, ISBEFOREFIRST, ISFIRST, ISLAST
Constructor and Description |
---|
MergeResultSet(NoPutResultSet drivingLeftJoin,
Activation activation)
Construct from a driving left join and an Activation.
|
Modifier and Type | Method and Description |
---|---|
private void |
addSubjectRow(SQLRef subjectRowID)
Add another subject row id to the evolving hashtable of affected target rows.
|
void |
cleanUp()
Tells the system to clean up on an error.
|
void |
close()
Clean up resources and call close on data members.
|
(package private) boolean |
collectAffectedRows()
Loop through the rows in the driving left join.
|
private void |
createSubjectRowIDhashtable()
Create a BackingStoreHashtable to hold the ids of subject rows.
|
void |
finish()
Tells the system that there will be no more access
to any database information via this result set;
in particular, no more calls to open().
|
long |
modifiedRowCount()
Returns zero.
|
void |
open()
Needs to be called before the result set will do anything.
|
(package private) void |
setup()
Set up the result set for use.
|
addWarning, checkRowPosition, clearCurrentRow, close, doesCommit, evaluateGenerationClauses, getAbsoluteRow, getActivation, getAutoGeneratedKeysResultset, getBeginExecutionTimestamp, getCurrentTimeMillis, getCursorName, getEndExecutionTimestamp, getExecuteTime, getFirstRow, getLastRow, getNextRow, getPreviousRow, getQueryPlanText, getRelativeRow, getResultDescription, getRowNumber, getSubqueryTrackingArray, getTimeSpent, getWarnings, isClosed, returnsRows, setAfterLastRow, setBeforeFirstRow, toXML
private NoPutResultSet _drivingLeftJoin
private MergeConstantAction _constants
private ExecRow _row
private long _rowCount
private TemporaryRowHolderImpl[] _thenRows
private BackingStoreHashtable _subjectRowIDs
private int _numOpens
MergeResultSet(NoPutResultSet drivingLeftJoin, Activation activation) throws StandardException
StandardException
public final long modifiedRowCount()
NoRowsResultSetImpl
modifiedRowCount
in interface ResultSet
modifiedRowCount
in class NoRowsResultSetImpl
public void open() throws StandardException
ResultSet
StandardException
- Thrown on failurevoid setup() throws StandardException
NoRowsResultSetImpl
open()
.setup
in class NoRowsResultSetImpl
StandardException
- thrown on errorpublic void close() throws StandardException
StandardException
- Thrown on error.public void cleanUp() throws StandardException
ResultSet
StandardException
- Thrown on error.public void finish() throws StandardException
ResultSet
finish
in interface ResultSet
finish
in class NoRowsResultSetImpl
StandardException
- on errorboolean collectAffectedRows() throws StandardException
Loop through the rows in the driving left join.
StandardException
private void addSubjectRow(SQLRef subjectRowID) throws StandardException
Add another subject row id to the evolving hashtable of affected target rows. The concept of a subject row is defined by the 2011 SQL Standard, part 2, section 14.12 (merge statement), general rule 6. A row in the target table is a subject row if it joins to the source table on the main search condition and if the joined row satisfies the matching refinement condition for some WHEN MATCHED clause. A row in the target table may only be a subject row once. That is, a given target row may only qualify for UPDATE or DELETE processing once. If it qualifies for more than one UPDATE or DELETE action, then the Standard requires us to raise a cardinality violation.
subjectRowID
- The location of the subject row.StandardException
- A cardinality exception is thrown if we've already added this subject row.private void createSubjectRowIDhashtable() throws StandardException
Create a BackingStoreHashtable to hold the ids of subject rows.
StandardException
Apache Derby V10.13 Internals - Copyright © 2004,2016 The Apache Software Foundation. All Rights Reserved.