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

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


The following commit(s) were added to refs/heads/cassandra-4.1 by this push:
     new 70b95d8098 Restore COPY ... TO STDOUT behavior in cqlsh
70b95d8098 is described below

commit 70b95d80985e9165528e0b22f32fec187098e0ff
Author: Brandon Williams <[email protected]>
AuthorDate: Tue Mar 21 16:07:49 2023 -0500

    Restore COPY ... TO STDOUT behavior in cqlsh
    
    Patch by brandonwilliams; reviewed by adelapena for CASSANDRA-18353
---
 CHANGES.txt                | 1 +
 pylib/cqlshlib/copyutil.py | 7 ++++++-
 2 files changed, 7 insertions(+), 1 deletion(-)

diff --git a/CHANGES.txt b/CHANGES.txt
index 27e7d998f2..7c7290f133 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -1,4 +1,5 @@
 4.1.2
+ * Fix COPY ... TO STDOUT behavior in cqlsh (CASSANDRA-18353)
  * Remove six and Py2SaferScanner merge cruft (CASSANDRA-18354)
  
 
diff --git a/pylib/cqlshlib/copyutil.py b/pylib/cqlshlib/copyutil.py
index 31c881c595..2a8a11d1bf 100644
--- a/pylib/cqlshlib/copyutil.py
+++ b/pylib/cqlshlib/copyutil.py
@@ -86,6 +86,11 @@ def printmsg(msg, eol='\n'):
     sys.stdout.flush()
 
 
+# Keep arguments in sync with printmsg
+def swallowmsg(msg, eol='\n'):
+    None
+
+
 class OneWayPipe(object):
     """
     A one way pipe protected by two process level locks, one for reading and 
one for writing.
@@ -249,7 +254,7 @@ class CopyTask(object):
             DEBUG = True
 
         # do not display messages when exporting to STDOUT unless --debug is 
set
-        self.printmsg = printmsg if self.fname is not None or direction == 
'from' or DEBUG else None
+        self.printmsg = printmsg if self.fname is not None or direction == 
'from' or DEBUG else swallowmsg
         self.options = self.parse_options(opts, direction)
 
         self.num_processes = self.options.copy['numprocesses']


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to