Bug #30530 | Missprint at "10.1.4. Data Type Default Values" | ||
---|---|---|---|
Submitted: | 21 Aug 2007 7:26 | Modified: | 23 Aug 2007 8:04 |
Reporter: | Sveta Smirnova | Email Updates: | |
Status: | Not a Bug | Impact on me: | |
Category: | MySQL Server: Documentation | Severity: | S3 (Non-critical) |
Version: | 5.0, 5.1, 4.1 | OS: | Any |
Assigned to: | Paul DuBois | CPU Architecture: | Any |
[21 Aug 2007 7:26]
Sveta Smirnova
[21 Aug 2007 13:03]
Paul DuBois
It looks correct as written to me. What is the error?
[21 Aug 2007 20:36]
Stefan Hinz
Looks to me like a language problem. "Other than" implies a negation, so the following two statements mean the same: "For numeric types other than integer types declared *with the AUTO_INCREMENT attribute*, the default is 0." "For numeric types that are not integer types declared *with the AUTO_INCREMENT attribute*, the default is 0." Sveta, can you confirm that you'd consider the latter statement to be true?
[21 Aug 2007 20:54]
Sveta Smirnova
Stefan, you are right, this is language problem. But when I found this is my missunderstanding I found this sentence still is incorrect: mysql> create table t1(f1 float not null auto_increment primary key); Query OK, 0 rows affected (0.10 sec) mysql> insert into t1 values (), (); Query OK, 2 rows affected (0.13 sec) Records: 2 Duplicates: 0 Warnings: 0 mysql> select * from t1; +----+ | f1 | +----+ | 1 | | 2 | +----+ 2 rows in set (0.00 sec)
[21 Aug 2007 22:22]
Paul DuBois
Your example uses AUTO_INCREMENT with a non-integer type. AUTO_INCREMENT should be used only with integer types. (The server doesn't enforce this, unfortunately) http://dev.mysql.com/doc/refman/5.0/en/create-table.html: "Some attributes do not apply to all data types. AUTO_INCREMENT applies only to integer types."
[21 Aug 2007 22:23]
Paul DuBois
Perhaps it should be considered a bug that the server does not complain about use of AUTO_INCREMENT with a non-integer type.
[23 Aug 2007 8:04]
Stefan Hinz
Sveta: After discussing this with PeterG it seems sufficient for the Manual to say this: "AUTO_INCREMENT applies only to integer types." It could be considered a bug that the server doesn't disallow FLOAT or DOUBLE, but if you think so please file a new bug in the Server category.