cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From alek...@apache.org
Subject [1/2] cqlsh: drop CQL2/CQL3-beta support
Date Tue, 21 May 2013 21:48:25 GMT
Updated Branches:
  refs/heads/trunk 2ee90305c -> 7f6ac19ef


http://git-wip-us.apache.org/repos/asf/cassandra/blob/7f6ac19e/pylib/cqlshlib/test/test_cqlsh_completion.py
----------------------------------------------------------------------
diff --git a/pylib/cqlshlib/test/test_cqlsh_completion.py b/pylib/cqlshlib/test/test_cqlsh_completion.py
index 321ee5f..ea4f77c 100644
--- a/pylib/cqlshlib/test/test_cqlsh_completion.py
+++ b/pylib/cqlshlib/test/test_cqlsh_completion.py
@@ -90,29 +90,22 @@ class CqlshCompletionCase(BaseTestCase):
     def strategies(self):
         return self.module.CqlRuleSet.replication_strategies
 
-class TestCqlshCompletion_CQL2(CqlshCompletionCase):
-    cqlver = 2
-    module = cqlsh.cqlhandling
+class TestCqlshCompletion(CqlshCompletionCase):
+    cqlver = '3.1.0'
+    module = cqlsh.cql3handling
 
     def test_complete_on_empty_string(self):
         self.trycompletions('', choices=('?', 'ALTER', 'BEGIN', 'CAPTURE', 'CONSISTENCY',
                                          'COPY', 'CREATE', 'DEBUG', 'DELETE', 'DESC', 'DESCRIBE',
-                                         'DROP', 'HELP', 'INSERT', 'SELECT', 'SHOW', 'SOURCE',
-                                         'TRACING', 'TRUNCATE', 'UPDATE', 'USE', 'exit',
'quit'))
+                                         'DROP', 'GRANT', 'HELP', 'INSERT', 'LIST', 'REVOKE',
+                                         'SELECT', 'SHOW', 'SOURCE', 'TRACING', 'TRUNCATE',
'UPDATE',
+                                         'USE', 'exit', 'quit'))
 
     def test_complete_command_words(self):
         self.trycompletions('alt', '\b\b\bALTER ')
         self.trycompletions('I', 'NSERT INTO ')
         self.trycompletions('exit', ' ')
 
-    def test_complete_in_string_literals(self):
-        # would be great if we could get a space after this sort of completion,
-        # but readline really wants to make things difficult for us
-        self.trycompletions("insert into system.'NodeId", "Info'")
-        self.trycompletions("USE '", choices=('system', self.cqlsh.keyspace), other_choices_ok=True)
-        self.trycompletions("create keyspace blah with strategy_class = 'Sim",
-                            "pleStrategy'")
-
     def test_complete_in_uuid(self):
         pass
 
@@ -132,59 +125,6 @@ class TestCqlshCompletion_CQL2(CqlshCompletionCase):
         pass
 
     def test_complete_in_create_keyspace(self):
-        self.trycompletions('create keyspace ', '', choices=('<new_keyspace_name>',))
-        self.trycompletions('create keyspace moo ', "WITH strategy_class = '")
-        self.trycompletions("create keyspace '12SomeName' with ", "strategy_class = '")
-        self.trycompletions("create keyspace moo with strategy_class", " = '")
-        self.trycompletions("create keyspace moo with strategy_class='",
-                            choices=self.strategies())
-        self.trycompletions("create keySPACE 123 with strategy_class='SimpleStrategy' A",
-                            "ND strategy_options:replication_factor = ")
-        self.trycompletions("create keyspace fish with strategy_class='SimpleStrategy'"
-                                  "and strategy_options:replication_factor = ", '',
-                            choices=('<option_value>',))
-        self.trycompletions("create keyspace 'PB and J' with strategy_class="
-                               "'NetworkTopologyStrategy' AND", ' ')
-        self.trycompletions("create keyspace 'PB and J' with strategy_class="
-                               "'NetworkTopologyStrategy' AND ", '',
-                            choices=('<strategy_option_name>',))
-
-    def test_complete_in_drop_keyspace(self):
-        pass
-
-    def test_complete_in_create_columnfamily(self):
-        pass
-
-    def test_complete_in_drop_columnfamily(self):
-        pass
-
-    def test_complete_in_truncate(self):
-        pass
-
-    def test_complete_in_alter_columnfamily(self):
-        pass
-
-    def test_complete_in_use(self):
-        pass
-
-    def test_complete_in_create_index(self):
-        pass
-
-    def test_complete_in_drop_index(self):
-        pass
-
-class TestCqlshCompletion_CQL3final(TestCqlshCompletion_CQL2):
-    cqlver = '3.0.0'
-    module = cqlsh.cql3handling
-
-    def test_complete_on_empty_string(self):
-        self.trycompletions('', choices=('?', 'ALTER', 'BEGIN', 'CAPTURE', 'CONSISTENCY',
-                                         'COPY', 'CREATE', 'DEBUG', 'DELETE', 'DESC', 'DESCRIBE',
-                                         'DROP', 'GRANT', 'HELP', 'INSERT', 'LIST', 'REVOKE',
-                                         'SELECT', 'SHOW', 'SOURCE', 'TRACING', 'TRUNCATE',
'UPDATE',
-                                         'USE', 'exit', 'quit'))
-
-    def test_complete_in_create_keyspace(self):
         self.trycompletions('create keyspace ', '', choices=('<identifier>', '<quotedName>'))
         self.trycompletions('create keyspace moo ',
                             "WITH replication = {'class': '")
@@ -241,3 +181,27 @@ class TestCqlshCompletion_CQL3final(TestCqlshCompletion_CQL2):
                             other_choices_ok=True)
         self.trycompletions("create keyspace blah with replication = {'class': 'Sim",
                             "pleStrategy'")
+
+    def test_complete_in_drop_keyspace(self):
+        pass
+
+    def test_complete_in_create_columnfamily(self):
+        pass
+
+    def test_complete_in_drop_columnfamily(self):
+        pass
+
+    def test_complete_in_truncate(self):
+        pass
+
+    def test_complete_in_alter_columnfamily(self):
+        pass
+
+    def test_complete_in_use(self):
+        pass
+
+    def test_complete_in_create_index(self):
+        pass
+
+    def test_complete_in_drop_index(self):
+        pass

http://git-wip-us.apache.org/repos/asf/cassandra/blob/7f6ac19e/pylib/cqlshlib/test/test_cqlsh_output.py
----------------------------------------------------------------------
diff --git a/pylib/cqlshlib/test/test_cqlsh_output.py b/pylib/cqlshlib/test/test_cqlsh_output.py
index a1cb947..a1922b4 100644
--- a/pylib/cqlshlib/test/test_cqlsh_output.py
+++ b/pylib/cqlshlib/test/test_cqlsh_output.py
@@ -197,23 +197,9 @@ class TestCqlshOutput(BaseTestCase):
                 GG
 
             """),
-        ), cqlver=(2, 3))
+        ), cqlver=3)
 
-        # different results cql2/cql3
         q = 'select COUNT(*) FROM twenty_rows_composite_table limit 1000000;'
-
-        self.assertQueriesGiveColoredOutput((
-            (q, """
-             count
-             MMMMM
-            -------
-
-                 1
-                GG
-
-            """),
-        ), cqlver=2)
-
         self.assertQueriesGiveColoredOutput((
             (q, """
              count
@@ -226,53 +212,6 @@ class TestCqlshOutput(BaseTestCase):
             """),
         ), cqlver=3)
 
-    def test_dynamic_cf_output(self):
-        self.assertQueriesGiveColoredOutput((
-            ('select * from dynamic_columns;', """
-             somekey,1 | 1.2,one point two
-            nMMMMMMM G   MMM YYYYYYYYYYYYY
-             somekey,2 | 2.3,two point three
-             MMMMMMM G   MMM YYYYYYYYYYYYYYY
-             somekey,3 | -0.0001,negative ten thousandth | 3.46,three point four six | 99,ninety-nine
point oh
-             MMMMMMM G   MMMMMMM YYYYYYYYYYYYYYYYYYYYYYY   MMMM YYYYYYYYYYYYYYYYYYYY n MM
YYYYYYYYYYYYYYYYYYYY
-
-            """),
-
-            ('select somekey, 2.3 from dynamic_columns;', """
-             somekey | 2.3
-             MMMMMMM   MMM
-            ---------+-----------------
-
-                   1 |            null
-                   G              RRRR
-                   2 | two point three
-                   G   YYYYYYYYYYYYYYY
-                   3 |            null
-                   G              RRRR
-
-            """),
-
-            ('select first 1 * from dynamic_columns where somekey = 2;', """
-             2.3
-             MMM
-            -----------------
-
-             two point three
-             YYYYYYYYYYYYYYY
-
-            """),
-
-            ('select * from dynamic_columns where somekey = 2;', """
-             somekey | 2.3
-             MMMMMMM   MMM
-            ---------+-----------------
-
-                   2 | two point three
-                   G   YYYYYYYYYYYYYYY
-
-            """),
-        ), cqlver=2, sort_results=True)
-
     def test_static_cf_output(self):
         self.assertCqlverQueriesGiveColoredOutput((
             ("select a, b from twenty_rows_table where a in ('1', '13', '2');", """
@@ -288,7 +227,7 @@ class TestCqlshOutput(BaseTestCase):
              YY   YY
 
             """),
-        ), cqlver=(2, 3))
+        ), cqlver=3)
 
         self.assertQueriesGiveColoredOutput((
             ('select * from dynamic_columns;', """
@@ -314,20 +253,9 @@ class TestCqlshOutput(BaseTestCase):
         self.assertCqlverQueriesGiveColoredOutput((
             ('select * from empty_table;', """
             """),
-        ), cqlver=(2, 3))
+        ), cqlver=3)
 
         q = 'select * from has_all_types where num = 999;'
-        self.assertQueriesGiveColoredOutput((
-            (q, """
-             num
-             MMM
-            -----
-
-             999
-             GGG
-
-            """),
-        ), cqlver=2)
 
         # same query should show up as empty in cql 3
         self.assertQueriesGiveColoredOutput((
@@ -337,21 +265,6 @@ class TestCqlshOutput(BaseTestCase):
 
     def test_columnless_key_output(self):
         q = "select a from twenty_rows_table where a in ('1', '2', '-9192');"
-        self.assertQueriesGiveColoredOutput((
-            (q, """
-             a
-             MMMMM
-            -------
-
-                 1
-             YYYYY
-                 2
-             YYYYY
-             -9192
-             YYYYY
-
-            """),
-        ), cqlver=2)
 
         self.assertQueriesGiveColoredOutput((
             (q, """
@@ -404,19 +317,7 @@ class TestCqlshOutput(BaseTestCase):
              GGGGGGGGGGGGGGGG     GGGGGGG      GGGGG
 
             """),
-        ), cqlver=(2, 3))
-
-        self.assertQueriesGiveColoredOutput((
-            ('''select * from dynamic_columns where somekey = 3;''', """
-             somekey | -0.0001                 | 3.46                 | 99
-             MMMMMMM   MMMMMMM                   MMMM                   MM
-            ---------+-------------------------+----------------------+----------------------
-
-                   3 | negative ten thousandth | three point four six | ninety-nine point
oh
-                   G   YYYYYYYYYYYYYYYYYYYYYYY   YYYYYYYYYYYYYYYYYYYY   YYYYYYYYYYYYYYYYYYYY
-
-            """),
-        ), cqlver=2)
+        ), cqlver=3)
 
     def test_timestamp_output(self):
         self.assertQueriesGiveColoredOutput((
@@ -460,7 +361,7 @@ class TestCqlshOutput(BaseTestCase):
                G        GGGGG
 
             """),
-        ), cqlver=(2, 3))
+        ), cqlver=3)
 
     def test_null_output(self):
         # column with metainfo but no values
@@ -476,7 +377,7 @@ class TestCqlshOutput(BaseTestCase):
              YY   YY       RRRR
 
             """),
-        ), cqlver=(2, 3))
+        ), cqlver=3)
 
         # all-columns, including a metainfo column has no values (cql3)
         self.assertQueriesGiveColoredOutput((
@@ -493,36 +394,6 @@ class TestCqlshOutput(BaseTestCase):
             """),
         ), cqlver=3)
 
-        # all-columns, including a metainfo column has no values (cql2)
-        self.assertQueriesGiveColoredOutput((
-            ("select * from undefined_values_table where k in ('k1', 'k2');", """
-             k  | c
-             M    M
-            ----+----
-
-             k1 | c1
-             YY   YY
-             k2 | c2
-             YY   YY
-
-            """),
-        ), cqlver=2)
-
-        # column not in metainfo, which has no values (invalid query in cql3)
-        self.assertQueriesGiveColoredOutput((
-            ("select num, fakecol from has_all_types where num in (1, 2);", """
-             num
-             MMM
-            -----
-
-               1
-             GGG
-               2
-             GGG
-
-            """),
-        ), cqlver=2)
-
     def test_string_output_ascii(self):
         self.assertCqlverQueriesGiveColoredOutput((
             ("select * from ascii_with_invalid_and_special_chars where k in (0, 1, 2, 3,
4);", r"""
@@ -542,7 +413,7 @@ class TestCqlshOutput(BaseTestCase):
              G                        YYYYYYYYYYYYYYYYYYYYYYYY
 
             """),
-        ), cqlver=(2, 3))
+        ), cqlver=3)
 
     def test_string_output_utf8(self):
         # many of these won't line up visually here, to keep the source code
@@ -573,7 +444,7 @@ class TestCqlshOutput(BaseTestCase):
              G        YYYYYYYYYYYYYYYYYYYYYYYY
 
             """.encode('utf-8')),
-        ), cqlver=(2, 3), env={'LANG': 'en_US.UTF-8'})
+        ), cqlver=3, env={'LANG': 'en_US.UTF-8'})
 
     def test_blob_output(self):
         self.assertCqlverQueriesGiveColoredOutput((
@@ -592,7 +463,7 @@ class TestCqlshOutput(BaseTestCase):
                G   mmmmmmmmmmmmmmmmmmmm
 
             """),
-        ), cqlver=(2, 3))
+        ), cqlver=3)
 
     def test_colname_decoding_errors(self):
         # not clear how to achieve this situation in the first place. the
@@ -617,7 +488,7 @@ class TestCqlshOutput(BaseTestCase):
             Failed to decode value '\x00\xff\x00\xff' (for column 'utf8col') as text: 'utf8'
codec can't decode byte 0xff in position 1: invalid start byte
             RRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRR
             """),
-        ), cqlver=(2, 3))
+        ), cqlver=3)
 
     def test_key_decoding_errors(self):
         self.assertCqlverQueriesGiveColoredOutput((
@@ -633,17 +504,17 @@ class TestCqlshOutput(BaseTestCase):
             Failed to decode value '\x00\xff\x02\x8f' (for column 'pkey') as text: 'utf8'
codec can't decode byte 0xff in position 1: invalid start byte
             RRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRR
             """),
-        ), cqlver=(2, 3))
+        ), cqlver=3)
 
     def test_prompt(self):
-        with testrun_cqlsh(tty=True, keyspace=None, cqlver=2) as c:
+        with testrun_cqlsh(tty=True, keyspace=None, cqlver=3) as c:
             self.assertEqual(c.output_header.splitlines()[-1], 'cqlsh> ')
 
             c.send('\n')
             output = c.read_to_next_prompt().replace('\r\n', '\n')
             self.assertEqual(output, '\ncqlsh> ')
 
-            cmd = "USE '%s';\n" % get_test_keyspace().replace("'", "''")
+            cmd = "USE \"%s\";\n" % get_test_keyspace().replace('"', '""')
             c.send(cmd)
             output = c.read_to_next_prompt().replace('\r\n', '\n')
             self.assertEqual(output, '%scqlsh:%s> ' % (cmd, get_test_keyspace()))
@@ -654,15 +525,17 @@ class TestCqlshOutput(BaseTestCase):
 
             c.send('use NONEXISTENTKEYSPACE;\n')
             outputlines = c.read_to_next_prompt().splitlines()
+
             self.assertEqual(outputlines[0], 'use NONEXISTENTKEYSPACE;')
-            self.assertEqual(outputlines[3], 'cqlsh:system> ')
+            self.assertEqual(outputlines[2], 'cqlsh:system> ')
             midline = ColoredText(outputlines[1])
             self.assertEqual(midline.plain(),
-                             "Bad Request: Keyspace 'NONEXISTENTKEYSPACE' does not exist")
+                             "Bad Request: Keyspace 'nonexistentkeyspace' does not exist")
             self.assertColorFromTags(midline,
                              "RRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRR")
 
-    def check_describe_keyspace(self, fullcqlver):
+    def test_describe_keyspace_output(self):
+        fullcqlver = '3.1.0'
         with testrun_cqlsh(tty=True, cqlver=fullcqlver) as c:
             ks = get_test_keyspace()
             qks = quote_name(fullcqlver, ks)
@@ -684,20 +557,7 @@ class TestCqlshOutput(BaseTestCase):
                 try:
                     for stmt in statements:
                         cqlshlog.debug('TEST EXEC: %s' % stmt)
-                        try:
-                            curs.execute(stmt)
-                        except cql.ProgrammingError, e:
-                            # expected sometimes under cql3, since some existing
-                            # tables made under cql2 are not recreatable with cql3
-                            for errmsg in ('No definition found that is not part of the PRIMARY
KEY',
-                                           "mismatched input '<' expecting EOF"):
-                                if errmsg in str(e):
-                                    do_drop = False
-                                    break
-                            else:
-                                raise
-                    # maybe we should do some checks that the two keyspaces
-                    # match up as much as we expect at this point?
+                        curs.execute(stmt)
                 finally:
                     curs.execute('use system')
                     if do_drop:
@@ -706,53 +566,15 @@ class TestCqlshOutput(BaseTestCase):
     def check_describe_keyspace_output(self, output, qksname, fullcqlver):
         expected_bits = [r'(?im)^CREATE KEYSPACE %s WITH\b' % re.escape(qksname),
                          r'(?im)^USE \S+;$',
-                         r';\s*$']
-        if fullcqlver == '3.0.0':
-            expected_bits.append(r'\breplication = {\n  \'class\':')
-        else:
-            expected_bits.append(r'\bstrategy_class =')
+                         r';\s*$',
+                         r'\breplication = {\n  \'class\':']
         for expr in expected_bits:
             self.assertRegexpMatches(output, expr)
 
-    def test_describe_keyspace_output(self):
-        for v in ('2.0.0', '3.0.0'):
-            self.check_describe_keyspace(v)
-
     def test_describe_columnfamily_output(self):
         # we can change these to regular expressions if/when it makes sense
         # to do so; these will likely be subject to lots of adjustments.
 
-        table_desc2 = dedent("""
-
-            CREATE TABLE has_all_types (
-              num int PRIMARY KEY,
-              intcol int,
-              timestampcol timestamp,
-              floatcol float,
-              uuidcol uuid,
-              bigintcol bigint,
-              doublecol double,
-              booleancol boolean,
-              decimalcol decimal,
-              asciicol ascii,
-              blobcol blob,
-              varcharcol text,
-              varintcol varint,
-              textcol text
-            ) WITH
-              comment='' AND
-              comparator=text AND
-              read_repair_chance=0.100000 AND
-              gc_grace_seconds=864000 AND
-              default_validation=text AND
-              min_compaction_threshold=4 AND
-              max_compaction_threshold=32 AND
-              replicate_on_write='true' AND
-              compaction_strategy_class='SizeTieredCompactionStrategy' AND
-              compression_parameters:sstable_compression='LZ4Compressor';
-
-        """)
-
         # note columns are now comparator-ordered instead of original-order.
         table_desc3 = dedent("""
 
@@ -771,7 +593,7 @@ class TestCqlshOutput(BaseTestCase):
               uuidcol uuid,
               varcharcol text,
               varintcol varint
-            ) WITH COMPACT STORAGE AND
+            ) WITH
               bloom_filter_fp_chance=0.010000 AND
               caching='KEYS_ONLY' AND
               comment='' AND
@@ -785,13 +607,12 @@ class TestCqlshOutput(BaseTestCase):
 
         """)
 
-        for v in ('2.0.0', '3.0.0'):
-            with testrun_cqlsh(tty=True, cqlver=v) as c:
-                for cmdword in ('describe table', 'desc columnfamily'):
-                    for semicolon in (';', ''):
-                        output = c.cmd_and_response('%s has_all_types%s' % (cmdword, semicolon))
-                        self.assertNoHasColors(output)
-                        self.assertEqual(output, {'2.0.0': table_desc2, '3.0.0': table_desc3}[v])
+        with testrun_cqlsh(tty=True, cqlver='3.0.0') as c:
+            for cmdword in ('describe table', 'desc columnfamily'):
+                for semicolon in (';', ''):
+                    output = c.cmd_and_response('%s has_all_types%s' % (cmdword, semicolon))
+                    self.assertNoHasColors(output)
+                    self.assertEqual(output, table_desc3)
 
     def test_describe_columnfamilies_output(self):
         output_re = r'''

http://git-wip-us.apache.org/repos/asf/cassandra/blob/7f6ac19e/pylib/cqlshlib/test/test_keyspace_init.cql
----------------------------------------------------------------------
diff --git a/pylib/cqlshlib/test/test_keyspace_init.cql b/pylib/cqlshlib/test/test_keyspace_init.cql
new file mode 100644
index 0000000..30a22bc
--- /dev/null
+++ b/pylib/cqlshlib/test/test_keyspace_init.cql
@@ -0,0 +1,198 @@
+CREATE TABLE has_all_types (
+    num int PRIMARY KEY,
+    intcol int,
+    asciicol ascii,
+    bigintcol bigint,
+    blobcol blob,
+    booleancol boolean,
+    decimalcol decimal,
+    doublecol double,
+    floatcol float,
+    textcol text,
+    timestampcol timestamp,
+    uuidcol uuid,
+    varcharcol varchar,
+    varintcol varint
+) WITH compression = {'sstable_compression':'LZ4Compressor'};
+
+INSERT INTO has_all_types (num, intcol, asciicol, bigintcol, blobcol, booleancol,
+                           decimalcol, doublecol, floatcol, textcol,
+                           timestampcol, uuidcol, varcharcol, varintcol)
+VALUES (0, -12, 'abcdefg', 1234567890123456789, 0x000102030405fffefd, true,
+        19952.11882, 1.0, -2.1, 'Voilá!', '2012-05-14 12:53:20+0000',
+        bd1924e1-6af8-44ae-b5e1-f24131dbd460, '"', 10000000000000000000000000);
+
+INSERT INTO has_all_types (num, intcol, asciicol, bigintcol, blobcol, booleancol,
+                           decimalcol, doublecol, floatcol, textcol,
+                           timestampcol, uuidcol, varcharcol, varintcol)
+VALUES (1, 2147483647, '__!''$#@!~"', 9223372036854775807, 0xffffffffffffffffff, true,
+        0.00000000000001, 9999999.999, 99999.99, '∭Ƕ⑮ฑ➳❏''', '1900-01-01+0000',
+        ffffffff-ffff-ffff-ffff-ffffffffffff, 'newline->
+<-', 9);
+
+INSERT INTO has_all_types (num, intcol, asciicol, bigintcol, blobcol, booleancol,
+                           decimalcol, doublecol, floatcol, textcol,
+                           timestampcol, uuidcol, varcharcol, varintcol)
+VALUES (2, 0, '', 0, 0x, false,
+        0.0, 0.0, 0.0, '', 0,
+        00000000-0000-0000-0000-000000000000, '', 0);
+
+INSERT INTO has_all_types (num, intcol, asciicol, bigintcol, blobcol, booleancol,
+                           decimalcol, doublecol, floatcol, textcol,
+                           timestampcol, uuidcol, varcharcol, varintcol)
+VALUES (3, -2147483648, '''''''', -9223372036854775808, 0x80, false,
+        10.0000000000000, -1004.10, 100000000.9, '龍馭鬱', '2038-01-19T03:14-1200',
+        ffffffff-ffff-1fff-8fff-ffffffffffff, '''', -10000000000000000000000000);
+
+
+
+CREATE TABLE has_value_encoding_errors (
+    pkey ascii PRIMARY KEY,
+    utf8col blob
+);
+
+INSERT INTO has_value_encoding_errors (pkey, utf8col) VALUES ('A', 0x00ff00ff);
+ALTER TABLE has_value_encoding_errors ALTER utf8col TYPE text;
+
+CREATE TABLE has_key_encoding_errors (
+    pkey blob PRIMARY KEY,
+    col text
+);
+
+INSERT INTO has_key_encoding_errors (pkey, col) VALUES (0x00ff028f, 'whatever');
+ALTER TABLE has_key_encoding_errors ALTER pkey TYPE text;
+
+
+
+CREATE TABLE empty_table (
+    lonelykey float primary key,
+    lonelycol text
+);
+
+
+
+CREATE COLUMNFAMILY dynamic_columns (
+    somekey int,
+    column1 float,
+    value text,
+    PRIMARY KEY(somekey, column1)
+) WITH COMPACT STORAGE;
+
+INSERT INTO dynamic_columns (somekey, column1, value) VALUES (1, 1.2, 'one point two');
+INSERT INTO dynamic_columns (somekey, column1, value) VALUES (2, 2.3, 'two point three');
+INSERT INTO dynamic_columns (somekey, column1, value) VALUES (3, 3.46, 'three point four
six');
+INSERT INTO dynamic_columns (somekey, column1, value) VALUES (3, 99.0, 'ninety-nine point
oh');
+INSERT INTO dynamic_columns (somekey, column1, value) VALUES (3, -0.0001, 'negative ten thousandth');
+
+
+
+CREATE TABLE twenty_rows_table (
+    a text primary key,
+    b text
+);
+
+INSERT INTO twenty_rows_table (a, b) VALUES ('1', '1');
+INSERT INTO twenty_rows_table (a, b) VALUES ('2', '2');
+INSERT INTO twenty_rows_table (a, b) VALUES ('3', '3');
+INSERT INTO twenty_rows_table (a, b) VALUES ('4', '4');
+INSERT INTO twenty_rows_table (a, b) VALUES ('5', '5');
+INSERT INTO twenty_rows_table (a, b) VALUES ('6', '6');
+INSERT INTO twenty_rows_table (a, b) VALUES ('7', '7');
+INSERT INTO twenty_rows_table (a, b) VALUES ('8', '8');
+INSERT INTO twenty_rows_table (a, b) VALUES ('9', '9');
+INSERT INTO twenty_rows_table (a, b) VALUES ('10', '10');
+INSERT INTO twenty_rows_table (a, b) VALUES ('11', '11');
+INSERT INTO twenty_rows_table (a, b) VALUES ('12', '12');
+INSERT INTO twenty_rows_table (a, b) VALUES ('13', '13');
+INSERT INTO twenty_rows_table (a, b) VALUES ('14', '14');
+INSERT INTO twenty_rows_table (a, b) VALUES ('15', '15');
+INSERT INTO twenty_rows_table (a, b) VALUES ('16', '16');
+INSERT INTO twenty_rows_table (a, b) VALUES ('17', '17');
+INSERT INTO twenty_rows_table (a, b) VALUES ('18', '18');
+INSERT INTO twenty_rows_table (a, b) VALUES ('19', '19');
+INSERT INTO twenty_rows_table (a, b) VALUES ('20', '20');
+
+
+CREATE TABLE undefined_values_table (
+    k text PRIMARY KEY,
+    c text,
+    notthere text
+);
+
+INSERT INTO undefined_values_table (k, c) VALUES ('k1', 'c1');
+INSERT INTO undefined_values_table (k, c) VALUES ('k2', 'c2');
+
+
+
+CREATE TABLE ascii_with_invalid_and_special_chars (
+    k int PRIMARY KEY,
+    val blob
+);
+
+-- "newline:\n"
+INSERT INTO ascii_with_invalid_and_special_chars (k, val) VALUES (0, 0x6e65776c696e653a0a);
+-- "return\rand null\0!"
+INSERT INTO ascii_with_invalid_and_special_chars (k, val) VALUES (1, 0x72657475726e0d616e64206e756c6c0021);
+-- "\x00\x01\x02\x03\x04\x05control chars\x06\x07"
+INSERT INTO ascii_with_invalid_and_special_chars (k, val) VALUES (2, 0x000102030405636f6e74726f6c2063686172730607);
+-- "\xfe\xffbyte order mark"
+INSERT INTO ascii_with_invalid_and_special_chars (k, val) VALUES (3, 0xfeff62797465206f72646572206d61726b);
+-- "fake special chars\\x00\\n"
+INSERT INTO ascii_with_invalid_and_special_chars (k, val) VALUES (4, 0x66616b65207370656369616c2063686172735c7830305c6e);
+
+ALTER TABLE ascii_with_invalid_and_special_chars ALTER val TYPE ascii;
+
+
+
+CREATE TABLE utf8_with_special_chars (
+    k int PRIMARY KEY,
+    val text
+);
+
+INSERT INTO utf8_with_special_chars (k, val) VALUES (0, 'Normal string');
+INSERT INTO utf8_with_special_chars (k, val) VALUES (1, 'Text with
+newlines
+');
+INSERT INTO utf8_with_special_chars (k, val) VALUES (2, 'Text with embedded  char');
+INSERT INTO utf8_with_special_chars (k, val) VALUES (3, 'ⓈⓅⒺⒸⒾⒶⓁ ⒞⒣⒜⒭⒮
and normal ones');
+INSERT INTO utf8_with_special_chars (k, val) VALUES (4, 'double wides: ⾑⾤⾚');
+INSERT INTO utf8_with_special_chars (k, val) VALUES (5, 'zero width​space');
+INSERT INTO utf8_with_special_chars (k, val) VALUES (6, 'fake special chars\x00\n');
+
+
+CREATE TABLE empty_composite_table (
+    lonelykey float,
+    lonelycol text,
+    lonelyval int,
+    primary key (lonelykey, lonelycol)
+);
+
+CREATE TABLE twenty_rows_composite_table (
+    a text,
+    b text,
+    c text,
+    primary key (a, b)
+);
+
+-- all in the same storage engine row:
+
+INSERT INTO twenty_rows_composite_table (a, b, c) VALUES ('A', '1', '1');
+INSERT INTO twenty_rows_composite_table (a, b, c) VALUES ('A', '2', '2');
+INSERT INTO twenty_rows_composite_table (a, b, c) VALUES ('A', '3', '3');
+INSERT INTO twenty_rows_composite_table (a, b, c) VALUES ('A', '4', '4');
+INSERT INTO twenty_rows_composite_table (a, b, c) VALUES ('A', '5', '5');
+INSERT INTO twenty_rows_composite_table (a, b, c) VALUES ('A', '6', '6');
+INSERT INTO twenty_rows_composite_table (a, b, c) VALUES ('A', '7', '7');
+INSERT INTO twenty_rows_composite_table (a, b, c) VALUES ('A', '8', '8');
+INSERT INTO twenty_rows_composite_table (a, b, c) VALUES ('A', '9', '9');
+INSERT INTO twenty_rows_composite_table (a, b, c) VALUES ('A', '10', '10');
+INSERT INTO twenty_rows_composite_table (a, b, c) VALUES ('A', '11', '11');
+INSERT INTO twenty_rows_composite_table (a, b, c) VALUES ('A', '12', '12');
+INSERT INTO twenty_rows_composite_table (a, b, c) VALUES ('A', '13', '13');
+INSERT INTO twenty_rows_composite_table (a, b, c) VALUES ('A', '14', '14');
+INSERT INTO twenty_rows_composite_table (a, b, c) VALUES ('A', '15', '15');
+INSERT INTO twenty_rows_composite_table (a, b, c) VALUES ('A', '16', '16');
+INSERT INTO twenty_rows_composite_table (a, b, c) VALUES ('A', '17', '17');
+INSERT INTO twenty_rows_composite_table (a, b, c) VALUES ('A', '18', '18');
+INSERT INTO twenty_rows_composite_table (a, b, c) VALUES ('A', '19', '19');
+INSERT INTO twenty_rows_composite_table (a, b, c) VALUES ('A', '20', '20');

http://git-wip-us.apache.org/repos/asf/cassandra/blob/7f6ac19e/pylib/cqlshlib/test/test_keyspace_init2.cql
----------------------------------------------------------------------
diff --git a/pylib/cqlshlib/test/test_keyspace_init2.cql b/pylib/cqlshlib/test/test_keyspace_init2.cql
deleted file mode 100644
index ca5f4a4..0000000
--- a/pylib/cqlshlib/test/test_keyspace_init2.cql
+++ /dev/null
@@ -1,180 +0,0 @@
-CREATE TABLE has_all_types (
-    num int PRIMARY KEY,
-    intcol int,
-    asciicol ascii,
-    bigintcol bigint,
-    blobcol blob,
-    booleancol boolean,
-    decimalcol decimal,
-    doublecol double,
-    floatcol float,
-    textcol text,
-    timestampcol timestamp,
-    uuidcol uuid,
-    varcharcol varchar,
-    varintcol varint
-) WITH compression_parameters:sstable_compression='LZ4Compressor';
-
-INSERT INTO has_all_types (num, intcol, asciicol, bigintcol, blobcol, booleancol,
-                           decimalcol, doublecol, floatcol, textcol,
-                           timestampcol, uuidcol, varcharcol, varintcol)
-VALUES (0, -12, 'abcdefg', 1234567890123456789, '000102030405fffefd', 'true',
-        19952.11882, 1.0, -2.1, 'Voilá!', '2012-05-14 12:53:20+0000',
-        bd1924e1-6af8-44ae-b5e1-f24131dbd460, '"', 10000000000000000000000000);
-
-INSERT INTO has_all_types (num, intcol, asciicol, bigintcol, blobcol, booleancol,
-                           decimalcol, doublecol, floatcol, textcol,
-                           timestampcol, uuidcol, varcharcol, varintcol)
-VALUES (1, 2147483647, '__!''$#@!~"', 9223372036854775807, 'ffffffffffffffffff', true,
-        0.00000000000001, 9999999.999, 99999.99, '∭Ƕ⑮ฑ➳❏''', '1900-01-01+0000',
-        ffffffff-ffff-ffff-ffff-ffffffffffff, 'newline->
-<-', 9);
-
-INSERT INTO has_all_types (num, intcol, asciicol, bigintcol, blobcol, booleancol,
-                           decimalcol, doublecol, floatcol, textcol,
-                           timestampcol, uuidcol, varcharcol, varintcol)
-VALUES (2, 0, '', 0, '', false,
-        0.0, 0.0, 0.0, '', 0,
-        00000000-0000-0000-0000-000000000000, '', 0);
-
-INSERT INTO has_all_types (num, intcol, asciicol, bigintcol, blobcol, booleancol,
-                           decimalcol, doublecol, floatcol, textcol,
-                           timestampcol, uuidcol, varcharcol, varintcol)
-VALUES (3, -2147483648, '''''''', -9223372036854775808, '80', 'false',
-        10.0000000000000, -1004.10, 100000000.9, '龍馭鬱', '2038-01-19T03:14-1200',
-        ffffffff-ffff-1fff-8fff-ffffffffffff, '''', -10000000000000000000000000);
-
-
-
-CREATE TABLE has_value_encoding_errors (
-    pkey ascii PRIMARY KEY,
-    utf8col blob
-);
-
-INSERT INTO has_value_encoding_errors (pkey, utf8col) VALUES ('A', '00ff00ff');
-ALTER TABLE has_value_encoding_errors ALTER utf8col TYPE text;
-
-CREATE TABLE has_key_encoding_errors (
-    pkey blob PRIMARY KEY,
-    col text
-);
-
-INSERT INTO has_key_encoding_errors (pkey, col) VALUES ('00ff028f', 'whatever');
-ALTER TABLE has_key_encoding_errors ALTER pkey TYPE text;
-
-
-
-CREATE TABLE empty_table (
-    lonelykey float primary key,
-    lonelycol text
-);
-
-
-
-CREATE COLUMNFAMILY dynamic_columns (
-    somekey int PRIMARY KEY
-) WITH comparator = float
-   AND default_validation = text;
-
-INSERT INTO dynamic_columns (somekey, 1.2) VALUES (1, 'one point two');
-INSERT INTO dynamic_columns (somekey, 2.3) VALUES (2, 'two point three');
-INSERT INTO dynamic_columns (somekey, 3.46) VALUES (3, 'three point four six');
-INSERT INTO dynamic_columns (somekey, 99.0) VALUES (3, 'ninety-nine point oh');
-INSERT INTO dynamic_columns (somekey, -0.0001) VALUES (3, 'negative ten thousandth');
-
-
-
-CREATE TABLE twenty_rows_table (
-    a text primary key,
-    b text
-);
-
-INSERT INTO twenty_rows_table (a, b) VALUES (1, 1);
-INSERT INTO twenty_rows_table (a, b) VALUES (2, 2);
-INSERT INTO twenty_rows_table (a, b) VALUES (3, 3);
-INSERT INTO twenty_rows_table (a, b) VALUES (4, 4);
-INSERT INTO twenty_rows_table (a, b) VALUES (5, 5);
-INSERT INTO twenty_rows_table (a, b) VALUES (6, 6);
-INSERT INTO twenty_rows_table (a, b) VALUES (7, 7);
-INSERT INTO twenty_rows_table (a, b) VALUES (8, 8);
-INSERT INTO twenty_rows_table (a, b) VALUES (9, 9);
-INSERT INTO twenty_rows_table (a, b) VALUES (10, 10);
-INSERT INTO twenty_rows_table (a, b) VALUES (11, 11);
-INSERT INTO twenty_rows_table (a, b) VALUES (12, 12);
-INSERT INTO twenty_rows_table (a, b) VALUES (13, 13);
-INSERT INTO twenty_rows_table (a, b) VALUES (14, 14);
-INSERT INTO twenty_rows_table (a, b) VALUES (15, 15);
-INSERT INTO twenty_rows_table (a, b) VALUES (16, 16);
-INSERT INTO twenty_rows_table (a, b) VALUES (17, 17);
-INSERT INTO twenty_rows_table (a, b) VALUES (18, 18);
-INSERT INTO twenty_rows_table (a, b) VALUES (19, 19);
-INSERT INTO twenty_rows_table (a, b) VALUES (20, 20);
-
--- one row is twenty cols wide
-INSERT INTO twenty_rows_table (a, b1) VALUES (1, 1);
-INSERT INTO twenty_rows_table (a, b2) VALUES (1, 2);
-INSERT INTO twenty_rows_table (a, b3) VALUES (1, 3);
-INSERT INTO twenty_rows_table (a, b4) VALUES (1, 4);
-INSERT INTO twenty_rows_table (a, b5) VALUES (1, 5);
-INSERT INTO twenty_rows_table (a, b6) VALUES (1, 6);
-INSERT INTO twenty_rows_table (a, b7) VALUES (1, 7);
-INSERT INTO twenty_rows_table (a, b8) VALUES (1, 8);
-INSERT INTO twenty_rows_table (a, b9) VALUES (1, 9);
-INSERT INTO twenty_rows_table (a, b10) VALUES (1, 10);
-INSERT INTO twenty_rows_table (a, b11) VALUES (1, 11);
-INSERT INTO twenty_rows_table (a, b12) VALUES (1, 12);
-INSERT INTO twenty_rows_table (a, b13) VALUES (1, 13);
-INSERT INTO twenty_rows_table (a, b14) VALUES (1, 14);
-INSERT INTO twenty_rows_table (a, b15) VALUES (1, 15);
-INSERT INTO twenty_rows_table (a, b16) VALUES (1, 16);
-INSERT INTO twenty_rows_table (a, b17) VALUES (1, 17);
-INSERT INTO twenty_rows_table (a, b18) VALUES (1, 18);
-INSERT INTO twenty_rows_table (a, b19) VALUES (1, 19);
-
-
-
-CREATE TABLE undefined_values_table (
-    k text PRIMARY KEY,
-    c text,
-    notthere text
-);
-
-INSERT INTO undefined_values_table (k, c) VALUES ('k1', 'c1');
-INSERT INTO undefined_values_table (k, c) VALUES ('k2', 'c2');
-
-
-
-CREATE TABLE ascii_with_invalid_and_special_chars (
-    k int PRIMARY KEY,
-    val blob
-);
-
--- "newline:\n"
-INSERT INTO ascii_with_invalid_and_special_chars (k, val) VALUES (0, '6e65776c696e653a0a');
--- "return\rand null\0!"
-INSERT INTO ascii_with_invalid_and_special_chars (k, val) VALUES (1, '72657475726e0d616e64206e756c6c0021');
--- "\x00\x01\x02\x03\x04\x05control chars\x06\x07"
-INSERT INTO ascii_with_invalid_and_special_chars (k, val) VALUES (2, '000102030405636f6e74726f6c2063686172730607');
--- "\xfe\xffbyte order mark"
-INSERT INTO ascii_with_invalid_and_special_chars (k, val) VALUES (3, 'feff62797465206f72646572206d61726b');
--- "fake special chars\\x00\\n"
-INSERT INTO ascii_with_invalid_and_special_chars (k, val) VALUES (4, '66616b65207370656369616c2063686172735c7830305c6e');
-
-ALTER TABLE ascii_with_invalid_and_special_chars ALTER val TYPE ascii;
-
-
-
-CREATE TABLE utf8_with_special_chars (
-    k int PRIMARY KEY,
-    val text
-);
-
-INSERT INTO utf8_with_special_chars (k, val) VALUES (0, 'Normal string');
-INSERT INTO utf8_with_special_chars (k, val) VALUES (1, 'Text with
-newlines
-');
-INSERT INTO utf8_with_special_chars (k, val) VALUES (2, 'Text with embedded  char');
-INSERT INTO utf8_with_special_chars (k, val) VALUES (3, 'ⓈⓅⒺⒸⒾⒶⓁ ⒞⒣⒜⒭⒮
and normal ones');
-INSERT INTO utf8_with_special_chars (k, val) VALUES (4, 'double wides: ⾑⾤⾚');
-INSERT INTO utf8_with_special_chars (k, val) VALUES (5, 'zero width​space');
-INSERT INTO utf8_with_special_chars (k, val) VALUES (6, 'fake special chars\x00\n');

http://git-wip-us.apache.org/repos/asf/cassandra/blob/7f6ac19e/pylib/cqlshlib/test/test_keyspace_init3.cql
----------------------------------------------------------------------
diff --git a/pylib/cqlshlib/test/test_keyspace_init3.cql b/pylib/cqlshlib/test/test_keyspace_init3.cql
deleted file mode 100644
index b801c55..0000000
--- a/pylib/cqlshlib/test/test_keyspace_init3.cql
+++ /dev/null
@@ -1,36 +0,0 @@
-CREATE TABLE empty_composite_table (
-    lonelykey float,
-    lonelycol text,
-    lonelyval int,
-    primary key (lonelykey, lonelycol)
-);
-
-CREATE TABLE twenty_rows_composite_table (
-    a text,
-    b text,
-    c text,
-    primary key (a, b)
-);
-
--- all in the same storage engine row:
-
-INSERT INTO twenty_rows_composite_table (a, b, c) VALUES ('A', '1', '1');
-INSERT INTO twenty_rows_composite_table (a, b, c) VALUES ('A', '2', '2');
-INSERT INTO twenty_rows_composite_table (a, b, c) VALUES ('A', '3', '3');
-INSERT INTO twenty_rows_composite_table (a, b, c) VALUES ('A', '4', '4');
-INSERT INTO twenty_rows_composite_table (a, b, c) VALUES ('A', '5', '5');
-INSERT INTO twenty_rows_composite_table (a, b, c) VALUES ('A', '6', '6');
-INSERT INTO twenty_rows_composite_table (a, b, c) VALUES ('A', '7', '7');
-INSERT INTO twenty_rows_composite_table (a, b, c) VALUES ('A', '8', '8');
-INSERT INTO twenty_rows_composite_table (a, b, c) VALUES ('A', '9', '9');
-INSERT INTO twenty_rows_composite_table (a, b, c) VALUES ('A', '10', '10');
-INSERT INTO twenty_rows_composite_table (a, b, c) VALUES ('A', '11', '11');
-INSERT INTO twenty_rows_composite_table (a, b, c) VALUES ('A', '12', '12');
-INSERT INTO twenty_rows_composite_table (a, b, c) VALUES ('A', '13', '13');
-INSERT INTO twenty_rows_composite_table (a, b, c) VALUES ('A', '14', '14');
-INSERT INTO twenty_rows_composite_table (a, b, c) VALUES ('A', '15', '15');
-INSERT INTO twenty_rows_composite_table (a, b, c) VALUES ('A', '16', '16');
-INSERT INTO twenty_rows_composite_table (a, b, c) VALUES ('A', '17', '17');
-INSERT INTO twenty_rows_composite_table (a, b, c) VALUES ('A', '18', '18');
-INSERT INTO twenty_rows_composite_table (a, b, c) VALUES ('A', '19', '19');
-INSERT INTO twenty_rows_composite_table (a, b, c) VALUES ('A', '20', '20');


Mime
View raw message