cphalcon
cphalcon copied to clipboard
Error with PHQL FIND_IN_SET
$phql = "SELECT r.id, r.name
FROM Ap\Models\Recipe r
JOIN Ap\Models\RecipeCategories as rc ON rc.id = r.category_id
LEFT JOIN Ap\Models\RecipeCuisines cu ON cu.id = r.cuisine_id
WHERE FIND_IN_SET(111, r.ingredient_ids)
ORDER BY r.id
";
$this->modelsManager->createQuery($phql)->parse()
Error
Syntax error, unexpected token IDENTIFIER(FIND_IN_SET), near to '(929, r.ingredient_ids) ORDER BY r...
Want to back this issue? Place a bounty on it! We accept bounties via Bountysource.
"...find_in_set FIND_IN_SET..." doubled, that is wrong. You need it only once. :-)
Sorry, my mistake when writing example.
In fact, the problem probably originated in the cphalcon/ext/mvc/model/query/parser.h, there was not a registered literal.
After updating to 1.3.3 the problem does not occur.