| Bug #28135 | error while inserting to auto_increment | ||
|---|---|---|---|
| Submitted: | 27 Apr 2007 12:40 | Modified: | 27 Apr 2007 13:35 |
| Reporter: | sandie bug | Email Updates: | |
| Status: | Not a Bug | Impact on me: | |
| Category: | MySQL Server | Severity: | S2 (Serious) |
| Version: | 5.2.3-falcon-alpha | OS: | Windows (2000 server) |
| Assigned to: | CPU Architecture: | Any | |
| Tags: | 5.2.3, auto_increment, error 1366, insert | ||
[27 Apr 2007 12:40]
sandie bug
[27 Apr 2007 12:41]
sandie bug
see this file
Attachment: mysql_error.doc (application/msword, text), 76.00 KiB.
[27 Apr 2007 13:35]
MySQL Verification Team
Thank you for the bug report. Please read the Manual regarding sql_mode:
c:\Arquivos de programas\mysql\MySQL Server 5.2>bin\mysql -uroot -P3308 test
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 1
Server version: 5.2.3-falcon-alpha-community-nt MySQL Community Server (GPL)
Type 'help;' or '\h' for help. Type '\c' to clear the buffer.
mysql> create table tb1 (id serial, col1 char(1));
Query OK, 0 rows affected (0.30 sec)
mysql> insert into tb1 values ('','a');
ERROR 1366 (HY000): Incorrect integer value: '' for column 'id' at row 1
mysql> select @@sql_mode;
+----------------------------------------------------------------+
| @@sql_mode |
+----------------------------------------------------------------+
| STRICT_TRANS_TABLES,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION |
+----------------------------------------------------------------+
1 row in set (0.00 sec)
mysql> set @@sql_mode='';
Query OK, 0 rows affected (0.00 sec)
mysql> insert into tb1 values ('','a');
Query OK, 1 row affected, 1 warning (0.07 sec)
mysql> select * from tb1;
+----+------+
| id | col1 |
+----+------+
| 1 | a |
+----+------+
1 row in set (0.03 sec)
mysql>
