Added feature #13508: Use exec_TRUNCATEquery() instead of DELETE FROM throughout...
authorChristian Kuhn <lolli@schwarzbu.ch>
Mon, 12 Apr 2010 18:12:52 +0000 (18:12 +0000)
committerChristian Kuhn <lolli@schwarzbu.ch>
Mon, 12 Apr 2010 18:12:52 +0000 (18:12 +0000)
git-svn-id: https://svn.typo3.org/TYPO3v4/Core/trunk@7311 709f56b5-9817-0410-a4d7-c38de5d9e867

ChangeLog
t3lib/cache/backend/class.t3lib_cache_backend_dbbackend.php
t3lib/class.t3lib_tcemain.php
typo3/mod/tools/em/class.em_xmlhandler.php
typo3/sysext/install/mod/class.tx_install.php
typo3/sysext/tsconfig_help/mod1/index.php

index 280ade4..6751c5b 100755 (executable)
--- a/ChangeLog
+++ b/ChangeLog
@@ -8,6 +8,7 @@
 
 2010-04-12  Christian Kuhn  <lolli@schwarzbu.ch>
 
+       * Added feature #13508: Use exec_TRUNCATEquery() instead of DELETE FROM throughout the core
        * Fixed bug #13945: Missing key on l18n_parent in tt_content table
 
 2010-04-12  Benjamin Mack  <benni@typo3.org>
index af6af6d..73896f1 100644 (file)
@@ -288,8 +288,8 @@ class t3lib_cache_backend_DbBackend extends t3lib_cache_backend_AbstractBackend
         * @author Ingo Renner <ingo@typo3.org>
         */
        public function flush() {
-               $GLOBALS['TYPO3_DB']->sql_query('TRUNCATE ' . $this->cacheTable);
-               $GLOBALS['TYPO3_DB']->sql_query('TRUNCATE ' . $this->tagsTable);
+               $GLOBALS['TYPO3_DB']->exec_TRUNCATEquery($this->cacheTable);
+               $GLOBALS['TYPO3_DB']->exec_TRUNCATEquery($this->tagsTable);
        }
 
        /**
index 8bb097b..c094c35 100644 (file)
@@ -7416,22 +7416,22 @@ State was change by %s (username: %s)
 
                                        if (TYPO3_UseCachingFramework) {
                                                if (t3lib_extMgm::isLoaded('cms'))      {
-                                                       $GLOBALS['TYPO3_DB']->exec_DELETEquery('cache_treelist', '');
+                                                       $GLOBALS['TYPO3_DB']->exec_TRUNCATEquery('cache_treelist');
                                                }
                                        } else {
                                                if (t3lib_extMgm::isLoaded('cms'))      {
-                                                       $GLOBALS['TYPO3_DB']->exec_DELETEquery('cache_treelist', '');
-                                                       $GLOBALS['TYPO3_DB']->exec_DELETEquery('cache_pagesection','');
+                                                       $GLOBALS['TYPO3_DB']->exec_TRUNCATEquery('cache_treelist');
+                                                       $GLOBALS['TYPO3_DB']->exec_TRUNCATEquery('cache_pagesection');
                                                }
                                                $this->internal_clearPageCache();
-                                               $GLOBALS['TYPO3_DB']->exec_DELETEquery('cache_hash','');
+                                               $GLOBALS['TYPO3_DB']->exec_TRUNCATEquery('cache_hash');
                                        }
 
                                                // Clearing additional cache tables:
                                        if (is_array($TYPO3_CONF_VARS['SC_OPTIONS']['t3lib/class.t3lib_tcemain.php']['clearAllCache_additionalTables']))        {
                                                foreach($TYPO3_CONF_VARS['SC_OPTIONS']['t3lib/class.t3lib_tcemain.php']['clearAllCache_additionalTables'] as $tableName)        {
                                                        if (!preg_match('/[^[:alnum:]_]/',$tableName) && substr($tableName,-5)=='cache')        {
-                                                               $GLOBALS['TYPO3_DB']->exec_DELETEquery($tableName,'');
+                                                               $GLOBALS['TYPO3_DB']->exec_TRUNCATEquery($tableName);
                                                        } else {
                                                                die('Fatal Error: Trying to flush table "'.$tableName.'" with "Clear All Cache"');
                                                        }
@@ -7626,7 +7626,7 @@ State was change by %s (username: %s)
                                                t3lib_div::sysLog('Could not remove page cache files in "'.$cacheDir.'"','Core/t3lib_tcemain',2);
                                        }
                                }
-                               $GLOBALS['TYPO3_DB']->exec_DELETEquery('cache_pages','');
+                               $GLOBALS['TYPO3_DB']->exec_TRUNCATEquery('cache_pages');
                        }
                }
        }
index a9a5a63..ddbf61e 100644 (file)
@@ -370,7 +370,7 @@ class SC_mod_tools_em_xmlhandler {
                        $this->revStateArr[$state] = $idx++;
                }
 
-               $GLOBALS['TYPO3_DB']->exec_DELETEquery('cache_extensions', '1=1');
+               $GLOBALS['TYPO3_DB']->exec_TRUNCATEquery('cache_extensions');
 
                $extcount = 0;
                @ini_set('pcre.backtrack_limit', 500000);
index 2f2ef71..08086ef 100755 (executable)
@@ -1886,7 +1886,7 @@ REMOTE_ADDR was '".t3lib_div::getIndpEnv('REMOTE_ADDR')."' (".t3lib_div::getIndp
                $action = $this->INSTALL['cleanup_type'];
 
                if (($action == 'cache_imagesizes' || $action == 'all') && isset ($tables['cache_imagesizes'])) {
-                       $GLOBALS['TYPO3_DB']->exec_DELETEquery ('cache_imagesizes','');
+                       $GLOBALS['TYPO3_DB']->exec_TRUNCATEquery('cache_imagesizes');
                }
 
                $cleanupType = array (
@@ -6306,7 +6306,7 @@ REMOTE_ADDR was '".t3lib_div::getIndpEnv('REMOTE_ADDR')."' (".t3lib_div::getIndp
                                                        if ($table!='--div--') {
                                                                $table_c = TYPO3_OS=='WIN' ? strtolower($table) : $table;
                                                                if ($this->INSTALL['database_clearcache'][$table] && $whichTables[$table_c]) {
-                                                                       $GLOBALS['TYPO3_DB']->exec_DELETEquery($table, '');
+                                                                       $GLOBALS['TYPO3_DB']->exec_TRUNCATEquery($table);
                                                                                // Define the markers content
                                                                        $emptiedTablesMarkers = array(
                                                                                'tableName' => $table
index 902aad6..892cefc 100644 (file)
@@ -727,7 +727,7 @@ class tx_tsconfighelp_module1 extends t3lib_SCbase {
                if ($extension != '')   {
                        $GLOBALS['TYPO3_DB']->exec_DELETEquery('static_tsconfig_help', 'guide='.$guide);
                } else {
-                       $GLOBALS['TYPO3_DB']->exec_DELETEquery('static_tsconfig_help', '');
+                       $GLOBALS['TYPO3_DB']->exec_TRUNCATEquery('static_tsconfig_help');
                }
        }