packages feed

pqi-conformance 1.0.13.0 → 1.0.14.0

raw patch · 3 files changed

+20/−3 lines, 3 filesPVP ok

version bump matches the API change (PVP)

API changes (from Hackage documentation)

Files

CHANGELOG.md view
@@ -1,3 +1,9 @@+# v1.0.14.0++## Non-breaking++- Extended the lost-connection scenario (`getResult`, `exec` and `execParams`) to observe the rest of the connection state that a caller reads after the loss: `transactionStatus`, `pipelineStatus`, `isBusy` and whether `socket` is still there. Found `pqi-native` diverging in two of them in every cell: `transactionStatus` stayed `TransIdle` (or whatever the last `ReadyForQuery` said) where `libpq`'s `PQtransactionStatus` reports `PQTRANS_UNKNOWN` for any connection that is not `CONNECTION_OK`, and `socket` returned the number of the closed descriptor (`Just (-1)`) where `PQsocket` returns `-1` once `pqDropConnection` has closed it, i.e. `Nothing`. `pipelineStatus` and `isBusy` agree: `libpq` leaves the pipeline status as it was and `PQisBusy` is `False` once the asynchronous status is back at idle. Only whether the socket is present is compared, not its number, which differs between adapters.+ # v1.0.13.0  ## Non-breaking
pqi-conformance.cabal view
@@ -1,6 +1,6 @@ cabal-version: 3.0 name: pqi-conformance-version: 1.0.13.0+version: 1.0.14.0 category: Database, PostgreSQL, Testing synopsis: Differential conformance tests for pqi adapters description:
src/library/Pqi/Conformance/Scenario/LostConnection.hs view
@@ -209,18 +209,29 @@       _ -> False  -- | The same handle, used again: a new command, then what the connection--- says about itself.+-- says about itself. Besides @status@ and @errorMessage@ that is every piece+-- of connection state that a lost connection leaves a caller to read:+-- @transactionStatus@, @pipelineStatus@, @isBusy@ and whether there is still+-- a @socket@ (its number is not compared: it differs between adapters). reuse :: Pqi.Connection -> IO [String] reuse connection = do   sent <- bounded (Pqi.sendQuery connection "select 1")   message <- bounded (Pqi.errorMessage connection)   result <- bounded (Pqi.getResult connection >>= traverse observeResult)   status <- bounded (Pqi.status connection)+  transactionStatus <- bounded (Pqi.transactionStatus connection)+  pipelineStatus <- bounded (Pqi.pipelineStatus connection)+  busy <- bounded (Pqi.isBusy connection)+  socket <- bounded (Pqi.socket connection)   pure     [ "afterwards, sendQuery: " <> renderCall show sent,       "afterwards, errorMessage: " <> renderCall show message,       "afterwards, getResult: " <> renderCall renderMaybeResult result,-      "afterwards, status: " <> renderCall show status+      "afterwards, status: " <> renderCall show status,+      "afterwards, transactionStatus: " <> renderCall show transactionStatus,+      "afterwards, pipelineStatus: " <> renderCall show pipelineStatus,+      "afterwards, isBusy: " <> renderCall show busy,+      "afterwards, socket: " <> renderCall (show . fmap (const ())) socket     ]  -- | What the victim saw, one line per observation.