Skip to content

Commit

Permalink
fix: search next root page
Browse files Browse the repository at this point in the history
  • Loading branch information
yongcai committed Dec 31, 2024
1 parent 0988258 commit 9cb10ab
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/pyinnodb/disk_struct/index.py
Original file line number Diff line number Diff line change
Expand Up @@ -355,8 +355,8 @@ def binary_search_with_page_directory(self, key, stream):
low,
high,
target,
record_key,
key,
const.parse_mysql_int(record_key),
const.parse_mysql_int(key),
self.page_directory[target],
)
if record_key == key:
Expand Down
6 changes: 5 additions & 1 deletion src/pyinnodb/sdi/table.py
Original file line number Diff line number Diff line change
Expand Up @@ -965,7 +965,7 @@ def search(self, f, primary_key, hidden_col):
- 5
)
end_rh = MRecordHeader.parse_stream(f)
logging.debug("end_rh is %s", end_rh)
logging.debug("end_rh is %s, match is %s", end_rh, match)
if (
match
and const.RecordType(end_rh.record_type)
Expand Down Expand Up @@ -1020,6 +1020,10 @@ def search(self, f, primary_key, hidden_col):
f.seek(start_rh.next_record_offset - 5, 1)
start_rh = MRecordHeader.parse_stream(f)

logging.debug("index_page.fil.next_page is %s", index_page.fil.next_page)
if first_leaf_page == 4294967295 and index_page.fil.next_page != 4294967295:
first_leaf_page = index_page.fil.next_page

def iter_record(self, f, hidden_col=False, garbage=False, transfter=None):
root_page_no = int(self.indexes[0].private_data.get("root", 4))
f.seek(root_page_no * const.PAGE_SIZE)
Expand Down

0 comments on commit 9cb10ab

Please sign in to comment.