Opened 12 years ago

Closed 5 years ago

#4694 closed defect (wontfix)

Oracle driver writes to metadata table when reading

Reported by: marcbria Owned by: warmerdam
Priority: normal Milestone: closed_because_of_github_migration
Component: OGR_SF Version: svn-trunk
Severity: critical Keywords: Oracle, OCI, OGR
Cc: msmitherdc, ilucena, andersmoe

Description (last modified by marcbria)

This bug causes two erroneous things to happen:

  • Connecting to an Oracle database and then disconnecting causes the Oracle driver to write updated extents information to the SDO_GEOM_METADATA_TABLE table for all detected layers.
  • If a user connects using an OCI connection string which specifies a table name but that table either does not exist in the database or is not a spatial layer it is also written to the SDO_GEOM_METADATA_TABLE. If the user subsequently tries to connect and disconnect a duplicate record exception is thrown.

My proposed solution involves modifying ogrocitablelayer.cpp

  • Set the boolean flag bExtentUpdated to false during the OGROCITableLayer() constructor. This way when the connection is destroyed and SyncToDisk() gets called the UpdateLayerExtents() method will not save updated extents to the SDO_GEOM_METADATA_TABLE unless new features have been added or removed.
  • Restore the code in UpdateLayerExtents() which looks for a degenerate extent and does not update the SDO_GEOM_METADATA_TABLE accordingly.

I've made these modifications on my own and they do not appear to have any adverse effects however I don't have a complete understanding of the OGR drivers and I'm not sure what ramifications it may have.

Attachments (1)

ogrocitablelayer.patch (347 bytes ) - added by Nicolas Simon 12 years ago.

Download all attachments as: .zip

Change History (6)

comment:1 by marcbria, 12 years ago

Description: modified (diff)

comment:2 by warmerdam, 12 years ago

Cc: ilucena andersmoe added
Component: defaultOGR_SF

The offending change seems to have been related to #4079.

I'm not sure that I will have time to work on this, so anyone else is welcome to take a crack at it.

comment:3 by ilucena, 12 years ago

If you want to send your changes as a patch we could integrate it on trunk.

comment:4 by Nicolas Simon, 12 years ago

Here is a patch for the constructor

by Nicolas Simon, 12 years ago

Attachment: ogrocitablelayer.patch added

comment:5 by Even Rouault, 5 years ago

Milestone: closed_because_of_github_migration
Resolution: wontfix
Status: newclosed

This ticket has been automatically closed because Trac is no longer used for GDAL bug tracking, since the project has migrated to GitHub. If you believe this ticket is still valid, you may file it to https://github.com/OSGeo/gdal/issues if it is not already reported there.

Note: See TracTickets for help on using tickets.