Fix indexes types

This commit is contained in:
Yuriy Dupyn 2024-02-04 18:13:05 +01:00
parent 89305b6126
commit 4c0f91ad33
3 changed files with 36 additions and 18 deletions

View file

@ -11,6 +11,8 @@ pub struct StoreHeader {
pub deleted_count: usize,
pub total_count: usize,
pub primary_column: Column,
// TODO
// pub indexed_columns: Vec<bool>,
}
impl StoreHeader {
@ -25,6 +27,10 @@ impl StoreHeader {
pub const TOTAL_COUNT_OFFSET: usize = Self::DELETED_COUNT_OFFSET + Self::DELETED_COUNT_SIZE;
pub const PRIMARY_COLUMN_OFFSET: usize = Self::TOTAL_COUNT_OFFSET + Self::TOTAL_COUNT_SIZE;
fn indexed_columns_size(&self) -> usize {
size_of::<bool>() * self.number_of_columns
}
pub fn encode(&self) -> Result<Vec<u8>> {
let mut result = encode(&self.number_of_columns)?;
result.append(&mut encode(&self.deleted_count)?);