Trying to use a facet with no hard limit gives the following fatal error:
PDOException: 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 line 2: SELECT t_2.value AS value, COUNT(DISTINCT t.item_id) AS num FROM {db_temporary_0} t INNER JOIN {search_api_db_nodes_field_state_name} t_2 ON t.item_id = t_2.item_id GROUP BY value ORDER BY num DESC LIMIT -1 OFFSET 0; Array ( ) in SearchApiDbService->getFacets() (line 1123 of sites/all/modules/search_api_db/service.inc).
The FacetAPI uses -1 to indicate no limit. We should check for this in our service.
| Comment | File | Size | Author |
|---|---|---|---|
| search_api_db_facet_limit.patch | 529 bytes | drewish |
Comments
Comment #1
drunken monkeySorry, didn't see this issue in time and posted a patch in a duplicate: #1550772: Facet hard limit set to "no limit" causes SQL error.
Please review there and post so I remember to still credit you for the patch.
Comment #2
drunken monkey