[TYPO3-core] FYI #12829: ALTER TABLE is not able to parse length restriction in index creation

Xavier Perseguers typo3 at perseguers.ch
Sun Feb 14 18:47:13 CET 2010


Hi,

FYI following patch has been committed to trunk (rev. 6902) and 4-3 (rev. 6903). Corresponding unit test has been committed to DBAL branches as well.

Type: Bugfix

Bugtracker reference:
http://bugs.typo3.org/view.php?id=12829

Branches: trunk, 4-3

Problem:
When installing RealURL (at least when bug was created), table tx_realurl_uniqalias contains a length restriction on field value_alias for index/key bk_realurl02. The length restriction is properly 
parsed during the table creation process.

Now, due to #3751, the index cannot be actually created because its generated identifier name, in Oracle, is too long, DBAL wants to create it with name tx_realurl_uniqalias_bk_realurl02 which is 33 
character wide and greater than the Oracle limit which is 30 characters and not even 32 as reported sometimes. As such, Install Tool asks us to ALTER TABLE tx_realurl_uniqalias to create the missing 
index:

ALTER TABLE tx_realurl_uniqalias ADD KEY bk_realurl02 (tablename,field_alias,field_id,value_alias(220),expire);

However length limit, although properly parsed in CREATE TABLE statements, is not handled when found in ALTER TABLE statements and trying to perform the change leads to a parser error:

ERROR: Query could not be parsed: "SQL engine parse ERROR: No ) parenthesis in list: near "(220),expire) "". Query: "ALTER TABLE tx_realurl_uniqalias ADD KEY bk_realurl02 
(tablename,field_alias,field_id,value_alias(220),expire);"

Solution:
Use same method as for CREATE TABLE statements, that is tell getValue to parse a list of values related to indexes.

Cheers

-- 
Xavier Perseguers
http://xavier.perseguers.ch/en
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: 12829_core.diff
URL: <http://lists.typo3.org/pipermail/typo3-team-core/attachments/20100214/f39adbed/attachment.txt>


More information about the TYPO3-team-core mailing list