Opened 7 years ago

Closed 7 years ago

Last modified 7 years ago

#4967 closed enhancement (fixed)

MSSQL driver should utilize MSSQL catalog if geometry_colums doesn't exist

Reported by: tamas Owned by: tamas
Priority: normal Milestone: 1.10.0
Component: default Version: unspecified
Severity: normal Keywords:
Cc:

Description


Change History (4)

comment:1 Changed 7 years ago by tamas

Also:

  • Use lazy initialization of layer definition to eliminate the need of querying for each table
  • Look up spatial reference by srid if spatial_ref_sys metadata table doesn’t exist

comment:2 Changed 7 years ago by tamas

Resolution: fixed
Status: newclosed

Fixed in r25558

comment:3 Changed 7 years ago by Even Rouault

I find the following line particularly suspicious :

bUseGeometryColumns = !CSLTestBoolean(CPLGetConfigOption("MSSQLSPATIAL_USE_GEOMETRY_COLUMNS", "NO"));

I guess it only works when MSSQLSPATIAL_USE_GEOMETRY_COLUMNS isn't set. But if someone sets MSSQLSPATIAL_USE_GEOMETRY_COLUMNS to NO, bUseGeometryColumns will be TRUE.

So I'd suggest removing the double negation : bUseGeometryColumns = CSLTestBoolean(CPLGetConfigOption("MSSQLSPATIAL_USE_GEOMETRY_COLUMNS", "YES"));

comment:4 in reply to:  3 Changed 7 years ago by tamas

Replying to rouault:

I find the following line particularly suspicious :

bUseGeometryColumns = !CSLTestBoolean(CPLGetConfigOption("MSSQLSPATIAL_USE_GEOMETRY_COLUMNS", "NO"));

I guess it only works when MSSQLSPATIAL_USE_GEOMETRY_COLUMNS isn't set. But if someone sets MSSQLSPATIAL_USE_GEOMETRY_COLUMNS to NO, bUseGeometryColumns will be TRUE.

So I'd suggest removing the double negation : bUseGeometryColumns = CSLTestBoolean(CPLGetConfigOption("MSSQLSPATIAL_USE_GEOMETRY_COLUMNS", "YES"));

You might be true. Changed this way

Note: See TracTickets for help on using tickets.