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

Cannot fetch with predicate referencing a managed object #51

Closed
patrickhartling opened this issue Jan 17, 2014 · 6 comments
Closed

Cannot fetch with predicate referencing a managed object #51

patrickhartling opened this issue Jan 17, 2014 · 6 comments
Assignees

Comments

@patrickhartling
Copy link
Contributor

I put together a test case that demonstrates trying to fetch using a predicate that references another managed object. If the store type is EncryptedStoreType, the fetch fails with this error:

Error Domain=NSSQLiteErrorDomain Code=1 "The operation couldn’t be completed. (NSSQLiteErrorDomain error 1.)" UserInfo=0x2c2d8a0 {EncryptedStoreErrorMessage=near "<": syntax error}

The test code uses a managed object has a temporary ID, but it fails in the same way if the object has a permanent ID.

The test behaves correctly if the store type is NSSQLiteStoreType.

@patrickhartling
Copy link
Contributor Author

I forgot to mention that the test relies upon the table name change on the name-append branch.

@gavin-black
Copy link
Member

Excellent, thank you for the test case. This one seems a bit more complicated than many of the predicate issues, but I'll try to look into it next week.

@gavin-black
Copy link
Member

This should be fixed with the latest commits, and I no longer see that error in the test case you provided. Let me know if you see otherwise. Thanks for keeping active, and letting me know what bugs you find.

Edit: Never-mind, I was seeing another bug that had been introduced. This issue does still seem to be here.

@gavin-black
Copy link
Member

Just for my own sake to keep track. Right now I'm seeing the following errors when setting newCoreDataStackUsingECD to YES:

 error: testFetchObjectWithTemporaryID (EncryptedCoreDataTests) failed: Cannot retrieve referenceObject from an objectID that was not created by this store

error: testMigration (EncryptedCoreDataTests) failed: "migrated" should be true. Failed to migrate to the new managed object model: Error Domain=NSCocoaErrorDomain Code=1570 "The operation couldn’t be completed. (Cocoa error 1570.)" UserInfo=0x24830a0 {NSValidationErrorObject=<NSManagedObject: 0x11b7e070> (entity: Transaction; id: 0x11b7f390 <x-coredata://CA8D6966-78CE-4815-89FE-524A0FAC049A/Transaction/p1> ; data: <fault>), NSValidationErrorKey=account, NSLocalizedDescription=The operation couldn’t be completed. (Cocoa error 1570.)}

@ghost ghost assigned gavin-black Jan 28, 2014
@salil-shahane
Copy link

I'm using NSExpression and NSExpressionDescription for calculating sums for multiple fields.
I get the following error -

Error Domain=NSSQLiteErrorDomain Code=1 "The operation couldn’t be completed. (NSSQLiteErrorDomain error 1.)" UserInfo=0x7fb2ce5e8dd0 {EncryptedStoreErrorMessage=near "FROM": syntax error}

If I remove the encrypted-core-data store setup code and revert back to the default Apple one it runs fine.
Any help appreciated as I need SQLCipher for encryption over core data and this library is the only way I can.

@DanielBroad
Copy link
Contributor

sum() queries are now supported

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

No branches or pull requests

4 participants