Uploaded image for project: 'Commons CSV'
  1. Commons CSV
  2. CSV-168

CsvFormat.nullString should not be escaped

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 1.2
    • Fix Version/s: 1.3
    • Component/s: Parser
    • Labels:
      None

      Description

      Hello,

      Use case: I'm generating MySQL dump files (text format) - for more details check this - http://dev.mysql.com/doc/refman/5.7/en/select-into.html.

      Issue: The value null is represented as "\N". Also by default the escape char is '\N'. The CsvPrinter.printAndEscape method will convert this value into

      "\\N"

      I suggest to modify the CsvPrinter in order to not escape the nullString value - it should be written as it is. I can create a pull request if you want.

      I consider it a minor issue because it can be mitigated by making sure that the escape character is not a part of the nullString - however in my case it means that the LOAD commands should be modified accordingly.

        Attachments

        1. codec-168-gg.diff
          6 kB
          Gary D. Gregory

          Issue Links

            Activity

              People

              • Assignee:
                ggregory Gary D. Gregory
                Reporter:
                cornelcreanga cornel creanga
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: