Thread: Beta 1.6: Crash on .CSV export of NULL-Values

Beta 1.6: Crash on .CSV export of NULL-Values

From
"Harald Armin Massa"
Date:
Hello,<br /><br />when exporting a query result with 1000 rows , 2 colums (int4 and text), and some NULL values within
thetext column, pgadmin crashes. (phone home crash)<br /><br />This crash does not appear on exporting a smaller subste
ofthe same result also with nulls and only 5, 100 or 200 rows (added a limit clause). <br /><br />Also no crash with
exporting~ 4000 rows with no NULL values.<br /><br />Platform windows xp.<br /><br />Can I specify the problem any
tighter?<br/><br />Harald<br /><br clear="all" /><br />-- <br />GHUM Harald Massa<br />persuadere et programmare <br
/>HaraldArmin Massa<br />Reinsburgstraße 202b<br />70197 Stuttgart<br />0173/9409607<br />-<br />Let's set so double
thekiller delete select all.  

Re: Beta 1.6: Crash on .CSV export of NULL-Values

From
"Dave Page"
Date:
 


From: pgadmin-support-owner@postgresql.org [mailto:pgadmin-support-owner@postgresql.org] On Behalf Of Harald Armin Massa
Sent: 15 September 2006 13:00
To: pgadmin-support@postgresql.org
Subject: [pgadmin-support] Beta 1.6: Crash on .CSV export of NULL-Values

Hello,

when exporting a query result with 1000 rows , 2 colums (int4 and text), and some NULL values within the text column, pgadmin crashes. (phone home crash)

This crash does not appear on exporting a smaller subste of the same result also with nulls and only 5, 100 or 200 rows (added a limit clause).

Also no crash with exporting ~ 4000 rows with no NULL values.
 
 Hi Harald,
 
I've managed to reproduce this - it appears to happen when wxFile::Write encounters characters that it cannot convert to the local charset (it then crashes). I've committed the following change to work around this:
 
When exporting data to the local charset wxFile::Write will crash if it can't convert the data. Check that conversion is possible before writing each row and skip if not. If any failures have occured, tell the user how many, and suggest they use UTF8 instead. Per Harald Armin Massa
 
Would you like an updated .exe to test?
 
Regards, Dave.