[TYPO3-core] RFC: Bug #13508: Use exec_TRUNCATETABLEquery() instead of DELETE FROM throughout the core

Martin Kutschker masi-no at spam-typo3.org
Fri Feb 12 11:16:54 CET 2010


Xavier Perseguers schrieb:
> Hi,
> 
>> Add $allowTruncate parameter to DELETE which is TRUE by default. This
>> way every DELETE automatically gets faster (TRUNCATE) and if some
>> extension really NEEDS the triggers or the auto-increment counter, it
>> can disable it.
> 
> After thinking still a bit, I'm against a DELETE that performs a
> TRUNCATE in underground "automagically" even if it makes stuff seem
> easier. Problem is that whenever I have constraints on a foreign table
> such as ON DELETE CASCADE, TRUNCATE cannot be used.

This would mean the unwashed masses that try to use SQL but don't care to learn about DBs will run
into serious problems.

IMHO TYPO3 shouldn't use and support TRUNCATE at all or support it properly. Mind that t3lib_db is
an SQL (!) utility class which is by definition on a low level (in a layered architecture). If you
want to hide the distinction between DELETE and TRUNCATE do it on a higher level.

Masi


More information about the TYPO3-team-core mailing list