[TASK] DBAL: Log error if query fails 72/35972/2
authorAndreas Fernandez <andreas.fernandez@aspedia.de>
Mon, 12 Jan 2015 09:19:41 +0000 (10:19 +0100)
committerMarkus Klein <klein.t3@reelworx.at>
Mon, 12 Jan 2015 18:50:44 +0000 (19:50 +0100)
Log error if a SELECT query fails on DBAL.

Resolves: #64245
Releases: master, 6.2
Change-Id: I7e263a3a0157200b0570be68d8153e69306acad3
Reviewed-on: http://review.typo3.org/35972
Reviewed-by: Markus Klein <klein.t3@reelworx.at>
Tested-by: Markus Klein <klein.t3@reelworx.at>
typo3/sysext/dbal/Classes/Database/DatabaseConnection.php

index 8e32734..bc50789 100644 (file)
@@ -836,6 +836,9 @@ class DatabaseConnection extends \TYPO3\CMS\Core\Database\DatabaseConnection {
                                        }
                                        $sqlResult = $this->handlerInstance[$this->lastHandlerKey]->_Execute($this->lastQuery);
                                }
+                               if (!is_object($sqlResult)) {
+                                       debug(array($this->lastQuery, $this->sql_error()));
+                               }
                                $sqlResult->TYPO3_DBAL_handlerType = 'adodb';
                                // Setting handler type in result object (for later recognition!)
                                $sqlResult->TYPO3_DBAL_tableList = $ORIG_tableName;