mirror of
https://github.com/aljazceru/turso.git
synced 2026-01-05 09:14:24 +01:00
Fix UPDATE inserting NULL into index instead of rowid
This commit is contained in:
@@ -1000,10 +1000,17 @@ fn emit_update_insns(
|
||||
|
||||
// copy each index column from the table's column registers into these scratch regs
|
||||
for (i, col) in index.columns.iter().enumerate() {
|
||||
let col_in_table = table_ref
|
||||
.columns()
|
||||
.get(col.pos_in_table)
|
||||
.expect("column index out of bounds");
|
||||
// copy from the table's column register over to the index's scratch register
|
||||
|
||||
program.emit_insn(Insn::Copy {
|
||||
src_reg: idx_cols_start_reg + col.pos_in_table,
|
||||
src_reg: if col_in_table.is_rowid_alias {
|
||||
rowid_reg
|
||||
} else {
|
||||
idx_cols_start_reg + col.pos_in_table
|
||||
},
|
||||
dst_reg: idx_start_reg + i,
|
||||
extra_amount: 0,
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user