You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cassandra.apache.org by ty...@apache.org on 2014/08/12 22:19:50 UTC

[1/4] git commit: Fix failing cqlsh formatting tests

Repository: cassandra
Updated Branches:
  refs/heads/trunk 2dfa90e2b -> d2bed56b0


Fix failing cqlsh formatting tests

Patch by Tyler Hobbs; review by Aleksey Yeschenko for CASSANDRA-7703


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

Branch: refs/heads/trunk
Commit: 0edd5ee9812bcc5852433751171c1687948e8bed
Parents: 7ddcf3e
Author: Tyler Hobbs <ty...@datastax.com>
Authored: Tue Aug 12 15:01:49 2014 -0500
Committer: Tyler Hobbs <ty...@datastax.com>
Committed: Tue Aug 12 15:01:49 2014 -0500

----------------------------------------------------------------------
 CHANGES.txt                                |   1 +
 pylib/cqlshlib/test/test_cqlsh_output.py   | 110 ++++++------------------
 pylib/cqlshlib/test/test_keyspace_init.cql |  34 ++------
 3 files changed, 33 insertions(+), 112 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cassandra/blob/0edd5ee9/CHANGES.txt
----------------------------------------------------------------------
diff --git a/CHANGES.txt b/CHANGES.txt
index d42c100..ae88957 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -1,4 +1,5 @@
 2.0.10
+ * (cqlsh) Fix failing cqlsh formatting tests (CASSANDRA-7703)
  * Fix MS expiring map timeout for Paxos messages (CASSANDRA-7752)
  * Do not flush on truncate if durable_writes is false (CASSANDRA-7750)
  * Give CRR a default input_cql Statement (CASSANDRA-7226)

http://git-wip-us.apache.org/repos/asf/cassandra/blob/0edd5ee9/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 f89127d..e680cab 100644
--- a/pylib/cqlshlib/test/test_cqlsh_output.py
+++ b/pylib/cqlshlib/test/test_cqlsh_output.py
@@ -21,7 +21,7 @@ from __future__ import with_statement
 
 import re
 from itertools import izip
-from .basecase import (BaseTestCase, cqlshlog, dedent, at_a_time, cql,
+from .basecase import (BaseTestCase, cqlshlog, dedent, at_a_time,
                        TEST_HOST, TEST_PORT)
 from .cassconnect import (get_test_keyspace, testrun_cqlsh, testcall_cqlsh,
                           cassandra_cursor, split_cql_commands, quote_name)
@@ -31,7 +31,9 @@ from .ansi_colors import (ColoredText, lookup_colorcode, lookup_colorname,
 CONTROL_C = '\x03'
 CONTROL_D = '\x04'
 
+
 class TestCqlshOutput(BaseTestCase):
+
     def setUp(self):
         pass
 
@@ -93,33 +95,28 @@ class TestCqlshOutput(BaseTestCase):
             with testrun_cqlsh(tty=True, env={'TERM': termname}) as c:
                 c.send('select * from has_all_types;\n')
                 self.assertNoHasColors(c.read_to_next_prompt())
-                c.send('select * from has_value_encoding_errors;\n')
-                self.assertNoHasColors(c.read_to_next_prompt())
                 c.send('select count(*) from has_all_types;\n')
                 self.assertNoHasColors(c.read_to_next_prompt())
                 c.send('totally invalid cql;\n')
                 self.assertNoHasColors(c.read_to_next_prompt())
 
     def test_no_prompt_or_colors_output(self):
-        # CQL queries and number of lines expected in output:
-        queries = (('select * from has_all_types limit 1;', 7),
-                   ('select * from has_value_encoding_errors limit 1;', 8))
         for termname in ('', 'dumb', 'vt100', 'xterm'):
             cqlshlog.debug('TERM=%r' % termname)
-            for cql, lines_expected in queries:
-                output, result = testcall_cqlsh(prompt=None, env={'TERM': termname},
-                                                tty=False, input=cql + '\n')
-                output = output.splitlines()
-                for line in output:
-                    self.assertNoHasColors(line)
-                    self.assertNotRegexpMatches(line, r'^cqlsh\S*>')
-                self.assertEqual(len(output), lines_expected,
-                                 msg='output: %r' % '\n'.join(output))
-                self.assertEqual(output[0], '')
-                self.assertNicelyFormattedTableHeader(output[1])
-                self.assertNicelyFormattedTableRule(output[2])
-                self.assertNicelyFormattedTableData(output[3])
-                self.assertEqual(output[4].strip(), '')
+            query = 'select * from has_all_types limit 1;'
+            output, result = testcall_cqlsh(prompt=None, env={'TERM': termname},
+                                            tty=False, input=query + '\n')
+            output = output.splitlines()
+            for line in output:
+                self.assertNoHasColors(line)
+                self.assertNotRegexpMatches(line, r'^cqlsh\S*>')
+            self.assertTrue(6 <= len(output) <= 8,
+                            msg='output: %r' % '\n'.join(output))
+            self.assertEqual(output[0], '')
+            self.assertNicelyFormattedTableHeader(output[1])
+            self.assertNicelyFormattedTableRule(output[2])
+            self.assertNicelyFormattedTableData(output[3])
+            self.assertEqual(output[4].strip(), '')
 
     def test_color_output(self):
         for termname in ('xterm', 'unknown-garbage'):
@@ -127,8 +124,6 @@ class TestCqlshOutput(BaseTestCase):
             with testrun_cqlsh(tty=True, env={'TERM': termname}) as c:
                 c.send('select * from has_all_types;\n')
                 self.assertHasColors(c.read_to_next_prompt())
-                c.send('select * from has_value_encoding_errors;\n')
-                self.assertHasColors(c.read_to_next_prompt())
                 c.send('select count(*) from has_all_types;\n')
                 self.assertHasColors(c.read_to_next_prompt())
                 c.send('totally invalid cql;\n')
@@ -438,7 +433,7 @@ class TestCqlshOutput(BaseTestCase):
 
     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"""
+            ("select * from ascii_with_special_chars where k in (0, 1, 2, 3);", r"""
              k | val
              M   MMM
             ---+-----------------------------------------------
@@ -449,13 +444,11 @@ class TestCqlshOutput(BaseTestCase):
              G                           YYYYYYmmYYYYYYYYmmmmY
              2 | \x00\x01\x02\x03\x04\x05control chars\x06\x07
              G   mmmmmmmmmmmmmmmmmmmmmmmmYYYYYYYYYYYYYmmmmmmmm
-             3 |                       \xfe\xffbyte order mark 
-             G                         mmmmmmmmYYYYYYYYYYYYYYY
-             4 |                      fake special chars\x00\n
+             3 |                      fake special chars\x00\n
              G                        YYYYYYYYYYYYYYYYYYYYYYYY
 
 
-            (5 rows)
+            (4 rows)
             nnnnnnnn
             """),
         ), cqlver=3)
@@ -516,55 +509,6 @@ class TestCqlshOutput(BaseTestCase):
             """),
         ), cqlver=3)
 
-    def test_colname_decoding_errors(self):
-        # not clear how to achieve this situation in the first place. the
-        # validator works pretty well, and we can't change the comparator
-        # after insertion.
-        #
-        # guess we could monkey-patch cqlsh or python-cql source to
-        # explicitly generate an exception on the deserialization of type X..
-        pass
-
-    def test_colval_decoding_errors(self):
-        self.assertCqlverQueriesGiveColoredOutput((
-            ("select * from has_value_encoding_errors;", r"""
-             pkey | utf8col
-             MMMM   MMMMMMM
-            ------+--------------------
-
-                A | '\x00\xff\x00\xff'
-                Y   RRRRRRRRRRRRRRRRRR
-
-
-            (1 rows)
-            nnnnnnnn
-
-
-            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=3)
-
-    def test_key_decoding_errors(self):
-        self.assertCqlverQueriesGiveColoredOutput((
-            ("select * from has_key_encoding_errors;", r"""
-             pkey               | col
-             MMMM                 MMM
-            --------------------+----------
-
-             '\x00\xff\x02\x8f' | whatever
-             RRRRRRRRRRRRRRRRRR   YYYYYYYY
-
-
-            (1 rows)
-            nnnnnnnn
-
-
-            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=3)
-
     def test_prompt(self):
         with testrun_cqlsh(tty=True, keyspace=None, cqlver=3) as c:
             self.assertEqual(c.output_header.splitlines()[-1], 'cqlsh> ')
@@ -652,19 +596,19 @@ class TestCqlshOutput(BaseTestCase):
               uuidcol uuid,
               varcharcol text,
               varintcol varint,
-              PRIMARY KEY (num)
+              PRIMARY KEY ((num))
             ) WITH
               bloom_filter_fp_chance=0.010000 AND
               caching='KEYS_ONLY' AND
               comment='' AND
-              dclocal_read_repair_chance=0.000000 AND
+              dclocal_read_repair_chance=0.100000 AND
               gc_grace_seconds=864000 AND
               index_interval=128 AND
-              read_repair_chance=0.100000 AND
+              read_repair_chance=0.000000 AND
               replicate_on_write='true' AND
               populate_io_cache_on_flush='false' AND
               default_time_to_live=0 AND
-              speculative_retry='NONE' AND
+              speculative_retry='99.0PERCENTILE' AND
               memtable_flush_period_in_ms=0 AND
               compaction={'class': 'SizeTieredCompactionStrategy'} AND
               compression={'sstable_compression': 'LZ4Compressor'};
@@ -705,7 +649,7 @@ class TestCqlshOutput(BaseTestCase):
                         cfnames = section.group('cfnames')
                         self.assertNotIn('\n\n', cfnames)
                         if ksname == ks:
-                            self.assertIn('ascii_with_invalid_and_special_chars', cfnames)
+                            self.assertIn('ascii_with_special_chars', cfnames)
 
                     self.assertIn('system', ksnames)
                     self.assertIn(quote_name('3.0.0', ks), ksnames)
@@ -721,7 +665,6 @@ class TestCqlshOutput(BaseTestCase):
                     self.assertEqual(output[0], '\n')
                     self.assertEqual(output[-1], '\n')
                     self.assertNotIn('Keyspace %s' % quote_name('3.0.0', ks), output)
-                    self.assertIn('has_value_encoding_errors', output)
                     self.assertIn('undefined_values_table', output)
 
     def test_describe_cluster_output(self):
@@ -801,8 +744,7 @@ class TestCqlshOutput(BaseTestCase):
 
     def test_help_types(self):
         with testrun_cqlsh(tty=True) as c:
-            output = c.cmd_and_response('help types')
-
+            c.cmd_and_response('help types')
 
     def test_help(self):
         pass

http://git-wip-us.apache.org/repos/asf/cassandra/blob/0edd5ee9/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
index e92d5d0..f63811f 100644
--- a/pylib/cqlshlib/test/test_keyspace_init.cql
+++ b/pylib/cqlshlib/test/test_keyspace_init.cql
@@ -52,24 +52,6 @@ VALUES (4, blobAsInt(0x), '', blobAsBigint(0x), 0x, blobAsBoolean(0x), blobAsDec
         blobAsVarint(0x));
 
 
-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
@@ -130,23 +112,19 @@ INSERT INTO undefined_values_table (k, c) VALUES ('k2', 'c2');
 
 
 
-CREATE TABLE ascii_with_invalid_and_special_chars (
+CREATE TABLE ascii_with_special_chars (
     k int PRIMARY KEY,
-    val blob
+    val ascii
 );
 
 -- "newline:\n"
-INSERT INTO ascii_with_invalid_and_special_chars (k, val) VALUES (0, 0x6e65776c696e653a0a);
+INSERT INTO ascii_with_special_chars (k, val) VALUES (0, blobAsAscii(0x6e65776c696e653a0a));
 -- "return\rand null\0!"
-INSERT INTO ascii_with_invalid_and_special_chars (k, val) VALUES (1, 0x72657475726e0d616e64206e756c6c0021);
+INSERT INTO ascii_with_special_chars (k, val) VALUES (1, blobAsAscii(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);
+INSERT INTO ascii_with_special_chars (k, val) VALUES (2, blobAsAscii(0x000102030405636f6e74726f6c2063686172730607));
 -- "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;
+INSERT INTO ascii_with_special_chars (k, val) VALUES (3, blobAsAscii(0x66616b65207370656369616c2063686172735c7830305c6e));
 
 
 


[2/4] git commit: Merge branch 'cassandra-2.0' into cassandra-2.1.0

Posted by ty...@apache.org.
Merge branch 'cassandra-2.0' into cassandra-2.1.0

Conflicts:
	CHANGES.txt
	pylib/cqlshlib/test/test_cqlsh_output.py
	pylib/cqlshlib/test/test_keyspace_init.cql


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

Branch: refs/heads/trunk
Commit: 2db047b09fcc952c0768fbe634539e55a971b6cc
Parents: 59a8e1c 0edd5ee
Author: Tyler Hobbs <ty...@datastax.com>
Authored: Tue Aug 12 15:14:14 2014 -0500
Committer: Tyler Hobbs <ty...@datastax.com>
Committed: Tue Aug 12 15:14:14 2014 -0500

----------------------------------------------------------------------

----------------------------------------------------------------------



[3/4] git commit: Merge branch 'cassandra-2.1.0' into cassandra-2.1

Posted by ty...@apache.org.
Merge branch 'cassandra-2.1.0' into cassandra-2.1


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

Branch: refs/heads/trunk
Commit: d9b463ef529cf697203278e3029ad8f0b38acdcd
Parents: 17193da 2db047b
Author: Tyler Hobbs <ty...@datastax.com>
Authored: Tue Aug 12 15:18:56 2014 -0500
Committer: Tyler Hobbs <ty...@datastax.com>
Committed: Tue Aug 12 15:18:56 2014 -0500

----------------------------------------------------------------------
 CHANGES.txt                                |   1 +
 pylib/cqlshlib/test/test_cqlsh_output.py   | 110 ++++++------------------
 pylib/cqlshlib/test/test_keyspace_init.cql |  28 ++----
 3 files changed, 33 insertions(+), 106 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cassandra/blob/d9b463ef/CHANGES.txt
----------------------------------------------------------------------
diff --cc CHANGES.txt
index c2dc249,be91bbc..050d274
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@@ -1,24 -1,3 +1,25 @@@
 +2.1.1
 + * Avoid IOOBE when building SyntaxError message snippet (CASSANDRA-7569)
 + * SSTableExport uses correct validator to create string representation of partition
 +   keys (CASSANDRA-7498)
 + * Avoid NPEs when receiving type changes for an unknown keyspace (CASSANDRA-7689)
 + * Add support for custom 2i validation (CASSANDRA-7575)
 + * Pig support for hadoop CqlInputFormat (CASSANDRA-6454)
 + * Add listen_interface and rpc_interface options (CASSANDRA-7417)
 + * Improve schema merge performance (CASSANDRA-7444)
 + * Adjust MT depth based on # of partition validating (CASSANDRA-5263)
 + * Optimise NativeCell comparisons (CASSANDRA-6755)
 + * Configurable client timeout for cqlsh (CASSANDRA-7516)
 + * Include snippet of CQL query near syntax error in messages (CASSANDRA-7111)
 +Merged from 2.0:
++ * (cqlsh) Fix failing cqlsh formatting tests (CASSANDRA-7703)
 + * Fix IncompatibleClassChangeError from hadoop2 (CASSANDRA-7229)
 + * Add 'nodetool sethintedhandoffthrottlekb' (CASSANDRA-7635)
 + * (cqlsh) Add tab-completion for CREATE/DROP USER IF [NOT] EXISTS (CASSANDRA-7611)
 + * Catch errors when the JVM pulls the rug out from GCInspector (CASSANDRA-5345)
 + * cqlsh fails when version number parts are not int (CASSANDRA-7524)
 +
 +
  2.1.0-rc6
   * Fix Thrift range filtering without 2ary index lookups (CASSANDRA-7741)
   * Add tracing entries about concurrent range requests (CASSANDRA-7599)

http://git-wip-us.apache.org/repos/asf/cassandra/blob/d9b463ef/pylib/cqlshlib/test/test_cqlsh_output.py
----------------------------------------------------------------------
diff --cc pylib/cqlshlib/test/test_cqlsh_output.py
index 4f1627e,6fb4f41..baf72c1
--- a/pylib/cqlshlib/test/test_cqlsh_output.py
+++ b/pylib/cqlshlib/test/test_cqlsh_output.py
@@@ -21,7 -21,7 +21,7 @@@ from __future__ import with_statemen
  
  import re
  from itertools import izip
--from .basecase import (BaseTestCase, cqlshlog, dedent, at_a_time, cql, cqlsh,
++from .basecase import (BaseTestCase, cqlshlog, dedent, at_a_time, cqlsh,
                         TEST_HOST, TEST_PORT)
  from .cassconnect import (get_test_keyspace, testrun_cqlsh, testcall_cqlsh,
                            cassandra_cursor, split_cql_commands, quote_name)
@@@ -31,7 -31,7 +31,9 @@@ from .ansi_colors import (ColoredText, 
  CONTROL_C = '\x03'
  CONTROL_D = '\x04'
  
++
  class TestCqlshOutput(BaseTestCase):
++
      def setUp(self):
          pass
  
@@@ -93,33 -93,33 +95,28 @@@
              with testrun_cqlsh(tty=True, env={'TERM': termname}) as c:
                  c.send('select * from has_all_types;\n')
                  self.assertNoHasColors(c.read_to_next_prompt())
--                c.send('select * from has_value_encoding_errors;\n')
--                self.assertNoHasColors(c.read_to_next_prompt())
                  c.send('select count(*) from has_all_types;\n')
                  self.assertNoHasColors(c.read_to_next_prompt())
                  c.send('totally invalid cql;\n')
                  self.assertNoHasColors(c.read_to_next_prompt())
  
      def test_no_prompt_or_colors_output(self):
--        # CQL queries and number of lines expected in output:
--        queries = (('select * from has_all_types limit 1;', 7),
--                   ('select * from has_value_encoding_errors limit 1;', 8))
          for termname in ('', 'dumb', 'vt100', 'xterm'):
              cqlshlog.debug('TERM=%r' % termname)
--            for cql, lines_expected in queries:
--                output, result = testcall_cqlsh(prompt=None, env={'TERM': termname},
--                                                tty=False, input=cql + '\n')
--                output = output.splitlines()
--                for line in output:
--                    self.assertNoHasColors(line)
--                    self.assertNotRegexpMatches(line, r'^cqlsh\S*>')
--                self.assertEqual(len(output), lines_expected,
--                                 msg='output: %r' % '\n'.join(output))
--                self.assertEqual(output[0], '')
--                self.assertNicelyFormattedTableHeader(output[1])
--                self.assertNicelyFormattedTableRule(output[2])
--                self.assertNicelyFormattedTableData(output[3])
--                self.assertEqual(output[4].strip(), '')
++            query = 'select * from has_all_types limit 1;'
++            output, result = testcall_cqlsh(prompt=None, env={'TERM': termname},
++                                            tty=False, input=query + '\n')
++            output = output.splitlines()
++            for line in output:
++                self.assertNoHasColors(line)
++                self.assertNotRegexpMatches(line, r'^cqlsh\S*>')
++            self.assertTrue(6 <= len(output) <= 8,
++                            msg='output: %r' % '\n'.join(output))
++            self.assertEqual(output[0], '')
++            self.assertNicelyFormattedTableHeader(output[1])
++            self.assertNicelyFormattedTableRule(output[2])
++            self.assertNicelyFormattedTableData(output[3])
++            self.assertEqual(output[4].strip(), '')
  
      def test_color_output(self):
          for termname in ('xterm', 'unknown-garbage'):
@@@ -127,8 -127,8 +124,6 @@@
              with testrun_cqlsh(tty=True, env={'TERM': termname}) as c:
                  c.send('select * from has_all_types;\n')
                  self.assertHasColors(c.read_to_next_prompt())
--                c.send('select * from has_value_encoding_errors;\n')
--                self.assertHasColors(c.read_to_next_prompt())
                  c.send('select count(*) from has_all_types;\n')
                  self.assertHasColors(c.read_to_next_prompt())
                  c.send('totally invalid cql;\n')
@@@ -449,9 -438,9 +444,9 @@@
  
      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"""
++            ("select * from ascii_with_special_chars where k in (0, 1, 2, 3);", r"""
               k | val
 -             M   MMM
 +             R   MMM
              ---+-----------------------------------------------
  
               0 |                                    newline:\n
@@@ -460,13 -449,13 +455,11 @@@
               G                           YYYYYYmmYYYYYYYYmmmmY
               2 | \x00\x01\x02\x03\x04\x05control chars\x06\x07
               G   mmmmmmmmmmmmmmmmmmmmmmmmYYYYYYYYYYYYYmmmmmmmm
--             3 |                       \xfe\xffbyte order mark 
--             G                         mmmmmmmmYYYYYYYYYYYYYYY
--             4 |                      fake special chars\x00\n
++             3 |                      fake special chars\x00\n
               G                        YYYYYYYYYYYYYYYYYYYYYYYY
  
  
--            (5 rows)
++            (4 rows)
              nnnnnnnn
              """),
          ), cqlver=cqlsh.DEFAULT_CQLVER)
@@@ -527,55 -516,55 +520,6 @@@
              """),
          ), cqlver=cqlsh.DEFAULT_CQLVER)
  
--    def test_colname_decoding_errors(self):
--        # not clear how to achieve this situation in the first place. the
--        # validator works pretty well, and we can't change the comparator
--        # after insertion.
--        #
--        # guess we could monkey-patch cqlsh or python-cql source to
--        # explicitly generate an exception on the deserialization of type X..
--        pass
--
--    def test_colval_decoding_errors(self):
--        self.assertCqlverQueriesGiveColoredOutput((
--            ("select * from has_value_encoding_errors;", r"""
--             pkey | utf8col
--             MMMM   MMMMMMM
--            ------+--------------------
--
--                A | '\x00\xff\x00\xff'
--                Y   RRRRRRRRRRRRRRRRRR
--
--
--            (1 rows)
--            nnnnnnnn
--
--
--            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=cqlsh.DEFAULT_CQLVER)
--
--    def test_key_decoding_errors(self):
--        self.assertCqlverQueriesGiveColoredOutput((
--            ("select * from has_key_encoding_errors;", r"""
--             pkey               | col
--             MMMM                 MMM
--            --------------------+----------
--
--             '\x00\xff\x02\x8f' | whatever
--             RRRRRRRRRRRRRRRRRR   YYYYYYYY
--
--
--            (1 rows)
--            nnnnnnnn
--
--
--            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=cqlsh.DEFAULT_CQLVER)
--
      def test_prompt(self):
          with testrun_cqlsh(tty=True, keyspace=None, cqlver=cqlsh.DEFAULT_CQLVER) as c:
              self.assertEqual(c.output_header.splitlines()[-1], 'cqlsh> ')
@@@ -712,7 -700,7 +656,7 @@@
                          cfnames = section.group('cfnames')
                          self.assertNotIn('\n\n', cfnames)
                          if ksname == ks:
--                            self.assertIn('ascii_with_invalid_and_special_chars', cfnames)
++                            self.assertIn('ascii_with_special_chars', cfnames)
  
                      self.assertIn('system', ksnames)
                      self.assertIn(quote_name(ks), ksnames)
@@@ -728,7 -716,7 +672,6 @@@
                      self.assertEqual(output[0], '\n')
                      self.assertEqual(output[-1], '\n')
                      self.assertNotIn('Keyspace %s' % quote_name(ks), output)
--                    self.assertIn('has_value_encoding_errors', output)
                      self.assertIn('undefined_values_table', output)
  
      def test_describe_cluster_output(self):
@@@ -807,8 -795,8 +750,7 @@@
  
      def test_help_types(self):
          with testrun_cqlsh(tty=True) as c:
--            output = c.cmd_and_response('help types')
--
++            c.cmd_and_response('help types')
  
      def test_help(self):
          pass
@@@ -873,10 -861,10 +815,10 @@@
              ("select info from songs;", r"""
               info
               MMMM
--            ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
++            -------------------------------------------------------------------------------------------------------------------------------------------------------------------
  
--             {founded: '1970-01-02 20:24:54-0800', members: {'Adrian Smith', 'Bruce Dickinson', 'Dave Murray', 'Janick Gers', 'Nicko McBrain', 'Steve Harris'}, description: 'Pure evil metal'}
--             BYYYYYYYBBGGGGGGGGGGGGGGGGGGGGGGGGGGBBYYYYYYYBBBYYYYYYYYYYYYYYBBYYYYYYYYYYYYYYYYYBBYYYYYYYYYYYYYBBYYYYYYYYYYYYYBBYYYYYYYYYYYYYYYBBYYYYYYYYYYYYYYBBBYYYYYYYYYYYBBYYYYYYYYYYYYYYYYYB
++             {founded: 188694000, members: {'Adrian Smith', 'Bruce Dickinson', 'Dave Murray', 'Janick Gers', 'Nicko McBrain', 'Steve Harris'}, description: 'Pure evil metal'}
++             BYYYYYYYBBGGGGGGGGGBBYYYYYYYBBBYYYYYYYYYYYYYYBBYYYYYYYYYYYYYYYYYBBYYYYYYYYYYYYYBBYYYYYYYYYYYYYBBYYYYYYYYYYYYYYYBBYYYYYYYYYYYYYYBBBYYYYYYYYYYYBBYYYYYYYYYYYYYYYYYB
  
  
              (1 rows)
@@@ -896,4 -884,4 +838,4 @@@
              (1 rows)
              nnnnnnnn
              """),
--        ), cqlver=cqlsh.DEFAULT_CQLVER)
++        ), cqlver=cqlsh.DEFAULT_CQLVER)

http://git-wip-us.apache.org/repos/asf/cassandra/blob/d9b463ef/pylib/cqlshlib/test/test_keyspace_init.cql
----------------------------------------------------------------------
diff --cc pylib/cqlshlib/test/test_keyspace_init.cql
index 98932bc,98932bc..b8d600c
--- a/pylib/cqlshlib/test/test_keyspace_init.cql
+++ b/pylib/cqlshlib/test/test_keyspace_init.cql
@@@ -52,20 -52,20 +52,6 @@@ VALUES (4, blobAsInt(0x), '', blobAsBig
          blobAsVarint(0x));
  
  
--CREATE TABLE has_value_encoding_errors (
--    pkey ascii PRIMARY KEY,
--    utf8col text
--);
--
--INSERT INTO has_value_encoding_errors (pkey, utf8col) VALUES ('A', blobAsText(0x00ff00ff));
--
--CREATE TABLE has_key_encoding_errors (
--    pkey blob PRIMARY KEY,
--    col text
--);
--
--INSERT INTO has_key_encoding_errors (pkey, col) VALUES (0x00ff028f, 'whatever');
--
  
  CREATE TABLE empty_table (
      lonelykey float primary key,
@@@ -127,21 -127,21 +113,19 @@@ INSERT INTO undefined_values_table (k, 
  
  
  
--CREATE TABLE ascii_with_invalid_and_special_chars (
++CREATE TABLE ascii_with_special_chars (
      k int PRIMARY KEY,
      val ascii
  );
  
  -- "newline:\n"
--INSERT INTO ascii_with_invalid_and_special_chars (k, val) VALUES (0, blobAsAscii(0x6e65776c696e653a0a));
++INSERT INTO ascii_with_special_chars (k, val) VALUES (0, blobAsAscii(0x6e65776c696e653a0a));
  -- "return\rand null\0!"
--INSERT INTO ascii_with_invalid_and_special_chars (k, val) VALUES (1, blobAsAscii(0x72657475726e0d616e64206e756c6c0021));
++INSERT INTO ascii_with_special_chars (k, val) VALUES (1, blobAsAscii(0x72657475726e0d616e64206e756c6c0021));
  -- "\x00\x01\x02\x03\x04\x05control chars\x06\x07"
--INSERT INTO ascii_with_invalid_and_special_chars (k, val) VALUES (2, blobAsAscii(0x000102030405636f6e74726f6c2063686172730607));
---- "\xfe\xffbyte order mark"
--INSERT INTO ascii_with_invalid_and_special_chars (k, val) VALUES (3, blobAsAscii(0xfeff62797465206f72646572206d61726b));
++INSERT INTO ascii_with_special_chars (k, val) VALUES (2, blobAsAscii(0x000102030405636f6e74726f6c2063686172730607));
  -- "fake special chars\\x00\\n"
--INSERT INTO ascii_with_invalid_and_special_chars (k, val) VALUES (4, blobAsAscii(0x66616b65207370656369616c2063686172735c7830305c6e));
++INSERT INTO ascii_with_special_chars (k, val) VALUES (3, blobAsAscii(0x66616b65207370656369616c2063686172735c7830305c6e));
  
  
  
@@@ -233,7 -233,7 +217,7 @@@ values ('vpupkin'
           {country: null, number: '03'}});
  
  CREATE TYPE band_info_type (
--  founded timestamp,
++  founded varint,
    members set<text>,
    description text
  );


[4/4] git commit: Merge branch 'cassandra-2.1' into trunk

Posted by ty...@apache.org.
Merge branch 'cassandra-2.1' into trunk


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

Branch: refs/heads/trunk
Commit: d2bed56b080fb4359734400092b966187f4a27b6
Parents: 2dfa90e d9b463e
Author: Tyler Hobbs <ty...@datastax.com>
Authored: Tue Aug 12 15:19:36 2014 -0500
Committer: Tyler Hobbs <ty...@datastax.com>
Committed: Tue Aug 12 15:19:36 2014 -0500

----------------------------------------------------------------------
 CHANGES.txt                                |   1 +
 pylib/cqlshlib/test/test_cqlsh_output.py   | 110 ++++++------------------
 pylib/cqlshlib/test/test_keyspace_init.cql |  28 ++----
 3 files changed, 33 insertions(+), 106 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cassandra/blob/d2bed56b/CHANGES.txt
----------------------------------------------------------------------