Opened 11 years ago
Closed 8 years ago
#4494 closed enhancement (fixed)
OGR SQL: select distinct and case sensitivity
Reported by: | peifer | Owned by: | warmerdam |
---|---|---|---|
Priority: | normal | Milestone: | |
Component: | OGR_SF | Version: | svn-trunk |
Severity: | normal | Keywords: | ogr sql |
Cc: |
Description
I am not sure if the below result is a feature or a bug but I would have thought that select DISTINCT is case insensitive
ogrinfo My_Shape.shp -sql "select distinct MS from My_Shape" MS (String) = UK MS (String) = Uk MS (String) = uk
Change History (2)
comment:1 by , 11 years ago
Component: | default → OGR_SF |
---|---|
Keywords: | ogr sql added |
Type: | defect → enhancement |
comment:2 by , 8 years ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
By the documentation of OGR SQL dialect http://www.gdal.org/ogr_sql.html DISTINCT is now always case insensitive: "Currently the distinctness test against a string value is case insensitive in OGR SQL"
Closing as fixed, anyone who would prefer to make a case sensitive SELECT DISTINCT can create a new ticket.
Note:
See TracTickets
for help on using tickets.
I've tested with sqlite, postgresql and mysql. The default behaviour is that sqlite and postgresql are case sensitive like OGR SQL, and that MySQL is case insensitive. For all, this can be changed in various ways, mainly through collation or using upper
So I guess OGR current behaviour is acceptable. But it might be nice to have an option to do case insensitive queries.