Bugzilla will be upgraded to version 5.0. The upgrade date is tentatively scheduled for 2 December 2018, pending final testing and feedback.
Bug 1434468 - /usr/bin/join displays fields in wrong order for unpairable lines
/usr/bin/join displays fields in wrong order for unpairable lines
Status: CLOSED ERRATA
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: coreutils (Show other bugs)
6.8
Unspecified Unspecified
medium Severity medium
: rc
: ---
Assigned To: Kamil Dudka
Radka Skvarilova
: Patch
Depends On:
Blocks: 1461138 1494481
  Show dependency treegraph
 
Reported: 2017-03-21 10:48 EDT by Renaud Métrich
Modified: 2018-06-19 01:09 EDT (History)
8 users (show)

See Also:
Fixed In Version: coreutils-8.4-47.el6
Doc Type: No Doc Update
Doc Text:
undefined
Story Points: ---
Clone Of:
Environment:
Last Closed: 2018-06-19 01:09:27 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
[PATCH] join: print fields in the correct order for unpaired lines (3.19 KB, patch)
2018-03-09 06:25 EST, Kamil Dudka
no flags Details | Diff


External Trackers
Tracker ID Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2018:1862 None None None 2018-06-19 01:09 EDT

  None (edit)
Description Renaud Métrich 2017-03-21 10:48:24 EDT
Description of problem:

Per join(1) manpage, the "join" utility is supposed to print the "Join field", then remaining fields from FILE1, then remaining fields from FILE2:

"Default FORMAT outputs  the  join  field, the remaining fields from FILE1, the remaining fields from FILE2, all separated by CHAR."

When printing unpairable lines from FILE2 (using the "-v 2" option) and specifying the second field as "Join field" (using the "-2 2" option), the fields are printed in wrong order.


Version-Release number of selected component (if applicable):

coreutils-8.4-46.el6


How reproducible:

Always

Steps to Reproduce:

$ echo "a b" | join -v 2 -2 2 /dev/null -

Actual results:

"a b"

Expected results:

"b a"

Additional info:

The issue is not present on RHEL7 (coreutils-8.22).
The issue happens only when printing unpaired lines of FILE2.

Everything works with FILE1 as shown below:

$ echo "a b" | join -v 1 -1 1  - /dev/null
a b

Joining on second field, displaying unjoinable lines from first file:
$ echo "a b" | join -v 1 -1 2  - /dev/null
b a
Comment 3 Kamil Dudka 2017-04-03 12:47:53 EDT
Sorry for replying late on this!

This bug seems to be fixed as a side effect of the following upstream commit:

http://git.savannah.gnu.org/gitweb/?p=coreutils.git;a=commitdiff;h=v8.9-32-gd4db0cb

I am able to extract the fix out of the above commit...
Comment 9 Jarek Polok 2018-03-09 04:21:00 EST
Any new about release date please ?

Thanks

Jarek
Comment 10 Kamil Dudka 2018-03-09 06:23:05 EST
(In reply to Jarek Polok from comment #9)
> Any new about release date please ?

We do not (and cannot) advertise release dates through Bugzilla.  Anyway, I will attach an unofficial patch for this bug in case you want to rebuild the package on your own.  Needless to say that you are out of support if you take this route.
Comment 11 Kamil Dudka 2018-03-09 06:25 EST
Created attachment 1406245 [details]
[PATCH] join: print fields in the correct order for unpaired lines
Comment 15 errata-xmlrpc 2018-06-19 01:09:27 EDT
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHBA-2018:1862

Note You need to log in before you can comment on or make changes to this bug.