[8.2] Reject Invalid Schema Options Combination - [MOD-14655]#9076
[8.2] Reject Invalid Schema Options Combination - [MOD-14655]#9076
Conversation
* add a failing test * fix * add unit tests (cherry picked from commit bf1be14)
🛡️ Jit Security Scan Results✅ No security findings were detected in this PR
Security scan by Jit
|
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 721dcc8. Configure here.
| QueryError_SetError(status, QUERY_EINVAL, | ||
| SPEC_SCHEMA_EXPANDABLE_STR " cannot be used with " SPEC_NOFIELDS_STR); | ||
| goto failure; | ||
| } |
There was a problem hiding this comment.
Missing release note for user-facing behavior change
Low Severity
The PR checkbox indicates release notes are required but none are included. Per the project rule, here's a suggested release note:
Bug Fixes
- Fixed a crash caused by using the invalid
NOFIELDS+MAXTEXTFIELDScombination inFT.CREATE. This combination is now rejected with a clear error message. Existing RDB files persisted with this invalid configuration are automatically corrected on load.
Triggered by project rule: Please assist in writing a GitHub release note for this PR, which is concise and focused on the user impact.
Reviewed by Cursor Bugbot for commit 721dcc8. Configure here.
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## 8.2 #9076 +/- ##
==========================================
- Coverage 88.98% 88.92% -0.07%
==========================================
Files 260 260
Lines 42093 42102 +9
Branches 3851 3851
==========================================
- Hits 37458 37440 -18
- Misses 4586 4613 +27
Partials 49 49
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|





Description
Backport of #8941 to
8.2.Describe the changes in the pull request
This fixes a crash caused by allowing the invalid
FT.CREATEcombinationNOFIELDS+MAXTEXTFIELDS. That combination could produce unsupported text index storage flags and later crash during indexing when selecting the inverted-index encoder.The fix rejects this combination at
FT.CREATEtime, and also hardens RDB loading by normalizing old persisted specs with that flag combination instead of failing startup. Regression tests were added for command parsing and RDB load behavior.Mark if applicable
Release Notes
Note
Medium Risk
Tightens
FT.CREATEvalidation and changes how persisted index flags are interpreted on load; could affect users relying on previously-accepted (but invalid) option combinations or legacy RDBs with inconsistent flags.Overview
Prevents a crash by rejecting the invalid
FT.CREATEoption combinationNOFIELDS+MAXTEXTFIELDS(wide/expandable schema without stored field flags), returning a clear error instead of creating a broken index.Hardens startup by normalizing legacy/persisted specs during RDB load: if an index has
MAXTEXTFIELDSset whileNOFIELDSis also set, the loader now drops the wide-schema flag and logs a warning. Adds regression tests covering the command error and the RDB-load normalization path.Reviewed by Cursor Bugbot for commit f65c4a1. Bugbot is set up for automated code reviews on this repo. Configure here.