[TYPO3-dev] Reserved keywords on fields and table names in the database

Martin Kutschker Martin.Kutschker at n0spam-blackbox.net
Mon May 15 09:48:56 CEST 2006


Bernhard Kraft schrieb:
> Martin Kutschker wrote:
> 
>> IMHO the code that creates the statement should do the quoting (also 
>> for tables). That's why I suggested 
>> $GLOBALS['TYPO3_DB']->quoteIdentifier($ident, $table). If you write 
>> your own statements use it. All other code in the TYPO3 core (BE and 
>> FE API) should use this function internally.
>>
> 
> And what about statements like:
> 
> $GLOBALS['TYPO3_DB']->exec_SELECTquery('fielda-fieldb AS whatever', ...);
> which you do require if you want to sort using "whatever" i.e.
> 
> Or are such statements intended to be "not supported" by DBAL ?

Why should it be unsupported by DBAL. TYPO3 itself doesn't cope well with 
column aliases. You run even into troubles using SQL functions, because it 
expects columns and nothing else as columns. This is fine for pure-TCA 
queries but a limitation for real-world SQL.

Anway, I deeply mistrust any auto-rewriting feature and that's where I 
dislike DBAL. I do like OTOH a good set of helper functions and QUERY 
generating functions.

Masi




More information about the TYPO3-dev mailing list