id	summary	reporter	owner	description	type	status	priority	milestone	component	version	severity	resolution	keywords	cc
4261	OGR SQL: another `where' versus `-where' issue	peifer	warmerdam	"When making an inappropriate -where query related to the string type attribute CellCode, ogrinfo gives an error (as expected), but nevertheless returns all features in the dataset, see (1).

When making the same inappropriate query by using -sql ""..."", I only get the error message, no features are returned, as I would expect, see (2)

{{{
(0)

$ cat grid.gmt
# @VGMT1.0 @GPOLYGON
# @R0/20/0/10
# @Je3035
# @NCellCode|EofOrigin|NofOrigin
# @Tstring|integer|integer
# FEATURE_DATA
>
# @D10mE0N0|0|0
# @P
0 0
0 10
10 10
10 0
0 0
>
# @D10mE1N0|10|0
# @P
10 0
10 10
20 10
20 0
10 0

(1)

$ ogrinfo -al -q -geom=no grid.gmt -where CellCode=10mE0N0
ERROR 1: SQL Expression Parsing Error: syntax error

Layer name: grid
OGRFeature(grid):0
  CellCode (String) = 10mE0N0
  EofOrigin (Integer) = 0
  NofOrigin (Integer) = 0

OGRFeature(grid):1
  CellCode (String) = 10mE1N0
  EofOrigin (Integer) = 10
  NofOrigin (Integer) = 0

(2)

$ ogrinfo -q -geom=no grid.gmt -sql ""select * from grid where CellCode=10mE0N0""
ERROR 1: SQL Expression Parsing Error: syntax error
$
}}}
"	defect	closed	normal	1.9.0	OGR_SF	svn-trunk	normal	fixed	OGR_SQL	
