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>
* @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);
}
/**
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"');
}
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');
}
}
}
$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 (
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