[TYPO3-core] length and usage of column "ident" of table "cash_hash"
Ernesto Baschny [cron IT]
ernst at cron-it.de
Mon Jul 17 13:00:40 CEST 2006
Martin Kutschker schrieb am 17.07.2006 12:48:
> I've run into a portability problem of Mysql: the silent length
> truncation of data. All other DBSs choke if strings are too long for a
> column.
>
> The problem in particular is the ident field. Some extension (eg
> automaketemplate) use the field. That is they fill it, but the don't use
> it. Otherwise it might have been noticed that a value of
> "tx_automaketemplate_pi1" will be truncated to "tx_automaketemplate_".
>
> What to do now?
>
> We could enlarge the column (20 chars is not extremely) long. Nice but
> not really necessary.
>
> Or we could do a substr on the ident value (in the identical functions
> storeHash in t3lib_page and t3lib_befunc). This should not hurt any code
> that reads the ident as it has always been trimmed by mysql. But we
> could say it's up to the PHP developer to send correct data.
>
> And we could do both.
I'm for substr'ing the ident string in the core before storing the value
(to avoid DB choking on the value) but keeping the field length it like
it is. It's documented that way ("$ident is just a textual
identification in order to inform about the content! May be 20
characters long.").
Its really just interesting for debugging purposes with no functionality
attached anyway, isn't it? There is no API call to read it back.
And I wonder why we need these functions in t3lib_page AND t3lib_befunc?
In our "refactoring game" there should be a couple of "generic" APIs for
both for FE and BE.
Cheers,
Ernesto
More information about the TYPO3-team-core
mailing list