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

Ernesto Baschny [cron IT] ernst at cron-it.de
Fri Feb 12 11:10:58 CET 2010


Xavier Perseguers schrieb am 12.02.2010 10:45:
> 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 is a major
> drawback and means we definitively need a dedicated method that is public.

This is not relevant to MySQL IMHO, so not really a problem for most
existing installations / extensions.

If you have an extension requiring a DELETE * to be a "DELETE" instead
of a truncate (because of those fancy SQL-stuff), you just set the
$allowTruncate parameter to FALSE. So the option is there anyway, and
the extension that uses "ON DELETE CASCADE" etc knows the difference and
how to use the new parameter.

Cheers,
Ernesto


More information about the TYPO3-team-core mailing list