Project

General

Profile

Actions

Bug #86154

closed

DatabaseConnection does not reset internal state on close()

Added by Helmut Hummel over 5 years ago. Updated over 5 years ago.

Status:
Closed
Priority:
Must have
Assignee:
-
Category:
-
Target version:
-
Start date:
2018-09-05
Due date:
% Done:

100%

Estimated time:
TYPO3 Version:
8
PHP Version:
Tags:
Complexity:
Is Regression:
Yes
Sprint Focus:

Description

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');

Expected result:
Query is executed

Actual result:
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


Related issues 2 (0 open2 closed)

Related to TYPO3 Core - Bug #82795: Page unavailable handling broken in connectToDB of TypoScriptFrontendControllerClosed2017-10-18

Actions
Related to TYPO3 Core - Task #85649: Functional tests without phpunit process isolationClosed2018-07-25

Actions
Actions

Also available in: Atom PDF