[TYPO3-dam-devel] RFC #8223: Add DEFAULT '' to field file_path in table tx_dam

Benjamin Mack benni at typo3.org
Tue May 6 00:06:17 CEST 2008


Hey Michiel,

so, after reading these things, the best way should be to remove both 
DEFAULT '' and NOT NULL having only

   myfield TEXT,

?

Michiel Roos wrote:
> And also: http://bugs.typo3.org/view.php?id=4693
> 
> On May 5, 2008, at 11:50 PM, Michiel Roos wrote:
> 
>> -1
>>
>> NOT NULL fields need a default value
>>
>> but . . . 
>>
>> http://dev.mysql.com/doc/refman/5.0/en/blob.html states: BLOB and TEXT 
>> columns cannot have DEFAULT values
>>
>> MySQL will complain when in strict mode when given NOT NULL DEFAULT '' 
>> since it will just strip the DEFAULT '' off of the query and then the 
>> query will fail. A lot of MySQL implementations ship out in a strict 
>> mode configuration.
>>
>> Please look closely at the patch attached to the related 
>> bug: http://bugs.typo3.org/view.php?id=4991
>>
>> The + and - are the wrong way around but the idea is that the text and 
>> blob fields are created 'cleanly' (without NOT NULL or DEFAULT '').
>>
>> Please find attached a possible solution.
>>
>> <20080505_8223.diff>
>>
>> On May 5, 2008, at 11:01 PM, Benjamin Mack wrote:
>>
>>> Hey team,
>>>
>>> this is a SVN patch request.
>>>
>>> Branches: DAM_1.0 and Trunk (1.1)
>>>
>>> BT Reference: http://bugs.typo3.org/view.php?id=8223
>>>
>>> Type: Bugfix / Cleanup
>>>
>>> Problem: In ext_tables.sql, the field "file_path" of the table 
>>> "tx_dam" has a NOT NULL, but not a DEFAULT '' set. Apparently on some 
>>> installations this causes an error.
>>>
>>> Solution: Although I cannot reproduce this, I fully agree with 
>>> setting this option.
>>>
>>> Notes: Thanks to Niels Pardon for the initial patch and the reporting.
>>>
>>> -- 
>>> greetings,
>>> benni.
>>> -SDG-
>>> Index: ext_tables.sql
>>> ===================================================================
>>> --- ext_tables.sql (revision 9103)
>>> +++ ext_tables.sql (working copy)
>>> @@ -91,7 +91,7 @@
>>>   file_type_version varchar(9) DEFAULT '' NOT NULL,
>>>
>>>   file_name varchar(255) DEFAULT '' NOT NULL,
>>> -  file_path text NOT NULL,
>>> +  file_path text DEFAULT '' NOT NULL,
>>>   file_size int(11) unsigned DEFAULT '0' NOT NULL,
>>>   file_mtime int(11) unsigned DEFAULT '0' NOT NULL,
>>>   file_inode int(11) DEFAULT '0' NOT NULL,
>>> Index: ext_tables.sql
>>> ===================================================================
>>> --- ext_tables.sql (revision 9104)
>>> +++ ext_tables.sql (working copy)
>>> @@ -107,7 +107,7 @@
>>>   file_type_version varchar(9) DEFAULT '' NOT NULL,
>>>
>>>   file_name varchar(255) DEFAULT '' NOT NULL,
>>> -  file_path text NOT NULL,
>>> +  file_path text DEFAULT '' NOT NULL,
>>>   file_size int(11) unsigned DEFAULT '0' NOT NULL,
>>>   file_mtime int(11) unsigned DEFAULT '0' NOT NULL,
>>>   file_inode int(11) DEFAULT '0' NOT NULL,
>>> _______________________________________________
>>> Before posting to this list, please have a look to the posting rules
>>> on the following websites:
>>>
>>> http://typo3.org/teams/core/core-mailinglist-rules/
>>> http://typo3.org/development/bug-fixing/diff-and-patch/
>>> _______________________________________________
>>> TYPO3-team-dam mailing list
>>> TYPO3-team-dam at lists.netfielders.de 
>>> <mailto:TYPO3-team-dam at lists.netfielders.de>
>>> http://lists.netfielders.de/cgi-bin/mailman/listinfo/typo3-team-dam
>>
>>
>> Met vriendelijke groet,
>>
>> Michiel Roos
>>
>> Netcreators BV :: creation and innovation
>> www.netcreators.com <http://www.netcreators.com> 
>>
>> Interesse in werken bij Netcreators?
>> http://www.netcreators.com/bedrijf/vacatures/ 
>>
>> _______________________________________________
>> Before posting to this list, please have a look to the posting rules
>> on the following websites:
>>
>> http://typo3.org/teams/core/core-mailinglist-rules/
>> http://typo3.org/development/bug-fixing/diff-and-patch/
>> _______________________________________________
>> TYPO3-team-dam mailing list
>> TYPO3-team-dam at lists.netfielders.de
>> http://lists.netfielders.de/cgi-bin/mailman/listinfo/typo3-team-dam
> 
> 
> Met vriendelijke groet,
> 
> Michiel Roos
> 
> Netcreators BV :: creation and innovation
> www.netcreators.com <http://www.netcreators.com> 
> 
> Interesse in werken bij Netcreators?
> http://www.netcreators.com/bedrijf/vacatures/ 
> 

-- 
greetings,
benni.
-SDG-


More information about the TYPO3-team-dam mailing list