Fix data corruption from length prefix mismatch in ReadBytesAt#21
Closed
Fix data corruption from length prefix mismatch in ReadBytesAt#21
Conversation
- Fixed ReadBytesAt to read length prefix before data (matching AppendBytes format) - Fixed full scan to handle length-prefixed records correctly - All data fields now show correct values instead of corrupted 16777216 - Tests improved from 160/183 to 162/183 passing - Demo CLI now works correctly with all 10,000 JOIN rows displaying properly Co-authored-by: MPCoreDeveloper <37024522+MPCoreDeveloper@users.noreply.github.com>
- Added validation to prevent excessive memory allocation from corrupted length values - Improved exception handling in full scan to distinguish EOF from corruption - Added bounds checking for record lengths Co-authored-by: MPCoreDeveloper <37024522+MPCoreDeveloper@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Fix test failure in CLI build
Fix data corruption from length prefix mismatch in ReadBytesAt
Dec 7, 2025
MPCoreDeveloper
approved these changes
Dec 7, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
CLI build and tests were failing due to data corruption - all IDs showing as 16777216, empty fields, garbled text. Root cause:
AppendByteswrites[length][data]butReadBytesAtand full table scans weren't consuming the length prefix.Changes
AppendBytesformatExample
Before (corrupted):
After (correct):
The constant
16777216(0x01000000) was the little-endian representation of small length prefixes being read as integer data.Original prompt
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.