Project

General

Profile

Actions

Bug #87557

closed

Invalid database result with sql_free_result

Added by Franz Holzinger over 5 years ago. Updated over 5 years ago.

Status:
Closed
Priority:
Should have
Assignee:
-
Category:
-
Target version:
-
Start date:
2019-01-28
Due date:
% Done:

90%

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

Description

After executing a wrong SQL message I get a PHP error:

bugfix error message: Invalid database result detected: function TYPO3\CMS\Core\Database\DatabaseConnection->sql_free_result

        public function exec_SELECTgetRows($select_fields, $from_table, $where_clause, $groupBy = '', $orderBy = '', $limit = '', $uidIndexField = '')
        {
            $this->logDeprecation();
            $res = $this->exec_SELECTquery($select_fields, $from_table, $where_clause, $groupBy, $orderBy, $limit);
            if ($this->sql_error()) {
                $this->sql_free_result($res);
                return null;
            }

Fix:

/typo3_src-8.7.15/typo3/sysext/core/Classes/Database/DatabaseConnection.php:

        if ($this->sql_error()) {
            if ($res !== false) {
                $this->sql_free_result($res);
            }
            return null;
        }

Actions

Also available in: Atom PDF