mirror of
https://github.com/aljazceru/turso.git
synced 2026-01-07 10:14:21 +01:00
Implement NOT NULL constraint check for UPDATE
This commit is contained in:
@@ -1095,6 +1095,19 @@ fn emit_update_insns(
|
||||
target_reg,
|
||||
&t_ctx.resolver,
|
||||
)?;
|
||||
use crate::error::SQLITE_CONSTRAINT_NOTNULL;
|
||||
program.emit_insn(Insn::HaltIfNull {
|
||||
target_reg,
|
||||
err_code: SQLITE_CONSTRAINT_NOTNULL,
|
||||
description: format!(
|
||||
"{}.{}",
|
||||
table_ref.table.get_name(),
|
||||
table_column
|
||||
.name
|
||||
.as_ref()
|
||||
.expect("Column name must be present")
|
||||
),
|
||||
});
|
||||
}
|
||||
} else {
|
||||
let column_idx_in_index = index.as_ref().and_then(|(idx, _)| {
|
||||
|
||||
Reference in New Issue
Block a user