Opened 11 years ago

Closed 11 years ago

Last modified 11 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 by tamas, 11 years ago

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 by tamas, 11 years ago

Resolution: fixed
Status: newclosed

Fixed in r25558

comment:3 by Even Rouault, 11 years ago

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"));

in reply to:  3 comment:4 by tamas, 11 years ago

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.