You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cassandra.apache.org by br...@apache.org on 2020/06/30 22:59:07 UTC

[cassandra-dtest] branch master updated: Add test for CASSANDRA-15905

This is an automated email from the ASF dual-hosted git repository.

brandonwilliams pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/cassandra-dtest.git


The following commit(s) were added to refs/heads/master by this push:
     new f5bc21c  Add test for CASSANDRA-15905
f5bc21c is described below

commit f5bc21c40ccd4bc2b9bc118ec5888bad3cc15b16
Author: Yifan Cai <yi...@apple.com>
AuthorDate: Tue Jun 30 14:23:04 2020 -0700

    Add test for CASSANDRA-15905
    
    Patch by Yifan Cai, reviewed by brandonwilliams for CASSANDRA-15905
---
 cqlsh_tests/test_cqlsh.py | 27 +++++++++++++++++++++++++++
 1 file changed, 27 insertions(+)

diff --git a/cqlsh_tests/test_cqlsh.py b/cqlsh_tests/test_cqlsh.py
index a47f942..f261833 100644
--- a/cqlsh_tests/test_cqlsh.py
+++ b/cqlsh_tests/test_cqlsh.py
@@ -2031,6 +2031,33 @@ Tracing session:""")
 
         assert_all(session, "SELECT * FROM ks.cf", [[0]])
 
+    def test_fetch_all_rows_in_batch_mode(self):
+        """
+        Test: cqlsh -e "<SELECT STATEMENT>" with more rows than 1 page
+        @jira_ticket CASSANDRA-15905
+        """
+        self.cluster.populate(1)
+        self.cluster.start(wait_for_binary_proto=True)
+        node1, = self.cluster.nodelist()
+        session = self.patient_cql_connection(node1)
+
+        session.execute("CREATE KEYSPACE ks WITH REPLICATION={'class':'SimpleStrategy','replication_factor':1};")
+        session.execute("CREATE TABLE ks.test (key uuid primary key);")
+
+        num_rows = 200
+        expected_lines = num_rows + 5 # 5: header + empty lines
+
+        for i in range(num_rows):
+            session.execute("INSERT INTO ks.test (key) VALUES (uuid())")
+
+        stdout, err = self.run_cqlsh(node1, cmds="", cqlsh_options=['-e', 'SELECT * FROM ks.test;'])
+        assert err == ""
+        output_lines = stdout.splitlines()
+        assert expected_lines == len(output_lines)
+        assert output_lines[0].strip() == ''
+        assert output_lines[-2].strip() == ''
+        assert output_lines[-1].strip() == "({} rows)".format(num_rows)
+
     def run_cqlsh(self, node, cmds, cqlsh_options=None, env_vars=None):
         """
         Local version of run_cqlsh to open a cqlsh subprocess with


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cassandra.apache.org
For additional commands, e-mail: commits-help@cassandra.apache.org