fix(engine): don't truncate a compound index expression to a field name - #134
Open
russimicro wants to merge 1 commit into
Open
fix(engine): don't truncate a compound index expression to a field name#134russimicro wants to merge 1 commit into
russimicro wants to merge 1 commit into
Conversation
Table::field_index retries a lookup longer than 10 characters against name.substr(0, 10), because DBF CREATE truncates field names to 10 (a proc __output column 'databasepath' lands as DATABASEPA). An index expression whose first component is a 10-character field — CCODIGOCON+CDOCUMETRA, CPREFIJTRA+CDOCUMETRA — therefore matched that field and reported itself as a bare field name. AdsCreateIndex61 then took the bare-field branch and pinned the key length to the first component's width, so every later component fell out of the key: records sharing the first component collapsed onto one key and ordered by recno. GotoTop on the compound tag landed on the wrong record, and an exact AdsSeek matched the wrong row. The retry now only fires for a plain identifier (alphanumeric/underscore), which is the case it was written for. New test abi_cdx_estaelec_compound_test: two distinct compound tags over the same table (con+doc and pre+doc) must order differently, plus a computed DTOS() tag, a FOR-clause tag and an exact seek on a compound key. Found while running a Harbour/FiveWin ERP's real index set on OpenADS. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
|
Caution The consumer version of Gemini Code Assist on GitHub has been sunset. All code review activity has officially ceased. |
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.
Table::field_indexretries a lookup longer than 10 characters againstname.substr(0, 10), because DBF CREATE truncates field names to 10 (a proc__outputcolumndatabasepathlands asDATABASEPA).An index expression whose first component is a 10-character field —
CCODIGOCON+CDOCUMETRA,CPREFIJTRA+CDOCUMETRA— therefore matched that field and reported itself as a bare field name.AdsCreateIndex61then took the bare-field branch and pinned the key length to the first component's width, so every later component fell out of the key: records sharing the first component collapsed onto one key and ordered by recno.GotoTopon the compound tag landed on the wrong record, and an exactAdsSeekmatched the wrong row.The retry now only fires for a plain identifier (alphanumeric/underscore), which is the case it was written for.
Test:
abi_cdx_estaelec_compound_test— two distinct compound tags over the same table (con+docandpre+doc) must order differently, plus a computedDTOS()tag, a FOR-clause tag, and an exact seek on a compound key.Found while running a Harbour/FiveWin ERP's real index set on OpenADS.
Suite: 1179/1191 — the same 12 pre-existing SQL-parser (7200) failures as pristine v1.8.31, verified on this branch in isolation (MSVC x64 Release).
🤖 Generated with Claude Code