cli: skip non-.sql files when loading statement bundle stats #158934
+91
−0
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.
When loading statistics from a statement bundle directory, the code would previously attempt to process any file starting with "stats-" regardless of its extension. This caused issues when backup files (e.g., files ending with .sql~) were present in the bundle directory, as these would be processed as valid statistics files.
This change adds a check to ensure only files with a .sql extension are processed when loading statement bundle statistics. This allows users to keep backup copies of statistics files (e.g., when manually editing stats for testing different scenarios) without breaking the bundle recreation process.
A new interactive test test_sb_recreate_edited_stats.tcl is added to verify that manually edited statistics are properly loaded during statement bundle recreation. The test creates a bundle, backs up the original stats file, edits the histogram values, and verifies that the edited statistics are used correctly.
🤖 Generated with Claude Code
Epic: None
Release note: none