Menu

#353 Exporting empty strings as CSV gives \N

GIT
closed-fixed
5
2010-08-26
2009-03-27
No

When exporting the result of a query as CSV, empty strings and NULL are treated the same way, and they result in "\N" in the output. The issue can be reproduced in 4.2.2 by executing these the following two queries with the option "Paginate results" and immediately afterwards choosing "download" and then selecting CSV as the format.

Query 1:

SELECT '';

Query 2:

SELECT NULL;

Both examples send a CSV file with the contents:

"?column?"
"\N"

The problem is in dataexport.php in all lines that contain this loose comparison:

$v == null

Please use the strict comparison operator to fix it:

$v === null

Discussion

  • J.Guillaume (ioguix) de Rorthais

    Hey,

    I just fixed the bug in our current dev tree.

    You can download a snapshot of our current dev tree here :

    http://github.com/xzilla/phppgadmin

    Thanks for the report !

     
  • J.Guillaume (ioguix) de Rorthais

    • milestone: 897043 --> GIT
    • assigned_to: nobody --> ioguix
    • status: open --> closed-fixed
     

Log in to post a comment.