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 );