CQL_FILTER=strToLowerCase(attribute) not returning expected records

Description

I am trying to query (for example) a Geoserver layer based on a PostGIS table with the attribute 'well_owner', 177 of which contain 'NANAIMO' and 6 'Nanaimo'.
I get all of the UPPERCASE features with the following request:
https://192.168.122.12/geoserver/wfs?service=WFS&request=GetFeature&version=2.0.0&typename=waterline:vw_bc_wells&srsname=EPSG:3857&outputFormat=JSON&count=500&PROPERTYNAME=well_owner&CQL_FILTER=well_owner%20like%20%27%25NANAIMO%25%27
...and all of the lowercase if I change the url to:
https://192.168.122.12/geoserver/wfs?service=WFS&request=GetFeature&version=2.0.0&typename=waterline:vw_bc_wells&srsname=EPSG:3857&outputFormat=JSON&count=500&PROPERTYNAME=well_owner&CQL_FILTER=well_owner%20like%20%27%25Nanaimo%25%27
...but if I try to filter the attribute to lower case as follows, I get only four, one of which has 'Nanaimo' and three which have 'NANAIMO'!?
https://192.168.122.12/geoserver/wfs?service=WFS&request=GetFeature&version=2.0.0&typename=waterline:vw_bc_wells&srsname=EPSG:3857&outputFormat=JSON&count=500&CQL_FILTER=strToLowerCase(well_owner)%20like%20%27%25nanaimo%25%27

(and maybe another issue, if I include &PROPERTYNAME in the strToLowerCase filter, I get zero results).

Environment

Ubuntu 14.04.3, Oracle JRE for Server

Status

Assignee

Unassigned

Reporter

Rob Flemming

Triage

None

Fix versions

None

Affects versions

Components

Priority

Medium
Configure