mirror of
https://github.com/aljazceru/turso.git
synced 2026-01-03 16:34:19 +01:00
Merge 'emit SetCookie when creating a view' from Glauber Costa
SetCookie is necessary to invalidate prepared statements in the connection after DDL expressions. Closes #2632
This commit is contained in:
@@ -48,7 +48,15 @@ fn emit_create_view_program(
|
||||
where_clause: Some(format!("name = '{normalized_view_name}'")),
|
||||
});
|
||||
|
||||
program.emit_insn(Insn::SetCookie {
|
||||
db: 0,
|
||||
cookie: Cookie::SchemaVersion,
|
||||
value: (schema.schema_version + 1) as i32,
|
||||
p5: 0,
|
||||
});
|
||||
|
||||
// Populate materialized views if needed
|
||||
// Note: This must come after SetCookie since it may do I/O operations
|
||||
if populate_materialized {
|
||||
program.emit_insn(Insn::PopulateMaterializedViews);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user