Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix bootstrapping of ST_MODULE #342

Merged
merged 1 commit into from
Sep 29, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion crates/core/src/db/datastore/locking_tx_datastore/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ use super::{

use crate::db::datastore::system_tables::{
st_constraints_schema, st_module_schema, table_name_is_system, StConstraintRow, SystemTables,
CONSTRAINT_ID_SEQUENCE_ID, ST_CONSTRAINTS_ID, ST_CONSTRAINT_ROW_TYPE,
CONSTRAINT_ID_SEQUENCE_ID, ST_CONSTRAINTS_ID, ST_CONSTRAINT_ROW_TYPE, ST_MODULE_ROW_TYPE,
};
use crate::{
db::datastore::traits::{TxOp, TxRecord},
Expand Down Expand Up @@ -1599,6 +1599,13 @@ impl Locking {
datastore.bootstrap_system_table(st_constraints_schema())?;
datastore.bootstrap_system_table(st_indexes_schema())?;
datastore.bootstrap_system_table(st_sequences_schema())?;
// TODO(kim): We need to make sure to have ST_MODULE in the committed
// state. `bootstrap_system_table` initializes the others lazily, but
// it doesn't know about `ST_MODULE_ROW_TYPE`. Perhaps the committed
// state should be initialized eagerly here?
datastore
.committed_state
.get_or_create_table(ST_MODULE_ID, &ST_MODULE_ROW_TYPE, &st_module_schema());
datastore.bootstrap_system_table(st_module_schema())?;

// The database tables are now initialized with the correct data.
Expand Down