Fix JetCommand regarding CREATE PROCEDURE statements and command splitting. (#87)

pull/88/head
Laurents Meyer 5 years ago committed by GitHub
parent 54b4af5759
commit 1df41e8b43
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -363,23 +363,30 @@ namespace EntityFrameworkCore.Jet.Data
var command = (JetCommand) ((ICloneable) this).Clone();
command.CommandText = commandText;
for (var i = 0; i < usedParameterCount; i++)
if (_createProcedureExpression.IsMatch(command.CommandText))
{
command.Parameters.RemoveAt(0);
command.Parameters.Clear();
}
var parameterIndices = parser.GetStateIndices(
new[] {'@', '?'},
currentCommandStart,
commandDelimiter - currentCommandStart);
while (command.Parameters.Count > parameterIndices.Count)
else
{
command.Parameters.RemoveAt(parameterIndices.Count);
for (var i = 0; i < usedParameterCount && command.Parameters.Count > 0; i++)
{
command.Parameters.RemoveAt(0);
}
var parameterIndices = parser.GetStateIndices(
new[] {'@', '?'},
currentCommandStart,
commandDelimiter - currentCommandStart);
while (command.Parameters.Count > parameterIndices.Count)
{
command.Parameters.RemoveAt(parameterIndices.Count);
}
usedParameterCount += parameterIndices.Count;
}
usedParameterCount += parameterIndices.Count;
commands.Add(command);
}

Loading…
Cancel
Save