List:Internals« Previous MessageNext Message »
From:gluh Date:March 29 2005 12:18pm
Subject:bk commit into 4.1 tree (gluh:1.2153) BUG#7977
View as plain text  
Below is the list of changes that have just been committed into a local
4.1 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
  1.2153 05/03/29 16:18:00 gluh@stripped +3 -0
  Fix for bug #7977: in sql_mode=ANSI, show create table ignores auto_increment
    print 'auto_increment' for a field if sql_mode does not have the option 'NO_FIELD_OPTIONS'

  sql/sql_show.cc
    1.198 05/03/29 16:16:59 gluh@stripped +2 -1
    Fix for bug #7977: in sql_mode=ANSI, show create table ignores auto_increment

  mysql-test/t/sql_mode.test
    1.8 05/03/29 16:16:59 gluh@stripped +7 -0
    Fix for bug #7977: in sql_mode=ANSI, show create table ignores auto_increment

  mysql-test/r/sql_mode.result
    1.11 05/03/29 16:16:58 gluh@stripped +10 -1
    Fix for bug #7977: in sql_mode=ANSI, show create table ignores auto_increment

# This is a BitKeeper patch.  What follows are the unified diffs for the
# set of deltas contained in the patch.  The rest of the patch, the part
# that BitKeeper cares about, is below these diffs.
# User:	gluh
# Host:	gluh.mysql.r18.ru
# Root:	/home/gluh/MySQL-BUGS/mysql-4.1.7977

--- 1.197/sql/sql_show.cc	Wed Mar 23 21:19:09 2005
+++ 1.198/sql/sql_show.cc	Tue Mar 29 16:16:59 2005
@@ -1372,7 +1372,8 @@
         field->unireg_check != Field::TIMESTAMP_DN_FIELD)
       packet->append(" on update CURRENT_TIMESTAMP",28);
 
-    if (field->unireg_check == Field::NEXT_NUMBER && !foreign_db_mode)
+    if (field->unireg_check == Field::NEXT_NUMBER && 
+        !(thd->variables.sql_mode & MODE_NO_FIELD_OPTIONS))
       packet->append(" auto_increment", 15 );
 
     if (field->comment.length)

--- 1.10/mysql-test/r/sql_mode.result	Thu Nov  4 07:48:56 2004
+++ 1.11/mysql-test/r/sql_mode.result	Tue Mar 29 16:16:58 2005
@@ -65,7 +65,7 @@
 show create table t1;
 Table	Create Table
 t1	CREATE TABLE `t1` (
-  `a` int(11) NOT NULL auto_increment,
+  `a` int(11) NOT NULL,
   `pseudo` varchar(35) NOT NULL default '',
   `email` varchar(60) NOT NULL default '',
   PRIMARY KEY  (`a`),
@@ -138,3 +138,12 @@
   `min_num` decimal(7,6) default '0.000001'
 ) ENGINE=MyISAM DEFAULT CHARSET=latin1
 drop table t1 ;
+create table t1(f1 integer auto_increment primary key);
+set session sql_mode=ansi;
+show create table t1;
+Table	Create Table
+t1	CREATE TABLE "t1" (
+  "f1" int(11) NOT NULL auto_increment,
+  PRIMARY KEY  ("f1")
+)
+drop table t1;

--- 1.7/mysql-test/t/sql_mode.test	Thu Nov  4 07:47:51 2004
+++ 1.8/mysql-test/t/sql_mode.test	Tue Mar 29 16:16:59 2005
@@ -80,3 +80,10 @@
 show create table t1;
 drop table t1 ;
 
+#
+# Bug #797: in sql_mode=ANSI, show create table ignores auto_increment
+#
+create table t1(f1 integer auto_increment primary key);
+set session sql_mode=ansi;
+show create table t1;
+drop table t1;
Thread
bk commit into 4.1 tree (gluh:1.2153) BUG#7977gluh29 Mar