Skip to content

Fix: Schema Length Mismatch for ObjectId Non-id Fields in Collections #588

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

kwonder0926
Copy link
Contributor

Proposed changes

When a non-id field in a collection has a value of ObjectId type, an error is reported with the following message:

Reason: column_name[objectIdField], the length of input is too long than schema. first 32 bytes of input str: [{‘$oid’:‘67f8e2503d1bd029812b776’}] schema length: 30; actual length: 35; . src line [];

This occurs because when the ObjectId is converted to a string, it takes the form: {‘$oid’:‘67f8e2503d1bd029812b7767’}. The length becomes 35, which exceeds the predefined varchar(30) limit.

Problem Summary:

Checklist(Required)

Does it affect the original behavior: No
Has unit tests been added: No Need
Has document been added or modified: No Need
Does it need to update dependencies: No)
Are there any changes that cannot be rolled back: No

Further comments

Only the length of the ObjectId type when converted to Varchar type was changed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant