mirror of
https://github.com/aljazceru/turso.git
synced 2026-02-09 02:04:22 +01:00
Dont assume the rowid is the second column - it's the last
This commit is contained in:
@@ -166,8 +166,8 @@ impl BTreeCursor {
|
||||
BTreeCell::IndexLeafCell(IndexLeafCell { payload, .. }) => {
|
||||
mem_page.advance();
|
||||
let record = crate::storage::sqlite3_ondisk::read_record(payload)?;
|
||||
let rowid = match record.values[1] {
|
||||
OwnedValue::Integer(rowid) => rowid as u64,
|
||||
let rowid = match record.values.last() {
|
||||
Some(OwnedValue::Integer(rowid)) => *rowid as u64,
|
||||
_ => unreachable!("index cells should have an integer rowid"),
|
||||
};
|
||||
return Ok(CursorResult::Ok((Some(rowid), Some(record))));
|
||||
|
||||
Reference in New Issue
Block a user