diff options
author | James Ahlborn <jtahlborn@yahoo.com> | 2008-07-17 02:46:42 +0000 |
---|---|---|
committer | James Ahlborn <jtahlborn@yahoo.com> | 2008-07-17 02:46:42 +0000 |
commit | 48404ab2d688d5fb9af63166e049a0a5c95800cd (patch) | |
tree | 92bb259913b8018c21bbd681012c93eebda04ede /src/java/com/healthmarketscience | |
parent | 506b7c28ee353058c8d3fdedba3098c60dfaabb3 (diff) | |
download | jackcess-48404ab2d688d5fb9af63166e049a0a5c95800cd.tar.gz jackcess-48404ab2d688d5fb9af63166e049a0a5c95800cd.zip |
Reserve minimum space for memo/ole fields so that greedy inline row usage does not cause spurious write failures for wide tables.
git-svn-id: https://svn.code.sf.net/p/jackcess/code/jackcess/trunk@358 f203690c-595d-4dc9-a70b-905162fa7fd2
Diffstat (limited to 'src/java/com/healthmarketscience')
-rw-r--r-- | src/java/com/healthmarketscience/jackcess/Table.java | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/src/java/com/healthmarketscience/jackcess/Table.java b/src/java/com/healthmarketscience/jackcess/Table.java index c4976ba..5007f3d 100644 --- a/src/java/com/healthmarketscience/jackcess/Table.java +++ b/src/java/com/healthmarketscience/jackcess/Table.java @@ -1374,7 +1374,17 @@ public class Table maxRowSize -= buffer.position(); // now, account for trailer space maxRowSize -= (nullMask.byteSize() + 4 + (_maxVarColumnCount * 2)); - + + // for each non-null long value column we need to reserve a small + // amount of space so that we don't end up running out of row space + // later by being too greedy + for (Column varCol : _varColumns) { + if((varCol.getType().isLongValue()) && + (rowArray[varCol.getColumnIndex()] != null)) { + maxRowSize -= getFormat().SIZE_LONG_VALUE_DEF; + } + } + //Now write out variable length column data short[] varColumnOffsets = new short[_maxVarColumnCount]; int varColumnOffsetsIndex = 0; |