[TYPO3-project-4-3] Deprecating SQL parser in TYPO3 4.3

Martin Kutschker masi-no at spam-typo3.org
Wed Nov 4 11:08:43 CET 2009


Ernesto Baschny [cron IT] schrieb:
> Xavier Perseguers schrieb:
> 
>> I hope to get some (positive) feedback here as I did not mention the
>> word "DBAL" in title (ouch I did it anyway with my first few words :D).
>>
>> OK. Once again, even with DBAL "outside" of Core, there is a real
>> problem to get patch committed to trunk when it comes to issues that
>> occur "only" when using DBAL.
>>
>> Here is some extract from a discussion I had today with Karsten about
>> what to do with SQL parser included in Core. I'm not speaking about the
>> parser used to allow modifications of the database structure (CREATE
>> TABLE, ALTER TABLE, ...) but the SELECT/INSERT/UPDATE parser which is
>> used when installing DBAL but not when using MySQL only.
>>
>>> I would probably remove the code from core. [...] that should mean
>> less probability for errors
>>> When Kasper put that code in place back in 2004 we all thought/hoped
>> that people would go crazy
>>> writing DB handlers, but that has not happened.
>>>
>>> Time to move the code into the right place, I'd say. And that is DBAL.
> 
> About this, I always wondered: if we have such a nice and complex
> sql-parser, why isn't it being used in more places?
> 
> For example the Install Tool "COMPARE" or the Ext.Manager ext_tables.sql
> file handling. Couldn't we have a single nice "sql parser" that parses
> the CREATE TABLE statements and use it in everywhere?
> 
> Compare:
> - t3lib_sqlparser::parseCREATETABLE
> - t3lib_install::getFieldDefinitions_fileContent
> 
> it does more or less "the same" (it parses a CREATE TABLE statement),
> but is completely different code. The install tool parser is already
> complex enough to cover lots of cases, but still buggy.

The code in the installer does too many checks based on string comparisons. This breaks even with
different version of the Mysql server.

If THE sql parser is to be used by the installer then there is a good reason to retian it in the
core. But it isn't the parser as such that is the problem. It is the odd sql_parser/sql_engine
couple that makes trouble (for DBAL).

Masi


More information about the TYPO3-project-4-3 mailing list