GNU bug report logs -
#12019
join command - wrong column moved to start of line with the -v2 option
Previous Next
Full log
View this message in rfc822 format
[Message part 1 (text/plain, inline)]
Your message dated Mon, 23 Jul 2012 10:01:05 +0100
with message-id <500D12D1.40704 <at> draigBrady.com>
and subject line Re: bug#12019: join command - wrong column moved to start of line with
has caused the debbugs.gnu.org bug report #12019,
regarding join command - wrong column moved to start of line with the -v2 option
to be marked as done.
(If you believe you have received this mail in error, please contact
help-debbugs <at> gnu.org.)
--
12019: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=12019
GNU Bug Tracking System
Contact help-debbugs <at> gnu.org with problems
[Message part 2 (message/rfc822, inline)]
[Message part 3 (text/plain, inline)]
Hello Maintainer,
I am using join v8.5 from debian squeeze.
When using the -v2 option with different join fields in files 1 and 2, the
join field which gets moved to the beginning of the result lines is the one
identified by the -1 option, not the one identified by the -2 option.
Here are my test files:
==== file a ====
axx111 keyX axx222
ayy111 keyY ayy222
==== file b ====
xxx111 xxx222 keyX xxx333
zzz111 zzz222 keyZ zzz333
now, the command:
join -v 2 -1 2 -2 3 a b
produces
==== wrong output ====
zzz222 zzz111 keyZ zzz333
instead of
==== expected output ====
keyZ zzz111 zzz222 zzz333
The two following other commands work as expected:
join -v 1 -1 2 -2 3 a b
join -1 2 -2 3 a b
I did not find this problem in your database - or am I mistaken ?
Best regards,
--
Jean-Pierre Tosoni
[Message part 4 (text/html, inline)]
[Message part 5 (message/rfc822, inline)]
[Message part 6 (text/plain, inline)]
On 07/22/2012 12:22 AM, Alan Curry wrote:
> Eric Blake writes:
>>
>> On 07/21/2012 12:20 PM, Jean-Pierre Tosoni wrote:
>>> Hello Maintainer,
>>> =20
>>> I am using join v8.5 from debian squeeze.
>>> =20
>>
>>> now, the command:
>>> join -v 2 -1 2 -2 3 a b
>>> produces
>>> =3D=3D=3D=3D wrong output =3D=3D=3D=3D
>>> zzz222 zzz111 keyZ zzz333
>>
>> I tried reproducing this with coreutils 8.17:
>>
>> $ cat a b
>> axx111 keyX axx222
>> ayy111 keyY ayy222
>> xxx111 xxx222 keyX xxx333
>> zzz111 zzz222 keyZ zzz333
>> $ join -v2 -1 2 -2 3 a b
>> keyZ zzz111 zzz222 zzz333
>>
>> but I get the expected order. I don't see a specific mention of a fix
>> for this in NEWS, so I have to wonder if this might be a bug in a
>> debian-specific patch. Can you do some more investigating, such as
>> compiling upstream coreutils to see if the problem still persists for you=
>> ?
>
> It's not a Debian-specific problem. I can reproduce the bug with unaltered
> coreutils 8.9. It was apparently fixed by accident as a side effect of some
> other work on the join program.
>
> commit d4db0cb1827730ed5536c12c0ebd024283b3a4db
> Author: Pádraig Brady <P <at> draigBrady.com>
> Date: Wed Jan 5 11:52:54 2011 +0000
>
> join: add -o 'auto' to output a constant number of fields per line
>
> d4db0cb1827730ed5536c12c0ebd024283b3a4db can be cherry-picked and applied to
> older coreutils to fix the bug. I tested this with upstream 8.9 and Debian's
> 8.5, both applied with fuzz but worked correctly.
>
Thanks for looking into that Alan, and thanks for reporting this Jean-Pierre.
I've installed the attached to document the fix and add a test.
cheers,
Pádraig.
[join-v2-test.diff (text/plain, attachment)]
This bug report was last modified 13 years and 25 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.