diff --git a/src/pyinnodb/disk_struct/index.py b/src/pyinnodb/disk_struct/index.py index 96622e3..3507936 100644 --- a/src/pyinnodb/disk_struct/index.py +++ b/src/pyinnodb/disk_struct/index.py @@ -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: diff --git a/src/pyinnodb/sdi/table.py b/src/pyinnodb/sdi/table.py index 7fb7feb..cc89545 100644 --- a/src/pyinnodb/sdi/table.py +++ b/src/pyinnodb/sdi/table.py @@ -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) @@ -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)