Details
-
Bug
-
Status: Closed (View Workflow)
-
P2
-
Resolution: Done
-
30.2.4
-
CP: sprint 94, CP: sprint 95
-
2
-
Core: Platform
-
Q2 2020 Hot Fix #1
-
Chalmers
Description
Overview: Given a query that matches >= 1000 rows, it is not possible to use limit and offset together to retrieve rows after the 999th because when limit is greater than 999, the result array is always empty. This makes it impossible to retrieve paged data beyond the 999th record.
Steps to reproduce:
- One way or another, find out the actual number of loans with Status "Open". In our case, it is 6023.
- Make this request to find out the estimated totalRecords count:
{{okapi-url}}/loan-storage/loans?limit=0&query=(status.name="Open")
Make a note that totalRecords: 1000.
- Attempt to retrieve these 6023 loans by making the 7 times, incrementing offset by 1000 for each iteration:
{{okapi-url}}/loan-storage/loans?limit=1000&offset=0&query=(status.name="Open")
Expected result:
The first 6 requests return 1000 loans each. The 7th request returns 23 loan objects.
Actual result:
The first request returns 1000. The subsequent requests return [] loans.
Additional information:
The same behaviour can be observed in the bugfest tenant as well.
If the offset parameter > than totalRecords, no records are returned. This can be demonstrated by the following steps:
- Make the following request:
{{okapi-url}}/loan-storage/loans?limit=1000&offset=1000&query=(status.name="Open").
This should return loans 1000 loans, but actually returns [] – ie no loans past totalRecords.
- Now change the offset to be < totalRecords:
{{okapi-url}}/loan-storage/loans?limit=200&offset=900&query=(status.name="Open")
After the last request, we might expect this to return 100 loans, stopping at the totalRecords. However, this actually returns 200 loans – ie the correct result, and 100 loans past the totalRecords.
This issue has also been observed in Inventory, see https://issues.folio.org/browse/CHAL-294
TestRail: Results
Attachments
Issue Links
- blocks
-
CHAL-294 Query request where offset value > totalRecords returns 0 reords even if actual number of records > totalRecords
-
- In Code Review
-
-
CIRCSTORE-226 Missing records when offset >= totalRecords
-
- Closed
-
-
MODFEE-90 /feefineactions?query=cql.allrecords=1 sortby id&offset=10000&limit=10000 query on table with 126,079 rows results in empty result set
-
- Closed
-
-
MODPERMS-91 /perms/users web API possibly relies on incorrect count_estimate_default() value and doesn't return records
-
- Closed
-
- relates to
-
UIORGS-196 Active status filter returns inaccurate number of results
-
- Closed
-
-
UIORGS-197 End of list displays for search results before all records are loaded
-
- Closed
-