);
}
else if (rs instanceof TableScanResultSet)
{
boolean instantaneousLocks = false;
TableScanResultSet tsrs = (TableScanResultSet) rs;
String startPosition = null;
String stopPosition = null;
String isolationLevel = null;
String lockString = null;
String lockRequestString = null;
switch (tsrs.isolationLevel)
{
case TransactionController.ISOLATION_SERIALIZABLE:
isolationLevel =
MessageService.getTextMessage(
SQLState.LANG_SERIALIZABLE);
break;
case TransactionController.ISOLATION_REPEATABLE_READ:
isolationLevel =
MessageService.getTextMessage(
SQLState.LANG_REPEATABLE_READ);
break;
case TransactionController.ISOLATION_READ_COMMITTED_NOHOLDLOCK:
instantaneousLocks = true;
//fall through
case TransactionController.ISOLATION_READ_COMMITTED:
isolationLevel = MessageService.getTextMessage(
SQLState.LANG_READ_COMMITTED);
break;
case TransactionController.ISOLATION_READ_UNCOMMITTED:
isolationLevel =
MessageService.getTextMessage(
SQLState.LANG_READ_UNCOMMITTED);
break;
}
if (tsrs.forUpdate)
{
lockString = MessageService.getTextMessage(
SQLState.LANG_EXCLUSIVE);
}
else
{
if (instantaneousLocks)
{
lockString = MessageService.getTextMessage(
SQLState.LANG_INSTANTANEOUS_SHARE);
}
else
{
lockString = MessageService.getTextMessage(
SQLState.LANG_SHARE);
}
}
switch (tsrs.lockMode)
{
case TransactionController.MODE_TABLE:
// RESOLVE: Not sure this will really work, as we
// are tacking together English words to make a phrase.
// Will this work in other languages?
lockRequestString = lockString + " " +
MessageService.getTextMessage(
SQLState.LANG_TABLE);
break;
case TransactionController.MODE_RECORD:
// RESOLVE: Not sure this will really work, as we
// are tacking together English words to make a phrase.
// Will this work in other languages?
lockRequestString = lockString + " " +
MessageService.getTextMessage(
SQLState.LANG_ROW);
break;
}
if (tsrs.indexName != null)
{
/* Start and stop position strings will be non-null
* if the TSRS has been closed. Otherwise, we go off
* and build the strings now.
*/
startPosition = tsrs.startPositionString;
if (startPosition == null)
{
startPosition = tsrs.printStartPosition();
}
stopPosition = tsrs.stopPositionString;
if (stopPosition == null)
{
stopPosition = tsrs.printStopPosition();
}
}
return new
RealTableScanStatistics(
tsrs.numOpens,
tsrs.rowsSeen,
tsrs.rowsFiltered,
tsrs.constructorTime,
tsrs.openTime,
tsrs.nextTime,
tsrs.closeTime,
tsrs.resultSetNumber,
tsrs.tableName,
tsrs.userSuppliedOptimizerOverrides,
tsrs.indexName,
tsrs.isConstraint,
tsrs.printQualifiers(tsrs.qualifiers),
tsrs.getScanProperties(),
startPosition,
stopPosition,
isolationLevel,
lockRequestString,
tsrs.rowsPerRead,