lundi 5 janvier 2015

CoreData with sqllite returning only 3 rows

My database has two tables ZDESTINATION and ZPOSTIT. There is many to one relationship, one ZPostIt can have many ZDestinations. I want to get all the ZDestination rows there are 9 of them and I am using Fetch Request. But only 3 rows are being returned. I have not specified a predicate. I have a sort order and a section keynamepath as @"postIt.creationTime". I checked the database and all postIts have a creation time and all destinations have a valid postit relation.


This is the very simplified query.



SELECT t0.Z_ENT, t0.Z_PK, t0.ZPOSTIT, FROM ZDESTINATION t0 LEFT OUTER JOIN ZPOSTIT t1 ON t0.ZPOSTIT = t1.Z_PK WHERE t0.Z_PK IN (?,?,?) ORDER BY t1.ZCREATIONTIME DESC LIMIT 20


DESTINATION (Primary key, PostIt)



"1" "3"
"2" "2"
"3" "4"
"4" "5"
"5" "5"
"6" "5"
"7" "7"
"8" "7"
"9" "7"


POSTIT primary key, creation time



"1" "442134908.015139"
"2" "442134921.469915"
"3" "442134941.083225"
"4" "442135028.839804"
"5" "442212344.121323"
"6" "442212468.053344"
"7" "442214203.670005"


Note the LEFT OUTERJOIN is generated automatically by the fetch request.


Would you have any ideas or tips on how this might be debugged?


Aucun commentaire:

Enregistrer un commentaire