Implement NOT NULL constraint check for UPDATE

This commit is contained in:
Anton Harniakou
2025-06-11 12:28:11 +03:00
parent f20e83eea1
commit b72e95dc05

View File

@@ -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, _)| {