CSV consecutive newline bug

Started by Andrew Dunstanover 21 years ago4 messagespatches
Jump to latest
#1Andrew Dunstan
andrew@dunslane.net

I have just been alerted to a bug in the 8.0 handling of embedded
newlines in CSV data. Basically it barfs on consecutive newlines. The
attached patch for 8.0 appears to fix it. The bug isn't present in the
HEAD branch, and I'm wondering if we should not backpatch the HEAD
multiline patch rather than applying this. OTOH, applying this patch
would probably be more in keeping with our conservative approach to
changes to stable branches, I guess.

cheers

andrew

Attachments:

copy2nl.patchtext/x-patch; name=copy2nl.patchDownload+1-0
#2Neil Conway
neilc@samurai.com
In reply to: Andrew Dunstan (#1)
Re: CSV consecutive newline bug

Andrew Dunstan wrote:

I have just been alerted to a bug in the 8.0 handling of embedded
newlines in CSV data. Basically it barfs on consecutive newlines. The
attached patch for 8.0 appears to fix it. The bug isn't present in the
HEAD branch, and I'm wondering if we should not backpatch the HEAD
multiline patch rather than applying this.

Is there a particular reason to backport the larger patch? As a general
rule I'm inclined to apply minimally-invasive fixes to stable branches,
but I don't know the code in question, so perhaps there is some reason
to make an exception in this case.

Also, a regression test for this bug would be nice :)

-Neil

#3Andrew Dunstan
andrew@dunslane.net
In reply to: Neil Conway (#2)
Re: CSV consecutive newline bug

Neil Conway wrote:

Andrew Dunstan wrote:

I have just been alerted to a bug in the 8.0 handling of embedded
newlines in CSV data. Basically it barfs on consecutive newlines. The
attached patch for 8.0 appears to fix it. The bug isn't present in
the HEAD branch, and I'm wondering if we should not backpatch the
HEAD multiline patch rather than applying this.

Is there a particular reason to backport the larger patch? As a
general rule I'm inclined to apply minimally-invasive fixes to stable
branches, but I don't know the code in question, so perhaps there is
some reason to make an exception in this case.

Well, if I'd known we were as far away from a release as we turned out
to be at the time the original multiline limitation was discovered, I
would have submitted a patch for inclusion in 8.0. Never mind -
hindsight doesn't help much. Just go with the tiny patch. If anyone
wants the later fix it's very easy to get, because it was the first
patch applied after 8.0 branched. Just dropping in the later version of
copy.c should work.

Also, a regression test for this bug would be nice :)

regression patch against 8.0 branch attached.

cheers

andrew

Attachments:

nlregress.patchtext/x-patch; name=nlregress.patchDownload+14-0
#4Neil Conway
neilc@samurai.com
In reply to: Andrew Dunstan (#3)
Re: CSV consecutive newline bug

Andrew Dunstan wrote:

regression patch against 8.0 branch attached.

The tiny patch has been applied to REL8_0_STABLE, and the regression
test patch has been applied to both REL8_0_STABLE and HEAD. Thanks for
the patches.

-Neil