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

Michiel Roos michiel at netcreators.com
Mon May 5 23:50:03 CEST 2008


-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.



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
> http://lists.netfielders.de/cgi-bin/mailman/listinfo/typo3-team-dam


Met vriendelijke groet,

Michiel Roos

Netcreators BV :: creation and innovation
www.netcreators.com

Interesse in werken bij Netcreators?
http://www.netcreators.com/bedrijf/vacatures/

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.netfielders.de/pipermail/typo3-team-dam/attachments/20080505/ba7c5e87/attachment-0002.htm 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 20080505_8223.diff
Type: application/octet-stream
Size: 3991 bytes
Desc: not available
Url : http://lists.netfielders.de/pipermail/typo3-team-dam/attachments/20080505/ba7c5e87/attachment-0001.obj 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.netfielders.de/pipermail/typo3-team-dam/attachments/20080505/ba7c5e87/attachment-0003.htm 


More information about the TYPO3-team-dam mailing list