Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Merge branch 'cassandra-2.1' into trunk

  • Loading branch information...
commit 9eb01aebd603243a7319b0025b23ed44a91925eb 2 parents 87318ef + e2a719a
@Mishail Mishail authored
Showing with 10 additions and 4 deletions.
  1. +4 −1 bin/cqlsh
  2. +6 −3 pylib/cqlshlib/cql3handling.py
View
5 bin/cqlsh
@@ -1172,7 +1172,10 @@ class Shell(cmd.Cmd):
if issubclass(coltype, ReversedType):
coltype = coltype.subtypes[0]
- out.write(" %s %s,\n" % (colname, coltype.cql_parameterized_type()))
+ out.write(" %s %s" % (colname, coltype.cql_parameterized_type()))
+ if col.is_static():
+ out.write(" static")
+ out.write(",\n")
out.write(" PRIMARY KEY (")
partkeynames = self.cql_protect_names(layout.partition_key_columns)
View
9 pylib/cqlshlib/cql3handling.py
@@ -889,8 +889,8 @@ def create_ks_wat_completer(ctxt, cass):
;
<compositeKeyCfSpec> ::= [newcolname]=<cident> <simpleStorageType>
- "," [newcolname]=<cident> <storageType>
- ( "," [newcolname]=<cident> <storageType> )*
+ "," [newcolname]=<cident> <storageType> ( "static" )?
+ ( "," [newcolname]=<cident> <storageType> ( "static" )? )*
"," "PRIMARY" k="KEY" p="(" ( partkey=<pkDef> | [pkey]=<cident> )
( c="," [pkey]=<cident> )* ")"
;
@@ -1008,7 +1008,7 @@ def drop_index_completer(ctxt, cass):
<alterInstructions>
;
<alterInstructions> ::= "ALTER" existcol=<cident> "TYPE" <storageType>
- | "ADD" newcol=<cident> <storageType>
+ | "ADD" newcol=<cident> <storageType> ("static")?
| "DROP" existcol=<cident>
| "WITH" <cfamProperty> ( "AND" <cfamProperty> )*
| "RENAME" existcol=<cident> "TO" newcol=<cident>
@@ -1145,6 +1145,9 @@ def from_layout(cls, layout):
c.index_options = json.loads(layout[u'index_options'])
return c
+ def is_static(self):
+ return self.component_type == 'static'
+
def __str__(self):
indexstr = ' (index %s)' % self.index_name if self.index_name is not None else ''
return '<CqlColumnDef %r %r%s>' % (self.name, self.cqltype, indexstr)
Please sign in to comment.
Something went wrong with that request. Please try again.