mirror of
https://github.com/aljazceru/turso.git
synced 2026-02-23 08:55:40 +01:00
do not ignore silent failures from view creation
We have an issue at the moment that when a materialized view fails to be created, we just swallow the error and leave the database in a funny state. We have can_create_view() to detect those issues early, but not all errors can be detected that early.
This commit is contained in:
committed by
Pekka Enberg
parent
1a4a53e6ea
commit
911b4c38a6
15
core/util.rs
15
core/util.rs
@@ -217,14 +217,13 @@ pub fn parse_schema_rows(
|
||||
|
||||
if should_create_new {
|
||||
// Create a new IncrementalView
|
||||
if let Ok(incremental_view) =
|
||||
IncrementalView::from_sql(sql, schema)
|
||||
{
|
||||
let referenced_tables =
|
||||
incremental_view.get_referenced_table_names();
|
||||
schema.add_materialized_view(incremental_view);
|
||||
views_to_process.push((view_name, referenced_tables));
|
||||
}
|
||||
// If this fails, we should propagate the error so the transaction rolls back
|
||||
let incremental_view =
|
||||
IncrementalView::from_sql(sql, schema)?;
|
||||
let referenced_tables =
|
||||
incremental_view.get_referenced_table_names();
|
||||
schema.add_materialized_view(incremental_view);
|
||||
views_to_process.push((view_name, referenced_tables));
|
||||
}
|
||||
}
|
||||
Stmt::CreateView {
|
||||
|
||||
Reference in New Issue
Block a user