mirror of
https://github.com/aljazceru/turso.git
synced 2026-02-09 02:04:22 +01:00
Fix bug: backwards iteration of table btree hangs
This commit is contained in:
@@ -576,6 +576,7 @@ impl BTreeCursor {
|
||||
} else {
|
||||
cell_idx
|
||||
};
|
||||
|
||||
let cell = contents.cell_get(
|
||||
cell_idx,
|
||||
payload_overflow_threshold_max(contents.page_type(), self.usable_space() as u16),
|
||||
@@ -589,6 +590,7 @@ impl BTreeCursor {
|
||||
_rowid,
|
||||
}) => {
|
||||
let mem_page = self.read_page(_left_child_page as usize)?;
|
||||
self.stack.retreat();
|
||||
self.stack.push_backwards(mem_page);
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -199,4 +199,9 @@ do_execsql_test orderby_desc_with_filter_id_le {
|
||||
6665
|
||||
6664
|
||||
6663
|
||||
6662}
|
||||
6662}
|
||||
|
||||
# regression test where backwards iteration used to hang indefinitely
|
||||
do_execsql_test orderby_desc_subquery_count_regression {
|
||||
select count(1) from (select * from users where id < 100 order by id desc)
|
||||
} {99}
|
||||
Reference in New Issue
Block a user