@@ -37,7 +37,7 @@ public void Execute(int step, int method)
3737 connection . Open ( ) ;
3838 using var command = connection . CreateCommand ( ) ;
3939 command . CommandTimeout = 1 ;
40- command . CommandText = $ "SELECT { 4000 + step } ;";
40+ command . CommandText = $ "SELECT 0, 4000, { step } , 1 ;";
4141 var stopwatch = Stopwatch . StartNew ( ) ;
4242 var ex = Assert . Throws < MySqlException > ( ( ) => s_executeMethods [ method ] ( command ) ) ;
4343 Assert . InRange ( stopwatch . ElapsedMilliseconds , 900 , 1500 ) ;
@@ -59,7 +59,7 @@ public async Task ExecuteAsyncs(int step, int method)
5959 connection . Open ( ) ;
6060 using var command = connection . CreateCommand ( ) ;
6161 command . CommandTimeout = 1 ;
62- command . CommandText = $ "SELECT { 4000 + step } ;";
62+ command . CommandText = $ "SELECT 0, 4000, { step } , 1 ;";
6363 var stopwatch = Stopwatch . StartNew ( ) ;
6464 var ex = await Assert . ThrowsAsync < MySqlException > ( async ( ) => await s_executeAsyncMethods [ method ] ( command , default ) ) ;
6565 Assert . InRange ( stopwatch . ElapsedMilliseconds , 900 , 1500 ) ;
@@ -84,7 +84,7 @@ public void Execute(int step, int method)
8484 connection . Open ( ) ;
8585 using var command = connection . CreateCommand ( ) ;
8686 command . CommandTimeout = 10 ;
87- command . CommandText = $ "SELECT { 4000 + step } ;";
87+ command . CommandText = $ "SELECT 0, 4000, { step } , 1 ;";
8888 var task = Task . Run ( async ( ) =>
8989 {
9090 await Task . Delay ( TimeSpan . FromSeconds ( 1 ) ) ;
@@ -111,7 +111,7 @@ public async Task ExecuteAsync(int step, int method)
111111 connection . Open ( ) ;
112112 using var command = connection . CreateCommand ( ) ;
113113 command . CommandTimeout = 10 ;
114- command . CommandText = $ "SELECT { 4000 + step } ;";
114+ command . CommandText = $ "SELECT 0, 4000, { step } , 1 ;";
115115 var task = Task . Run ( async ( ) =>
116116 {
117117 await Task . Delay ( TimeSpan . FromSeconds ( 1 ) ) ;
@@ -141,7 +141,7 @@ public async Task Test(int step, int method)
141141 connection . Open ( ) ;
142142 using var command = connection . CreateCommand ( ) ;
143143 command . CommandTimeout = 0 ;
144- command . CommandText = $ "SELECT { 4000 + step } ;";
144+ command . CommandText = $ "SELECT 0, 4000, { step } , 1 ;";
145145 using var source = new CancellationTokenSource ( TimeSpan . FromSeconds ( 1 ) ) ;
146146 var stopwatch = Stopwatch . StartNew ( ) ;
147147 var ex = await Assert . ThrowsAsync < OperationCanceledException > ( async ( ) => await s_executeAsyncMethods [ method ] ( command , source . Token ) ) ;
@@ -166,14 +166,13 @@ public void Test(int step, int method)
166166 connection . Open ( ) ;
167167 using var command = connection . CreateCommand ( ) ;
168168 command . CommandTimeout = 1 ;
169- var expected = 100 + step ;
170- command . CommandText = $ "SELECT { expected } ;";
169+ command . CommandText = $ "SELECT 42, 100, { step } , 1;";
171170 var stopwatch = Stopwatch . StartNew ( ) ;
172171 var result = s_executeMethods [ method ] ( command ) ;
173172 if ( method == 1 )
174173 Assert . Equal ( 0 , result ) ; // ExecuteNonQuery
175174 else
176- Assert . Equal ( expected , result ) ;
175+ Assert . Equal ( 42 , result ) ;
177176 Assert . InRange ( stopwatch . ElapsedMilliseconds , 50 , 250 ) ;
178177 }
179178 }
@@ -188,15 +187,14 @@ public async Task Test(int step, int method)
188187 connection . Open ( ) ;
189188 using var command = connection . CreateCommand ( ) ;
190189 command . CommandTimeout = 0 ;
191- var expected = 100 + step ;
192- command . CommandText = $ "SELECT { expected } ;";
190+ command . CommandText = $ "SELECT 42, 100, { step } , 1;";
193191 using var source = new CancellationTokenSource ( TimeSpan . FromSeconds ( 1 ) ) ;
194192 var stopwatch = Stopwatch . StartNew ( ) ;
195193 var result = await s_executeAsyncMethods [ method ] ( command , source . Token ) ;
196194 if ( method == 1 )
197195 Assert . Equal ( 0 , result ) ; // ExecuteNonQuery
198196 else
199- Assert . Equal ( expected , result ) ;
197+ Assert . Equal ( 42 , result ) ;
200198 Assert . InRange ( stopwatch . ElapsedMilliseconds , 50 , 250 ) ;
201199 }
202200 }
@@ -212,7 +210,7 @@ public void Timeout(int method)
212210 connection . Open ( ) ;
213211 using var command = connection . CreateCommand ( ) ;
214212 command . CommandTimeout = 1 ;
215- command . CommandText = $ "SELECT 100;";
213+ command . CommandText = $ "SELECT 0, 100, -1, 1 ;";
216214 var stopwatch = Stopwatch . StartNew ( ) ;
217215 var ex = Assert . Throws < MySqlException > ( ( ) => s_executeMethods [ method ] ( command ) ) ;
218216 Assert . InRange ( stopwatch . ElapsedMilliseconds , 900 , 1500 ) ;
@@ -229,10 +227,10 @@ public void NoTimeout(int method)
229227 connection . Open ( ) ;
230228 using var command = connection . CreateCommand ( ) ;
231229 command . CommandTimeout = 1 ;
232- command . CommandText = $ "SELECT 100;";
230+ command . CommandText = $ "SELECT 42, 100, -1, 1 ;";
233231 var stopwatch = Stopwatch . StartNew ( ) ;
234232 var result = s_executeMethods [ method ] ( command ) ;
235- Assert . Equal ( 100 , result ) ;
233+ Assert . Equal ( 42 , result ) ;
236234 Assert . InRange ( stopwatch . ElapsedMilliseconds , 1100 , 1500 ) ;
237235 }
238236 }
@@ -248,7 +246,7 @@ public async Task Timeout(int method)
248246 connection . Open ( ) ;
249247 using var command = connection . CreateCommand ( ) ;
250248 command . CommandTimeout = 1 ;
251- command . CommandText = $ "SELECT 100;";
249+ command . CommandText = $ "SELECT 0, 100, -1, 1 ;";
252250 var stopwatch = Stopwatch . StartNew ( ) ;
253251 var ex = await Assert . ThrowsAsync < MySqlException > ( async ( ) => await s_executeAsyncMethods [ method ] ( command , default ) ) ;
254252 Assert . InRange ( stopwatch . ElapsedMilliseconds , 900 , 1500 ) ;
@@ -265,10 +263,10 @@ public async Task NoTimeout(int method)
265263 connection . Open ( ) ;
266264 using var command = connection . CreateCommand ( ) ;
267265 command . CommandTimeout = 1 ;
268- command . CommandText = $ "SELECT 100;";
266+ command . CommandText = $ "SELECT 42, 100, -1, 1 ;";
269267 var stopwatch = Stopwatch . StartNew ( ) ;
270268 var result = await s_executeAsyncMethods [ method ] ( command , default ) ;
271- Assert . Equal ( 100 , result ) ;
269+ Assert . Equal ( 42 , result ) ;
272270 Assert . InRange ( stopwatch . ElapsedMilliseconds , 1100 , 1500 ) ;
273271 }
274272 }
@@ -283,7 +281,7 @@ public void Test(int step, int method)
283281 connection . Open ( ) ;
284282 using var command = connection . CreateCommand ( ) ;
285283 command . CommandTimeout = 1 ;
286- command . CommandText = $ "SELECT { 10000 + step } ;";
284+ command . CommandText = $ "SELECT 0, 10000, { step } , 0 ;";
287285 var stopwatch = Stopwatch . StartNew ( ) ;
288286 var ex = Assert . Throws < MySqlException > ( ( ) => s_executeMethods [ method ] ( command ) ) ;
289287 Assert . InRange ( stopwatch . ElapsedMilliseconds , 2900 , 3500 ) ;
@@ -305,7 +303,7 @@ public async Task Test(int step, int method)
305303 connection . Open ( ) ;
306304 using var command = connection . CreateCommand ( ) ;
307305 command . CommandTimeout = 1 ;
308- command . CommandText = $ "SELECT { 10000 + step } ;";
306+ command . CommandText = $ "SELECT 0, 10000, { step } , 0 ;";
309307 var stopwatch = Stopwatch . StartNew ( ) ;
310308 var ex = await Assert . ThrowsAsync < MySqlException > ( async ( ) => await s_executeAsyncMethods [ method ] ( command , default ) ) ;
311309 Assert . InRange ( stopwatch . ElapsedMilliseconds , 2900 , 3500 ) ;
@@ -328,7 +326,7 @@ public void Execute(int step, int method)
328326 connection . Open ( ) ;
329327 using var command = connection . CreateCommand ( ) ;
330328 command . CommandTimeout = 1 ;
331- command . CommandText = $ "SELECT { 10000 + step } ;";
329+ command . CommandText = $ "SELECT 0, 10000, { step } , 0 ;";
332330 var stopwatch = Stopwatch . StartNew ( ) ;
333331 var ex = Assert . Throws < MySqlException > ( ( ) => s_executeMethods [ method ] ( command ) ) ;
334332 Assert . InRange ( stopwatch . ElapsedMilliseconds , 900 , 1500 ) ;
@@ -348,7 +346,7 @@ public async Task ExecuteAsync(int step, int method)
348346 connection . Open ( ) ;
349347 using var command = connection . CreateCommand ( ) ;
350348 command . CommandTimeout = 1 ;
351- command . CommandText = $ "SELECT { 10000 + step } ;";
349+ command . CommandText = $ "SELECT 0, 10000, { step } , 0 ;";
352350 var stopwatch = Stopwatch . StartNew ( ) ;
353351 var ex = await Assert . ThrowsAsync < MySqlException > ( async ( ) => await s_executeAsyncMethods [ method ] ( command , default ) ) ;
354352 Assert . InRange ( stopwatch . ElapsedMilliseconds , 900 , 1500 ) ;
0 commit comments