Incorrect SQL generated when mapped geometry object is null

Description

When the mapped geometry property of an object that is being saved is null, the following SQL is being generated by the SQLServer 2008 Spatial dialect:

exec sp_executesql N'INSERT INTO SpatialTable (theGeometryCol) VALUES (@p0)', N'@p0 tinyint', @p0=NULL

when it should be

exec sp_executesql N'INSERT INTO SpatialTable (theGeometryCol) VALUES (@p0)', N'@p0 geometry, @p0=NULL

The resulting error is: "Operand type clash: tinyint is incompatible with geometry"

Example table for this sample is:

CREATE TABLE SpatialTable(
id int IDENTITY (1,1),
theGeometryCol geometry)
GO

Environment

None

Activity

Show:

Ricardo Stuven 
March 8, 2009 at 9:29 PM

Resolved in revision 727.

Aleš Roubíček 
March 5, 2009 at 5:53 AM

It will be corrected after this patch https://nhibernate.jira.com/browse/NHSP-1

Fixed

Details

Assignee

Reporter

Fix versions

Affects versions

Priority

Who's Looking?

Open Who's Looking?
Created December 2, 2008 at 9:21 PM
Updated March 8, 2009 at 9:29 PM
Resolved March 8, 2009 at 9:29 PM
Who's Looking?

Flag notifications