DatabaseConnection does not reset internal state on close()
In connect() we set customConnectSetupExecuted to true, but this state is not reset when closing the connection.
This leads to the situation that when close() is called and after that connect(), that the connection is not properly
initialized any more, because of the early exit when internal state is set to true.
Steps to reproduce:
$connection->close(); $connection->connect(); $connection->select(['*'], 'be_users');
Query is executed
Fatal error: "Call to a member function query() on null"
The issue became more pressing with prioritizing the check for internal state over the parent::connect() call with #82795 respectively: https://review.typo3.org/#/c/54512/2/typo3/sysext/core/Classes/Database/Connection.php
Updated by Helmut Hummel over 2 years ago
- Status changed from Under Review to New
With that fix, the workarounds introduced here: https://review.typo3.org/#/c/57129/19/typo3/sysext/core/Classes/Database/ConnectionPool.php and here: https://github.com/TYPO3/testing-framework/blob/487197e0a178cf28c1fe60f643a34f919260890d/Classes/Core/Testbase.php#L559-L564
can be removed again