Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion 2 Dapper/CompiledRegex.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ internal static partial class CompiledRegex
[StringSyntax("Regex")]
#endif
private const string
WhitespaceOrReservedPattern = @"[\s;/\-+*]|^vacuum$",
WhitespaceOrReservedPattern = @"[\s;/\-+*]|^vacuum$|^commit$|^rollback$",
LegacyParameterPattern = @"(?<![\p{L}\p{N}@_])[?@:](?![\p{L}\p{N}@_])", // look for ? / @ / : *by itself* - see SupportLegacyParameterTokens
LiteralTokensPattern = @"(?<![\p{L}\p{N}_])\{=([\p{L}\p{N}_]+)\}", // look for {=abc} to inject member abc as a literal
PseudoPositionalPattern = @"\?([\p{L}_][\p{L}\p{N}_]*)\?"; // look for ?abc? for the purpose of subst back to ? using member abc
Expand Down
6 changes: 4 additions & 2 deletions 6 tests/Dapper.Tests/ProcedureTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@ public void TestDateTime2PrecisionPreservedInDynamicParameters()
{
const string tempSPName = "#" + nameof(TestDateTime2PrecisionPreservedInDynamicParameters);

DateTime datetimeDefault = new DateTime(2000, 1, 1, 0, 0, 0, DateTimeKind.Utc);
DateTime datetimeDefault = new(2000, 1, 1, 0, 0, 0, DateTimeKind.Utc);
DateTime datetime2 = datetimeDefault.AddTicks(1); // Add 100 ns

Assert.True(datetimeDefault < datetime2);
Expand Down Expand Up @@ -252,7 +252,7 @@ public void TestDateTime2LosePrecisionInDynamicParameters(DbType? dbType)
{
const string tempSPName = "#" + nameof(TestDateTime2LosePrecisionInDynamicParameters);

DateTime datetimeDefault = new DateTime(2000, 1, 1, 0, 0, 0, DateTimeKind.Utc);
DateTime datetimeDefault = new(2000, 1, 1, 0, 0, 0, DateTimeKind.Utc);
DateTime datetime2 = datetimeDefault.AddTicks(1); // Add 100 ns

Assert.True(datetimeDefault < datetime2);
Expand Down Expand Up @@ -331,6 +331,8 @@ public async Task Issue1986_AutoProc_Whitespace(string space)
[InlineData("FOO BAR;", CommandType.Text)]
[InlineData("VACUUM", CommandType.Text)]
[InlineData("VACUUM;", CommandType.Text)]
[InlineData("cOmmiT", CommandType.Text)]
[InlineData("rOllbAck", CommandType.Text)]

// comments imply text
[InlineData("foo--bar", CommandType.Text)]
Expand Down
Morty Proxy This is a proxified and sanitized view of the page, visit original site.