mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 09:38:11 +00:00
LibSQL: Reset the highest written block during the zeroth block init
Otherwise, when changing the SQL heap version, the value from the now- stale heap file will continue to be used.
This commit is contained in:
parent
cd0e07f6a4
commit
7a912ca891
1 changed files with 2 additions and 0 deletions
|
@ -49,6 +49,7 @@ ErrorOr<void> Heap::open()
|
||||||
} else {
|
} else {
|
||||||
file_size = stat_buffer.st_size;
|
file_size = stat_buffer.st_size;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (file_size > 0) {
|
if (file_size > 0) {
|
||||||
m_next_block = file_size / Block::SIZE;
|
m_next_block = file_size / Block::SIZE;
|
||||||
m_highest_block_written = m_next_block - 1;
|
m_highest_block_written = m_next_block - 1;
|
||||||
|
@ -357,6 +358,7 @@ ErrorOr<void> Heap::initialize_zero_block()
|
||||||
m_tables_root = 0;
|
m_tables_root = 0;
|
||||||
m_table_columns_root = 0;
|
m_table_columns_root = 0;
|
||||||
m_next_block = 1;
|
m_next_block = 1;
|
||||||
|
m_highest_block_written = 0;
|
||||||
for (auto& user : m_user_values)
|
for (auto& user : m_user_values)
|
||||||
user = 0u;
|
user = 0u;
|
||||||
return update_zero_block();
|
return update_zero_block();
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue