Fix table_metadata.handle omitting address standardization - #52
Open
sausagee wants to merge 3 commits into
Open
Conversation
Proto table handles are not always 64-char padded. table_items and current_table_items already run standardize_address; table_metadatas stored the raw proto string, so joins on handle miss when the stream emits a short form such as 0xabc. Co-authored-by: Young Yang Liauw <sausagee@users.noreply.github.com>
Co-authored-by: Young Yang Liauw <sausagee@users.noreply.github.com>
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.
Bug
table_metadatas.handlewas stored as the raw proto table handle, whiletable_items.table_handleandcurrent_table_items.table_handlealways go throughstandardize_address.Indexer stream handles are not always 64-hex-char padded (
0xabcvs0x000…abc). Both columns areVARCHAR(66)and are meant to be the same key, so joins / lookups on handle miss whenever the proto emits a short form.Root cause
TableMetadata::from_write_table_itemusedtable_item.handle.to_string()instead of the samestandardize_addresspath asTableItem/CurrentTableItem. The in-batch map is already keyed by the standardizedCurrentTableItem.table_handle, so the stored value could disagree with its own map key.Fix
Standardize
table_metadatas.handlethe same way as sibling table-item tables. Unit test asserts an unpadded proto handle produces one matching 66-char value across all three models.This is independent of open PRs #16–#51.
Tests
cargo test -p processor --lib table_metadata_handle_matches_standardized_table_item_handle(pass)cargo clippy -p processor --lib --tests -- -D warnings(pass)