You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
What is the bug?
CSV output of entries like "a" b or a " b should, according to RFC 4180, escape them to be """a"" b" and "a "" b", respectively. See section 2.5, https://www.rfc-editor.org/rfc/rfc4180
How can one reproduce the bug?
Steps to reproduce the behavior:
Add values to a test index.
#!/usr/bin/env bash
# Assuming OPENSEARCH_SERVER is the server,
# OPENSEARCH_USER is the host, OPENSEARCH_PASSWORD is the password.
# and the user has the rights to create and query this index.
# Add an entry to the index that has two quotes in it, not at the boundaries.
curl -XPUT "https://${OPENSEARCH_SERVER}:9200/csv_error/_doc/1" \
-H 'Content-Type: application/json' \
-d'{ "field1": "\"a\" b" }' --user "${OPENSEARCH_USER}":"${OPENSEARCH_PASSWORD}"
# Add an entry that has a quote in it.
curl -XPUT "https://${OPENSEARCH_SERVER}:9200/csv_error/_doc/2" \
-H 'Content-Type: application/json' \
-d'{ "field1": "\"a\" b" }' --user "${OPENSEARCH_USER}":"${OPENSEARCH_PASSWORD}"
# Optional, add an entry that has no quotes or commas.
curl -XPUT "https://${OPENSEARCH_SERVER}:9200/csv_error/_doc/3" \
-H 'Content-Type: application/json' \
-d'{ "field1": "a b" }' --user "${OPENSEARCH_USER}":"${OPENSEARCH_PASSWORD}"
# Optional, add an entry that has commas.
curl -XPUT "https://${OPENSEARCH_SERVER}:9200/csv_error/_doc/4" \
-H 'Content-Type: application/json' \
-d'{ "field1": "a, b" }' --user "${OPENSEARCH_USER}":"${OPENSEARCH_PASSWORD}"
What is the bug?
CSV output of entries like
"a" b
ora " b
should, according to RFC 4180, escape them to be"""a"" b"
and"a "" b"
, respectively. See section 2.5, https://www.rfc-editor.org/rfc/rfc4180How can one reproduce the bug?
Steps to reproduce the behavior:
What is the expected behavior?
The CSV output escapes double quotes properly.
What is your host/environment?
Do you have any additional context?
As far as I can tell, the problem appears to be in function
quoteIfRequired
inFlatResponseBase.java
,sql/protocol/src/main/java/org/opensearch/sql/protocol/response/format/FlatResponseBase.java
Line 85 in c1e623d
The text was updated successfully, but these errors were encountered: