Opened 8 years ago

Closed 8 years ago

#4823 closed enhancement (fixed)

Add support for REGEXP keyword in sqlite/spatialite databases

Reported by: asuchander Owned by: Even Rouault
Priority: normal Milestone: 1.10.0
Component: OGR_SF Version: unspecified
Severity: normal Keywords: sqlite


Currently, in order to use the regex operator with spatialite one needs to load the pcre extension ( . Unfortunately, OGR doesn't provide a mechanism to do this when it loads a sqlite database. That means that SQL queries using REGEXP cannot be used.

This also breaks support for views (such as

'CREATE VIEW wms_view as SELECT "shapefile_4864"."gid", "shapefile_4864"."lease_numb", "shapefile_4864"."sale_numbe", "shapefile_4864"."shape_area", "shapefile_4864"."shape_fid", "shapefile_4864"."the_geom", "shapefile_4864"."web_geometry" FROM "shapefile_4864" WHERE "shapefile_4864"."lease_numb" REGEXP \'(?i)\' || 'Y019'  ORDER BY "shapefile_4864"."gid" ASC'

), which might depend on the regexp operator

Per EvenR:

The source code is so small (and public domain) that it might be simpler to integrate it into OGR itself.

Perhaps it can be integrated as a feature (always support REGEXP in sqlite/spatialite databases?)

Change History (2)

comment:1 Changed 8 years ago by Even Rouault

Component: defaultOGR_SF
Keywords: sqlite added
Owner: changed from warmerdam to Even Rouault
Status: newassigned

comment:2 Changed 8 years ago by Even Rouault

Milestone: 2.0.0
Resolution: fixed
Status: assignedclosed

r24963: "SQLite3: make REGEXP function available by using libpcre (Unix configure support only for now) (#4823)"

r24964: "Add Windows build support for pcre (#4823)"

Note: See TracTickets for help on using tickets.