Project

General

Profile

Bug #6907

strcoll() and strxfrm() don't seem to agree

Added by Garrett D'Amore about 4 years ago. Updated about 3 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
cmd - userland programs
Start date:
2016-04-12
Due date:
% Done:

100%

Estimated time:
Difficulty:
Bite-size
Tags:
Gerrit CR:

Description

The code at this URL demonstrates the bug (note you need to change MAXXFRMLEN to * 10 though):

http://www.postgresql.org/message-id/attachment/43201/strcolltest.c

Basically, strxfrm() and strcoll() sort results are not matching. This seems to mainly impact strings that fall into the UNDEFINED part of the collation tables.


Files

strcoll-strxfrm-6907.c (2.08 KB) strcoll-strxfrm-6907.c Yuri Pankov, 2017-03-11 06:40 PM

History

#1

Updated by Yuri Pankov about 3 years ago

  • File tc6907.c added
  • Subject changed from strcoll() and strxfrm() don't seem to agree to strxfrm() fails for certain characters
#2

Updated by Yuri Pankov about 3 years ago

  • Category set to cmd - userland programs
  • Status changed from New to In Progress
  • Assignee set to Yuri Pankov
  • % Done changed from 0 to 30
  • Difficulty changed from Medium to Bite-size
  • Tags deleted (needs-triage)
#3

Updated by Yuri Pankov about 3 years ago

  • File deleted (tc6907.c)
#4

Updated by Yuri Pankov about 3 years ago

  • File strcoll-strxfrm-6907.c added
  • Subject changed from strxfrm() fails for certain characters to strcoll() and strxfrm() don't seem to agree

While the locale data problem is related, it's separate issue (now #7962).

I've simplified the linked test case for this one, to exclude the qsort "feature" of being uncertain of the sorting order of equal entries.

#5

Updated by Yuri Pankov about 3 years ago

  • File deleted (strcoll-strxfrm-6907.c)
#7

Updated by Electric Monk about 3 years ago

  • Status changed from In Progress to Closed
  • % Done changed from 30 to 100

git commit efcfb316ebac90ddc614edc285349bc5c55e52bd

commit  efcfb316ebac90ddc614edc285349bc5c55e52bd
Author: Yuri Pankov <yuri.pankov@nexenta.com>
Date:   2017-03-28T04:13:01.000Z

    6907 strcoll() and strxfrm() don't seem to agree
    Reviewed by: Robert Mustacchi <rm@joyent.com>
    Approved by: Dan McDonald <danmcd@omniti.com>

Also available in: Atom PDF