<action dev="jahlborn" type="fix" system="SourceForge2" issue="109">
IndexCursor can early exit when searching based on indexed values.
</action>
+ <action dev="jahlborn" type="fix" system="SourceForge2" issue="110">
+ Fix regression where empty memo values are returned as null.
+ </action>
</release>
<release version="2.0.5" date="2014-09-17">
<action dev="jahlborn" type="add">
throws IOException
{
byte[] binData = readLongValue(lvalDefinition);
- if((binData == null) || (binData.length == 0)) {
+ if(binData == null) {
return null;
}
+ if(binData.length == 0) {
+ return "";
+ }
return decodeTextValue(binData);
}
table.addRow(testStr, testStr, null);
table.addRow(testStr, longMemo, oleValue);
+ table.addRow("", "", new byte[0]);
+ table.addRow(null, null, null);
table.reset();
assertEquals(longMemo, row.get("B"));
assertTrue(Arrays.equals(oleValue, row.getBytes("C")));
+ row = table.getNextRow();
+
+ assertEquals("", row.get("A"));
+ assertEquals("", row.get("B"));
+ assertTrue(Arrays.equals(new byte[0], row.getBytes("C")));
+
+ row = table.getNextRow();
+
+ assertNull(row.get("A"));
+ assertNull(row.get("B"));
+ assertNull(row.getBytes("C"));
+
db.close();
}
}
for(Map<String, Object> row : cursor) {
foundTable.add(row);
}
- assertEquals(expectedTable, foundTable);
+ assertEquals(expectedTable.size(), foundTable.size());
+ for(int i = 0; i < expectedTable.size(); ++i) {
+ assertEquals(expectedTable.get(i), foundTable.get(i));
+ }
}
public static RowImpl createExpectedRow(Object... rowElements) {
t.addRow(Column.AUTO_NUMBER, "foo", "1_foo", longStr, true, 2, bd1);
t.addRow(Column.AUTO_NUMBER, "bar", "2_bar", longStr, false, -37, bd2);
+ t.addRow(Column.AUTO_NUMBER, "", "", "", false, 0, BigDecimal.ZERO);
+ t.addRow(Column.AUTO_NUMBER, null, null, null, null, null, null);
List<? extends Map<String, Object>> expectedRows =
createExpectedTable(
"calc_memo", longStr,
"calc_bool", false,
"calc_long", -37,
- "calc_numeric", bd2));
+ "calc_numeric", bd2),
+ createExpectedRow(
+ "id", 3,
+ "data", "",
+ "calc_text", "",
+ "calc_memo", "",
+ "calc_bool", false,
+ "calc_long", 0,
+ "calc_numeric", BigDecimal.ZERO),
+ createExpectedRow(
+ "id", 4,
+ "data", null,
+ "calc_text", null,
+ "calc_memo", null,
+ "calc_bool", null,
+ "calc_long", null,
+ "calc_numeric", null));
assertTable(expectedRows, t);