Skip to content

Commit 4ccf267

Browse files
WinChuayongcai
and
yongcai
authored
Feature/build data (#61)
* feat: generate data randomly for ibd file * fix: search next root page --------- Co-authored-by: yongcai <[email protected]>
1 parent e64d09c commit 4ccf267

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

src/pyinnodb/disk_struct/index.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -355,8 +355,8 @@ def binary_search_with_page_directory(self, key, stream):
355355
low,
356356
high,
357357
target,
358-
record_key,
359-
key,
358+
const.parse_mysql_int(record_key),
359+
const.parse_mysql_int(key),
360360
self.page_directory[target],
361361
)
362362
if record_key == key:

src/pyinnodb/sdi/table.py

+5-1
Original file line numberDiff line numberDiff line change
@@ -965,7 +965,7 @@ def search(self, f, primary_key, hidden_col):
965965
- 5
966966
)
967967
end_rh = MRecordHeader.parse_stream(f)
968-
logging.debug("end_rh is %s", end_rh)
968+
logging.debug("end_rh is %s, match is %s", end_rh, match)
969969
if (
970970
match
971971
and const.RecordType(end_rh.record_type)
@@ -1020,6 +1020,10 @@ def search(self, f, primary_key, hidden_col):
10201020
f.seek(start_rh.next_record_offset - 5, 1)
10211021
start_rh = MRecordHeader.parse_stream(f)
10221022

1023+
logging.debug("index_page.fil.next_page is %s", index_page.fil.next_page)
1024+
if first_leaf_page == 4294967295 and index_page.fil.next_page != 4294967295:
1025+
first_leaf_page = index_page.fil.next_page
1026+
10231027
def iter_record(self, f, hidden_col=False, garbage=False, transfter=None):
10241028
root_page_no = int(self.indexes[0].private_data.get("root", 4))
10251029
f.seek(root_page_no * const.PAGE_SIZE)

0 commit comments

Comments
 (0)