Opened 4 months ago

Closed 4 months ago

Last modified 4 months ago

#7149 closed defect (fixed)

NULL query using SQLITE dialect causes OGR to fail with "ERROR 1 Unhandled constraint operator : 70"

Reported by: snorris Owned by: warmerdam
Priority: normal Milestone: 2.2.3
Component: default Version: unspecified
Severity: normal Keywords:


ogrinfo and ogr2ogr fail with this message when using -dialect "SQLITE" and SQL conditions IS NULL or IS NOT NULL

$ wget
$ unzip
$ ogrinfo stations.shp -sql "SELECT * FROM stations WHERE name IS NOT NULL" -dialect "SQLITE"
INFO: Open of `stations.shp'
      using driver `ESRI Shapefile' successful.
ERROR 1: In ExecuteSQL(): sqlite3_step(SELECT * FROM stations WHERE name IS NOT NULL):
  Unhandled constraint operator : 70
$ ogrinfo --version
GDAL 2.2.1, released 2017/06/23
$ brew info gdal2
osgeo/osgeo4mac/gdal2: stable 2.2.2 (bottled), HEAD [keg-only]
GDAL: Geospatial Data Abstraction Library
/usr/local/Cellar/gdal2/2.2.1_3 (243 files, 44.7MB) *
  Built from source on 2017-09-20 at 15:26:50 with: --with-complete --with-libkml --with-unsupported --with-postgresql
==> Dependencies
Required: libpng ✘, jpeg ✔, giflib ✔, libtiff ✘, libgeotiff ✔, proj ✔, geos ✔, sqlite ✔, pcre ✔, freexl ✔, libspatialite ✔
Optional: postgresql ✘, mysql ✘, ogdi ✘, armadillo ✘, sfcgal ✔
==> Requirements
Build: java >= 1.7 ✔
Optional: java >= 1.7 ✔
==> Options
  Build with Armadillo accelerated TPS transforms.
  Use additional Homebrew libraries to provide more drivers.
  Build with java support
  Build with Google's libkml driver (requires libkml-dev >= 1.3)
  Build with Access MDB driver (requires Java 1.6+ JDK/JRE, from Apple or Oracle).
  Build with mysql support
  Build with OGDI support (consider gdal2-ogdi instead)
  Build with OpenCL acceleration.
  Build with postgresql support
  Build with internal qhull libary support
  Build with CGAL C++ wrapper support
  Build the swig java bindings
  Allow configure to drag in any library it can find. Invoke this at your own risk.
  Build without Geographic Network Model support
  Install HEAD version
==> Caveats
Plugins for this version of GDAL/OGR, generated by other formulae, should
be symlinked to the following directory:
You may need to set the following enviroment variable:
  export GDAL_DRIVER_PATH=/usr/local/lib/gdalplugins
PYTHON BINDINGS are now built in a separate formula: gdal2-python
This formula is keg-only, which means it was not symlinked into /usr/local,
because older version of gdal is in main tap and installs similar components.

Change History (4)

comment:1 Changed 4 months ago by snorris

Just tested the same data and command on ubuntu (GDAL 2.13), and it works fine there. Perhaps it is not a gdal bug after all - but any suggestions for what might be going on would be most welcome.


comment:2 Changed 4 months ago by Even Rouault

Resolution: fixed
Status: newclosed

In 40713:

SQLite dialect: support SQLite 3.21, and LIKE, <>, IS NOT, IS NOT NULL, IS NULL and IS operators (fixes #7149)

comment:3 Changed 4 months ago by Even Rouault

In 40714:

SQLite dialect: support SQLite 3.21, and LIKE, <>, IS NOT, IS NOT NULL, IS NULL and IS operators (fixes #7149)

comment:4 Changed 4 months ago by Even Rouault

Milestone: 2.2.3
Note: See TracTickets for help on using tickets.