PIVOT fails when two elements of IN list only differ by letter case

LabKey Support Forum (Inactive)
PIVOT fails when two elements of IN list only differ by letter case Will Holtz  2015-01-27 14:05
Status: Closed
 
The following query fails with the error message, "Error on line 5: Duplicate pivot column name: Foo."
SELECT
    MAX(userid) as id, displayname
FROM Core.users
GROUP BY displayname
PIVOT id BY displayname IN ('foo', 'Foo')

Without the IN clause it works fine. In modules/query/src/org/labkey/query/sql/QueryPivot.java, the pivotValue variable is of type CaseInsensitiveMapWrapper. Is the case insensitivity needed for some reason? I've worked around this in my project, but wanted to report it.

-Will
 
 
Matthew Bellew responded:  2015-01-27 14:11
Good catch. This is one of those places where underlying database semantics affects the LabKey SQL semantics. This map should probably needs to match the sensitive/insensitive string matching of the underlying database.
 
Jon (LabKey DevOps) responded:  2015-01-27 15:54
Thanks Will,

I've setup a bug for this.

https://www.labkey.org/issues/home/Developer/issues/details.view?issueId=22382

Regards,

Jon