SCM

[#1010854] Error with named parameter inmediately followed by PostgreSQL type casting

View Trackers | Bugs | Download .csv | Monitor

Date:
2010-07-21 11:52
Priority:
3
State:
Open
Submitted by:
Paco Calvo (pac)
Assigned to:
Nobody (None)
Npgsql Version:
2.0.9
Category:
Group:
Resolution:
None
Summary:
Error with named parameter inmediately followed by PostgreSQL type casting

Detailed description
Executing a parameterized query for PostGis "select field from table where geometry && st_setsrid(:box::box2d, :srid)", where the first parameter "box" is casted to type box2d, emits this exception's message and callstack:

Parameter box not found in query.
in Npgsql.NpgsqlCommand.ReplaceParameterValue(String result, String parameterName, String paramVal) in C:\projects\Npgsql2\src\Npgsql\NpgsqlCommand.cs:line 2865
in Npgsql.NpgsqlCommand.GetParseCommandText() en C:\projects\Npgsql2\src\Npgsql\NpgsqlCommand.cs:line 2525
in Npgsql.NpgsqlCommand.Prepare() in C:\projects\Npgsql2\src\Npgsql\NpgsqlCommand.cs:line 1583
in ...

As a workaround, query "select field from table where (geometry && st_setsrid(:box ::box2d, :srid));" (separating "::box2d" with one space character) works fine.

Followup

No Followups Have Been Posted

Attached Files:

Changes:

No Changes Have Been Made to This Item

Powered By FusionForge