List:Commits« Previous MessageNext Message »
From:holyfoot Date:August 8 2006 10:34am
Subject:bk commit into 5.0 tree (holyfoot:1.2231) BUG#20910
View as plain text  
Below is the list of changes that have just been committed into a local
5.0 repository of hf. When hf 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, 2006-08-08 13:34:27+05:00, holyfoot@stripped +3 -0
  bug #20910 (NOT NULL reported as NULL for TIMESTAMP)
  
  we intentionally reported that for TIMESTAMPS, which isn't right

  mysql-test/r/type_timestamp.result@stripped, 2006-08-08 13:34:23+05:00, holyfoot@stripped
+24 -9
    result fixed

  mysql-test/t/type_timestamp.test@stripped, 2006-08-08 13:34:23+05:00, holyfoot@stripped +11
-0
    testcase added

  sql/sql_show.cc@stripped, 2006-08-08 13:34:23+05:00, holyfoot@stripped +1 -3
    remove the check for TIMESTAMP type -
    all types will report 'NO' if they're defined as NOT NULL

# 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:	holyfoot
# Host:	deer.(none)
# Root:	/home/hf/work/mysql-5.0.20910

--- 1.327/sql/sql_show.cc	2006-08-08 13:34:34 +05:00
+++ 1.328/sql/sql_show.cc	2006-08-08 13:34:34 +05:00
@@ -2713,9 +2713,7 @@
       table->field[5]->store("",0, cs);
       table->field[5]->set_notnull();
     }
-    pos=(byte*) ((flags & NOT_NULL_FLAG) &&
-                 field->type() != FIELD_TYPE_TIMESTAMP ?
-                 "NO" : "YES");
+    pos=(byte*) ((flags & NOT_NULL_FLAG) ?  "NO" : "YES");
     table->field[6]->store((const char*) pos,
                            strlen((const char*) pos), cs);
     is_blob= (field->type() == FIELD_TYPE_BLOB);

--- 1.29/mysql-test/r/type_timestamp.result	2006-08-08 13:34:34 +05:00
+++ 1.30/mysql-test/r/type_timestamp.result	2006-08-08 13:34:34 +05:00
@@ -201,9 +201,9 @@
 ) ENGINE=MyISAM DEFAULT CHARSET=latin1
 show columns from t1;
 Field	Type	Null	Key	Default	Extra
-t1	timestamp	YES		2003-01-01 00:00:00	
+t1	timestamp	NO		2003-01-01 00:00:00	
 t2	datetime	YES		NULL	
-t3	timestamp	YES		0000-00-00 00:00:00	
+t3	timestamp	NO		0000-00-00 00:00:00	
 drop table t1;
 create table t1 (t1 timestamp default now(), t2 datetime, t3 timestamp);
 SET TIMESTAMP=1000000002;
@@ -225,9 +225,9 @@
 ) ENGINE=MyISAM DEFAULT CHARSET=latin1
 show columns from t1;
 Field	Type	Null	Key	Default	Extra
-t1	timestamp	YES		CURRENT_TIMESTAMP	
+t1	timestamp	NO		CURRENT_TIMESTAMP	
 t2	datetime	YES		NULL	
-t3	timestamp	YES		0000-00-00 00:00:00	
+t3	timestamp	NO		0000-00-00 00:00:00	
 drop table t1;
 create table t1 (t1 timestamp default '2003-01-01 00:00:00' on update now(), t2
datetime);
 SET TIMESTAMP=1000000004;
@@ -251,7 +251,7 @@
 ) ENGINE=MyISAM DEFAULT CHARSET=latin1
 show columns from t1;
 Field	Type	Null	Key	Default	Extra
-t1	timestamp	YES		2003-01-01 00:00:00	
+t1	timestamp	NO		2003-01-01 00:00:00	
 t2	datetime	YES		NULL	
 drop table t1;
 create table t1 (t1 timestamp default now() on update now(), t2 datetime);
@@ -276,7 +276,7 @@
 ) ENGINE=MyISAM DEFAULT CHARSET=latin1
 show columns from t1;
 Field	Type	Null	Key	Default	Extra
-t1	timestamp	YES		CURRENT_TIMESTAMP	
+t1	timestamp	NO		CURRENT_TIMESTAMP	
 t2	datetime	YES		NULL	
 drop table t1;
 create table t1 (t1 timestamp, t2 datetime, t3 timestamp);
@@ -302,9 +302,9 @@
 ) ENGINE=MyISAM DEFAULT CHARSET=latin1
 show columns from t1;
 Field	Type	Null	Key	Default	Extra
-t1	timestamp	YES		CURRENT_TIMESTAMP	
+t1	timestamp	NO		CURRENT_TIMESTAMP	
 t2	datetime	YES		NULL	
-t3	timestamp	YES		0000-00-00 00:00:00	
+t3	timestamp	NO		0000-00-00 00:00:00	
 drop table t1;
 create table t1 (t1 timestamp default current_timestamp on update current_timestamp, t2
datetime);
 SET TIMESTAMP=1000000009;
@@ -328,7 +328,7 @@
 ) ENGINE=MyISAM DEFAULT CHARSET=latin1
 show columns from t1;
 Field	Type	Null	Key	Default	Extra
-t1	timestamp	YES		CURRENT_TIMESTAMP	
+t1	timestamp	NO		CURRENT_TIMESTAMP	
 t2	datetime	YES		NULL	
 delete from t1;
 insert into t1 values ('2004-04-01 00:00:00', '2004-04-01 00:00:00');
@@ -493,3 +493,18 @@
 6	NULL	2006-06-06 06:06:06
 drop table t1;
 set time_zone= @@global.time_zone;
+CREATE TABLE t1 (
+`id` int(11) NOT NULL auto_increment,
+`username` varchar(80) NOT NULL default '',
+`posted_on` timestamp NOT NULL default '0000-00-00 00:00:00',
+PRIMARY KEY (`id`)
+) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=1;
+show fields from t1;
+Field	Type	Null	Key	Default	Extra
+id	int(11)	NO	PRI	NULL	auto_increment
+username	varchar(80)	NO			
+posted_on	timestamp	NO		0000-00-00 00:00:00	
+select is_nullable from INFORMATION_SCHEMA.COLUMNS where TABLE_NAME='t1' and
COLUMN_NAME='posted_on';
+is_nullable
+NO
+drop table t1;

--- 1.27/mysql-test/t/type_timestamp.test	2006-08-08 13:34:34 +05:00
+++ 1.28/mysql-test/t/type_timestamp.test	2006-08-08 13:34:34 +05:00
@@ -328,3 +328,14 @@
 
 # Restore timezone to default
 set time_zone= @@global.time_zone;
+
+CREATE TABLE t1 (
+`id` int(11) NOT NULL auto_increment,
+`username` varchar(80) NOT NULL default '',
+`posted_on` timestamp NOT NULL default '0000-00-00 00:00:00',
+PRIMARY KEY (`id`)
+) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=1;
+
+show fields from t1;
+select is_nullable from INFORMATION_SCHEMA.COLUMNS where TABLE_NAME='t1' and
COLUMN_NAME='posted_on';
+drop table t1;
Thread
bk commit into 5.0 tree (holyfoot:1.2231) BUG#20910holyfoot8 Aug