You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cassandra.apache.org by dj...@apache.org on 2020/04/16 16:51:13 UTC

[cassandra-dtest] branch master updated: Fix CQLSH to avoid arguments being evaluated

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

djoshi 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 2b6286b  Fix CQLSH to avoid arguments being evaluated
2b6286b is described below

commit 2b6286b503e1223659ffb9e31b5f73200348e781
Author: Zhao Yang <zh...@gmail.com>
AuthorDate: Tue Mar 31 18:37:51 2020 +0800

    Fix CQLSH to avoid arguments being evaluated
    
    Patch By Zhao Yang; reviewed by Dinesh Joshi and Brandon Williams for CASSANDRA-15660
---
 cqlsh_tests/test_cqlsh.py | 21 +++++++++++++++++++++
 1 file changed, 21 insertions(+)

diff --git a/cqlsh_tests/test_cqlsh.py b/cqlsh_tests/test_cqlsh.py
index e22097e..1de4fcb 100644
--- a/cqlsh_tests/test_cqlsh.py
+++ b/cqlsh_tests/test_cqlsh.py
@@ -2003,6 +2003,27 @@ Tracing session:""")
         assert 0 == len(stderr), stderr
         assert 0 == len(stdout), stdout
 
+    @since('3.0')
+    def test_execute_statement(self):
+        """
+        Test: cqlsh -e "<STATEMENT>"
+        @jira_ticket CASSANDRA-15660
+        """
+        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.cf (id int primary key);")
+
+        stdout, stderr = self.run_cqlsh(node1, cmds="", cqlsh_options=['-e', 'INSERT INTO ks.cf (id) VALUES (0);'])
+
+        assert 0 == len(stderr), stderr
+        assert 0 == len(stdout), stdout
+
+        assert_all(session, "SELECT * FROM ks.cf", [[0]])
+
     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