Project

General

Profile

Actions

Bug #16689

closed

Index on tx_realurl_uniqalias breaks with DBAL

Added by Martin Kutschker over 17 years ago. Updated over 14 years ago.

Status:
Closed
Priority:
Should have
Category:
Database API (Doctrine DBAL)
Target version:
-
Start date:
2006-11-06
Due date:
% Done:

0%

Estimated time:
TYPO3 Version:
PHP Version:
Tags:
Complexity:
Is Regression:
Sprint Focus:

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

4466_core.diff (1.72 KB) 4466_core.diff Administrator Admin, 2009-11-17 07:51
4466_dbal-unittest.diff (1.36 KB) 4466_dbal-unittest.diff Administrator Admin, 2009-11-17 07:51

Related issues 1 (0 open1 closed)

Related to TYPO3 Core - Bug #21730: ALTER TABLE is not able to parse length restriction in index creation (Oracle)ClosedXavier Perseguers2009-11-29

Actions
Actions #1

Updated by Dmitry Dulepov over 17 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.

Actions #2

Updated by Martin Kutschker over 17 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.

Actions #3

Updated by Dmitry Dulepov over 17 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.

Actions #4

Updated by Martin Kutschker over 17 years ago

Yes, it should and does, but some things are simply not portable.

Actions #5

Updated by Dmitry Dulepov over 17 years ago

Yes, but DBAL still may analyze this in some way? Dropping index will be extreme scenario, otherwise index length can be changed...

Actions #6

Updated by Martin Kutschker over 17 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 ;-)

Actions #7

Updated by Dmitry Dulepov over 17 years ago

I do not blame it, I think it can handle it because its purpose is to adopt sql to other systems :)

Actions #8

Updated by Martin Kutschker over 17 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 :-)

Actions #9

Updated by Dmitry Dulepov over 17 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?

Actions #10

Updated by Martin Kutschker over 17 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.

Actions #11

Updated by Xavier Perseguers over 14 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

Actions #12

Updated by Dmitry Dulepov over 14 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)

Actions #13

Updated by Xavier Perseguers over 14 years ago

Hi Dmitry, I totally agree with you, RealURL should not be changed. Attached patch simply drops the length restriction when using DBAL.

Actions #14

Updated by Dmitry Dulepov over 14 years ago

Thanks! :) This is a great solution! :) I see DBAL becomes better and better in your hands :)

Actions #15

Updated by Oliver Hader over 14 years ago

Committed to SVN Trunk (rev. 6463)

Actions

Also available in: Atom PDF