typeorm 0.3.27-dev.6965fa2 → 0.3.27-dev.9cdfb20

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -904,6 +904,11 @@ export class SelectQueryBuilder extends QueryBuilder {
904
904
  const hasOffset = this.expressionMap.offset !== undefined &&
905
905
  this.expressionMap.offset !== null &&
906
906
  this.expressionMap.offset > 0;
907
+ if (entitiesAndRaw.entities.length === 0 && (hasSkip || hasOffset)) {
908
+ // when skip or offset were used and no results found, we need to execute a full count
909
+ // (the given offset may have exceeded the actual number of rows)
910
+ return undefined;
911
+ }
907
912
  // offset overrides skip when no join is defined
908
913
  const previousResults = hasOffset
909
914
  ? this.expressionMap.offset