Project

General

Profile

Actions

Bug #61229

closed

Missing check in PreparedStatement

Added by Jacob Rasmussen over 10 years ago. Updated about 6 years ago.

Status:
Closed
Priority:
Must have
Assignee:
-
Category:
Database API (Doctrine DBAL)
Target version:
Start date:
2014-08-27
Due date:
% Done:

100%

Estimated time:
TYPO3 Version:
6.2
PHP Version:
5.4
Tags:
Complexity:
no-brainer
Is Regression:
No
Sprint Focus:

Description

If the prepared statement class is used for inserts or updates, the persistence class will trigger a fatal error, as there are no fields in the result set.

A simple fix is needed in the execute method

@@ -363,8 +364,10 @@ class PreparedStatement {
                        // Store the list of fields
                        if ($this->statement instanceof \mysqli_stmt) {
                                $result = $this->statement->result_metadata();
-                               $fields = $result->fetch_fields();
-                               $result->close();
+                               if ($result instanceof \mysqli_result) {
+                                       $fields = $result->fetch_fields();
+                                       $result->close();
+                               }
                        } else {

I will send a patch for TYPO3 6.2 to gerrit shortly

Actions #1

Updated by Gerrit Code Review over 10 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 http://review.typo3.org/32452

Actions #2

Updated by Gerrit Code Review over 10 years ago

Patch set 1 for branch TYPO3_6-2 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at http://review.typo3.org/32457

Actions #3

Updated by Jacob Rasmussen over 10 years ago

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

Updated by Benni Mack about 6 years ago

  • Status changed from Resolved to Closed
Actions

Also available in: Atom PDF