File tree Expand file tree Collapse file tree 1 file changed +17
-0
lines changed Expand file tree Collapse file tree 1 file changed +17
-0
lines changed Original file line number Diff line number Diff line change @@ -34,6 +34,7 @@ testDriver = testGroup "Driver"
34
34
, testCase " Empty query" testEmptyQuery
35
35
, testCase " Query without result" testQueryWithoutResult
36
36
, testCase " Invalid queries" testInvalidBatch
37
+ , testCase " Valid after postgres error" testValidAfterError
37
38
, testCase " Describe statement" testDescribeStatement
38
39
, testCase " Describe statement with no data" testDescribeStatementNoData
39
40
, testCase " Describe empty statement" testDescribeStatementEmpty
@@ -155,6 +156,22 @@ testInvalidBatch = do
155
156
sendBatchAndSync c qs
156
157
checkInvalidResult c $ length qs
157
158
159
+ -- | Connection remains valid even after PostgreSQL returned error on the
160
+ -- previous query.
161
+ testValidAfterError :: IO ()
162
+ testValidAfterError = withConnection $ \ c -> do
163
+ let a = " 5"
164
+ rightQuery = makeQuery1 a
165
+ invalidQuery = Query " SELECT $1" (V. fromList [] ) Text Text NeverCache
166
+ sendBatchAndSync c [invalidQuery]
167
+ checkInvalidResult c 1
168
+ waitReadyForQuery c
169
+
170
+ sendBatchAndSync c [rightQuery]
171
+ r <- readNextData c
172
+ waitReadyForQuery c
173
+ a @=? fromMessage r
174
+
158
175
-- | Describes usual statement.
159
176
testDescribeStatement :: IO ()
160
177
testDescribeStatement = withConnectionCommon $ \ c -> do
You can’t perform that action at this time.
0 commit comments