Skip to content
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

sql statement error cause cannot fetch data when relationship of relationship is nil in fetch statement #226

Open
SimonSuo opened this issue Feb 6, 2016 · 1 comment
Labels

Comments

@SimonSuo
Copy link

SimonSuo commented Feb 6, 2016

Reproduce steps:
1, create a model, add a relationship to an entity.
2, add a relationship to the entity of #1 destination of relationship.
3, use the FetchRequest in core data to load data, E.G. "[NSPredicate predicateWithFormat:@"user.posts.comments = nil"];" --- the condition is entity.relationship1.relationship2 == nil.
4. check the sql statement generate by EncryptedStore. The record in database is **relationship1.relationship2__objectID is NUL _actually, but the sql statement always show like _relationship1.relationship2__objectID = relationship2.__objectID and relationship2.__objectID is NULL.
Suggestion: maybe need to some special process for the case -- the relationship is NULL. Change to directly relationship1.relationship2__objectId is NULL

@DanielBroad
Copy link
Contributor

Hmm tricky, you could have an unlimited number of relationships in the chain

@DanielBroad DanielBroad added the bug label Feb 7, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants