cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jbel...@apache.org
Subject [4/9] git commit: fix NPE in cql3 ALTER TABLE patch by pcannon; reviewed by jbellis for CASSANDRA-4163
Date Thu, 19 Apr 2012 20:54:42 GMT
fix NPE in cql3 ALTER TABLE
patch by pcannon; reviewed by jbellis for CASSANDRA-4163


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

Branch: refs/heads/trunk
Commit: 36a9f9bd8f70b35a13fe510576635c619b2b81ff
Parents: dc975e8
Author: Jonathan Ellis <jbellis@apache.org>
Authored: Thu Apr 19 15:53:53 2012 -0500
Committer: Jonathan Ellis <jbellis@apache.org>
Committed: Thu Apr 19 15:53:53 2012 -0500

----------------------------------------------------------------------
 CHANGES.txt                                        |    1 +
 build.xml                                          |   12 +++++-------
 src/java/org/apache/cassandra/cql3/Cql.g           |    4 +---
 .../cql3/statements/AlterTableStatement.java       |    2 +-
 4 files changed, 8 insertions(+), 11 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cassandra/blob/36a9f9bd/CHANGES.txt
----------------------------------------------------------------------
diff --git a/CHANGES.txt b/CHANGES.txt
index 8a9d924..5e84e66 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -1,4 +1,5 @@
 1.1-dev
+ * fix NPE in cql3 ALTER TABLE (CASSANDRA-4163)
  * (cqlsh) fix recognizing uppercase SELECT keyword (CASSANDRA-4161)
  * average a reduced liveRatio estimate with the previous one (CASSANDRA-4065)
  * Allow KS and CF names up to 48 characters (CASSANDRA-4157)

http://git-wip-us.apache.org/repos/asf/cassandra/blob/36a9f9bd/build.xml
----------------------------------------------------------------------
diff --git a/build.xml b/build.xml
index 6ec0cde..89f3bc2 100644
--- a/build.xml
+++ b/build.xml
@@ -190,16 +190,14 @@
        This generates the CQL grammar files from Cql.g
     -->
     <target name="check-gen-cql-grammar">
-      <uptodate property="cqlcurrent" 
-                srcfile="${build.src.java}/org/apache/cassandra/cql/Cql.g" 
-                targetfile="${build.src.gen-java}/org/apache/cassandra/cql/Cql.tokens"/>
-      <uptodate property="cqlcurrent"
-                srcfile="${build.src.java}/org/apache/cassandra/cql3/Cql.g"
-                targetfile="${build.src.gen-java}/org/apache/cassandra/cql3/Cql.tokens"/>
+      <uptodate property="cqlcurrent">
+        <srcfiles dir="${build.src.java}" includes="org/apache/cassandra/cql*/Cql.g"/>
+        <mapper type="glob" from="*.g" to="*.tokens"/>
+      </uptodate>
     </target>
  
     <target name="gen-cql-grammar" depends="check-gen-cql-grammar" unless="cqlcurrent">
-      <echo>Building Grammar ${build.src.java}/org/apache/cassandra/cql/Cql.g  ...</echo>
+      <echo>Building Grammar ${build.src.java}/org/apache/cassandra/cql*/Cql.g  ...</echo>
       <java classname="org.antlr.Tool"
             classpath="${build.lib}/antlr-3.2.jar"
             fork="true"

http://git-wip-us.apache.org/repos/asf/cassandra/blob/36a9f9bd/src/java/org/apache/cassandra/cql3/Cql.g
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/cql3/Cql.g b/src/java/org/apache/cassandra/cql3/Cql.g
index cb15272..f1b4718 100644
--- a/src/java/org/apache/cassandra/cql3/Cql.g
+++ b/src/java/org/apache/cassandra/cql3/Cql.g
@@ -362,9 +362,7 @@ createIndexStatement returns [CreateIndexStatement expr]
 alterTableStatement returns [AlterTableStatement expr]
     @init {
         AlterTableStatement.Type type = null;
-        String validator = null;
-        ColumnIdentifier columnName = null;
-        Map<String, String> propertyMap = null;
+        props = new HashMap<String, String>();
     }
     : K_ALTER K_COLUMNFAMILY cf=columnFamilyName
           ( K_ALTER id=cident K_TYPE v=comparatorType { type = AlterTableStatement.Type.ALTER;
}

http://git-wip-us.apache.org/repos/asf/cassandra/blob/36a9f9bd/src/java/org/apache/cassandra/cql3/statements/AlterTableStatement.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/cql3/statements/AlterTableStatement.java b/src/java/org/apache/cassandra/cql3/statements/AlterTableStatement.java
index 1ecbd8a..37db2fd 100644
--- a/src/java/org/apache/cassandra/cql3/statements/AlterTableStatement.java
+++ b/src/java/org/apache/cassandra/cql3/statements/AlterTableStatement.java
@@ -47,7 +47,7 @@ public class AlterTableStatement extends SchemaAlteringStatement
     {
         super(name);
         this.oType = type;
-        this.columnName = null;
+        this.columnName = columnName;
         this.validator = validator; // used only for ADD/ALTER commands
         this.cfProps.addAll(propertyMap);
     }


Mime
View raw message