Closed dbu closed 11 years ago
moved from https://github.com/phpcr/phpcr/issues/21
When using the QOM, the user should not need to know about escaping in SQL2. But when you do something like the following you still need the brackets:
$qomFactory->fulltextSearch('title', 'The', '[nt:unstructured]');
Without square brackets jackrabbit throws:
HTTP 400: Query: SELECT * FROM [nt:unstructured] WHERE CONTAINS(nt:(*)unstructured.title, 'Team') AND [phpcr:class] = 'Sandbox\MainBundle\Document\EditableStaticContent' ORDER BY path ASC; expected: ,
looking through this https://github.com/phpcr/phpcr-utils/blob/master/src/PHPCR/Util/QOM/Sql2Generator.php i see many places where a name without [] is created. maybe we need more validation too. QueryBuilder seems to expect namespaced names whereas Sql2Generator seems to have 2 parameters if i understand correctly.
this is now fixed, or not?
moved from https://github.com/phpcr/phpcr/issues/21
When using the QOM, the user should not need to know about escaping in SQL2. But when you do something like the following you still need the brackets:
Without square brackets jackrabbit throws:
looking through this https://github.com/phpcr/phpcr-utils/blob/master/src/PHPCR/Util/QOM/Sql2Generator.php i see many places where a name without [] is created. maybe we need more validation too. QueryBuilder seems to expect namespaced names whereas Sql2Generator seems to have 2 parameters if i understand correctly.