Added feature #16491: Provide a pass-through flag for sql_exec() which goes directly...
authorXavier Perseguers <typo3@perseguers.ch>
Tue, 30 Nov 2010 14:35:54 +0000 (14:35 +0000)
committerXavier Perseguers <typo3@perseguers.ch>
Tue, 30 Nov 2010 14:35:54 +0000 (14:35 +0000)
git-svn-id: https://svn.typo3.org/TYPO3v4/Extensions/dbal/trunk@40681 735d13b6-9817-0410-8766-e36946ffe9aa

typo3/sysext/dbal/ChangeLog
typo3/sysext/dbal/class.ux_t3lib_db.php
typo3/sysext/dbal/ext_conf_template.txt

index 8e09ce0..5294d1e 100644 (file)
@@ -1,3 +1,7 @@
+2010-11-30  Xavier Perseguers  <typo3@perseguers.ch>
+
+       * Added feature #16491: Provide a pass-through flag for sql_exec() which goes directly to the native MySQL engine
+
 2010-11-18  Xavier Perseguers  <typo3@perseguers.ch>
 
        * Fixed bug #16392: Install tool cannot compare "ENGINE" of MySQL Tables when DBAL is active
index 1a4ef11..78e0868 100644 (file)
@@ -2479,6 +2479,11 @@ class ux_t3lib_DB extends t3lib_DB {
         * @return      pointer         Result pointer / DBAL object
         */
        public function sql_query($query) {
+               $globalConfig = unserialize($GLOBALS['TYPO3_CONF_VARS']['EXT']['extConf']['dbal']);
+               if ($globalConfig['sql_query.passthrough']) {
+                       return parent::sql_query($query);
+               }
+
                        // This method is heavily used by Extbase, try to handle it with DBAL-native methods
                $queryParts = $this->SQLparser->parseSQL($query);
                if (is_array($queryParts) && t3lib_div::inList('SELECT,UPDATE,INSERT,DELETE', $queryParts['type'])) {
index 1403261..44fe9d1 100644 (file)
@@ -1,3 +1,6 @@
+  # cat=basic; type=boolean; label=Enable MySQL pass-through: Method $GLOBALS['TYPO3_DB']->sql_query() is only experimentally supported by DBAL. Its use should be avoided. When active, this flag tells DBAL to not try to parse the query and always send it as-this to MySQL, thus as if DBAL were not loaded.
+sql_query.passthrough=1
+
   # cat=basic; type=user[EXT:dbal/lib/class.tx_dbal_tsparserext.php:tx_dbal_tsparserext->displayMessage];
 Compatibility=