[BUGFIX] DBAL native mode: Database compare fails 31/29631/3
authorMarkus Klein <klein.t3@mfc-linz.at>
Thu, 24 Apr 2014 08:35:39 +0000 (10:35 +0200)
committerJigal van Hemert <jigal.van.hemert@typo3.org>
Fri, 2 May 2014 07:36:24 +0000 (09:36 +0200)
Database compare does not work with DBAL in native mode
as the ALTER TABLE statement is not processed correctly.
The SQL statement is wrongly interpreted as array, but is of
type string.

Fix this by extending the check which determines the type.

Resolves: #58147
Releases: 6.2
Change-Id: I467494c633b8af9e5a17dce64f071667dd985177
Reviewed-on: https://review.typo3.org/29631
Reviewed-by: Xavier Perseguers
Tested-by: Xavier Perseguers
Reviewed-by: Jigal van Hemert
Tested-by: Jigal van Hemert
typo3/sysext/dbal/Classes/Database/DatabaseConnection.php

index d1b5288..6c19ef5 100644 (file)
@@ -2912,7 +2912,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'], array('INSERT', 'DROPTABLE'))) {
+                               if (in_array($this->lastParsedAndMappedQueryArray['type'], array('INSERT', 'DROPTABLE', 'ALTERTABLE'))) {
                                        $result = $this->query($compiledQuery);
                                } else {
                                        $result = $this->query($compiledQuery[0]);