[Typo3-dev] NOT NULL for some columns in tt_address

Karsten Dambekalns k.dambekalns at fishfarm.de
Tue Dec 14 12:51:41 CET 2004


Hi,

(seems you hijacked a thread...)

On 2004-12-13, Dimitri Tarassenko <mitka at mitka.us> wrote:
> Is there any good reason that I fail to comprehend that the following 
> columns in tt_address do not have defaults assigned in the table definition:
>
> address (tinytext)
> image (tinyblob)
> description (text)
>
> , while having "NOT NULL"?

Have you ever *really read* the MySQL manual? No offense, I didn't for
a long time :). Their notion of NOT NULL is somewhat crude, so the
above makes perfect sense to them - the default is an empty string.

In fact, NOT NULL in MySQL *always* allows you to insert without
specifiyng the field, it just means the field will not be NULL
afterwards, but the 'internal standard default' (my name for it),
being either '' or 0, IIRC.

That's why... :)

And most people create SQL files for generating tables with mysqldump
or some other tool, which tend to add those rather senseless
definitions. My estimate is, that 80% of the NOT NULL fields in
MySQL-based PHP apps floating around on the net could be set up
without adding NOT NULL just fine.

Karsten




More information about the TYPO3-dev mailing list