Fix SQL reference persistence and repeated statement scans - #5431
Merged
Merged
Conversation
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.
SQL indexing can fail while persisting
@@ROWCOUNT,@@IDENTITY, and other system-variable references: the extractor emitssystem_variable, but the shared kind catalog rejects it. Register that existing kind so writer validation and SQLite CHECK constraints accept the extracted references. Existing databases use the current constraint-migration path, which preserves stored rows.Repeated seed-data statements also accumulate and rescan all prior statement text when semicolons are absent, including across
GOseparators. Clear that text at standalone batch separators and conservative independent INSERT/UPDATE/DELETE boundaries. Preserve compound WITH/MERGE/CREATE context, nested expressions, upsert continuations, and temporary-object names.Validation
SELECT @@ROWCOUNT;and failing extraction/CLI regression tests.dotnet build --no-restore: passed with no warnings or errors.make lint: passed.dotnet run --project tools/CodeIndex.Changelog -- check: passed.status --checkandworkspace status --check: passed after rebuilding and refreshing the local index.Documentation
Updated the English/Japanese SQL persistence and statement-carry notes in
DEVELOPER_GUIDE.mdand the regression guidance inTESTING_GUIDE.md.Changelog fragment:
changelog.d/unreleased/+sql-reference-indexing.fixed.md.Limits and follow-up
The original SQL files were not available. These are independently reproduced defects found while investigating a v1.51.0 error report; the exact cause of the reported five-minute
E013_INDEX_EXTRACTION_STALLEDremains unconfirmed. Verify the original files with the fixed binary. Normal indexing can update the existing database without deleting it or requiring--rebuild.