You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@jackrabbit.apache.org by Gadbury <ga...@googlemail.com> on 2010/03/11 13:36:36 UTC
SQL2 Column Selector bug?
Hi all,
I am preparing and executing an SQL2 query (JCR 2.0) as follows:
QueryManager qm = jcrSession.getWorkspace().getQueryManager();
String queryString = "select order.[customerAccountUUID] as cust from
[atl:order] as order";
Query query = qm.createQuery(queryString, Query.JCR_SQL2);
QueryResult queryResult = query.execute();
I have been using the test case (here:
http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-spi-commons/src/test/resources/org/apache/jackrabbit/spi/commons/query/sql2/test.sql2.txt?view=markup)
as a guideline.
The following query fails:
select order.[customerAccountUUID] from [atl:order] as order
java.lang.NullPointerException
org.apache.jackrabbit.commons.query.sql2.QOMFormatter.isSimpleName(QOMFormatter.java:577)
org.apache.jackrabbit.commons.query.sql2.QOMFormatter.formatName(QOMFormatter.java:567)
org.apache.jackrabbit.commons.query.sql2.QOMFormatter.format(QOMFormatter.java:452)
org.apache.jackrabbit.commons.query.sql2.QOMFormatter.format(QOMFormatter.java:123)
org.apache.jackrabbit.commons.query.sql2.QOMFormatter.format(QOMFormatter.java:117)
line 452: c.getColumnName() returns null.
The following query is fine:
select order.[customerAccountUUID] as cust from [atl:order] as order
The test case suggests that I do not need the 'as cust' for the column
select, so should the failing sql work?
Cheers,
James
--
View this message in context: http://n4.nabble.com/SQL2-Column-Selector-bug-tp1588881p1588881.html
Sent from the Jackrabbit - Users mailing list archive at Nabble.com.
Re: SQL2 Column Selector bug?
Posted by Gadbury <ga...@googlemail.com>.
Done. Glad to have made a (minor) contribution :)
JIRA here: https://issues.apache.org/jira/browse/JCR-2561
--
View this message in context: http://n4.nabble.com/SQL2-Column-Selector-bug-tp1588881p1588913.html
Sent from the Jackrabbit - Users mailing list archive at Nabble.com.
Re: SQL2 Column Selector bug?
Posted by Thomas Müller <th...@day.com>.
Hi,
This is a bug. Could you create a new Jira issue?
Regards,
Thomas
On Thu, Mar 11, 2010 at 1:36 PM, Gadbury <ga...@googlemail.com> wrote:
>
> Hi all,
>
> I am preparing and executing an SQL2 query (JCR 2.0) as follows:
>
> QueryManager qm = jcrSession.getWorkspace().getQueryManager();
> String queryString = "select order.[customerAccountUUID] as cust from
> [atl:order] as order";
> Query query = qm.createQuery(queryString, Query.JCR_SQL2);
> QueryResult queryResult = query.execute();
>
> I have been using the test case (here:
> http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-spi-commons/src/test/resources/org/apache/jackrabbit/spi/commons/query/sql2/test.sql2.txt?view=markup)
> as a guideline.
>
> The following query fails:
>
> select order.[customerAccountUUID] from [atl:order] as order
>
> java.lang.NullPointerException
>
> org.apache.jackrabbit.commons.query.sql2.QOMFormatter.isSimpleName(QOMFormatter.java:577)
>
> org.apache.jackrabbit.commons.query.sql2.QOMFormatter.formatName(QOMFormatter.java:567)
>
> org.apache.jackrabbit.commons.query.sql2.QOMFormatter.format(QOMFormatter.java:452)
>
> org.apache.jackrabbit.commons.query.sql2.QOMFormatter.format(QOMFormatter.java:123)
>
> org.apache.jackrabbit.commons.query.sql2.QOMFormatter.format(QOMFormatter.java:117)
>
> line 452: c.getColumnName() returns null.
>
> The following query is fine:
>
> select order.[customerAccountUUID] as cust from [atl:order] as order
>
> The test case suggests that I do not need the 'as cust' for the column
> select, so should the failing sql work?
>
> Cheers,
>
> James
> --
> View this message in context: http://n4.nabble.com/SQL2-Column-Selector-bug-tp1588881p1588881.html
> Sent from the Jackrabbit - Users mailing list archive at Nabble.com.
>