Bug #86154

DatabaseConnection does not reset internal state on close()

Added by Helmut Hummel over 2 years ago. Updated over 2 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

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
#1

Updated by Helmut Hummel over 2 years ago

  • Related to Bug #82795: Page unavailable handling broken in connectToDB of TypoScriptFrontendController added
#2

Updated by Helmut Hummel over 2 years ago

  • Related to Task #85649: Functional tests without phpunit process isolation added
#3

Updated by Gerrit Code Review over 2 years ago

  • Status changed from New to Under Review

Patch set 1 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/58189

#5

Updated by Gerrit Code Review over 2 years ago

  • Status changed from New to Under Review

Patch set 2 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/58189

#6

Updated by Gerrit Code Review over 2 years ago

Patch set 1 for branch TYPO3_8-7 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/58196

#7

Updated by Nicole Cordes over 2 years ago

  • Status changed from Under Review to Resolved
  • % Done changed from 0 to 100
#8

Updated by Benni Mack over 2 years ago

  • Status changed from Resolved to Closed

Also available in: Atom PDF