[TYPO3-core] RFC: Remove "default 0" from auto_increment lines in SQL files

Karsten Dambekalns karsten at typo3.org
Sat Jan 14 09:47:05 CET 2006


Hi Michael.

On Friday 13 January 2006 15:43, Michael Stucki wrote:
> This does nothing but remove the "default 0" definitions from SQL fields
> which are auto-incremented. Doesn't make any sense as we already remove
> such parts dynamically when parsing the SQL content.

+1 !!!

Too bad you did that, it was on my list of things to do for 4.0 :)

> @Karsten: Are there any drawbacks for other DBMS?

No. Well, there might be, but since we map auto_increment fields to a serial, 
sequence, ... anyway, it doesn't matter.

BUT we should think about the dumps again, anyway. Because we could drop all 
the NOT NULL, too, without any effect. This is because in MySQL 4, defining a 
column not null does NOT mean, that one cannot insert null. Instead it will 
either have the given default or a "standard default" depending on the type. 
The only difference is, that in once you can insert null and will have null 
in the field, once you insert null and have a "real" value.

Now, we never insert null, so having this option makes no sense. This is why I 
drop it in DBAL anyway, because in other RDBMS you'd get tons of errors for 
fields not being specified in an insert statement.

And now we have this problem with MySQL5 in a default install, see bug #2059
 http://bugs.typo3.org/view.php?id=2059
We could set the server mode in the code, or ask users to change their 
configuration. The clean way would be to re-think the whole DB schema and 
clean up all operations around that, but this is rather a task for 5.0.

So why not drop all NOT NULL attributes as an immediate solution?

Karsten
-- 
Karsten Dambekalns
TYPO3 Association - Active Member
http://association.typo3.org/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 307 bytes
Desc: not available
Url : http://lists.netfielders.de/pipermail/typo3-team-core/attachments/20060114/d4cc51c9/attachment.pgp 


More information about the TYPO3-team-core mailing list