[TYPO3-core] RFC: #11438: Add a registry to t3lib

Ernesto Baschny [cron IT] ernst at cron-it.de
Mon Aug 31 11:39:14 CEST 2009


Ingo Renner schrieb:

>> For a follow-up like this, I don't find it neccessary to create
>> additional bug reports. Just fix the key, that's it.
> 
> I agree, the report was just to not forget about it...

Some options you have regarding this problem:


1) use engine "InnoDB", which doesn't have this key-size limit, so the
current definition will also work on UTF8,


2) as the namespace + keyname are expected to be ASCII only, mark those
columns as ASCII and MySQL will create the unique key with no problem:

CREATE TABLE sys_registry (
 ...
 entry_namespace varchar(128) CHARACTER SET ASCII DEFAULT '' NOT NULL,
 entry_key varchar(255) CHARACTER SET ASCII DEFAULT '' NOT NULL,
 ...
 UNIQUE KEY entry_identifier (entry_namespace,entry_key)
);


3) limit the key size, but then truncating the uniqueness requirement on
those columns:

CREATE TABLE sys_registry (
 ...
 entry_namespace varchar(128) DEFAULT '' NOT NULL,
 entry_key varchar(255) DEFAULT '' NOT NULL,
 ...
 UNIQUE KEY entry_identifier (entry_namespace,entry_key(200))
);


Each has its pros and cons:

1)
pro: can be done without any other core change and no DBAL penalty.
con: this table probably doesn't need to be InnoDB

2)
pro: most clean solution, in my eyes.
con: probably change required in our SQL-parsing engine (Install Tool)
and also probably DBAL considerations (stripping this part for non-MySQL
databases)

3)
pro: it works
con: ugly hack and also needs DBAL considerations which we have had in
the past (other DB engines doesn't seem to like this kind of key)


I would choose 2) and then seeing if this can already be done already or
what have to be changed in the SQL-parsing or DBAL-layer to make it
possible.

Cheers,
Ernesto


More information about the TYPO3-team-core mailing list