Browse Source

fix handling of descending indexes

git-svn-id: https://svn.code.sf.net/p/jackcess/code/jackcess/branches/a97_indexes@1311 f203690c-595d-4dc9-a70b-905162fa7fd2
tags/jackcess-3.5.0
James Ahlborn 4 years ago
parent
commit
48170577dd

+ 9
- 13
src/main/java/com/healthmarketscience/jackcess/impl/General97IndexCodes.java View File

@@ -150,29 +150,25 @@ public class General97IndexCodes extends GeneralLegacyIndexCodes
}
}

// FIXME, how to handle extra codes for non ascending?
if(extraCodes != null) {

// write the extra codes to the end
extraCodes.writeNibble(EXT_CODES_BOUNDS_NIBBLE);
extraCodes.writeTo(bout);

} else {

// handle descending order by inverting the bytes
if(!isAscending) {

// we actually write the end byte before flipping the bytes, and write
// another one after flipping
bout.write(END_EXTRA_TEXT);

// flip the bytes that we have written thus far for this text value
IndexData.flipBytes(bout.getBytes(), prevLength,
(bout.getLength() - prevLength));
}

// write end extra text
bout.write(END_EXTRA_TEXT);
}

// handle descending order by inverting the bytes
if(!isAscending) {

// flip the bytes that we have written thus far for this text value
IndexData.flipBytes(bout.getBytes(), prevLength,
(bout.getLength() - prevLength));
}
}

private static void writeExtraCodes(int numSigChars, byte[] bytes,

Loading…
Cancel
Save