[BUGFIX] DBAL: Pass database connection to SQL compiler 17/43017/2
authorMorton Jonuschat <m.jonuschat@mojocode.de>
Fri, 4 Sep 2015 10:52:05 +0000 (12:52 +0200)
committerWouter Wolters <typo3@wouterwolters.nl>
Sat, 5 Sep 2015 12:59:19 +0000 (14:59 +0200)
The SQL compilers need the current database connection for properly
quoting identifiers. The constructor declares them a required argument
but the SQL parser didn't pass the database connection on instanciation.

Resolves: #69528
Releases: master
Change-Id: I8cd67bb07d954b73c1e8f1de93f208ca7a835c08
Reviewed-on: http://review.typo3.org/43017
Reviewed-by: Andreas Fernandez <typo3@scripting-base.de>
Tested-by: Andreas Fernandez <typo3@scripting-base.de>
Reviewed-by: Wouter Wolters <typo3@wouterwolters.nl>
Tested-by: Wouter Wolters <typo3@wouterwolters.nl>
typo3/sysext/dbal/Classes/Database/SqlParser.php

index b66e5fa..dd585e4 100644 (file)
@@ -88,8 +88,8 @@ class SqlParser {
         */
        public function __construct(DatabaseConnection $databaseConnection = NULL) {
                $this->databaseConnection = $databaseConnection ?: $GLOBALS['TYPO3_DB'];
-               $this->sqlCompiler = GeneralUtility::makeInstance(SqlCompilers\Adodb::class);
-               $this->nativeSqlCompiler = GeneralUtility::makeInstance(SqlCompilers\Mysql::class);
+               $this->sqlCompiler = GeneralUtility::makeInstance(SqlCompilers\Adodb::class, $this->databaseConnection);
+               $this->nativeSqlCompiler = GeneralUtility::makeInstance(SqlCompilers\Mysql::class, $this->databaseConnection);
        }
 
        /**