List:Commits« Previous MessageNext Message »
From:konstantin Date:August 1 2007 10:28am
Subject:bk commit into 5.0 tree (kostja:1.2487)
View as plain text  
Below is the list of changes that have just been committed into a local
5.0 repository of kostja. When kostja 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, 2007-08-01 12:28:08+04:00, kostja@bodhi.(none) +2 -0
  Fix an unstable test. It was reliant on the current time.

  mysql-test/r/func_time.result@stripped, 2007-08-01 12:28:03+04:00, kostja@bodhi.(none) +4 -4
    Update results (use fixed datetime values instead of NOW()).

  mysql-test/t/func_time.test@stripped, 2007-08-01 12:28:03+04:00, kostja@bodhi.(none) +4 -4
    Use fixed datetime values instead of NOW(): the test would have a sporadic
    failure when current day changed between two consequtive calls to
    NOW(). The test actually tests FROM_DAYS/TO_DAYS functions, 
    so use of NOW() is not necessary.

diff -Nrup a/mysql-test/r/func_time.result b/mysql-test/r/func_time.result
--- a/mysql-test/r/func_time.result	2007-03-06 20:50:42 +03:00
+++ b/mysql-test/r/func_time.result	2007-08-01 12:28:03 +04:00
@@ -840,11 +840,11 @@ id	select_type	table	type	possible_keys	
 1	SIMPLE	NULL	NULL	NULL	NULL	NULL	NULL	NULL	No tables used
 Warnings:
 Note	1003	select period_add(_latin1'9602',-(12)) AS
`period_add("9602",-12)`,period_diff(199505,_latin1'9404') AS
`period_diff(199505,"9404")`,from_days(to_days(_latin1'960101')) AS
`from_days(to_days("960101"))`,dayofmonth(_latin1'1997-01-02') AS
`dayofmonth("1997-01-02")`,month(_latin1'1997-01-02') AS
`month("1997-01-02")`,monthname(_latin1'1972-03-04') AS
`monthname("1972-03-04")`,dayofyear(_latin1'0000-00-00') AS
`dayofyear("0000-00-00")`,hour(_latin1'1997-03-03 23:03:22') AS `HOUR("1997-03-03
23:03:22")`,minute(_latin1'23:03:22') AS `MINUTE("23:03:22")`,second(230322) AS
`SECOND(230322)`,quarter(980303) AS `QUARTER(980303)`,week(_latin1'1998-03-03',0) AS
`WEEK("1998-03-03")`,yearweek(_latin1'2000-01-01',1) AS
`yearweek("2000-01-01",1)`,week(19950101,1) AS `week(19950101,1)`,year(_latin1'98-02-03')
AS `year("98-02-03")`,(weekday(curdate()) - weekday(now())) AS
`weekday(curdate())-weekday(now())`,dayname(_latin1'1962-03-03') AS
`dayname("1962-03-03")`,unix_timestamp() AS!
  `unix_timestamp()`,sec_to_time((time_to_sec(_latin1'0:30:47') / 6.21)) AS
`sec_to_time(time_to_sec("0:30:47")/6.21)`,curtime() AS `curtime()`,utc_time() AS
`utc_time()`,curdate() AS `curdate()`,utc_date() AS `utc_date()`,utc_timestamp() AS
`utc_timestamp()`,date_format(_latin1'1997-01-02 03:04:05',_latin1'%M %W %D %Y %y %m %d
%h %i %s %w') AS `date_format("1997-01-02 03:04:05", "%M %W %D %Y %y %m %d %h %i %s
%w")`,from_unixtime(unix_timestamp(_latin1'1994-03-02 10:11:12')) AS
`from_unixtime(unix_timestamp("1994-03-02 10:11:12"))`,(_latin1'1997-12-31 23:59:59' +
interval 1 second) AS `"1997-12-31 23:59:59" + INTERVAL 1 SECOND`,(_latin1'1998-01-01
00:00:00' - interval 1 second) AS `"1998-01-01 00:00:00" - INTERVAL 1
SECOND`,(_latin1'1997-12-31' + interval 1 day) AS `INTERVAL 1 DAY +
"1997-12-31"`,extract(year from _latin1'1999-01-02 10:11:12') AS `extract(YEAR FROM
"1999-01-02 10:11:12")`,(_latin1'1997-12-31 23:59:59' + interval 1 second) AS
`date_add("1997-12-31 23:59:59",I!
 NTERVAL 1 SECOND)`
-SET @TMP=NOW();
+SET @TMP='2007-08-01 12:22:49';
 CREATE TABLE t1 (d DATETIME);
-INSERT INTO t1 VALUES (NOW());
-INSERT INTO t1 VALUES (NOW());
-INSERT INTO t1 VALUES (NOW());
+INSERT INTO t1 VALUES ('2007-08-01 12:22:59');
+INSERT INTO t1 VALUES ('2007-08-01 12:23:01');
+INSERT INTO t1 VALUES ('2007-08-01 12:23:20');
 SELECT count(*) FROM t1 WHERE d>FROM_DAYS(TO_DAYS(@TMP)) AND
d<=FROM_DAYS(TO_DAYS(@TMP)+1);
 count(*)
 3
diff -Nrup a/mysql-test/t/func_time.test b/mysql-test/t/func_time.test
--- a/mysql-test/t/func_time.test	2007-03-06 20:50:43 +03:00
+++ b/mysql-test/t/func_time.test	2007-08-01 12:28:03 +04:00
@@ -423,11 +423,11 @@ select strcmp(concat(utc_date(),' ',utc_
 
 explain extended select
period_add("9602",-12),period_diff(199505,"9404"),from_days(to_days("960101")),dayofmonth("1997-01-02"),
month("1997-01-02"), monthname("1972-03-04"),dayofyear("0000-00-00"),HOUR("1997-03-03
23:03:22"),MINUTE("23:03:22"),SECOND(230322),QUARTER(980303),WEEK("1998-03-03"),yearweek("2000-01-01",1),week(19950101,1),year("98-02-03"),weekday(curdate())-weekday(now()),dayname("1962-03-03"),unix_timestamp(),sec_to_time(time_to_sec("0:30:47")/6.21),curtime(),utc_time(),curdate(),utc_date(),utc_timestamp(),date_format("1997-01-02
03:04:05", "%M %W %D %Y %y %m %d %h %i %s %w"),from_unixtime(unix_timestamp("1994-03-02
10:11:12")),"1997-12-31 23:59:59" + INTERVAL 1 SECOND,"1998-01-01 00:00:00" - INTERVAL 1
SECOND,INTERVAL 1 DAY + "1997-12-31", extract(YEAR FROM "1999-01-02
10:11:12"),date_add("1997-12-31 23:59:59",INTERVAL 1 SECOND);
 
-SET @TMP=NOW();
+SET @TMP='2007-08-01 12:22:49';
 CREATE TABLE t1 (d DATETIME);
-INSERT INTO t1 VALUES (NOW());
-INSERT INTO t1 VALUES (NOW());
-INSERT INTO t1 VALUES (NOW());
+INSERT INTO t1 VALUES ('2007-08-01 12:22:59');
+INSERT INTO t1 VALUES ('2007-08-01 12:23:01');
+INSERT INTO t1 VALUES ('2007-08-01 12:23:20');
 SELECT count(*) FROM t1 WHERE d>FROM_DAYS(TO_DAYS(@TMP)) AND
d<=FROM_DAYS(TO_DAYS(@TMP)+1);
 DROP TABLE t1;
 
Thread
bk commit into 5.0 tree (kostja:1.2487)konstantin1 Aug