double optimizerEstimatedCost,
int baseColumnCount)
throws StandardException
{
super(a, resultSetNumber, optimizerEstimatedRowCount, optimizerEstimatedCost);
final GenericPreparedStatement gp =
(GenericPreparedStatement)a.getPreparedStatement();
scoci = (StaticCompiledOpenConglomInfo) gp.getSavedObject(scociItem);
TransactionController tc = activation.getTransactionController();
dcoci = tc.getDynamicCompiledConglomInfo(conglomId);
this.source = source;
this.indexName = indexName;
this.forUpdate = forUpdate;
this.restriction = restriction;
_baseColumnCount = baseColumnCount;
/* RESOLVE - once we push Qualifiers into the store we
* need to clear their Orderable cache on each open/reopen.
*/
// retrieve the valid column list from
// the saved objects, if it exists
if (heapColRefItem != -1) {
this.accessedHeapCols =
(FormatableBitSet) gp.getSavedObject(heapColRefItem);
}
if (allColRefItem != -1) {
this.accessedAllCols =
(FormatableBitSet) gp.getSavedObject(allColRefItem);
}
// retrieve the array of columns coming from the index
indexCols =
((ReferencedColumnsDescriptorImpl)
gp.getSavedObject(indexColMapItem))
.getReferencedColumnPositions();
/* Get the result row template */
ExecRow resultRow =
((ExecRowBuilder) gp.getSavedObject(resultRowAllocator))
.build(a.getExecutionFactory());
// Note that getCompactRow will assign its return value to the
// variable compactRow which can be accessed through
// inheritance. Hence we need not collect the return value
// of the method.
getCompactRow(resultRow, accessedAllCols, false);
/* If there's no partial row bit map, then we want the entire
* row, otherwise we need to diddle with the row array so that
* we only get the columns coming from the heap on the fetch.
*/
if (accessedHeapCols == null) {
rowArray = resultRow.getRowArray();
}
else {
// Figure out how many columns are coming from the heap
final DataValueDescriptor[] resultRowArray =
resultRow.getRowArray();
final FormatableBitSet heapOnly =
(FormatableBitSet) gp.getSavedObject(heapOnlyColRefItem);
final int heapOnlyLen = heapOnly.getLength();
// Need a separate DataValueDescriptor array in this case
rowArray =
new DataValueDescriptor[heapOnlyLen];