Commit 07d3636
committed
[#258] Fix total_rows recount for case-insensitive queries
When Query.total_rows() is called on a GenQuery1 query with a non-zero
offset, genquery.py issues a second query with offset=0 so iRODS can
return the full row count.
That recount query was being built via Query(...) without passing
through the original case_sensitive setting. Because
Query.__init__() defaults case_sensitive to True, the recount path
cleared UPPER_CASE_WHERE and skipped uppercasing the condition
string. This allowed a case-insensitive fetch query to be paired
with a case-sensitive recount query, producing total_rows() values
smaller than the number of rows actually returned.
Use self.copy(offset=0, limit=0, ...) for the recount path so the
original query attributes are preserved, including case sensitivity
and the rest of the query configuration. This keeps the recount
query aligned with the fetch query while still forcing
RETURN_TOTAL_ROW_COUNT for the manual recount.1 parent 7291262 commit 07d3636
1 file changed
Lines changed: 5 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
267 | 267 | | |
268 | 268 | | |
269 | 269 | | |
270 | | - | |
271 | | - | |
| 270 | + | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
| 274 | + | |
272 | 275 | | |
273 | 276 | | |
274 | 277 | | |
| |||
0 commit comments