Commit 727ba274 authored by Igor Shuvalov's avatar Igor Shuvalov

Fix improper oledb parameter regex detection

Depends on Issue 174
https://code.google.com/p/dapper-dot-net/issues/detail?id=174
parent 5472d2ab
......@@ -2533,7 +2533,7 @@ private static IEnumerable<PropertyInfo> FilterParameters(IEnumerable<PropertyIn
// look for ? / @ / : *by itself*
static readonly Regex smellsLikeOleDb = new Regex(@"(?<![a-zA-Z0-9_])[?@:](?![a-zA-Z0-9_])", RegexOptions.IgnoreCase | RegexOptions.Multiline | RegexOptions.CultureInvariant | RegexOptions.Compiled),
static readonly Regex smellsLikeOleDb = new Regex(@"(?<![a-zA-Z0-9@_])[?@:](?![a-zA-Z0-9@_])", RegexOptions.IgnoreCase | RegexOptions.Multiline | RegexOptions.CultureInvariant | RegexOptions.Compiled),
literalTokens = new Regex(@"\{=([a-zA-Z0-9_]+)\}", RegexOptions.IgnoreCase | RegexOptions.Multiline | RegexOptions.CultureInvariant | RegexOptions.Compiled);
/// <summary>
......
......@@ -355,5 +355,20 @@ public void Issue22_ExecuteScalar()
k.IsNull();
}
}
public void TestAtEscaping()
{
using (var connection = Program.GetOpenConnection())
{
var id = connection.QueryAsync<int>(@"
create table #atescaping(id int not null);
insert into #atescaping (id) values (1)
declare @@Name int
select @@Name = @Id+1
select @@Name
", new Product { Id = 1 }).Result.Single();
id.IsEqualTo(2);
}
}
}
}
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment