Skip to content

Commit

Permalink
core(dav): improve SQL queries of multiget and sync-collection
Browse files Browse the repository at this point in the history
  • Loading branch information
cgx committed Feb 21, 2022
1 parent 4ed6bce commit 5d0a48d
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions SoObjects/SOGo/SOGoGCSFolder.m
Original file line number Diff line number Diff line change
Expand Up @@ -1989,7 +1989,7 @@ - (NSArray *) _fetchComponentsMatchingObjectNames: (NSArray *) cNames
components = [NSMutableArray arrayWithCapacity: max];
for (count = 0; count < max; count++)
{
currentName = [cNames objectAtIndex: count];
currentName = [[cNames objectAtIndex: count] asSafeSQLString];
queryNameLength = idQueryOverhead + [currentName length];
if ((currentSize + queryNameLength)
> maxQuerySize)
Expand All @@ -2003,8 +2003,11 @@ - (NSArray *) _fetchComponentsMatchingObjectNames: (NSArray *) cNames
currentSize += queryNameLength;
}

records = [self _fetchComponentsWithNames: currentNames fields: fields];
[components addObjectsFromArray: records];
if ([currentNames count])
{
records = [self _fetchComponentsWithNames: currentNames fields: fields];
[components addObjectsFromArray: records];
}

// NSLog (@"/fetching components matching names");

Expand Down

0 comments on commit 5d0a48d

Please sign in to comment.