Просмотр исходного кода

Ignore invalid column usage map definitions, fixes issue 97

git-svn-id: https://svn.code.sf.net/p/jackcess/code/jackcess/branches/jackcess-1.2.14@799 f203690c-595d-4dc9-a70b-905162fa7fd2
tags/jackcess-1.2.14.3
James Ahlborn 10 лет назад
Родитель
Сommit
339acb2705

+ 5
- 0
src/changes/changes.xml Просмотреть файл

@@ -4,6 +4,11 @@
<author email="javajedi@users.sf.net">Tim McCune</author>
</properties>
<body>
<release version="1.2.14.3" date="TBD">
<action dev="jahlborn" type="fix" system="SourceForge2" issue="97">
Ignore invalid column usage map definitions.
</action>
</release>
<release version="1.2.14.2" date="2013-08-25">
<action dev="jahlborn" type="fix" system="SourceForge2" issue="96">
Fix reading of Properties with multiple value blocks.

+ 14
- 4
src/java/com/healthmarketscience/jackcess/Table.java Просмотреть файл

@@ -1404,10 +1404,20 @@ public class Table
break;
}
UsageMap colOwnedPages = UsageMap.read(
getDatabase(), tableBuffer, false);
UsageMap colFreeSpacePages = UsageMap.read(
getDatabase(), tableBuffer, false);
int pos = tableBuffer.position();
UsageMap colOwnedPages = null;
UsageMap colFreeSpacePages = null;
try {
colOwnedPages = UsageMap.read(getDatabase(), tableBuffer, false);
colFreeSpacePages = UsageMap.read(getDatabase(), tableBuffer, false);
} catch(IllegalStateException e) {
// ignore invalid usage map info
colOwnedPages = null;
colFreeSpacePages = null;
tableBuffer.position(pos + 8);
LOG.warn("Table " + _name + " invalid column " + umapColNum +
" usage map definition: " + e);
}
for(Column col : _columns) {
if(col.getColumnNumber() == umapColNum) {

+ 5
- 0
src/java/com/healthmarketscience/jackcess/UsageMap.java Просмотреть файл

@@ -136,6 +136,11 @@ public class UsageMap
int rowNum, boolean assumeOutOfRangeBitsOn)
throws IOException
{
if(pageNum <= 0) {
// usage maps will never appear on page 0 (or less)
throw new IllegalStateException("Invalid usage map page number " + pageNum);
}

JetFormat format = database.getFormat();
PageChannel pageChannel = database.getPageChannel();
ByteBuffer tableBuffer = pageChannel.createPageBuffer();

Загрузка…
Отмена
Сохранить