Jens-G commented on PR #4819:
URL: https://github.com/apache/cassandra/pull/4819#issuecomment-4493035294

   ### Code review
   
   Found 1 issue:
   
   1. Backslash doubling in `format_value_text` is unconditional, reintroducing 
the CASSANDRA-21131 bug for CSV export
   
   In the PR's `format_value_text`, the line `escapedval = val.replace('\\', 
'\\\\')` runs unconditionally before the `if escape_control_chars:` guard (line 
485). When `copyutil.py` calls with `escape_control_chars=False` during CSV 
export, literal backslashes in string data are still doubled — e.g. 
`C:\Users\alice` becomes `C:\\Users\\alice` in the CSV. The new tests in 
`test_formatting.py` don't cover this because no test includes a literal `\` 
when testing with `escape_control_chars=False`.
   
   
https://github.com/apache/cassandra/blob/fb55b2ec14dc47eefd8bc8e32d0efc109f52c508/pylib/cqlshlib/formatting.py#L481-L487
   
   🤖 Generated with [Claude Code](https://claude.ai/code)
   
   <sub>- If this code review was useful, please react with 👍. Otherwise, react 
with 👎.</sub>


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


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

Reply via email to