cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jbel...@apache.org
Subject svn commit: r1199023 - in /cassandra/branches/cassandra-1.0: CHANGES.txt src/java/org/apache/cassandra/cql/QueryProcessor.java
Date Tue, 08 Nov 2011 00:06:48 GMT
Author: jbellis
Date: Tue Nov  8 00:06:47 2011
New Revision: 1199023

URL: http://svn.apache.org/viewvc?rev=1199023&view=rev
Log:
fix handling of rows with no columns
patch by pyaskevich and jbellis for CASSANDRA-3424

Modified:
    cassandra/branches/cassandra-1.0/CHANGES.txt
    cassandra/branches/cassandra-1.0/src/java/org/apache/cassandra/cql/QueryProcessor.java

Modified: cassandra/branches/cassandra-1.0/CHANGES.txt
URL: http://svn.apache.org/viewvc/cassandra/branches/cassandra-1.0/CHANGES.txt?rev=1199023&r1=1199022&r2=1199023&view=diff
==============================================================================
--- cassandra/branches/cassandra-1.0/CHANGES.txt (original)
+++ cassandra/branches/cassandra-1.0/CHANGES.txt Tue Nov  8 00:06:47 2011
@@ -2,6 +2,7 @@
  * (Hadoop) Fix empty row filtering (CASSANDRA-3450)
  * fix invalidate-related test failures (CASSANDRA-3437)
  * add next-gen cqlsh to bin/
+ * (CQL) fix handling of rows with no columns (CASSANDRA-3424)
 Merged from 0.8:
  * Make counter shard merging thread safe (CASSANDRA-3178)
 

Modified: cassandra/branches/cassandra-1.0/src/java/org/apache/cassandra/cql/QueryProcessor.java
URL: http://svn.apache.org/viewvc/cassandra/branches/cassandra-1.0/src/java/org/apache/cassandra/cql/QueryProcessor.java?rev=1199023&r1=1199022&r2=1199023&view=diff
==============================================================================
--- cassandra/branches/cassandra-1.0/src/java/org/apache/cassandra/cql/QueryProcessor.java
(original)
+++ cassandra/branches/cassandra-1.0/src/java/org/apache/cassandra/cql/QueryProcessor.java
Tue Nov  8 00:06:47 2011
@@ -578,10 +578,6 @@ public class QueryProcessor
                 List<CqlRow> cqlRows = new ArrayList<CqlRow>();
                 for (org.apache.cassandra.db.Row row : rows)
                 {
-                    /// No results for this row
-                    if (row.cf == null)
-                        continue;
-
                     List<Column> thriftColumns = new ArrayList<Column>();
                     if (select.isColumnRange())
                     {
@@ -594,16 +590,19 @@ public class QueryProcessor
                         }
 
                         // preserve comparator order
-                        for (IColumn c : row.cf.getSortedColumns())
+                        if (row.cf != null)
                         {
-                            if (c.isMarkedForDelete())
-                                continue;
+                            for (IColumn c : row.cf.getSortedColumns())
+                            {
+                                if (c.isMarkedForDelete())
+                                    continue;
 
-                            ColumnDefinition cd = metadata.getColumnDefinition(c.name());
-                            if (cd != null)
-                                result.schema.value_types.put(c.name(), TypeParser.getShortName(cd.getValidator()));
+                                ColumnDefinition cd = metadata.getColumnDefinition(c.name());
+                                if (cd != null)
+                                    result.schema.value_types.put(c.name(), TypeParser.getShortName(cd.getValidator()));
 
-                            thriftColumns.add(thriftify(c));
+                                thriftColumns.add(thriftify(c));
+                            }
                         }
                     }
                     else



Mime
View raw message