Expand the characters supported in index updates to all of the
ISO-8859-1 character set.
</action>
+ <action dev="jahlborn" type="update">
+ Fix bug caused by sign extension when reading single-byte row numbers.
+ </action>
</release>
<release version="1.1.12" date="2008-02-27">
<action dev="jahlborn" type="fix">
lvalDefinition.length);
}
- byte rowNum = def.get();
+ int rowNum = ByteUtil.toUnsignedInt(def.get());
int pageNum = ByteUtil.get3ByteInt(def, def.position());
ByteBuffer lvalPage = getPageChannel().createPageBuffer();
// read next page information
lvalPage.position(rowStart);
- rowNum = lvalPage.get();
+ rowNum = ByteUtil.toUnsignedInt(lvalPage.get());
pageNum = ByteUtil.get3ByteInt(lvalPage);
// update rowEnd and remainingLen based on chunkLength
++charOffset;
}
tmpBout.write(extraCodes._extraCodes);
+ ++charOffset;
}
}
}
// write end extra text
- tmpBout.write(END_EXTRA_TEXT);
+ bout.write(END_EXTRA_TEXT);
}
/**
// read the rowId
int page = ByteUtil.get3ByteInt(buffer, ByteOrder.BIG_ENDIAN);
- int row = buffer.get();
+ int row = ByteUtil.toUnsignedInt(buffer.get());
+
_rowId = new RowId(page, row);
_type = EntryType.NORMAL;
}
/** Global usage map always lives on page 1 */
private static final int PAGE_GLOBAL_USAGE_MAP = 1;
+ /** Global usage map always lives at row 0 */
+ private static final int ROW_GLOBAL_USAGE_MAP = 0;
/** Channel containing the database */
private final FileChannel _channel;
{
// note the global usage map is a special map where any page outside of
// the current range is assumed to be "on"
- _globalUsageMap = UsageMap.read(database, PAGE_GLOBAL_USAGE_MAP, (byte) 0,
- true);
+ _globalUsageMap = UsageMap.read(database, PAGE_GLOBAL_USAGE_MAP,
+ ROW_GLOBAL_USAGE_MAP, true);
}
/**
// Overflow page. the "row" data in the current page points to
// another page/row
- int overflowRowNum = rowBuffer.get(rowStart);
+ int overflowRowNum = ByteUtil.toUnsignedInt(rowBuffer.get(rowStart));
int overflowPageNum = ByteUtil.get3ByteInt(rowBuffer, rowStart + 1);
rowBuffer = rowState.setOverflowRow(
new RowId(overflowPageNum, overflowRowNum));
_indexSlotCount = tableBuffer.getInt(getFormat().OFFSET_NUM_INDEX_SLOTS);
_indexCount = tableBuffer.getInt(getFormat().OFFSET_NUM_INDEXES);
- byte rowNum = tableBuffer.get(getFormat().OFFSET_OWNED_PAGES);
+ int rowNum = ByteUtil.toUnsignedInt(
+ tableBuffer.get(getFormat().OFFSET_OWNED_PAGES));
int pageNum = ByteUtil.get3ByteInt(tableBuffer, getFormat().OFFSET_OWNED_PAGES + 1);
_ownedPages = UsageMap.read(getDatabase(), pageNum, rowNum, false);
- rowNum = tableBuffer.get(getFormat().OFFSET_FREE_SPACE_PAGES);
+ rowNum = ByteUtil.toUnsignedInt(
+ tableBuffer.get(getFormat().OFFSET_FREE_SPACE_PAGES));
pageNum = ByteUtil.get3ByteInt(tableBuffer, getFormat().OFFSET_FREE_SPACE_PAGES + 1);
_freeSpacePages = UsageMap.read(getDatabase(), pageNum, rowNum, false);
* which type of map is found
*/
public static UsageMap read(Database database, int pageNum,
- byte rowNum, boolean assumeOutOfRangeBitsOn)
+ int rowNum, boolean assumeOutOfRangeBitsOn)
throws IOException
{
JetFormat format = database.getFormat();