[TYPO3-core] RFC: Bug #13508: Use exec_TRUNCATETABLEquery() instead of DELETE FROM throughout the core
Xavier Perseguers
typo3 at perseguers.ch
Thu Feb 11 09:04:55 CET 2010
Hi Dmitry,
> -1 because it adds MySQL–specific naming and unnecessary complexity. A
Well, it's not standard SQL I agree but it is implemented by all
officially supported databases:
- MySQL (of course)
- MSSQL [1]
- Oracle [2]
- PostgreSQL [3]
> different approach is better: keep DELETEquery but check WHERE
> statement. If it is empty or 1=1, use TRUNCATE. No need for a new
> method, no need for API change, no confusion for programmers, no need
> for programmers to make call decisions in their code. API must hide
> complexity, not add it!
Well, please post this to FYI #13504 and I'll possibly make a follow-up
with change to make those methods protected instead (for instance). Kind
of a "post-review". Sorry, I really took it as a bug fix more than a new
feature, but it makes sense.
[1] http://msdn.microsoft.com/en-us/library/aa260621%28SQL.80%29.aspx
[2]
http://download-west.oracle.com/docs/cd/B19306_01/server.102/b14200/statements_10006.htm
[3] http://www.postgresql.org/docs/8.1/static/sql-truncate.html
--
Xavier Perseguers
http://xavier.perseguers.ch/en
More information about the TYPO3-team-core
mailing list