more careful handling of reconnects in fuzzer

This commit is contained in:
Alexander Kuzmenkov 2021-08-05 14:34:13 +03:00
parent cfcb0e4b22
commit 04da62707e

View File

@ -1449,7 +1449,12 @@ private:
"Error while reconnecting to the server: {}\n",
getCurrentExceptionMessage(true));
assert(!connection->isConnected());
// The reconnection might fail, but we'll still be connected
// in the sense of `connection->isConnected() = true`,
// in case when the requested database doesn't exist.
// Disconnect manually now, so that the following code doesn't
// have any doubts, and the connection state is predictable.
connection->disconnect();
}
}