if( getTable( info.getName() ) != null )
{
throw new DBException( 0, "Table already exists" );
}
final ByteArrayOutputStream baos = new ByteArrayOutputStream();
final SerializerOutputStream out = new SerializerOutputStream( baos );
baos.reset();
out.writeByte( Constants.DBRT_TABLE_INFO );
info.serialize( out );
byte[] data = baos.toByteArray();
int recordId = rs.addRecord( data, 0, data.length );
info.setRecordId( recordId );
log.debug( "saved table info in " + data.length + " bytes" );
final TableStatus status = new TableStatus( this );
status.setTableName( info.getName() );
baos.reset();
out.writeByte( Constants.DBRT_TABLE_STATUS );
status.serialize( out );
data = baos.toByteArray();
recordId = rs.addRecord( data, 0, data.length );
status.setRecordId( recordId );
log.debug( "saved table status in " + data.length + " bytes" );