> Where did you hear that one Jochem? MySQL enforces NOT NULL just fine.
>
> mysql> create table test (id int not null);
> Query OK, 0 rows affected (0.05 sec)
>
> mysql> insert into test (id) values (null);
> ERROR 1048: Column 'id' cannot be null
<quote>
If no DEFAULT value is specified for a column, MySQL
automatically assigns one, as follows. If the column may take
NULL as a value, the default value is NULL. If the column is
declared as NOT NULL, the default value depends on the column type:
* For numeric types other than those declared with the
AUTO_INCREMENT attribute, the default is 0. For an AUTO_INCREMENT
column, the default value is the next value in the sequence.
* For date and time types other than TIMESTAMP, the default
is the appropriate zero value for the type. For the first
TIMESTAMP column in a table, the default value is the current
date and time. See section 6.2.2 Date and Time Types.
* For string types other than ENUM, the default value is the
empty string. For ENUM, the default is the first enumeration value.
</quote>
http://www.mysql.com/doc/en/CREATE_TABLE.html
Jochem
--
When you don't want to be surprised by the revolution
organize one yourself
- Loesje
[Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings]

