_autoNumber = false;
_autoNumberGenerator = null;
_columnNumber = (short)colNumber;
- _displayIndex = 0;
+ _columnIndex = colNumber;
+ _displayIndex = colNumber;
_fixedDataOffset = fixedOffset;
_varLenTableIndex = varLenIndex;
}
t = (TableImpl)db.getTable("Table1");
index = t.getIndex("col1");
- System.out.println("BigIndexTest: Index type: " +
- index.getIndexData().getClass());
-
// add 2,000 (pseudo) random entries to the table
Random rand = new Random(13L);
for(int i = 0; i < 2000; ++i) {
}
@SuppressWarnings("unchecked")
- private void replaceColumn(Table t, String colName) throws Exception
+ private static void replaceColumn(Table t, String colName) throws Exception
{
- Field colsField = Table.class.getDeclaredField("_columns");
+ Field colsField = TableImpl.class.getDeclaredField("_columns");
colsField.setAccessible(true);
List<Column> cols = (List<Column>)colsField.get(t);
Column srcCol = null;
- Column destCol = new BogusColumn(t);
+ ColumnImpl destCol = new BogusColumn(t);
+ destCol.setName(colName);
for(int i = 0; i < cols.size(); ++i) {
srcCol = cols.get(i);
if(srcCol.getName().equals(colName)) {
private static class BogusColumn extends ColumnImpl
{
private BogusColumn(Table table) {
- super((TableImpl)table, DataType.TEXT, 0, 0, 0);
+ super((TableImpl)table, DataType.LONG, 1, 0, 0);
}
@Override
for (final TestDB testDB : TestDB.getSupportedForBasename(Basename.INDEX)) {
Database db = openCopy(testDB);
+ db.setEnforceForeignKeys(false);
Table t1 = db.getTable("Table1");
Table t2 = db.getTable("Table2");
Table t3 = db.getTable("Table3");
for (final TestDB testDB : TestDB.getSupportedForBasename(Basename.INDEX)) {
Database db = openCopy(testDB);
- db.setEnforceForeignKeys(true);
Table t1 = db.getTable("Table1");
Table t2 = db.getTable("Table2");
Table t3 = db.getTable("Table3");
List<Map<String,Object>> rows = Arrays.asList(row0, row1, row2, row3, row4, row5);
+ ColumnImpl testCol = new ColumnImpl(null, DataType.TEXT, 0, 0, 0);
+ testCol.setName(COL1);
assertEquals(Arrays.asList(row0, row2, row4),
- toList(RowFilter.matchPattern(
- new ColumnImpl(null, DataType.TEXT, 0, 0, 0),
+ toList(RowFilter.matchPattern(testCol,
"foo").apply(rows)));
assertEquals(Arrays.asList(row1, row3, row5),
toList(RowFilter.invert(
RowFilter.matchPattern(
- new ColumnImpl(null, DataType.TEXT, 0, 0, 0),
+ testCol,
"foo")).apply(rows)));
assertEquals(Arrays.asList(row0, row2, row4),
}
public void testCreateRow() throws Exception {
+ reset();
newTestColumn(DataType.INT, false);
newTestColumn(DataType.TEXT, false);
newTestColumn(DataType.TEXT, false);
}
public void testUnicodeCompression() throws Exception {
+ reset();
newTestColumn(DataType.TEXT, false);
newTestColumn(DataType.MEMO, false);
newTestTable();