jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From thom...@apache.org
Subject svn commit: r818778 - in /jackrabbit/trunk/jackrabbit-spi-commons/src: main/java/org/apache/jackrabbit/spi/commons/query/sql2/Parser.java test/resources/org/apache/jackrabbit/spi/commons/query/sql2/test.sql2.txt
Date Fri, 25 Sep 2009 09:14:38 GMT
Author: thomasm
Date: Fri Sep 25 09:14:38 2009
New Revision: 818778

URL: http://svn.apache.org/viewvc?rev=818778&view=rev
Log:
JCR-2328 PropertyValue constraint fails with implicit selectorName using JCR-SQL2

Modified:
    jackrabbit/trunk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/query/sql2/Parser.java
    jackrabbit/trunk/jackrabbit-spi-commons/src/test/resources/org/apache/jackrabbit/spi/commons/query/sql2/test.sql2.txt

Modified: jackrabbit/trunk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/query/sql2/Parser.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/query/sql2/Parser.java?rev=818778&r1=818777&r2=818778&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/query/sql2/Parser.java
(original)
+++ jackrabbit/trunk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/query/sql2/Parser.java
Fri Sep 25 09:14:38 2009
@@ -265,6 +265,13 @@
             } else {
                 a = parseCondition(factory.propertyValue(getOnlySelectorName(), identifier));
             }
+        } else if ("[".equals(currentToken)) {
+            String name = readName();
+            if (readIf(".")) {
+                a = parseCondition(factory.propertyValue(name, readName()));
+            } else {
+                a = parseCondition(factory.propertyValue(getOnlySelectorName(), name));
+            }
         } else {
             throw getSyntaxError();
         }

Modified: jackrabbit/trunk/jackrabbit-spi-commons/src/test/resources/org/apache/jackrabbit/spi/commons/query/sql2/test.sql2.txt
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-spi-commons/src/test/resources/org/apache/jackrabbit/spi/commons/query/sql2/test.sql2.txt?rev=818778&r1=818777&r2=818778&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-spi-commons/src/test/resources/org/apache/jackrabbit/spi/commons/query/sql2/test.sql2.txt
(original)
+++ jackrabbit/trunk/jackrabbit-spi-commons/src/test/resources/org/apache/jackrabbit/spi/commons/query/sql2/test.sql2.txt
Fri Sep 25 09:14:38 2009
@@ -69,12 +69,14 @@
 # 6.7.15 Not (p 110)
 select * from test where not id=2
 select * from test where not (id=2 and name='Hello')
+select * from test where not ([id]=2 and [name]='Hello')
 select * from test where id=2 or not (name='Hello' and id=3)
 
 # 6.7.16 Comparison (p 110)
 # 6.7.17 Operator (p 112)
 select * from test where id<=2 or id>=3 and name<'a' or name>'c'
 select * from test where id<>2
+select * from [test] where [id]<>2
 select * from test where name like 'H%'
 
 # 6.7.18 PropertyExistence (p 113)
@@ -114,6 +116,10 @@
 # 6.7.28 Length (p 120)
 select * from test where length(name)=5
 select * from test as t where length(t.name)=5
+select * from test as t where length(name)=5
+SELECT * FROM [my:thing] WHERE [my:property] = 'abc'
+SELECT * FROM [my:thing] AS thing WHERE [my:property] = 'abc'
+SELECT * FROM [my:thing] AS [thing] WHERE [thing].[my:property] = 'abc'
 
 # 6.7.29 NodeName (p 121)
 select * from test where name()='test'



Mime
View raw message