[BUGFIX] Handle different result types in dbal 89/50189/3
authorNicole Cordes <typo3@cordes.co>
Tue, 11 Oct 2016 19:56:42 +0000 (21:56 +0200)
committerMarkus Klein <markus.klein@typo3.org>
Sat, 12 Nov 2016 17:19:15 +0000 (18:19 +0100)
Due to multiple SQL compilers the return type is mixed between strings
and arrays. To be able to run both the
\TYPO3\CMS\Dbal\Database\DatabaseConnection::admin_query should care
about arrays.

Resolves: #78250
Releases: 7.6
Change-Id: Ib9b3e8cb3d98e4556257331a720aeaa49db0b2cd
Reviewed-on: https://review.typo3.org/50189
Tested-by: TYPO3com <no-reply@typo3.com>
Reviewed-by: Andreas Fernandez <typo3@scripting-base.de>
Reviewed-by: Wouter Wolters <typo3@wouterwolters.nl>
Tested-by: Wouter Wolters <typo3@wouterwolters.nl>
Reviewed-by: Markus Klein <markus.klein@typo3.org>
Tested-by: Markus Klein <markus.klein@typo3.org>
typo3/sysext/dbal/Classes/Database/DatabaseConnection.php

index 451c340..3b1e4ae 100644 (file)
@@ -3027,7 +3027,7 @@ class DatabaseConnection extends \TYPO3\CMS\Core\Database\DatabaseConnection
             case 'native':
                 // Compiling query:
                 $compiledQuery = $this->SQLparser->compileSQL($this->lastParsedAndMappedQueryArray);
-                if (in_array($this->lastParsedAndMappedQueryArray['type'], ['INSERT', 'DROPTABLE', 'ALTERTABLE'])) {
+                if (!is_array($compiledQuery)) {
                     $result = $this->query($compiledQuery);
                 } else {
                     $result = $this->query($compiledQuery[0]);