@FixFor( "MODE-1095" )
@Test
public void shouldBeAbleToCreateAndExecuteJcrSql2QueryWithOrderByUsingColumnNotInSelect() throws RepositoryException {

    String sql = "SELECT [car:model], [car:maker] FROM [car:Car] WHERE [car:year] <= 2012 ORDER BY [car:year] DESC";
    Query query = session.getWorkspace().getQueryManager().createQuery(sql, Query.JCR_SQL2);
    QueryResult result = query.execute();
    String[] columnNames = {"car:model", "car:maker", "car:year"};
    validateQuery().rowCount(13).noWarnings().hasColumns(columnNames).validate(query, result);
}