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()
363363 var command = ( JetCommand ) ( ( ICloneable ) this ) . Clone ( ) ;
364364 command . CommandText = commandText ;
365365
366- for ( var i = 0 ; i < usedParameterCount ; i ++ )
366+ if ( _createProcedureExpression . IsMatch ( command . CommandText ) )
367367 {
368- command . Parameters . RemoveAt ( 0 ) ;
368+ command . Parameters . Clear ( ) ;
369369 }
370-
371- var parameterIndices = parser . GetStateIndices (
372- new [ ] { '@' , '?' } ,
373- currentCommandStart ,
374- commandDelimiter - currentCommandStart ) ;
375-
376- while ( command . Parameters . Count > parameterIndices . Count )
370+ else
377371 {
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 ;
379388 }
380389
381- usedParameterCount += parameterIndices . Count ;
382-
383390 commands . Add ( command ) ;
384391 }
385392
You can’t perform that action at this time.
0 commit comments