mirror of
https://gitea.invidious.io/iv-org/shard-crystal-db.git
synced 2024-08-15 00:53:32 +00:00
ensure the connection is released after exec
avoid releasing connection twice on exec. avoid releasing connection when QueryMethod#query is blockless called.
This commit is contained in:
parent
b5112d9a48
commit
325fa9d4ae
5 changed files with 23 additions and 15 deletions
|
@ -118,4 +118,13 @@ describe DB::Statement do
|
|||
rs.statement.should be(stmt)
|
||||
end
|
||||
end
|
||||
|
||||
it "connection should be released if error occurs during exec" do
|
||||
with_dummy do |db|
|
||||
expect_raises do
|
||||
db.exec "raise"
|
||||
end
|
||||
db.@in_pool.should be_true
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue