nextcloud / nextcloud/fulltextsearch
HUGE warning log during indexing due to unsupported "LIMIT -1" in mysql query
Nobody has claimed this yet.
- Dominant language
- PHP
- Stars
- 234
- Forks
- 64
- Avg merge
- 6h 18m
- Merged PRs (30d)
- 10
Description
When I'm running the occ fulltextsearch:index on the console, my log files fill up to Gig Bytes within seconds!!! The reason being that the query uses LIMIT -1 which is not supported by MySQL:
Exception while generateDocument: An exception occurred while executing 'SELECT
uid,displaynameFROMoc_usersuLEFT JOINoc_preferencespON (userid=uid) AND (appid= 'settings') AND (configkey= 'email') WHERE (uidCOLLATE utf8mb4_general_ci LIKE ?) OR (displaynameCOLLATE utf8mb4_general_ci LIKE ?) OR (configvalueCOLLATE utf8mb4_general_ci LIKE ?) ORDER BYuid_lowerASC LIMIT -1 OFFSET 0' with params ["%%", "%%", "%%"]: SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '-1 OFFSET 0' at ...
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 by reproducing occ fulltextsearch:index with MySQL and inspect the query that generates LIMIT -1 OFFSET 0. The fix is done when indexing no longer emits the unsupported MySQL query or fills the logs with repeated warnings.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- mysql, php
- Domain
- databases, search
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100