manticoresoftware / manticoresoftware/manticoresearch
Total is always zero in select via /sql endpoint
Nobody has claimed this yet.
- Dominant language
- C++
- Stars
- 12k
- Forks
- 642
- Avg merge
- 3d 12h
- Merged PRs (30d)
- 47
Description
An /sql endpoint always return 0 in "total" attibute:
```
{
"columns":[...],
"data":[...],
"total":0,
"error":"",
"warning":""
}
```
I have found that this parameter is set in that line: https://github.com/manticoresoftware/manticoresearch/blob/81f1893e61c2f0978141b4f6649bc4c97bf4c570/src/searchdhttp.cpp#L798
But _Ok_ function seem forgotten to be called (somewhere in _SendMysqlSelectResult_ i suppose).
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start in src/searchdhttp.cpp at the referenced line where the /sql response total is set, then inspect SendMysqlSelectResult and the suspected Ok call. Reproduce a /sql request with results and verify that the response total reflects the returned result count instead of remaining zero.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp, sql
- Domain
- api, database
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100