@@ -42,11 +42,12 @@ private ParameterParser()
42
42
public static void Parse ( string sqlString , IRecognizer recognizer )
43
43
{
44
44
// TODO: WTF? "CALL"... it may work for ORACLE but what about others RDBMS ? (by FM)
45
- bool hasMainOutputParameter = sqlString . IndexOf ( "call" , StringComparison . Ordinal ) > 0 &&
45
+ var indexOfCall = sqlString . IndexOf ( "call" , StringComparison . Ordinal ) ;
46
+ bool hasMainOutputParameter = indexOfCall > 0 &&
46
47
sqlString . IndexOf ( '?' ) > 0 &&
47
48
sqlString . IndexOf ( '=' ) > 0 &&
48
- sqlString . IndexOf ( '?' ) < sqlString . IndexOf ( "call" , StringComparison . Ordinal ) &&
49
- sqlString . IndexOf ( '=' ) < sqlString . IndexOf ( "call" , StringComparison . Ordinal ) ;
49
+ sqlString . IndexOf ( '?' ) < indexOfCall &&
50
+ sqlString . IndexOf ( '=' ) < indexOfCall ;
50
51
bool foundMainOutputParam = false ;
51
52
52
53
int stringLength = sqlString . Length ;
@@ -59,7 +60,7 @@ public static void Parse(string sqlString, IRecognizer recognizer)
59
60
// check comments
60
61
if ( indx + 1 < stringLength && sqlString . Substring ( indx , 2 ) == "/*" )
61
62
{
62
- var closeCommentIdx = sqlString . IndexOf ( "*/" , indx + 2 ) ;
63
+ var closeCommentIdx = sqlString . IndexOf ( "*/" , indx + 2 , StringComparison . Ordinal ) ;
63
64
recognizer . Other ( sqlString . Substring ( indx , ( closeCommentIdx - indx ) + 2 ) ) ;
64
65
indx = closeCommentIdx + 1 ;
65
66
continue ;
@@ -112,7 +113,7 @@ public static void Parse(string sqlString, IRecognizer recognizer)
112
113
if ( c == ':' )
113
114
{
114
115
// named parameter
115
- int right = StringHelper . FirstIndexOfChar ( sqlString , ParserHelper . HqlSeparators , indx + 1 ) ;
116
+ int right = StringHelper . FirstIndexOfChar ( sqlString , ParserHelper . HqlSeparatorsAsCharArray , indx + 1 ) ;
116
117
int chopLocation = right < 0 ? sqlString . Length : right ;
117
118
string param = sqlString . Substring ( indx + 1 , chopLocation - ( indx + 1 ) ) ;
118
119
recognizer . NamedParameter ( param , indx ) ;
@@ -124,7 +125,7 @@ public static void Parse(string sqlString, IRecognizer recognizer)
124
125
if ( indx < stringLength - 1 && char . IsDigit ( sqlString [ indx + 1 ] ) )
125
126
{
126
127
// a peek ahead showed this as an ejb3-positional parameter
127
- int right = StringHelper . FirstIndexOfChar ( sqlString , ParserHelper . HqlSeparators , indx + 1 ) ;
128
+ int right = StringHelper . FirstIndexOfChar ( sqlString , ParserHelper . HqlSeparatorsAsCharArray , indx + 1 ) ;
128
129
int chopLocation = right < 0 ? sqlString . Length : right ;
129
130
string param = sqlString . Substring ( indx + 1 , chopLocation - ( indx + 1 ) ) ;
130
131
// make sure this "name" is an integral
0 commit comments