Page MenuHomePhabricator

SQL String functions (like UCASE, UPPER etc) not working
Closed, InvalidPublic

Description

I tried using STRING functions from SQL (like UCASE, UPPER etc) on various iterations of queries http://quarry.wmflabs.org/query/3671 and http://quarry.wmflabs.org/query/3669 but none of these functions seem to work. Is that a Quarry issue, or am I doing something wrong?

Event Timeline

Soni assigned this task to yuvipanda.
Soni raised the priority of this task from to Needs Triage.
Soni updated the task description. (Show Details)
Soni added a project: Quarry.
Soni subscribed.
Aklapper set Security to None.

This is because the fields are stored as raw bytes in a VARBINARY field. You need to cast the field to an encoding before it MySQL knows that the byte for "t" corresponds to the byte for "T".

See http://quarry.wmflabs.org/query/3919 for an example. :)

Note that converting the type of a VARBINARY column (like titles, names, etc) will make it so that you can no longer use the indexes that were built on it. So, these functions are best used in the SELECT clause right before output (as @Soni did in his example queries).

Aklapper renamed this task from SQL String functions not working to SQL String functions (like UCASE, UPPER etc) not working.Jun 8 2015, 9:15 AM