List:Internals« Previous MessageNext Message »
From:ramil Date:July 15 2005 12:47pm
Subject:bk commit into 5.0 tree (ramil:1.1942) BUG#11964
View as plain text  
Below is the list of changes that have just been committed into a local
5.0 repository of ram. When ram 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.1942 05/07/15 17:47:40 ramil@stripped +3 -0
  a fix (bug #11964: ALTER TABLE gives wrong error message with sql-mode TRADITIONAL (timestamp)).

  sql/field.cc
    1.275 05/07/15 17:47:31 ramil@stripped +2 -1
    a fix (bug #11964: ALTER TABLE gives wrong error message with sql-mode TRADITIONAL (timestamp)).
    don't set def for timestamp fields.

  mysql-test/t/strict.test
    1.15 05/07/15 17:47:31 ramil@stripped +10 -0
    a fix (bug #11964: ALTER TABLE gives wrong error message with sql-mode TRADITIONAL (timestamp)).

  mysql-test/r/strict.result
    1.20 05/07/15 17:47:31 ramil@stripped +11 -0
    a fix (bug #11964: ALTER TABLE gives wrong error message with sql-mode TRADITIONAL (timestamp)).

# 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:	ramil
# Host:	gw.mysql.r18.ru
# Root:	/usr/home/ram/work/mysql-5.0

--- 1.274/sql/field.cc	2005-07-15 16:25:23 +05:00
+++ 1.275/sql/field.cc	2005-07-15 17:47:31 +05:00
@@ -8489,7 +8489,8 @@
   def=0;
   if (!(flags & (NO_DEFAULT_VALUE_FLAG | BLOB_FLAG)) &&
       !old_field->is_real_null() &&
-      old_field->ptr && orig_field)
+      old_field->ptr && orig_field &&
+      sql_type != FIELD_TYPE_TIMESTAMP)
   {
     char buff[MAX_FIELD_WIDTH],*pos;
     String tmp(buff,sizeof(buff), charset), *res;

--- 1.19/mysql-test/r/strict.result	2005-07-15 15:50:48 +05:00
+++ 1.20/mysql-test/r/strict.result	2005-07-15 17:47:31 +05:00
@@ -1245,3 +1245,14 @@
   `b` date NOT NULL
 ) ENGINE=MyISAM DEFAULT CHARSET=latin1
 drop table t1;
+set @@sql_mode='traditional';
+create table t1(a int, b timestamp);
+alter table t1 add primary key(a);
+show create table t1;
+Table	Create Table
+t1	CREATE TABLE `t1` (
+  `a` int(11) NOT NULL default '0',
+  `b` timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP,
+  PRIMARY KEY  (`a`)
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;

--- 1.14/mysql-test/t/strict.test	2005-07-15 15:50:48 +05:00
+++ 1.15/mysql-test/t/strict.test	2005-07-15 17:47:31 +05:00
@@ -1103,3 +1103,13 @@
 alter table t1 modify a bigint unsigned not null;
 show create table t1;
 drop table t1;
+
+#
+# Bug #11964: problem with altering table
+#
+
+set @@sql_mode='traditional';
+create table t1(a int, b timestamp); 
+alter table t1 add primary key(a);
+show create table t1;
+drop table t1;
Thread
bk commit into 5.0 tree (ramil:1.1942) BUG#11964ramil15 Jul