mirror of
https://github.com/aljazceru/turso.git
synced 2025-12-28 13:34:24 +01:00
There's bad interaction with schema changes and `ROLLBACK`: https://github.com/tursodatabase/turso/issues/1890 Disable the statement for now to avoid people hitting the issue.
33 lines
784 B
Rust
33 lines
784 B
Rust
use turso_sqlite3_parser::ast::Name;
|
|
|
|
use crate::{
|
|
schema::Schema,
|
|
translate::emitter::TransactionMode,
|
|
vdbe::{
|
|
builder::{ProgramBuilder, QueryMode},
|
|
insn::Insn,
|
|
},
|
|
Result, SymbolTable,
|
|
};
|
|
|
|
#[allow(dead_code)]
|
|
pub fn translate_rollback(
|
|
_query_mode: QueryMode,
|
|
_schema: &Schema,
|
|
_syms: &SymbolTable,
|
|
mut program: ProgramBuilder,
|
|
txn_name: Option<Name>,
|
|
savepoint_name: Option<Name>,
|
|
) -> Result<ProgramBuilder> {
|
|
assert!(
|
|
txn_name.is_none() && savepoint_name.is_none(),
|
|
"txn_name and savepoint not supported yet"
|
|
);
|
|
program.emit_insn(Insn::AutoCommit {
|
|
auto_commit: true,
|
|
rollback: true,
|
|
});
|
|
program.epilogue_maybe_rollback(TransactionMode::None, true);
|
|
Ok(program)
|
|
}
|