File tree 1 file changed +32
-2
lines changed
mysql-async/src/test/scala/com/github/mauricio/async/db/mysql
1 file changed +32
-2
lines changed Original file line number Diff line number Diff line change @@ -245,8 +245,6 @@ class PreparedStatementsSpec extends Specification with ConnectionHelper {
245
245
246
246
" read a timestamp with microseconds" in {
247
247
248
-
249
-
250
248
val create =
251
249
""" CREATE TEMPORARY TABLE posts (
252
250
id INT NOT NULL AUTO_INCREMENT,
@@ -346,6 +344,38 @@ class PreparedStatementsSpec extends Specification with ConnectionHelper {
346
344
}
347
345
}
348
346
347
+ " bind parameters on a prepared statement with limit" in {
348
+
349
+ val create = """ CREATE TEMPORARY TABLE posts (
350
+ | id INT NOT NULL AUTO_INCREMENT,
351
+ | some_text TEXT not null,
352
+ | primary key (id) )""" .stripMargin
353
+
354
+ val insert = " insert into posts (some_text) values (?)"
355
+ val select = " select * from posts limit 100"
356
+
357
+ withConnection {
358
+ connection =>
359
+ executeQuery(connection, create)
360
+
361
+ 1 .until(10 ).foreach { index =>
362
+ executePreparedStatement(connection, insert, " this is some text here" )
363
+ }
364
+
365
+ val row = executeQuery(connection, select).rows.get(0 )
366
+
367
+ row(" id" ) === 1
368
+ row(" some_text" ) === " this is some text here"
369
+
370
+ val queryRow = executeQuery(connection, select).rows.get(0 )
371
+
372
+ queryRow(" id" ) === 1
373
+ queryRow(" some_text" ) === " this is some text here"
374
+
375
+
376
+ }
377
+ }
378
+
349
379
}
350
380
351
381
}
You can’t perform that action at this time.
0 commit comments