Bug #11719 | Incorrect warning when out of the set value is inserted in the column. | ||
---|---|---|---|
Submitted: | 4 Jul 2005 12:03 | Modified: | 4 Jul 2005 12:47 |
Reporter: | Disha | Email Updates: | |
Status: | Not a Bug | Impact on me: | |
Category: | MySQL Server | Severity: | S3 (Non-critical) |
Version: | 5.0.7-beta | OS: | Windows (Windows 2000 Server) |
Assigned to: | CPU Architecture: | Any |
[4 Jul 2005 12:03]
Disha
[4 Jul 2005 12:47]
MySQL Verification Team
http://dev.mysql.com/doc/mysql/en/insert.html If you are not running in strict mode, any column not explicitly given a value is set to its default (explicit or implicit) value. For example, if you specify a column list that doesn't name all the columns in the table, unnamed columns are set to their default values. Default value assignment is described in Section 13.2.5, “CREATE TABLE Syntax”. See Section 1.7.6.2, “Constraints on Invalid Data”. c:\mysql\bin>mysql -uroot test Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 2 to server version: 5.0.9-beta-nt Type 'help;' or '\h' for help. Type '\c' to clear the buffer. mysql> delimiter // mysql> Create table t1(f1 set('a','b','c'))// Query OK, 0 rows affected (0.06 sec) mysql> insert into t1 values('x')// Query OK, 1 row affected, 1 warning (0.02 sec) mysql> select f1+0 from t1// +------+ | f1+0 | +------+ | 0 | +------+ 1 row in set (0.00 sec) mysql> set sql_mode="traditional"// Query OK, 0 rows affected (0.00 sec) mysql> insert into t1 values('x')// ERROR 1265 (01000): Data truncated for column 'f1' at row 1 mysql> select f1+0 from t1// +------+ | f1+0 | +------+ | 0 | +------+ 1 row in set (0.00 sec) mysql>