10000 clear old query return value · odd/postgresql-async@7349866 · GitHub
[go: up one dir, main page]

Skip to content

Commit 7349866

Browse files
committed
clear old query return value
1 parent 91deca6 commit 7349866

File tree

2 files changed

+15
-0
lines changed

2 files changed

+15
-0
lines changed

postgresql-async/src/main/scala/com/github/mauricio/async/db/postgresql/PostgreSQLConnection.scala

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -303,6 +303,7 @@ class PostgreSQLConnection
303303

304304
private def succeedQueryPromise(result: QueryResult) {
305305
this.queryResult = None
306+
this.currentQuery = None
306307
this.clearQueryPromise.foreach {
307308
_.success(result)
308309
}

postgresql-async/src/test/scala/com/github/mauricio/async/db/postgresql/PostgreSQLConnectionSpec.scala

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -428,6 +428,20 @@ class PostgreSQLConnectionSpec extends Specification with DatabaseTestHelper {
428428

429429
}
430430

431+
"insert without return after select" in {
432+
433+
withHandler {
434+
handler =>
435+
executeDdl(handler, this.preparedStatementCreate)
436+
executeDdl(handler, this.preparedStatementInsert, 1)
437+
executeDdl(handler, this.preparedStatementSelect, 1)
438+
val result = executeQuery(handler, this.preparedStatementInsert2)
439+
440+
result.rows === None
441+
}
442+
443+
}
444+
431445
}
432446

433447
}

0 commit comments

Comments
 (0)
0