Bug #16689
closedIndex on tx_realurl_uniqalias breaks with DBAL
0%
Description
The length restriction is not compatible with DBAL:
KEY bk_realurl02 (tablename,field_alias,field_id,value_alias(230),expire)
Other DBs do not support this syntax (but may allow for expressions in indices) or may not need it at all.
(issue imported from #M4466)
Files
Updated by Dmitry Dulepov almost 18 years ago
I expect that DBAL takes care for proper conversion between various syntaxies. Since mysql is main db for typo3 and this index improves performance a lot, I prefer to keep it as is.
Updated by Martin Kutschker almost 18 years ago
Well, this specific syntax is unique to Mysl. You may create a similar effect in other (but not all!) DBs but it's complicated and not easily done.
There shouldn't be no need for DBAL to deal with such an edge case.
BTW, if you want a Myslq specific hack have a look at my comment in #4395 and set the table or the used fields to latin1. This will make your index shorter and maybe a bit faster as well.
Updated by Dmitry Dulepov almost 18 years ago
I thought that dbal is supposed to provide compatibility between databases... This is precizely that case. I should not really care about mssql, sqllite, oracle, etc while writing table definitions.
Updated by Martin Kutschker almost 18 years ago
Yes, it should and does, but some things are simply not portable.
Updated by Dmitry Dulepov almost 18 years ago
Yes, but DBAL still may analyze this in some way? Dropping index will be extreme scenario, otherwise index length can be changed...
Updated by Martin Kutschker almost 18 years ago
DBAL could ignore the length restriction. AFAIK only Mysql has a 1000 byte key length restriction. So why blame DBAL if Mysql is the bummer ;-)
Updated by Dmitry Dulepov almost 18 years ago
I do not blame it, I think it can handle it because its purpose is to adopt sql to other systems :)
Updated by Martin Kutschker almost 18 years ago
I see.
Well, child, now is the day you have to learn that your father does not know everything and there are things he cannot accomplish :-)
Updated by Dmitry Dulepov almost 18 years ago
I really cannot understand why DBAL cannot convert
KEY bk_realurl02 (tablename,field_alias,field_id,value_alias(230),expire)
to
KEY bk_realurl02 (tablename,field_alias,field_id,value_alias,expire)
Is it so difficult?
Updated by Martin Kutschker almost 18 years ago
It could skip it, yes. And I think it does already, I recall adding some code into 4.0.3 that deals with this issue.
Updated by Xavier Perseguers about 15 years ago
Index size is not 230 anymore but 220 but the bug still occurs, explained on http://xavier.perseguers.ch/en/tutorials/typo3/articles/oracle-database/configuring-typo3.html
Updated by Dmitry Dulepov about 15 years ago
RealURL is mainly MySQL oriented because majority of TYPO3 users use MySQL. So I am not going to sacrifice performance for those users. Sorry :( If DBAL can't convert indexes to other supported format, we only have to say that RealURL does not work with DBAL out of the box because DBAL cannot provide proper conversion. That's it.
In the new version of RealURL index will change to:
KEY bk_realurl02 (tablename,field_alias,field_id,value_alias(20),expire)
Updated by Xavier Perseguers about 15 years ago
Hi Dmitry, I totally agree with you, RealURL should not be changed. Attached patch simply drops the length restriction when using DBAL.
Updated by Dmitry Dulepov about 15 years ago
Thanks! :) This is a great solution! :) I see DBAL becomes better and better in your hands :)