[TYPO3-core] RFC: Bug #11903: Use separate tables for tags in the caching framework

Martin Kutschker masi-no at spam-typo3.org
Sun Sep 27 22:40:27 CEST 2009


Martin Kutschker schrieb:
> Oliver Hader schrieb:
>> Hi Masi,
>>
>>> I know that the patch is in but yet a -1 from me. Why? Because the patch sneaks in a new feature of
>>> t3lib_db. This should have been a separate RFC. The reason is that the new feature
>>> DELETEmultipleTablesQuery() isn't DBAL save.
>>>
>>> This surprises me as I have attached many notes in the bug tracker concerning other database
>>> systems.  I suggest to use two different WHERE clauses: one for the JOIN and one for WHERE clause.
>>
>> Yes, that's the information I pointed out in the "Notes:" section of
>> this RFC. There is no overall solution for all DMBS right know and I
>> discussed this also in private with Xavier as DBAL team leader.
> 
> Oh. To me the conclusio (of my own research) was, that having such a feature is possible, but it
> must be implemented differently for all database systems.
> 
> 
>> Your example would only delete elements from one table.
> 
> Ouch. I thought that the point was the join, not the deleting from multiple tables at once. Mysql
> offers both options, but I haven't checked properly for both options. I'll reinvestigate that matter.

After re-reading the docs for Mysql, PostgreSQL and SQL server I find that these three databases
support THIS syntax:

DELETE
  [FROM] tbl_name
  USING|FROM table_references
  WHERE where_condition

Note: Mysql and Posgresql use USING, whereas SQL server uses a second FROM. The "table_references"
can be anything that is found in the FROM clause of a SELECT statement.

Unfortunately this syntax deletes only from one table. Neither PostgreSQL nor SQL server allow
multi-tables in the (first) FROM. The USING (second FROM) is only used for a join.

So this syntax is not the answer for DBAL.

Masi


More information about the TYPO3-team-core mailing list