throw new IOException("Looking for system catalog at page " +
PAGE_SYSTEM_CATALOG + ", but page type is " + pageType);
}
- _systemCatalog = new Table(_buffer, _pageChannel, _format, PAGE_SYSTEM_CATALOG);
+ _systemCatalog = new Table(_buffer, _pageChannel, _format, PAGE_SYSTEM_CATALOG, "System Catalog");
Map row;
while ( (row = _systemCatalog.getNextRow(Arrays.asList(
COL_NAME, COL_TYPE, COL_ID))) != null)
throw new IOException("Looking for MSysACEs at page " + pageNum +
", but page type is " + pageType);
}
- _accessControlEntries = new Table(buffer, _pageChannel, _format, pageNum);
+ _accessControlEntries = new Table(buffer, _pageChannel, _format, pageNum, "Access Control Entries");
}
/**
return null;
} else {
_pageChannel.readPage(_buffer, pageNumber.intValue());
- return new Table(_buffer, _pageChannel, _format, pageNumber.intValue());
+ return new Table(_buffer, _pageChannel, _format, pageNumber.intValue(), name);
}
}
private List<Index> _indexes = new ArrayList<Index>();
/** Used to read in pages */
private PageChannel _pageChannel;
+ /** Table name as stored in Database */
+ private String _name;
/** Usage map of pages that this table owns */
private UsageMap _ownedPages;
/** Usage map of pages that this table owns with free space on them */
* @param pageChannel Page channel to get database pages from
* @param format Format of the database that contains this table
* @param pageNumber Page number of the table definition
+ * @param name Table name
*/
- protected Table(ByteBuffer buffer, PageChannel pageChannel, JetFormat format, int pageNumber)
+ protected Table(ByteBuffer buffer, PageChannel pageChannel, JetFormat format, int pageNumber, String name)
throws IOException, SQLException
{
_buffer = buffer;
newBuffer.put(nextPageBuffer.array(), 8, format.PAGE_SIZE - 8);
_buffer = newBuffer;
}
- readPage();
+ readPage();
+ _name = name;
+ }
+
+ /**
+ * @return The name of the table
+ */
+ public String getName() {
+ return _name;
}
/**