core(dav): improve SQL queries of multiget and sync-collection
parent
cfe8decd21
commit
4397e6a2e1
|
@ -2029,7 +2029,7 @@ static NSArray *childRecordFields = nil;
|
||||||
components = [NSMutableArray arrayWithCapacity: max];
|
components = [NSMutableArray arrayWithCapacity: max];
|
||||||
for (count = 0; count < max; count++)
|
for (count = 0; count < max; count++)
|
||||||
{
|
{
|
||||||
currentName = [cNames objectAtIndex: count];
|
currentName = [[cNames objectAtIndex: count] asSafeSQLString];
|
||||||
queryNameLength = idQueryOverhead + [currentName length];
|
queryNameLength = idQueryOverhead + [currentName length];
|
||||||
if ((currentSize + queryNameLength)
|
if ((currentSize + queryNameLength)
|
||||||
> maxQuerySize)
|
> maxQuerySize)
|
||||||
|
@ -2043,8 +2043,11 @@ static NSArray *childRecordFields = nil;
|
||||||
currentSize += queryNameLength;
|
currentSize += queryNameLength;
|
||||||
}
|
}
|
||||||
|
|
||||||
records = [self _fetchComponentsWithNames: currentNames fields: fields];
|
if ([currentNames count])
|
||||||
[components addObjectsFromArray: records];
|
{
|
||||||
|
records = [self _fetchComponentsWithNames: currentNames fields: fields];
|
||||||
|
[components addObjectsFromArray: records];
|
||||||
|
}
|
||||||
|
|
||||||
// NSLog (@"/fetching components matching names");
|
// NSLog (@"/fetching components matching names");
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue