diff --git a/src/System.Data.Jet/JetCommand.cs b/src/System.Data.Jet/JetCommand.cs index 739cf77..2a8febc 100644 --- a/src/System.Data.Jet/JetCommand.cs +++ b/src/System.Data.Jet/JetCommand.cs @@ -16,8 +16,6 @@ namespace System.Data.Jet private readonly JetConnection _connection; private JetTransaction _transaction; - private Guid? _lastGuid; - private static readonly Regex _createProcedureExpression = new Regex(@"^\s*create\s*procedure\b", RegexOptions.IgnoreCase); private static readonly Regex _topParameterRegularExpression = new Regex(@"(?<=(?:^|\s)select\s+top\s+)(?:@\w+|\?)(?=\s)", RegexOptions.IgnoreCase); private static readonly Regex _selectRowCountRegularExpression = new Regex(@"^\s*select\s*@@rowcount\s*;?\s*$", RegexOptions.IgnoreCase); @@ -455,7 +453,6 @@ namespace System.Data.Jet commandText = FixupIdentity(commandText); commandText = FixupRowCount(commandText); - commandText = FixupGuid(commandText); InnerCommand.CommandText = commandText; } @@ -478,26 +475,6 @@ namespace System.Data.Jet protected virtual string FixupRowCount(string commandText) => FixupGlobalVariablePlaceholder(commandText, "@@rowcount", (outerCommand, placeholder) => outerCommand._connection.RowCount); - protected virtual string FixupGuid(string commandText) - { - // TODO: Fix the following code, that does work only for common scenarios. Use state machine instead. - while (commandText.ToLower() - .Contains("newguid()")) - { - _lastGuid = Guid.NewGuid(); - commandText = Regex.Replace(commandText, @"newguid\(\)", $"{{{_lastGuid}}}", RegexOptions.IgnoreCase); - } - - if (commandText.ToLower() - .Contains("@@guid")) - { - LogHelper.ShowInfo("@@guid = {{{0}}}", _lastGuid); - commandText = Regex.Replace(commandText, "@@guid", $"{{{_lastGuid}}}", RegexOptions.IgnoreCase); - } - - return commandText; - } - protected virtual string FixupGlobalVariablePlaceholder(string commandText, string placeholder, Func valueFactory) where T : struct {