File tree Expand file tree Collapse file tree 1 file changed +19
-12
lines changed Expand file tree Collapse file tree 1 file changed +19
-12
lines changed Original file line number Diff line number Diff line change @@ -363,23 +363,30 @@ protected virtual IReadOnlyList<JetCommand> SplitCommands()
363
363
var command = ( JetCommand ) ( ( ICloneable ) this ) . Clone ( ) ;
364
364
command . CommandText = commandText ;
365
365
366
- for ( var i = 0 ; i < usedParameterCount ; i ++ )
366
+ if ( _createProcedureExpression . IsMatch ( command . CommandText ) )
367
367
{
368
- command . Parameters . RemoveAt ( 0 ) ;
368
+ command . Parameters . Clear ( ) ;
369
369
}
370
-
371
- var parameterIndices = parser . GetStateIndices (
372
- new [ ] { '@' , '?' } ,
373
- currentCommandStart ,
374
- commandDelimiter - currentCommandStart ) ;
375
-
376
- while ( command . Parameters . Count > parameterIndices . Count )
370
+ else
377
371
{
378
- command . Parameters . RemoveAt ( parameterIndices . Count ) ;
372
+ for ( var i = 0 ; i < usedParameterCount && command . Parameters . Count > 0 ; i ++ )
373
+ {
374
+ command . Parameters . RemoveAt ( 0 ) ;
375
+ }
376
+
377
+ var parameterIndices = parser . GetStateIndices (
378
+ new [ ] { '@' , '?' } ,
379
+ currentCommandStart ,
380
+ commandDelimiter - currentCommandStart ) ;
381
+
382
+ while ( command . Parameters . Count > parameterIndices . Count )
383
+ {
384
+ command . Parameters . RemoveAt ( parameterIndices . Count ) ;
385
+ }
386
+
387
+ usedParameterCount += parameterIndices . Count ;
379
388
}
380
389
381
- usedParameterCount += parameterIndices . Count ;
382
-
383
390
commands . Add ( command ) ;
384
391
}
385
392
You can’t perform that action at this time.
0 commit comments