Bug #16689
closed
Index on tx_realurl_uniqalias breaks with DBAL
Added by Martin Kutschker about 18 years ago.
Updated about 15 years ago.
Category:
Database API (Doctrine DBAL)
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
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.
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.
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.
Yes, it should and does, but some things are simply not portable.
Yes, but DBAL still may analyze this in some way? Dropping index will be extreme scenario, otherwise index length can be changed...
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 ;-)
I do not blame it, I think it can handle it because its purpose is to adopt sql to other systems :)
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 :-)
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?
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.
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)
Hi Dmitry, I totally agree with you, RealURL should not be changed. Attached patch simply drops the length restriction when using DBAL.
Thanks! :) This is a great solution! :) I see DBAL becomes better and better in your hands :)
Committed to SVN Trunk (rev. 6463)
Also available in: Atom
PDF