jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From alexparvule...@apache.org
Subject svn commit: r1303438 - in /jackrabbit/trunk/jackrabbit-core/src: main/java/org/apache/jackrabbit/core/query/lucene/join/AbstractRow.java test/java/org/apache/jackrabbit/core/query/SQL2QueryResultTest.java
Date Wed, 21 Mar 2012 15:21:25 GMT
Author: alexparvulescu
Date: Wed Mar 21 15:21:24 2012
New Revision: 1303438

URL: http://svn.apache.org/viewvc?rev=1303438&view=rev
Log:
JCR-3266 JCR-SQL2 query with multiple columns in result only returns last column when using
Row.getValues()

Modified:
    jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/join/AbstractRow.java
    jackrabbit/trunk/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/query/SQL2QueryResultTest.java

Modified: jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/join/AbstractRow.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/join/AbstractRow.java?rev=1303438&r1=1303437&r2=1303438&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/join/AbstractRow.java
(original)
+++ jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/join/AbstractRow.java
Wed Mar 21 15:21:24 2012
@@ -42,8 +42,9 @@ abstract class AbstractRow implements Ro
 
     public Value[] getValues() throws RepositoryException {
         Value[] values = new Value[columns.size()];
-        for (Operand operand : columns.values()) {
-            values = evaluator.getValues(operand, this);
+        int i = 0;
+        for (String columnName : columns.keySet()) {
+            values[i++] = getValue(columnName);
         }
         return values;
     }

Modified: jackrabbit/trunk/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/query/SQL2QueryResultTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/query/SQL2QueryResultTest.java?rev=1303438&r1=1303437&r2=1303438&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/query/SQL2QueryResultTest.java
(original)
+++ jackrabbit/trunk/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/query/SQL2QueryResultTest.java
Wed Mar 21 15:21:24 2012
@@ -27,7 +27,9 @@ import javax.jcr.Node;
 import javax.jcr.RepositoryException;
 import javax.jcr.nodetype.NodeTypeManager;
 import javax.jcr.query.QueryResult;
+import javax.jcr.query.Row;
 
+import org.apache.jackrabbit.commons.JcrUtils;
 import org.apache.jackrabbit.commons.cnd.CndImporter;
 
 /**
@@ -112,6 +114,10 @@ public class SQL2QueryResultTest extends
                     .getColumnNames())));
             assertTrue("Got unexpected columns: " + expectedCols,
                     expectedCols.isEmpty());
+            for (Row row : JcrUtils.getRows(r)) {
+                assertNotNull(row.getValues());
+                assertEquals(expected, row.getValues().length);
+            }
         }
     }
 }



Mime
View raw message