OpenTenBase / OpenTenBase/TXSQL
Bug#39033858 Parallel_reader::Scan_ctx::copy_row copies wrong range of bytes
Nobody has claimed this yet.
- Dominant language
- C++
- Stars
- 337
- Forks
- 234
- PR merge metrics
- No merged PRs in 30d
Description
Problem:
InnoDB uses a convention where rec pointers point in between two
fragments of the record: to the left of it, are so called "extra"
bytes which contain metadata such as flags, info about which fields are
null and what is their length. To the right of it, is the actual data of
the fields.
The function rec_offs_size(offsets) returns the total length of the
record which is the sum of these two:
rec_offs_data_size(offsets) + rec_offs_extra_size(offsets)
The logic of Parallel_reader::Scan_ctx::copy_row() copied that many
bytes into a freshly allocated buffer, but used rec address as the
source, instead of "rec - extra", resulting in copying wrong range of
bytes.
Solution:
Adjust the logic to copy the correct range of bytes.
Change-Id: Ia0463e4a752dfce70ff5a2ac83818132de9a638c
Commit
https://github.com/Wen-He/TXSQL/commit/52de0a885eb1bbfdaa1f03f5352419a124c8f419
Upstream Reference
https://github.com/mysql/mysql-server/commit/c4148fad113945e51b1a44e88a798e87216a7c3b
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by locating Parallel_reader::Scan_ctx::copy_row() and inspect how rec_offs_size(offsets), rec_offs_data_size(offsets), and rec_offs_extra_size(offsets) determine the copied range. Compare the logic with the upstream MySQL commit referenced in the issue; done means the buffer receives the complete record from the correct source range.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp
- Domain
- database
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Quiet
- Clarity
- Clearly specified
- Newbie friendliness
- 68/100