From 2efa95d8e8691fc4f76c37628e14946b9734c29c Mon Sep 17 00:00:00 2001 From: Eric Evans Date: Wed, 30 Mar 2011 19:02:37 +0000 Subject: [PATCH] (dumb )cqlsh completion for PRIMARY KEY in CREATE Patch by eevans git-svn-id: https://svn.apache.org/repos/asf/cassandra/trunk@1087039 13f79535-47bb-0310-9956-ffa450edef68 --- drivers/py/cqlsh | 3 ++- test/system/test_cql.py | 14 +++++++------- 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/drivers/py/cqlsh b/drivers/py/cqlsh index 4472f0e911..a99b9ba5a9 100755 --- a/drivers/py/cqlsh +++ b/drivers/py/cqlsh @@ -129,6 +129,7 @@ class Shell(cmd.Cmd): if words[1].upper() == 'COLUMNFAMILY': types = startswith(CQLTYPES, text) + keywords = startswith(('KEY', 'PRIMARY'), text.upper()) props = startswith(("comparator", "comment", "row_cache_size", @@ -144,7 +145,7 @@ class Shell(cmd.Cmd): "memtable_throughput_in_mb", "memtable_operations_in_millions", "replicate_on_write"), text) - return startswith(common, text.upper()) + types + props + return startswith(common, text.upper()) + types + keywords + props if words[1].upper() == 'KEYSPACE': props = ("replication_factor", "strategy_options", "strategy_class") diff --git a/test/system/test_cql.py b/test/system/test_cql.py index a58b9c6ff1..5697978eea 100644 --- a/test/system/test_cql.py +++ b/test/system/test_cql.py @@ -81,13 +81,13 @@ def load_sample(dbconn): dbconn.execute(""" BEGIN BATCH USING CONSISTENCY ONE - UPDATE StandardLongA SET 1='1', 2='2', 3='3', 4='4' WHERE KEY='aa'; - UPDATE StandardLongA SET 5='5', 6='6', 7='8', 9='9' WHERE KEY='ab'; - UPDATE StandardLongA SET 9='9', 8='8', 7='7', 6='6' WHERE KEY='ac'; - UPDATE StandardLongA SET 5='5', 4='4', 3='3', 2='2' WHERE KEY='ad'; - UPDATE StandardLongA SET 1='1', 2='2', 3='3', 4='4' WHERE KEY='ae'; - UPDATE StandardLongA SET 1='1', 2='2', 3='3', 4='4' WHERE KEY='af'; - UPDATE StandardLongA SET 5='5', 6='6', 7='8', 9='9' WHERE KEY='ag'; + UPDATE StandardLongA SET 1='1', 2='2', 3='3', 4='4' WHERE KEY='aa' + UPDATE StandardLongA SET 5='5', 6='6', 7='8', 9='9' WHERE KEY='ab' + UPDATE StandardLongA SET 9='9', 8='8', 7='7', 6='6' WHERE KEY='ac' + UPDATE StandardLongA SET 5='5', 4='4', 3='3', 2='2' WHERE KEY='ad' + UPDATE StandardLongA SET 1='1', 2='2', 3='3', 4='4' WHERE KEY='ae' + UPDATE StandardLongA SET 1='1', 2='2', 3='3', 4='4' WHERE KEY='af' + UPDATE StandardLongA SET 5='5', 6='6', 7='8', 9='9' WHERE KEY='ag' APPLY BATCH """)