[BUGFIX] InstallTool: connect to DBMS before retrieving current schema 37/39937/2
authorMorton Jonuschat <m.jonuschat@mojocode.de>
Wed, 3 Jun 2015 20:59:40 +0000 (22:59 +0200)
committerMarkus Klein <markus.klein@typo3.org>
Sat, 6 Jun 2015 13:29:01 +0000 (15:29 +0200)
SqlSchemaMigrationService needs to explicitly connect to the database
before retrieving the current schema. On native MySQL connections this
happens implicitly when using sql_select_db(), on DBAL a connectDB() is
required.

Resolves: #67286
Releases: master, 6.2
Change-Id: I2c93111f1f6919f31d71b4b46fd353d9a3629dbc
Reviewed-on: http://review.typo3.org/39937
Reviewed-by: Andreas Fernandez <typo3@scripting-base.de>
Reviewed-by: Christian Kuhn <lolli@schwarzbu.ch>
Tested-by: Christian Kuhn <lolli@schwarzbu.ch>
Reviewed-by: Markus Klein <markus.klein@typo3.org>
Tested-by: Markus Klein <markus.klein@typo3.org>
typo3/sysext/core/Classes/Database/DatabaseConnection.php
typo3/sysext/install/Classes/Service/SqlSchemaMigrationService.php

index f721a61..ef612a2 100644 (file)
@@ -1529,7 +1529,6 @@ class DatabaseConnection {
         *
         * @throws \RuntimeException
         * @throws \UnexpectedValueException
-        * @internal param string $user Username to connect with.
         * @return void
         */
        public function connectDB() {
index 985b6ed..05adcbd 100644 (file)
@@ -176,7 +176,7 @@ class SqlSchemaMigrationService {
                $total = array();
                $tempKeys = array();
                $tempKeysPrefix = array();
-               $GLOBALS['TYPO3_DB']->sql_select_db();
+               $GLOBALS['TYPO3_DB']->connectDB();
                echo $GLOBALS['TYPO3_DB']->sql_error();
                $tables = $GLOBALS['TYPO3_DB']->admin_get_tables();
                foreach ($tables as $tableName => $tableStatus) {