query: Fix limit:N clauses on strange iterators

If the underlying source didn't abort at the result limit count we
have to clip it manually ourselves higher up in the query processor.
I failed to use the limit:N value and instead clipped with the
default, resulting in larger result sets for certain queries.

Change-Id: Ibc68dde8631788ffa1e2ea23266bb736280abc04
Signed-off-by: Shawn O. Pearce <sop@google.com>
2 files changed