Bug report #10754

Oracle Provider: cannot open a layer without an SRID definition (NULL as SRID).

Added by Médéric RIBREUX over 7 years ago. Updated over 7 years ago.

Status:Closed
Priority:Normal
Assignee:Jürgen Fischer
Category:Data Provider/Oracle
Affected QGIS version:2.4.0 Regression?:No
Operating System: Easy fix?:No
Pull Request or Patch supplied:No Resolution:fixed/implemented
Crashes QGIS or corrupts data:Yes Copied to github as #:19137

Description

Hello,

on QGis 2.4, I am not able to open a layer without an SRID definition in the Oracle metadata table (SRID is declared to NULL in the metadata table). When I try to open such a layer, Qgis just crash even before the SRID selection dialog box opens. The layer is added to the layer panel and after a few seconds, QGis stops working.

This is clearly a functional regression (a true bug) as QGis 2.2 was able to handle such layers without any problem.

I've tried to check or uncheck the "Use estimated metadata" and "Search in metadata" options and it doesn't change anything.

I've made some further tests by listening to the queries sent to Oracle server. QGis crash when trying to get data for the actual bounding-box. Here is the query which failed:
SELECT "GEOCOL","MI_PRINX","NOM","CCATEGORIE","LCATEGORIE","LACTIVITE","LIBVOIE","NUMADRESSE","N_POLE","COMMUNE","DATE_CREATION","DATE_MODIFICATION"
FROM "MMET"."COMMERCE" "featureRequest"
WHERE sdo_filter("GEOCOL",mdsys.sdo_geometry(2003,27562,NULL,mdsys.sdo_elem_info_array(1,1003,3),mdsys.sdo_ordinate_array(289133.85299840883817524,243026.70290453374036588,318784.85986274213064462,263727.93079406826291233)))='TRUE'
AND mod("featureRequest"."GEOCOL".sdo_gtype,100) IN (3,7)

On this query, Oracle server returns an error saying that the window SRID (27562) doesn't match layer SRID (ORA-13208). Then QGis crash...

On v2.2, QGis sent nearly the same query but the SRID of the layer was affected to NULL (which in my case, is the good value):
SELECT "GEOCOL","MI_PRINX","NOM","CCATEGORIE","LCATEGORIE","LACTIVITE","LIBVOIE","NUMADRESSE","N_POLE","COMMUNE","DATE_CREATION","DATE_MODIFICATION"
FROM "MMET"."COMMERCE" "featureRequest"
WHERE sdo_filter("GEOCOL",mdsys.sdo_geometry(2003,NULL,NULL,mdsys.sdo_elem_info_array(1,1003,3),mdsys.sdo_ordinate_array(289133.85299840883817524,243026.70290453374036588,318784.85986274213064462,263727.93079406826291233)))='TRUE'
AND mod("featureRequest"."GEOCOL".sdo_gtype,100) IN (3,7)

I know that declaring a NULL SRID for a layer is far from the best practices on geo-datawarehouse but the last version of QGis was able to open those layers. I believe that the 2.4 version of QGis should be able to do the same. What is strange is also the fact that QGis never asks for the SRID of the layer when trying to open it even if I've checked the "ask for SCR when a layer without SCR is opened" option... In v2.2 it asked for SRID even though we were forced to declare an SRID to "activate" a layer in the list of layers of the Oracle Connector (which was perhaps a bug).

Now, v2.4 just use the SRID declared in the list of layers (so whatever you want) but we can't declare a NULL SRID.

Hope you can fix this bug without too much effort...

History

#1 Updated by Jürgen Fischer over 7 years ago

  • Resolution set to fixed/implemented
  • Status changed from Open to Closed

already done yesterday in 9f777177. You can also specify SRID -1 to work around this.

Also available in: Atom PDF