cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tylerho...@apache.org
Subject [1/2] cassandra git commit: Ninja: fix check for duplicate cols in INSERT
Date Fri, 21 Nov 2014 19:26:08 GMT
Repository: cassandra
Updated Branches:
  refs/heads/cassandra-2.1 705e5e47d -> 6826888be


Ninja: fix check for duplicate cols in INSERT

This was caused by the changes for CASSANDRA-8178


Project: http://git-wip-us.apache.org/repos/asf/cassandra/repo
Commit: http://git-wip-us.apache.org/repos/asf/cassandra/commit/025b4060
Tree: http://git-wip-us.apache.org/repos/asf/cassandra/tree/025b4060
Diff: http://git-wip-us.apache.org/repos/asf/cassandra/diff/025b4060

Branch: refs/heads/cassandra-2.1
Commit: 025b4060cb3088f8815909e1710801f757e7a497
Parents: 084d93d
Author: Tyler Hobbs <tyler@datastax.com>
Authored: Fri Nov 21 13:21:36 2014 -0600
Committer: Tyler Hobbs <tyler@datastax.com>
Committed: Fri Nov 21 13:21:36 2014 -0600

----------------------------------------------------------------------
 .../cassandra/cql3/statements/UpdateStatement.java      | 12 ++++++++----
 1 file changed, 8 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cassandra/blob/025b4060/src/java/org/apache/cassandra/cql3/statements/UpdateStatement.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/cql3/statements/UpdateStatement.java b/src/java/org/apache/cassandra/cql3/statements/UpdateStatement.java
index 022af26..e2da251 100644
--- a/src/java/org/apache/cassandra/cql3/statements/UpdateStatement.java
+++ b/src/java/org/apache/cassandra/cql3/statements/UpdateStatement.java
@@ -138,13 +138,17 @@ public class UpdateStatement extends ModificationStatement
 
             for (int i = 0; i < columnNames.size(); i++)
             {
-                CFDefinition.Name name = cfDef.get(columnNames.get(i).prepare(cfDef.cfm));
+                ColumnIdentifier id = columnNames.get(i).prepare(cfDef.cfm);
+                CFDefinition.Name name = cfDef.get(id);
                 if (name == null)
-                    throw new InvalidRequestException(String.format("Unknown identifier %s",
columnNames.get(i)));
+                    throw new InvalidRequestException(String.format("Unknown identifier %s",
id));
 
                 for (int j = 0; j < i; j++)
-                    if (name.name.equals(columnNames.get(j)))
-                        throw new InvalidRequestException(String.format("Multiple definitions
found for column %s", name));
+                {
+                    ColumnIdentifier otherId = columnNames.get(j).prepare(cfDef.cfm);
+                    if (id.equals(otherId))
+                        throw new InvalidRequestException(String.format("Multiple definitions
found for column %s", id));
+                }
 
                 Term.Raw value = columnValues.get(i);
 


Mime
View raw message