List:Internals« Previous MessageNext Message »
From:Martin Skold Date:April 1 2005 5:59pm
Subject:bk commit into 4.1 tree (mskold:1.2172) BUG#9435
View as plain text  
Below is the list of changes that have just been committed into a local
4.1 repository of marty. When marty 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.2172 05/04/01 17:59:46 mskold@stripped +3 -0
  Fix for bug#9435: TIMESTAMP columns don't update

  sql/ha_ndbcluster.cc
    1.136 05/04/01 17:59:28 mskold@stripped +4 -0
    Fix for bug#9435: TIMESTAMP columns don't update

  mysql-test/t/ndb_types.test
    1.2 05/04/01 17:59:28 mskold@stripped +36 -4
    Fix for bug#9435: TIMESTAMP columns don't update

  mysql-test/r/ndb_types.result
    1.2 05/04/01 17:59:28 mskold@stripped +39 -3
    Fix for bug#9435: TIMESTAMP columns don't update

# 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:	mskold
# Host:	blowfish.ndb.mysql.com
# Root:	/usr/local/home/marty/MySQL/mysql-4.1

--- 1.1/mysql-test/r/ndb_types.result	Mon Jul 19 11:38:26 2004
+++ 1.2/mysql-test/r/ndb_types.result	Fri Apr  1 17:59:28 2005
@@ -2,6 +2,9 @@
 CREATE TABLE t1 (
 auto int(5) unsigned NOT NULL auto_increment,
 string char(10) default "hello",
+vstring varchar(10) default "hello",
+bin binary(7),
+vbin varbinary(7),
 tiny tinyint(4) DEFAULT '0' NOT NULL ,
 short smallint(6) DEFAULT '1' NOT NULL ,
 medium mediumint(8) DEFAULT '0' NOT NULL,
@@ -14,12 +17,13 @@
 umedium mediumint(8) unsigned DEFAULT '0' NOT NULL,
 ulong int(11) unsigned DEFAULT '0' NOT NULL,
 ulonglong bigint(13) unsigned DEFAULT '0' NOT NULL,
-time_stamp timestamp,
+options enum('one','two','tree') not null,
+flags set('one','two','tree') not null,
 date_field date,	
+year_field year,
 time_field time,	
 date_time datetime,
-options enum('one','two','tree') not null,
-flags set('one','two','tree') not null,
+time_stamp timestamp not null default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP,
 PRIMARY KEY (auto),
 KEY (utiny),
 KEY (tiny),
@@ -33,4 +37,36 @@
 KEY (ulonglong,ulong),
 KEY (options,flags)
 );
+set @now = now();
+insert into t1 
+(string,vstring,bin,vbin,tiny,short,medium,long_int,longlong,
+real_float,real_double, utiny, ushort, umedium,ulong,ulonglong,
+options,flags,date_field,year_field,time_field,date_time)
+values
+("aaaa","aaaa",0xAAAA,0xAAAA,-1,-1,-1,-1,-1,1.1,1.1,1,1,1,1,1, 
+'one','one', '1901-01-01','1901','01:01:01','1901-01-01 01:01:01');
+select auto,string,vstring,bin,vbin,tiny,short,medium,long_int,longlong,
+real_float,real_double, utiny, ushort, umedium,ulong,ulonglong,
+options,flags,date_field,year_field,time_field,date_time
+from t1;
+auto	string	vstring	bin	vbin	tiny	short	medium	long_int	longlong	real_float	real_double	utiny	ushort	umedium	ulong	ulonglong	options	flags	date_field	year_field	time_field	date_time
+1	aaaa	aaaa	ªª	ªª	-1	-1	-1	-1	-1	1.1	1.1000	1	00001	1	1	1	one	one	1901-01-01	1901	01:01:01	1901-01-01
01:01:01
+select time_stamp>@now from t1;
+time_stamp>@now
+1
+set @now = now();
+update t1 set string="bbbb",vstring="bbbb",bin=0xBBBB,vbin=0xBBBB,
+tiny=-2,short=-2,medium=-2,long_int=-2,longlong=-2,real_float=2.2,
+real_double=2.2,utiny=2,ushort=2,umedium=2,ulong=2,ulonglong=2, 
+options='one',flags='one', date_field='1902-02-02',year_field='1902',
+time_field='02:02:02',date_time='1902-02-02 02:02:02' where auto=1;
+select auto,string,vstring,bin,vbin,tiny,short,medium,long_int,longlong,
+real_float,real_double, utiny, ushort, umedium,ulong,ulonglong,
+options,flags,date_field,year_field,time_field,date_time
+from t1;
+auto	string	vstring	bin	vbin	tiny	short	medium	long_int	longlong	real_float	real_double	utiny	ushort	umedium	ulong	ulonglong	options	flags	date_field	year_field	time_field	date_time
+1	bbbb	bbbb	»»	»»	-2	-2	-2	-2	-2	2.2	2.2000	2	00002	2	2	2	one	one	1902-02-02	1902	02:02:02	1902-02-02
02:02:02
+select time_stamp>@now from t1;
+time_stamp>@now
+1
 drop table t1;

--- 1.1/mysql-test/t/ndb_types.test	Mon Jul 19 11:38:26 2004
+++ 1.2/mysql-test/t/ndb_types.test	Fri Apr  1 17:59:28 2005
@@ -7,10 +7,12 @@
 #
 # Test creation of different column types in NDB
 #
-
 CREATE TABLE t1 (
   auto int(5) unsigned NOT NULL auto_increment,
   string char(10) default "hello",
+  vstring varchar(10) default "hello",
+  bin binary(7),
+  vbin varbinary(7),
   tiny tinyint(4) DEFAULT '0' NOT NULL ,
   short smallint(6) DEFAULT '1' NOT NULL ,
   medium mediumint(8) DEFAULT '0' NOT NULL,
@@ -23,12 +25,13 @@
   umedium mediumint(8) unsigned DEFAULT '0' NOT NULL,
   ulong int(11) unsigned DEFAULT '0' NOT NULL,
   ulonglong bigint(13) unsigned DEFAULT '0' NOT NULL,
-  time_stamp timestamp,
+  options enum('one','two','tree') not null,
+  flags set('one','two','tree') not null,
   date_field date,	
+  year_field year,
   time_field time,	
   date_time datetime,
-  options enum('one','two','tree') not null,
-  flags set('one','two','tree') not null,
+  time_stamp timestamp not null default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP,
   PRIMARY KEY (auto),
   KEY (utiny),
   KEY (tiny),
@@ -43,5 +46,34 @@
   KEY (options,flags)
 );
 
+set @now = now();
+sleep 1;
+insert into t1 
+(string,vstring,bin,vbin,tiny,short,medium,long_int,longlong,
+ real_float,real_double, utiny, ushort, umedium,ulong,ulonglong,
+ options,flags,date_field,year_field,time_field,date_time)
+values
+("aaaa","aaaa",0xAAAA,0xAAAA,-1,-1,-1,-1,-1,1.1,1.1,1,1,1,1,1, 
+ 'one','one', '1901-01-01','1901','01:01:01','1901-01-01 01:01:01');
+
+select auto,string,vstring,bin,vbin,tiny,short,medium,long_int,longlong,
+ real_float,real_double, utiny, ushort, umedium,ulong,ulonglong,
+ options,flags,date_field,year_field,time_field,date_time
+from t1;
+select time_stamp>@now from t1;
+
+set @now = now();
+sleep 1;
+update t1 set string="bbbb",vstring="bbbb",bin=0xBBBB,vbin=0xBBBB,
+tiny=-2,short=-2,medium=-2,long_int=-2,longlong=-2,real_float=2.2,
+real_double=2.2,utiny=2,ushort=2,umedium=2,ulong=2,ulonglong=2, 
+options='one',flags='one', date_field='1902-02-02',year_field='1902',
+time_field='02:02:02',date_time='1902-02-02 02:02:02' where auto=1;
+
+select auto,string,vstring,bin,vbin,tiny,short,medium,long_int,longlong,
+ real_float,real_double, utiny, ushort, umedium,ulong,ulonglong,
+ options,flags,date_field,year_field,time_field,date_time
+from t1;
+select time_stamp>@now from t1;
 
 drop table t1;

--- 1.135/sql/ha_ndbcluster.cc	Tue Mar 22 17:48:12 2005
+++ 1.136/sql/ha_ndbcluster.cc	Fri Apr  1 17:59:28 2005
@@ -1953,7 +1953,11 @@
   
   statistic_increment(ha_update_count,&LOCK_status);
   if (table->timestamp_field_type & TIMESTAMP_AUTO_SET_ON_UPDATE)
+  {
     table->timestamp_field->set_time();
+    // Set query_id so that field is really updated
+    table->timestamp_field->query_id= thd->query_id;
+  }
 
   /* Check for update of primary key for special handling */  
   if ((table->primary_key != MAX_KEY) &&
Thread
bk commit into 4.1 tree (mskold:1.2172) BUG#9435Martin Skold1 Apr