[TYPO3-core] RFC #8542: Cannot create page with Mysl in strict mode (STRICT_TRANS_TABLES)
Dmitry Dulepov [typo3]
dmitry at typo3.org
Thu May 29 13:21:36 CEST 2008
Hi!
Martin Kutschker wrote:
> After further analysis I have found that the problem is a bit odd. THe
> TCA has the type "group"/"db" which uses an integer when uses as "MM".
Because it stores only number of MM relations in this case.
> But this is not the case for "storage_pid". What we have here is a field
> that has "maxitems" of 1 and "prepend_tname" = 0, which means that there
> will only be an integer stored and not a comma separated list of
> strings. TYPO3 copes with the fact that Mysql will turn an empty
> list/string into 0. This is fine, but a bit of a hack as a group with
> exactly one item isn't a group at all.
Wait, it is not the case. Integer will be 0 but string will be empty. These are two valid cases. If you set prepend_tname to false, you can use integer and have 0 in it because it is logical for integer field. But having 0 in string field is not logical, in fact it is invalid reference value. And if you use prepend_tname=true, you just cannot have just 0 in the string field, it is not valid (due to prepend_tname).
> A "group"/"db" field that is no "MM" would usually be a VARCHAR, but
> because of the special constraints it may be an INT. What to do now?
> Change the fields in the Core to VARCHAR or make sure that all fields
> with such a setup write 0 to the DB? The latter would fix all
> occurrences in the Core an extensions that follow the (bad?) example of
> "storage_pid".
What about unsetting empty values in TCEmain? Leave it to MySQL to decide what to put by default.
--
Dmitry Dulepov
TYPO3 core team
Learn more about TYPO3! Read http://typo3bloke.net/
Skype: callto:liels_bugs but go straight to business!
More information about the TYPO3-team-core
mailing list