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.2327 05/06/30 14:12:25 gluh@stripped +3 -0
Fix for bug#7977 in sql_mode=ANSI, show create table ignores auto_increment
print 'auto_increment','sharacter set','collate', 'default', 'current_timestamp'
for a field if sql_mode does not have the option 'NO_FIELD_OPTIONS'
sql/sql_show.cc
1.199 05/06/30 14:11:45 gluh@stripped +5 -3
Fix for bug#7977 in sql_mode=ANSI, show create table ignores auto_increment
print 'auto_increment','sharacter set','collate', 'default', 'current_timestamp'
for a field if sql_mode does not have the option 'NO_FIELD_OPTIONS'
mysql-test/t/sql_mode.test
1.9 05/06/30 14:11:45 gluh@stripped +10 -0
Fix for bug#7977 in sql_mode=ANSI, show create table ignores auto_increment
print 'auto_increment','sharacter set','collate', 'default', 'current_timestamp'
for a field if sql_mode does not have the option 'NO_FIELD_OPTIONS'
mysql-test/r/sql_mode.result
1.12 05/06/30 14:11:45 gluh@stripped +13 -1
Fix for bug#7977 in sql_mode=ANSI, show create table ignores auto_increment
print 'auto_increment','sharacter set','collate', 'default', 'current_timestamp'
for a field if sql_mode does not have the option 'NO_FIELD_OPTIONS'
# 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: eagle.intranet.mysql.r18.ru
# Root: /home/gluh/MySQL/Bugs/4.1.7977
--- 1.198/sql/sql_show.cc Sun Apr 17 00:35:37 2005
+++ 1.199/sql/sql_show.cc Thu Jun 30 14:11:45 2005
@@ -1299,7 +1299,8 @@
field->sql_type(type);
packet->append(type.ptr(), type.length(), system_charset_info);
- if (field->has_charset() && !limited_mysql_mode && !foreign_db_mode)
+ if (field->has_charset() &&
+ !(thd->variables.sql_mode & MODE_NO_FIELD_OPTIONS))
{
if (field->charset() != table->table_charset)
{
@@ -1337,7 +1338,7 @@
has_default= (field->type() != FIELD_TYPE_BLOB &&
field->unireg_check != Field::NEXT_NUMBER &&
- !((foreign_db_mode || limited_mysql_mode) &&
+ !((thd->variables.sql_mode & MODE_NO_FIELD_OPTIONS) &&
has_now_default));
if (has_default)
@@ -1372,7 +1373,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.11/mysql-test/r/sql_mode.result Thu Jun 9 14:38:50 2005
+++ 1.12/mysql-test/r/sql_mode.result Thu Jun 30 14:11:45 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`),
@@ -140,3 +140,15 @@
drop table t1 ;
set @@SQL_MODE=NULL;
ERROR 42000: Variable 'sql_mode' can't be set to the value of 'NULL'
+set session sql_mode=ansi;
+create table t1
+(f1 integer auto_increment primary key,
+f2 timestamp default current_timestamp on update current_timestamp);
+show create table t1;
+Table Create Table
+t1 CREATE TABLE "t1" (
+ "f1" int(11) NOT NULL auto_increment,
+ "f2" timestamp NOT NULL default CURRENT_TIMESTAMP,
+ PRIMARY KEY ("f1")
+)
+drop table t1;
--- 1.8/mysql-test/t/sql_mode.test Thu Jun 9 14:38:50 2005
+++ 1.9/mysql-test/t/sql_mode.test Thu Jun 30 14:11:45 2005
@@ -85,3 +85,13 @@
#
--error 1231
set @@SQL_MODE=NULL;
+
+#
+# Bug #797: in sql_mode=ANSI, show create table ignores auto_increment
+#
+set session sql_mode=ansi;
+create table t1
+(f1 integer auto_increment primary key,
+ f2 timestamp default current_timestamp on update current_timestamp);
+show create table t1;
+drop table t1;
| Thread |
|---|
| • bk commit into 4.1 tree (gluh:1.2327) BUG#7977 | gluh | 30 Jun |