All pastes #295251 Raw Edit

Unnamed

public text v1 · immutable
#295251 ·published 2006-12-29 06:10 UTC
rendered paste body
mysql> CREATE TABLE two ( one INT NOT NULL, two INT ) ENGINE=InnoDB;
Query OK, 0 rows affected (0.37 sec)

mysql> INSERT INTO two ( one, two ) VALUES ( 1, 2 );
Query OK, 1 row affected (0.00 sec)

mysql> INSERT INTO two ( one ) VALUES ( 3 );
Query OK, 1 row affected (0.01 sec)

mysql> INSERT INTO two ( two ) VALUES ( 4 );
Query OK, 1 row affected, 1 warning (0.00 sec)

mysql> show warnings;
+---------+------+------------------------------------------+
| Level   | Code | Message                                  |
+---------+------+------------------------------------------+
| Warning | 1364 | Field 'one' doesn't have a default value |
+---------+------+------------------------------------------+
1 row in set (0.00 sec)

mysql> SHOW CREATE TABLE two;
+-------+--------------------------------------------------------------------------------------------------------------------+
| Table | Create Table                                                                                                       |
+-------+--------------------------------------------------------------------------------------------------------------------+
| two   | CREATE TABLE `two` (
  `one` int(11) NOT NULL,
  `two` int(11) default NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1 |
+-------+--------------------------------------------------------------------------------------------------------------------+
1 row in set (0.00 sec)