Repository navigation
fix: preserve extensionless document suffix on GaussDB - #18483
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (3)
Included review availability: Your plan provides up to 10 included reviews per hour; 7 remain after this review. 📝 WalkthroughWalkthrough
ChangesDocument suffix compatibility
Estimated code review effort: 2 (Simple) | ~10 minutes Merge Risk: ⚪ Minimal · up to The PR applies a localized compatibility fix for extensionless documents and adds regression coverage; no actionable merge-blocking risk remains after normal checks and review. Possibly related PRs
Suggested reviewers: Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Lynn-Inf
left a comment
There was a problem hiding this comment.
LGTM. Please also update entity.Document.Suffix in Go — this ensures the field is properly adapted in the Go ragflow_server when connecting to GaussDB.
|
@Lynn-Inf Thanks. The Go |
Lynn-Inf
left a comment
There was a problem hiding this comment.
Thanks — merging as soon as CI is green.
Summary
RAGFlow's "Create empty document" flow accepts names without a file extension. The
POST /datasets/<dataset_id>/documents?type=emptyroute calls_upload_empty_document(), wherePath(name).suffix.lstrip(".")returns"".In GaussDB's A/ORA compatibility mode, that empty string is persisted as SQL
NULL. Becausedocument.suffixwas defined asNOT NULL, the insert failed with a constraint violation.Reproduction
Changes
EmptyStringCharFieldforDocument.suffix.document.suffixto nullable for existing GaussDB metadata schemas.Compatibility
Only GaussDB maps the application-level empty string to SQL
NULLand restores it to""on reads. MySQL, PostgreSQL, and OceanBase retain the originalNOT NULLconstraint and continue storing""unchanged.Tests
python -m pytest test/unit_test/api/db/test_gaussdb_adaptation_points.py test/unit_test/api/db/test_gaussdb_user_flow.py::test_gaussdb_empty_string_compatible_fields_are_nullable_only_for_gaussdb -q— 18 passedlefthook run pre-commit— all checks passed