@Test
@FixFor( "MODE-2267" )
public void shouldAllowNameAndLocalNameConstraints() throws Exception {

    Node node1 = session.getRootNode().addNode("test:testNode1");
    Node node2 = session.getRootNode().addNode("test:testNode2");
    session.save();
    try {
        String sql = "SELECT [jcr:path] FROM [nt:unstructured] AS node WHERE node.[mode:localName] LIKE '%testNode%'";
        Query query = session.getWorkspace().getQueryManager().createQuery(sql, Query.JCR_SQL2);
        NodeIterator nodes = query.execute().getNodes();
        assertEquals(2, nodes.getSize());
        sql = "SELECT [jcr:path] FROM [nt:unstructured] AS node WHERE node.[jcr:name] LIKE '%test%'";
        query = session.getWorkspace().getQueryManager().createQuery(sql, Query.JCR_SQL2);
        nodes = query.execute().getNodes();
        assertEquals(2, nodes.getSize());
    } finally {
        node1.remove();
        node2.remove();
        session.save();
    }
}