diff options
author | James Ahlborn <jtahlborn@yahoo.com> | 2016-09-09 11:58:37 +0000 |
---|---|---|
committer | James Ahlborn <jtahlborn@yahoo.com> | 2016-09-09 11:58:37 +0000 |
commit | 545c0269857a0be87823bdbe08b92309f2466c96 (patch) | |
tree | 20851c0b82b777499d09caab57d75a1ddb1da0ca /src/main/java | |
parent | 819953ac72f4e8ba7e070e53ee12e9ba1decda5a (diff) | |
download | jackcess-545c0269857a0be87823bdbe08b92309f2466c96.tar.gz jackcess-545c0269857a0be87823bdbe08b92309f2466c96.zip |
more update tests; fix minor bug with allocating new usage maps
git-svn-id: https://svn.code.sf.net/p/jackcess/code/jackcess/trunk@1032 f203690c-595d-4dc9-a70b-905162fa7fd2
Diffstat (limited to 'src/main/java')
-rw-r--r-- | src/main/java/com/healthmarketscience/jackcess/impl/DatabaseImpl.java | 4 | ||||
-rw-r--r-- | src/main/java/com/healthmarketscience/jackcess/impl/TableImpl.java | 5 |
2 files changed, 7 insertions, 2 deletions
diff --git a/src/main/java/com/healthmarketscience/jackcess/impl/DatabaseImpl.java b/src/main/java/com/healthmarketscience/jackcess/impl/DatabaseImpl.java index 8ed8f57..dc5ecbf 100644 --- a/src/main/java/com/healthmarketscience/jackcess/impl/DatabaseImpl.java +++ b/src/main/java/com/healthmarketscience/jackcess/impl/DatabaseImpl.java @@ -1716,12 +1716,12 @@ public class DatabaseImpl implements Database } public void validateNewTableName(String name) throws IOException { + validateIdentifierName(name, getFormat().MAX_TABLE_NAME_LENGTH, "table"); + if(lookupTable(name) != null) { throw new IllegalArgumentException(withErrorContext( "Cannot create table with name of existing table '" + name + "'")); } - - validateIdentifierName(name, getFormat().MAX_TABLE_NAME_LENGTH, "table"); } /** diff --git a/src/main/java/com/healthmarketscience/jackcess/impl/TableImpl.java b/src/main/java/com/healthmarketscience/jackcess/impl/TableImpl.java index e1b0d1e..e5a6316 100644 --- a/src/main/java/com/healthmarketscience/jackcess/impl/TableImpl.java +++ b/src/main/java/com/healthmarketscience/jackcess/impl/TableImpl.java @@ -1560,6 +1560,10 @@ public class TableImpl implements Table return tableBuffer; } + /** + * Adds some usage maps for use with this table. This method is expected to + * be called with a small-ish number of requested usage maps. + */ private Map.Entry<Integer,Integer> addUsageMaps( int numMaps, Integer firstUsedPage) throws IOException @@ -1595,6 +1599,7 @@ public class TableImpl implements Table if(umapPageNumber == PageChannel.INVALID_PAGE_NUMBER) { // didn't find any existing pages, need to create a new one + umapPageNumber = pageChannel.allocateNewPage(); freeSpace = format.DATA_PAGE_INITIAL_FREE_SPACE; firstRowNum = 0; umapBuf = createUsageMapDefPage(pageChannel, freeSpace); |