MySQL Lists are EOL. Please join:

List:Commits« Previous MessageNext Message »
From:gluh Date:October 30 2007 10:09am
Subject:bk commit into 5.0 tree (gluh:1.2547) BUG#31032
View as plain text  
Below is the list of changes that have just been committed into a local
5.0 repository of gluh. When gluh does a push these changes will
be propagated to the main repository and, within 24 hours after the
push, to the public repository.
For information on how to access the public repository
see http://dev.mysql.com/doc/mysql/en/installing-source-tree.html

ChangeSet@stripped, 2007-10-30 14:09:19+04:00, gluh@stripped +3 -0
  Bug#31032 AUTO_INCREMENT not consistently rejected for non-integer data types
  removed AUTO_INCREMENT_FLAG setting for float&double fields
  (according to manual: http://dev.mysql.com/doc/refman/5.0/en/create-table.html)

  mysql-test/r/create.result@stripped, 2007-10-30 14:09:18+04:00, gluh@stripped +4 -0
    test result

  mysql-test/t/create.test@stripped, 2007-10-30 14:09:18+04:00, gluh@stripped +8 -0
    test case

  sql/field.cc@stripped, 2007-10-30 14:09:18+04:00, gluh@stripped +0 -2
    removed AUTO_INCREMENT_FLAG setting for float&double fields
    (according to manual: http://dev.mysql.com/doc/refman/5.0/en/create-table.html)

diff -Nrup a/mysql-test/r/create.result b/mysql-test/r/create.result
--- a/mysql-test/r/create.result	2007-10-10 19:50:45 +05:00
+++ b/mysql-test/r/create.result	2007-10-30 14:09:18 +04:00
@@ -1532,4 +1532,8 @@ Handler_read_prev	0
 Handler_read_rnd	0
 Handler_read_rnd_next	7
 drop table t1,t2;
+CREATE TABLE t1 (f1 FLOAT AUTO_INCREMENT NOT NULL PRIMARY KEY);
+ERROR 42000: Incorrect column specifier for column 'f1'
+CREATE TABLE t1 (f1 DOUBLE AUTO_INCREMENT NOT NULL PRIMARY KEY);
+ERROR 42000: Incorrect column specifier for column 'f1'
 End of 5.0 tests
diff -Nrup a/mysql-test/t/create.test b/mysql-test/t/create.test
--- a/mysql-test/t/create.test	2007-07-26 03:28:49 +05:00
+++ b/mysql-test/t/create.test	2007-10-30 14:09:18 +04:00
@@ -1148,4 +1148,12 @@ create table t2 select sql_big_result f1
 show status like 'handler_read%';
 drop table t1,t2;
 
+#
+# Bug#31032 AUTO_INCREMENT not consistently rejected for non-integer data types
+#
+--error 1063
+CREATE TABLE t1 (f1 FLOAT AUTO_INCREMENT NOT NULL PRIMARY KEY);
+--error 1063
+CREATE TABLE t1 (f1 DOUBLE AUTO_INCREMENT NOT NULL PRIMARY KEY);
+
 --echo End of 5.0 tests
diff -Nrup a/sql/field.cc b/sql/field.cc
--- a/sql/field.cc	2007-10-23 18:48:55 +05:00
+++ b/sql/field.cc	2007-10-30 14:09:18 +04:00
@@ -8495,7 +8495,6 @@ bool create_field::init(THD *thd, char *
     break;
   case FIELD_TYPE_FLOAT:
     /* change FLOAT(precision) to FLOAT or DOUBLE */
-    allowed_type_modifier= AUTO_INCREMENT_FLAG;
     if (fld_length && !fld_decimals)
     {
       uint tmp_length= length;
@@ -8527,7 +8526,6 @@ bool create_field::init(THD *thd, char *
     }
     break;
   case FIELD_TYPE_DOUBLE:
-    allowed_type_modifier= AUTO_INCREMENT_FLAG;
     if (!fld_length && !fld_decimals)
     {
       length= DBL_DIG+7;
Thread
bk commit into 5.0 tree (gluh:1.2547) BUG#31032gluh30 Oct