Details
-
Bug
-
Status: Open
-
Minor
-
Resolution: Unresolved
-
DataMapper 1.6.1
-
None
-
None
Description
When inserted a literal questionMark, using variables with # # breaks the parser:
<select id="countrySearch" parameterClass="Core.DataAccess.Table, Core" resultClass="System.Collections.Hashtable">
SELECT * FROM table AS T
WHERE T.id = #Id#
AND
T.Name = '?'
</select>
The error with stacktrace:
System.ArgumentOutOfRangeException: Specified argument was out of the range of valid values.
Parameter name: index
at IBatisNet.DataMapper.Configuration.ParameterMapping.ParameterPropertyCollection.get_Item(Int32 index)
at IBatisNet.DataMapper.Configuration.Statements.PreparedStatementFactory.EvaluateParameterMap()
at IBatisNet.DataMapper.Configuration.Statements.PreparedStatementFactory.Prepare()
at IBatisNet.DataMapper.Configuration.Sql.SimpleDynamic.SimpleDynamicSql.BuildPreparedStatement(ISqlMapSession session, RequestScope request, String sqlStatement)
at IBatisNet.DataMapper.Configuration.Sql.SimpleDynamic.SimpleDynamicSql.GetRequestScope(IMappedStatement mappedStatement, Object parameterObject, ISqlMapSession session)
at IBatisNet.DataMapper.MappedStatements.CachingStatement.ExecuteQueryForList(ISqlMapSession session, Object parameterObject, Int32 skipResults, Int32 maxResults)
at IBatisNet.DataMapper.MappedStatements.CachingStatement.ExecuteQueryForList(ISqlMapSession session, Object parameterObject)
at IBatisNet.DataMapper.SqlMapper.QueryForList(String statementName, Object parameterObject)
Reported similar in Nabble: http://www.nabble.com/Escaping-the-question-mark-td16609896.html