diff options
author | Alexander Barkov <bar@mnogosearch.org> | 2013-09-12 21:31:14 +0400 |
---|---|---|
committer | Alexander Barkov <bar@mnogosearch.org> | 2013-09-12 21:31:14 +0400 |
commit | 499ddea5766d988adc858448c8eec549c7bedcc1 (patch) | |
tree | fd0a976fc3ac2b96c8f812c1bab2e0e57976cfce /mysql-test/r | |
parent | c2b38529a9ca2ea09dfa73186d9350a0d6dcd6ac (diff) | |
download | mariadb-git-499ddea5766d988adc858448c8eec549c7bedcc1.tar.gz |
MDEV-4724 Some temporal functions do not preserve microseconds
Diffstat (limited to 'mysql-test/r')
-rw-r--r-- | mysql-test/r/date_formats.result | 108 | ||||
-rw-r--r-- | mysql-test/r/func_sapdb.result | 6 | ||||
-rw-r--r-- | mysql-test/r/func_time.result | 175 | ||||
-rw-r--r-- | mysql-test/r/func_time_hires.result | 20 | ||||
-rw-r--r-- | mysql-test/r/ps_2myisam.result | 12 | ||||
-rw-r--r-- | mysql-test/r/ps_3innodb.result | 12 | ||||
-rw-r--r-- | mysql-test/r/ps_4heap.result | 12 | ||||
-rw-r--r-- | mysql-test/r/ps_5merge.result | 24 | ||||
-rw-r--r-- | mysql-test/r/timezone.result | 4 | ||||
-rw-r--r-- | mysql-test/r/timezone4.result | 2 | ||||
-rw-r--r-- | mysql-test/r/type_time.result | 4 |
11 files changed, 262 insertions, 117 deletions
diff --git a/mysql-test/r/date_formats.result b/mysql-test/r/date_formats.result index dd346cb94dc..88255a06adb 100644 --- a/mysql-test/r/date_formats.result +++ b/mysql-test/r/date_formats.result @@ -257,70 +257,70 @@ Tuesday 52 2001 %W %V %X 2002-01-01 15-2001-1 %d-%Y-%c 2001-01-15 select date,format,TIME(str_to_date(date, format)) as time from t1; date format time -2003-01-02 10:11:12 %Y-%m-%d %H:%i:%S 10:11:12 -03-01-02 8:11:2.123456 %y-%m-%d %H:%i:%S.%# 08:11:02 -0003-01-02 8:11:2.123456 %Y-%m-%d %H:%i:%S.%# 08:11:02 -03-01-02 8:11:2.123456 %Y-%m-%d %H:%i:%S.%# 08:11:02 -2003-01-02 10:11:12 PM %Y-%m-%d %h:%i:%S %p 22:11:12 +2003-01-02 10:11:12 %Y-%m-%d %H:%i:%S 10:11:12.000000 +03-01-02 8:11:2.123456 %y-%m-%d %H:%i:%S.%# 08:11:02.000000 +0003-01-02 8:11:2.123456 %Y-%m-%d %H:%i:%S.%# 08:11:02.000000 +03-01-02 8:11:2.123456 %Y-%m-%d %H:%i:%S.%# 08:11:02.000000 +2003-01-02 10:11:12 PM %Y-%m-%d %h:%i:%S %p 22:11:12.000000 2003-01-02 01:11:12.12345AM %Y-%m-%d %h:%i:%S.%f%p 01:11:12.123450 2003-01-02 02:11:12.12345AM %Y-%m-%d %h:%i:%S.%f %p 02:11:12.123450 2003-01-02 12:11:12.12345 am %Y-%m-%d %h:%i:%S.%f%p 00:11:12.123450 -2003-01-02 11:11:12Pm %Y-%m-%d %h:%i:%S%p 23:11:12 -10:20:10 %H:%i:%s 10:20:10 -10:20:10 %h:%i:%s.%f 10:20:10 -10:20:10 %T 10:20:10 -10:20:10AM %h:%i:%s%p 10:20:10 -10:20:10AM %r 10:20:10 +2003-01-02 11:11:12Pm %Y-%m-%d %h:%i:%S%p 23:11:12.000000 +10:20:10 %H:%i:%s 10:20:10.000000 +10:20:10 %h:%i:%s.%f 10:20:10.000000 +10:20:10 %T 10:20:10.000000 +10:20:10AM %h:%i:%s%p 10:20:10.000000 +10:20:10AM %r 10:20:10.000000 10:20:10.44AM %h:%i:%s.%f%p 10:20:10.440000 -15-01-2001 12:59:58 %d-%m-%Y %H:%i:%S 12:59:58 -15 September 2001 %d %M %Y 00:00:00 -15 SEPTEMB 2001 %d %M %Y 00:00:00 -15 MAY 2001 %d %b %Y 00:00:00 -15th May 2001 %D %b %Y 00:00:00 -Sunday 15 MAY 2001 %W %d %b %Y 00:00:00 -Sund 15 MAY 2001 %W %d %b %Y 00:00:00 -Tuesday 00 2002 %W %U %Y 00:00:00 -Thursday 53 1998 %W %u %Y 00:00:00 -Sunday 01 2001 %W %v %x 00:00:00 -Tuesday 52 2001 %W %V %X 00:00:00 -060 2004 %j %Y 00:00:00 -4 53 1998 %w %u %Y 00:00:00 -15-01-2001 %d-%m-%Y %H:%i:%S 00:00:00 -15-01-20 %d-%m-%y 00:00:00 -15-2001-1 %d-%Y-%c 00:00:00 +15-01-2001 12:59:58 %d-%m-%Y %H:%i:%S 12:59:58.000000 +15 September 2001 %d %M %Y 00:00:00.000000 +15 SEPTEMB 2001 %d %M %Y 00:00:00.000000 +15 MAY 2001 %d %b %Y 00:00:00.000000 +15th May 2001 %D %b %Y 00:00:00.000000 +Sunday 15 MAY 2001 %W %d %b %Y 00:00:00.000000 +Sund 15 MAY 2001 %W %d %b %Y 00:00:00.000000 +Tuesday 00 2002 %W %U %Y 00:00:00.000000 +Thursday 53 1998 %W %u %Y 00:00:00.000000 +Sunday 01 2001 %W %v %x 00:00:00.000000 +Tuesday 52 2001 %W %V %X 00:00:00.000000 +060 2004 %j %Y 00:00:00.000000 +4 53 1998 %w %u %Y 00:00:00.000000 +15-01-2001 %d-%m-%Y %H:%i:%S 00:00:00.000000 +15-01-20 %d-%m-%y 00:00:00.000000 +15-2001-1 %d-%Y-%c 00:00:00.000000 select date,format,concat(TIME(str_to_date(date, format))) as time2 from t1; date format time2 -2003-01-02 10:11:12 %Y-%m-%d %H:%i:%S 10:11:12 -03-01-02 8:11:2.123456 %y-%m-%d %H:%i:%S.%# 08:11:02 -0003-01-02 8:11:2.123456 %Y-%m-%d %H:%i:%S.%# 08:11:02 -03-01-02 8:11:2.123456 %Y-%m-%d %H:%i:%S.%# 08:11:02 -2003-01-02 10:11:12 PM %Y-%m-%d %h:%i:%S %p 22:11:12 +2003-01-02 10:11:12 %Y-%m-%d %H:%i:%S 10:11:12.000000 +03-01-02 8:11:2.123456 %y-%m-%d %H:%i:%S.%# 08:11:02.000000 +0003-01-02 8:11:2.123456 %Y-%m-%d %H:%i:%S.%# 08:11:02.000000 +03-01-02 8:11:2.123456 %Y-%m-%d %H:%i:%S.%# 08:11:02.000000 +2003-01-02 10:11:12 PM %Y-%m-%d %h:%i:%S %p 22:11:12.000000 2003-01-02 01:11:12.12345AM %Y-%m-%d %h:%i:%S.%f%p 01:11:12.123450 2003-01-02 02:11:12.12345AM %Y-%m-%d %h:%i:%S.%f %p 02:11:12.123450 2003-01-02 12:11:12.12345 am %Y-%m-%d %h:%i:%S.%f%p 00:11:12.123450 -2003-01-02 11:11:12Pm %Y-%m-%d %h:%i:%S%p 23:11:12 -10:20:10 %H:%i:%s 10:20:10 -10:20:10 %h:%i:%s.%f 10:20:10 -10:20:10 %T 10:20:10 -10:20:10AM %h:%i:%s%p 10:20:10 -10:20:10AM %r 10:20:10 +2003-01-02 11:11:12Pm %Y-%m-%d %h:%i:%S%p 23:11:12.000000 +10:20:10 %H:%i:%s 10:20:10.000000 +10:20:10 %h:%i:%s.%f 10:20:10.000000 +10:20:10 %T 10:20:10.000000 +10:20:10AM %h:%i:%s%p 10:20:10.000000 +10:20:10AM %r 10:20:10.000000 10:20:10.44AM %h:%i:%s.%f%p 10:20:10.440000 -15-01-2001 12:59:58 %d-%m-%Y %H:%i:%S 12:59:58 -15 September 2001 %d %M %Y 00:00:00 -15 SEPTEMB 2001 %d %M %Y 00:00:00 -15 MAY 2001 %d %b %Y 00:00:00 -15th May 2001 %D %b %Y 00:00:00 -Sunday 15 MAY 2001 %W %d %b %Y 00:00:00 -Sund 15 MAY 2001 %W %d %b %Y 00:00:00 -Tuesday 00 2002 %W %U %Y 00:00:00 -Thursday 53 1998 %W %u %Y 00:00:00 -Sunday 01 2001 %W %v %x 00:00:00 -Tuesday 52 2001 %W %V %X 00:00:00 -060 2004 %j %Y 00:00:00 -4 53 1998 %w %u %Y 00:00:00 -15-01-2001 %d-%m-%Y %H:%i:%S 00:00:00 -15-01-20 %d-%m-%y 00:00:00 -15-2001-1 %d-%Y-%c 00:00:00 +15-01-2001 12:59:58 %d-%m-%Y %H:%i:%S 12:59:58.000000 +15 September 2001 %d %M %Y 00:00:00.000000 +15 SEPTEMB 2001 %d %M %Y 00:00:00.000000 +15 MAY 2001 %d %b %Y 00:00:00.000000 +15th May 2001 %D %b %Y 00:00:00.000000 +Sunday 15 MAY 2001 %W %d %b %Y 00:00:00.000000 +Sund 15 MAY 2001 %W %d %b %Y 00:00:00.000000 +Tuesday 00 2002 %W %U %Y 00:00:00.000000 +Thursday 53 1998 %W %u %Y 00:00:00.000000 +Sunday 01 2001 %W %v %x 00:00:00.000000 +Tuesday 52 2001 %W %V %X 00:00:00.000000 +060 2004 %j %Y 00:00:00.000000 +4 53 1998 %w %u %Y 00:00:00.000000 +15-01-2001 %d-%m-%Y %H:%i:%S 00:00:00.000000 +15-01-20 %d-%m-%y 00:00:00.000000 +15-2001-1 %d-%Y-%c 00:00:00.000000 select concat('',str_to_date('8:11:2.123456 03-01-02','%H:%i:%S.%f %y-%m-%d')); concat('',str_to_date('8:11:2.123456 03-01-02','%H:%i:%S.%f %y-%m-%d')) 2003-01-02 08:11:02.123456 diff --git a/mysql-test/r/func_sapdb.result b/mysql-test/r/func_sapdb.result index feb92da3321..138b1a99d97 100644 --- a/mysql-test/r/func_sapdb.result +++ b/mysql-test/r/func_sapdb.result @@ -156,7 +156,7 @@ timestamp("2001-12-01", "25:01:01") 2001-12-02 01:01:01 select timestamp("2001-12-01 01:01:01.000100"); timestamp("2001-12-01 01:01:01.000100") -2001-12-01 01:01:01.000100 +2001-12-01 01:01:01.0001 select timestamp("2001-12-01"); timestamp("2001-12-01") 2001-12-01 00:00:00 @@ -200,12 +200,12 @@ f3 time(6) YES NULL f4 time(6) YES NULL f5 time(6) YES NULL f6 time YES NULL -f7 datetime(6) YES NULL +f7 datetime YES NULL f8 date YES NULL f9 time(6) YES NULL select * from t1; f1 f2 f3 f4 f5 f6 f7 f8 f9 -1997-01-01 1998-01-02 01:01:00.000003 49:01:01.000001 46:58:57.999999 -24:00:00.000001 10:11:12 2001-12-01 01:01:01.000000 1997-12-31 23:59:59.000001 +1997-01-01 1998-01-02 01:01:00.000003 49:01:01.000001 46:58:57.999999 -24:00:00.000001 10:11:12 2001-12-01 01:01:01 1997-12-31 23:59:59.000001 create table test(t1 datetime, t2 time, t3 time, t4 datetime); insert into test values ('2001-01-01 01:01:01', '01:01:01', null, '2001-02-01 01:01:01'), diff --git a/mysql-test/r/func_time.result b/mysql-test/r/func_time.result index 8bbc692aa4a..99104136f2b 100644 --- a/mysql-test/r/func_time.result +++ b/mysql-test/r/func_time.result @@ -11,17 +11,17 @@ now()-now() weekday(curdate())-weekday(now()) unix_timestamp()-unix_timestamp(no 0 0 0 select from_unixtime(unix_timestamp("1994-03-02 10:11:12")),from_unixtime(unix_timestamp("1994-03-02 10:11:12"),"%Y-%m-%d %h:%i:%s"),from_unixtime(unix_timestamp("1994-03-02 10:11:12"))+0; from_unixtime(unix_timestamp("1994-03-02 10:11:12")) from_unixtime(unix_timestamp("1994-03-02 10:11:12"),"%Y-%m-%d %h:%i:%s") from_unixtime(unix_timestamp("1994-03-02 10:11:12"))+0 -1994-03-02 10:11:12.000000 1994-03-02 10:11:12 19940302101112.000000 +1994-03-02 10:11:12 1994-03-02 10:11:12 19940302101112 select sec_to_time(9001),sec_to_time(9001)+0,time_to_sec("15:12:22"), sec_to_time(time_to_sec("0:30:47")/6.21); sec_to_time(9001) sec_to_time(9001)+0 time_to_sec("15:12:22") sec_to_time(time_to_sec("0:30:47")/6.21) -02:30:01 23001 54742.000000 00:04:57.423510 +02:30:01 23001 54742 00:04:57.4235 select sec_to_time(9001.1), time_to_sec('15:12:22.123456'), time_to_sec(15.5566778899); sec_to_time(9001.1) time_to_sec('15:12:22.123456') time_to_sec(15.5566778899) 02:30:01.1 54742.123456 15.556677 select sec_to_time(time_to_sec('-838:59:59')); sec_to_time(time_to_sec('-838:59:59')) --838:59:59.000000 +-838:59:59 select sec_to_time('9001.1'), sec_to_time('1234567890123.123'); sec_to_time('9001.1') sec_to_time('1234567890123.123') 02:30:01.100000 838:59:59.999999 @@ -77,7 +77,7 @@ HOUR("1997-03-03 23:03:22") MINUTE("23:03:22") SECOND(230322) 23 3 22 select TIME(230322), TIME(230322.33), TIME("230322.33"); TIME(230322) TIME(230322.33) TIME("230322.33") -23:03:22 23:03:22.33 23:03:22.330000 +23:03:22 23:03:22.33 23:03:22.33 select week(19980101),week(19970101),week(19980101,1),week(19970101,1); week(19980101) week(19970101) week(19980101,1) week(19970101,1) 0 0 1 1 @@ -569,7 +569,7 @@ select @a:=FROM_UNIXTIME(1); 1970-01-01 03:00:01 select unix_timestamp(@a); unix_timestamp(@a) -1.000000 +1 select unix_timestamp('1969-12-01 19:00:01'); unix_timestamp('1969-12-01 19:00:01') NULL @@ -611,10 +611,10 @@ unix_timestamp('1969-12-30 01:00:00') NULL select unix_timestamp('2038-01-17 12:00:00'); unix_timestamp('2038-01-17 12:00:00') -2147331600.000000 +2147331600 select unix_timestamp('1970-01-01 03:00:01'); unix_timestamp('1970-01-01 03:00:01') -1.000000 +1 select unix_timestamp('2038-01-19 07:14:07'); unix_timestamp('2038-01-19 07:14:07') NULL @@ -1947,7 +1947,7 @@ TIME(COALESCE(DATE('2001-01-01'),TIMESTAMP('2001-01-02 10:20:30'))) AS c5, DATE(COALESCE(DATE('2001-01-01'),TIMESTAMP('2001-01-02 10:20:30'))) AS c6, TIMESTAMP(COALESCE(DATE('2001-01-01'),TIMESTAMP('2001-01-02 10:20:30'))) AS c7; c1 c2 c3 c4 c5 c6 c7 -20010101000000 20010101000000.0000 20010101000000 2001-01-01 00:00:00.000000 00:00:00.000000 2001-01-01 2001-01-01 00:00:00.000000 +20010101000000 20010101000000.0000 20010101000000 2001-01-01 00:00:00 00:00:00 2001-01-01 2001-01-01 00:00:00 SELECT CAST(COALESCE(TIMESTAMP('2001-01-02 10:20:30'),DATE('2001-01-01')) AS SIGNED) AS c1, CAST(COALESCE(TIMESTAMP('2001-01-02 10:20:30'),DATE('2001-01-01')) AS DECIMAL(25,4)) AS c2, @@ -1957,7 +1957,7 @@ TIME(COALESCE(TIMESTAMP('2001-01-02 10:20:30'),DATE('2001-01-01'))) AS c5, DATE(COALESCE(TIMESTAMP('2001-01-02 10:20:30'),DATE('2001-01-01'))) AS c6, TIMESTAMP(COALESCE(TIMESTAMP('2001-01-02 10:20:30'),DATE('2001-01-01'))) AS c7; c1 c2 c3 c4 c5 c6 c7 -20010102102030 20010102102030.0000 20010102102030 2001-01-02 10:20:30.000000 10:20:30.000000 2001-01-02 2001-01-02 10:20:30.000000 +20010102102030 20010102102030.0000 20010102102030 2001-01-02 10:20:30 10:20:30 2001-01-02 2001-01-02 10:20:30 SELECT CAST(IFNULL(DATE('2001-01-01'),TIMESTAMP('2001-01-02 10:20:30')) AS SIGNED) AS c1, CAST(IFNULL(DATE('2001-01-01'),TIMESTAMP('2001-01-02 10:20:30')) AS DECIMAL(25,4)) AS c2, @@ -1967,7 +1967,7 @@ TIME(IFNULL(DATE('2001-01-01'),TIMESTAMP('2001-01-02 10:20:30'))) AS c5, DATE(IFNULL(DATE('2001-01-01'),TIMESTAMP('2001-01-02 10:20:30'))) AS c6, TIMESTAMP(IFNULL(DATE('2001-01-01'),TIMESTAMP('2001-01-02 10:20:30'))) AS c7; c1 c2 c3 c4 c5 c6 c7 -20010101000000 20010101000000.0000 20010101000000 2001-01-01 00:00:00.000000 00:00:00.000000 2001-01-01 2001-01-01 00:00:00.000000 +20010101000000 20010101000000.0000 20010101000000 2001-01-01 00:00:00 00:00:00 2001-01-01 2001-01-01 00:00:00 SELECT CAST(IFNULL(TIMESTAMP('2001-01-02 10:20:30'),DATE('2001-01-01')) AS SIGNED) AS c1, CAST(IFNULL(TIMESTAMP('2001-01-02 10:20:30'),DATE('2001-01-01')) AS DECIMAL(25,4)) AS c2, @@ -1977,7 +1977,7 @@ TIME(IFNULL(TIMESTAMP('2001-01-02 10:20:30'),DATE('2001-01-01'))) AS c5, DATE(IFNULL(TIMESTAMP('2001-01-02 10:20:30'),DATE('2001-01-01'))) AS c6, TIMESTAMP(IFNULL(TIMESTAMP('2001-01-02 10:20:30'),DATE('2001-01-01'))) AS c7; c1 c2 c3 c4 c5 c6 c7 -20010102102030 20010102102030.0000 20010102102030 2001-01-02 10:20:30.000000 10:20:30.000000 2001-01-02 2001-01-02 10:20:30.000000 +20010102102030 20010102102030.0000 20010102102030 2001-01-02 10:20:30 10:20:30 2001-01-02 2001-01-02 10:20:30 SELECT CAST(IF(1,DATE('2001-01-01'),TIMESTAMP('2001-01-02 10:20:30')) AS SIGNED) AS c1, CAST(IF(1,DATE('2001-01-01'),TIMESTAMP('2001-01-02 10:20:30')) AS DECIMAL(25,4)) AS c2, @@ -1987,7 +1987,7 @@ TIME(IF(1,DATE('2001-01-01'),TIMESTAMP('2001-01-02 10:20:30'))) AS c5, DATE(IF(1,DATE('2001-01-01'),TIMESTAMP('2001-01-02 10:20:30'))) AS c6, TIMESTAMP(IF(1,DATE('2001-01-01'),TIMESTAMP('2001-01-02 10:20:30'))) AS c7; c1 c2 c3 c4 c5 c6 c7 -20010101000000 20010101000000.0000 20010101000000 2001-01-01 00:00:00.000000 00:00:00.000000 2001-01-01 2001-01-01 00:00:00.000000 +20010101000000 20010101000000.0000 20010101000000 2001-01-01 00:00:00 00:00:00 2001-01-01 2001-01-01 00:00:00 SELECT CAST(IF(0,DATE('2001-01-01'),TIMESTAMP('2001-01-02 10:20:30')) AS SIGNED) AS c1, CAST(IF(0,DATE('2001-01-01'),TIMESTAMP('2001-01-02 10:20:30')) AS DECIMAL(25,4)) AS c2, @@ -1997,7 +1997,7 @@ TIME(IF(0,DATE('2001-01-01'),TIMESTAMP('2001-01-02 10:20:30'))) AS c5, DATE(IF(0,DATE('2001-01-01'),TIMESTAMP('2001-01-02 10:20:30'))) AS c6, TIMESTAMP(IF(0,DATE('2001-01-01'),TIMESTAMP('2001-01-02 10:20:30'))) AS c7; c1 c2 c3 c4 c5 c6 c7 -20010102102030 20010102102030.0000 20010102102030 2001-01-02 10:20:30.000000 10:20:30.000000 2001-01-02 2001-01-02 10:20:30.000000 +20010102102030 20010102102030.0000 20010102102030 2001-01-02 10:20:30 10:20:30 2001-01-02 2001-01-02 10:20:30 SELECT CAST(CASE WHEN 1 THEN DATE('2001-01-01') ELSE TIMESTAMP('2001-01-02 10:20:30') END AS SIGNED) AS c1, CAST(CASE WHEN 1 THEN DATE('2001-01-01') ELSE TIMESTAMP('2001-01-02 10:20:30') END AS DECIMAL(25,4)) AS c2, @@ -2007,7 +2007,7 @@ TIME(CASE WHEN 1 THEN DATE('2001-01-01') ELSE TIMESTAMP('2001-01-02 10:20:30') E DATE(CASE WHEN 1 THEN DATE('2001-01-01') ELSE TIMESTAMP('2001-01-02 10:20:30') END) AS c6, TIMESTAMP(CASE WHEN 1 THEN DATE('2001-01-01') ELSE TIMESTAMP('2001-01-02 10:20:30') END) AS c7; c1 c2 c3 c4 c5 c6 c7 -20010101000000 20010101000000.0000 20010101000000 2001-01-01 00:00:00.000000 00:00:00.000000 2001-01-01 2001-01-01 00:00:00.000000 +20010101000000 20010101000000.0000 20010101000000 2001-01-01 00:00:00 00:00:00 2001-01-01 2001-01-01 00:00:00 SELECT CAST(CASE WHEN 0 THEN DATE('2001-01-01') ELSE TIMESTAMP('2001-01-02 10:20:30') END AS SIGNED) AS c1, CAST(CASE WHEN 0 THEN DATE('2001-01-01') ELSE TIMESTAMP('2001-01-02 10:20:30') END AS DECIMAL(25,4)) AS c2, @@ -2017,7 +2017,7 @@ TIME(CASE WHEN 0 THEN DATE('2001-01-01') ELSE TIMESTAMP('2001-01-02 10:20:30') E DATE(CASE WHEN 0 THEN DATE('2001-01-01') ELSE TIMESTAMP('2001-01-02 10:20:30') END) AS c6, TIMESTAMP(CASE WHEN 0 THEN DATE('2001-01-01') ELSE TIMESTAMP('2001-01-02 10:20:30') END) AS c7; c1 c2 c3 c4 c5 c6 c7 -20010102102030 20010102102030.0000 20010102102030 2001-01-02 10:20:30.000000 10:20:30.000000 2001-01-02 2001-01-02 10:20:30.000000 +20010102102030 20010102102030.0000 20010102102030 2001-01-02 10:20:30 10:20:30 2001-01-02 2001-01-02 10:20:30 CREATE TABLE t1 AS SELECT CONCAT(COALESCE(TIME(101010),TIME(101010))) AS c1, CONCAT(IF(0,TIME(101010),TIME(101010))) AS c2, @@ -2032,3 +2032,148 @@ t1 CREATE TABLE `t1` ( `c4` varbinary(10) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 DROP TABLE t1; +# +# MDEV-4724 Some temporal functions do not preserve microseconds +# +SELECT MAKETIME(10,10,10.231); +MAKETIME(10,10,10.231) +10:10:10.231 +SELECT MAKETIME(0, 0, 59.9); +MAKETIME(0, 0, 59.9) +00:00:59.9 +CREATE TABLE t1 AS SELECT +MAKETIME(10,00,00), +MAKETIME(10,00,00.1), +MAKETIME(10,00,00.12), +MAKETIME(10,00,00.123), +MAKETIME(10,00,00.1234), +MAKETIME(10,00,00.12345), +MAKETIME(10,00,00.123456); +SHOW COLUMNS FROM t1; +Field Type Null Key Default Extra +MAKETIME(10,00,00) time YES NULL +MAKETIME(10,00,00.1) time(1) YES NULL +MAKETIME(10,00,00.12) time(2) YES NULL +MAKETIME(10,00,00.123) time(3) YES NULL +MAKETIME(10,00,00.1234) time(4) YES NULL +MAKETIME(10,00,00.12345) time(5) YES NULL +MAKETIME(10,00,00.123456) time(6) YES NULL +DROP TABLE t1; +CREATE TABLE t1 AS SELECT +TIME('10:00:00'), +TIME('10:00:00.1'), +TIME('10:00:00.12'), +TIME('10:00:00.123'), +TIME('10:00:00.1234'), +TIME('10:00:00.12345'), +TIME('10:00:00.12346'); +SHOW COLUMNS FROM t1; +Field Type Null Key Default Extra +TIME('10:00:00') time YES NULL +TIME('10:00:00.1') time(1) YES NULL +TIME('10:00:00.12') time(2) YES NULL +TIME('10:00:00.123') time(3) YES NULL +TIME('10:00:00.1234') time(4) YES NULL +TIME('10:00:00.12345') time(5) YES NULL +TIME('10:00:00.12346') time(5) YES NULL +DROP TABLE t1; +SET TIME_ZONE='+00:00'; +SET TIMESTAMP=UNIX_TIMESTAMP('2012-10-16 22:46:17'); +SELECT NOW(), UNIX_TIMESTAMP(), UNIX_TIMESTAMP(NOW()),UNIX_TIMESTAMP('2012-10-16 22:46:17'); +NOW() UNIX_TIMESTAMP() UNIX_TIMESTAMP(NOW()) UNIX_TIMESTAMP('2012-10-16 22:46:17') +2012-10-16 22:46:17 1350427577 1350427577 1350427577 +SET TIMESTAMP=UNIX_TIMESTAMP('1970-01-02 03:04:05.123456'); +SELECT @@timestamp, FROM_UNIXTIME(@@timestamp); +@@timestamp FROM_UNIXTIME(@@timestamp) +97445.123456 1970-01-02 03:04:05.123456 +SET TIME_ZONE=DEFAULT; +SET TIMESTAMP=DEFAULT; +SELECT TIME('2012-10-16 15:54:16.12'); +TIME('2012-10-16 15:54:16.12') +15:54:16.12 +SELECT TIMESTAMP('2012-10-16 15:54:16.12'); +TIMESTAMP('2012-10-16 15:54:16.12') +2012-10-16 15:54:16.12 +SELECT TIMEDIFF('10:10:10.1','00:00:00'); +TIMEDIFF('10:10:10.1','00:00:00') +10:10:10.1 +SELECT TIME_TO_SEC('10:10:10'); +TIME_TO_SEC('10:10:10') +36610 +SELECT ADDTIME(TIME('10:10:10.1'),'10:10:10.12'); +ADDTIME(TIME('10:10:10.1'),'10:10:10.12') +20:20:20.22 +SELECT ADDTIME(TIMESTAMP('2001-01-01 10:10:10.1'),'10:10:10.12'); +ADDTIME(TIMESTAMP('2001-01-01 10:10:10.1'),'10:10:10.12') +2001-01-01 20:20:20.22 +SELECT DATE_ADD('2001-01-01 00:00:00', INTERVAL 1 SECOND); +DATE_ADD('2001-01-01 00:00:00', INTERVAL 1 SECOND) +2001-01-01 00:00:01 +SELECT DATE_ADD('2001-01-01 00:00:00.1', INTERVAL 1 SECOND); +DATE_ADD('2001-01-01 00:00:00.1', INTERVAL 1 SECOND) +2001-01-01 00:00:01.1 +SELECT DATE_ADD('2001-01-01 00:00:00.12', INTERVAL 1 SECOND); +DATE_ADD('2001-01-01 00:00:00.12', INTERVAL 1 SECOND) +2001-01-01 00:00:01.12 +SELECT DATE_ADD('2001-01-01 00:00:00.123', INTERVAL 1 SECOND); +DATE_ADD('2001-01-01 00:00:00.123', INTERVAL 1 SECOND) +2001-01-01 00:00:01.123 +SELECT DATE_ADD('2001-01-01 00:00:00.1234', INTERVAL 1 SECOND); +DATE_ADD('2001-01-01 00:00:00.1234', INTERVAL 1 SECOND) +2001-01-01 00:00:01.1234 +SELECT DATE_ADD('2001-01-01 00:00:00.12345', INTERVAL 1 SECOND); +DATE_ADD('2001-01-01 00:00:00.12345', INTERVAL 1 SECOND) +2001-01-01 00:00:01.12345 +SELECT DATE_ADD('2001-01-01 00:00:00.123456', INTERVAL 1 SECOND); +DATE_ADD('2001-01-01 00:00:00.123456', INTERVAL 1 SECOND) +2001-01-01 00:00:01.123456 +SELECT DATE_ADD('2001-01-01 00:00:00', INTERVAL 1 SECOND); +DATE_ADD('2001-01-01 00:00:00', INTERVAL 1 SECOND) +2001-01-01 00:00:01 +SELECT DATE_ADD('2001-01-01 00:00:00', INTERVAL 1.1 SECOND); +DATE_ADD('2001-01-01 00:00:00', INTERVAL 1.1 SECOND) +2001-01-01 00:00:01.1 +SELECT DATE_ADD('2001-01-01 00:00:00', INTERVAL 1.12 SECOND); +DATE_ADD('2001-01-01 00:00:00', INTERVAL 1.12 SECOND) +2001-01-01 00:00:01.12 +SELECT DATE_ADD('2001-01-01 00:00:00', INTERVAL 1.123 SECOND); +DATE_ADD('2001-01-01 00:00:00', INTERVAL 1.123 SECOND) +2001-01-01 00:00:01.123 +SELECT DATE_ADD('2001-01-01 00:00:00', INTERVAL 1.1234 SECOND); +DATE_ADD('2001-01-01 00:00:00', INTERVAL 1.1234 SECOND) +2001-01-01 00:00:01.1234 +SELECT DATE_ADD('2001-01-01 00:00:00', INTERVAL 1.12345 SECOND); +DATE_ADD('2001-01-01 00:00:00', INTERVAL 1.12345 SECOND) +2001-01-01 00:00:01.12345 +SELECT DATE_ADD('2001-01-01 00:00:00', INTERVAL 1.123456 SECOND); +DATE_ADD('2001-01-01 00:00:00', INTERVAL 1.123456 SECOND) +2001-01-01 00:00:01.123456 +SELECT DATE_ADD('2001-01-01 00:00:00', INTERVAL -1 SECOND); +DATE_ADD('2001-01-01 00:00:00', INTERVAL -1 SECOND) +2000-12-31 23:59:59 +SELECT DATE_ADD('2001-01-01 00:00:00', INTERVAL -1.1 SECOND); +DATE_ADD('2001-01-01 00:00:00', INTERVAL -1.1 SECOND) +2000-12-31 23:59:58.9 +SELECT DATE_ADD('2001-01-01 00:00:00', INTERVAL -1.12 SECOND); +DATE_ADD('2001-01-01 00:00:00', INTERVAL -1.12 SECOND) +2000-12-31 23:59:58.88 +SELECT DATE_ADD('2001-01-01 00:00:00', INTERVAL -1.123 SECOND); +DATE_ADD('2001-01-01 00:00:00', INTERVAL -1.123 SECOND) +2000-12-31 23:59:58.877 +SELECT DATE_ADD('2001-01-01 00:00:00', INTERVAL -1.1234 SECOND); +DATE_ADD('2001-01-01 00:00:00', INTERVAL -1.1234 SECOND) +2000-12-31 23:59:58.8766 +SELECT DATE_ADD('2001-01-01 00:00:00', INTERVAL -1.12345 SECOND); +DATE_ADD('2001-01-01 00:00:00', INTERVAL -1.12345 SECOND) +2000-12-31 23:59:58.87655 +SELECT DATE_ADD('2001-01-01 00:00:00', INTERVAL -1.123456 SECOND); +DATE_ADD('2001-01-01 00:00:00', INTERVAL -1.123456 SECOND) +2000-12-31 23:59:58.876544 +SELECT DATE_ADD('2001-01-01 00:00:00', INTERVAL 'xxx' SECOND); +DATE_ADD('2001-01-01 00:00:00', INTERVAL 'xxx' SECOND) +2001-01-01 00:00:00.000000 +Warnings: +Warning 1292 Truncated incorrect DECIMAL value: 'xxx' +SELECT CONVERT_TZ('2001-01-01 10:20:30.12','+00:00','+01:00'); +CONVERT_TZ('2001-01-01 10:20:30.12','+00:00','+01:00') +2001-01-01 11:20:30.12 diff --git a/mysql-test/r/func_time_hires.result b/mysql-test/r/func_time_hires.result index 4aa0333c4b4..1a736c89573 100644 --- a/mysql-test/r/func_time_hires.result +++ b/mysql-test/r/func_time_hires.result @@ -15,11 +15,11 @@ current_time(3) 01:01:01.123 current_timestamp(4) 2011-01-01 01:01:01.1234 localtime(5) 2011-01-01 01:01:01.12345 localtimestamp(6) 2011-01-01 01:01:01.123456 -time_to_sec('12:34:56') 45296.000000 -time_to_sec('12:34:56.789') 45296.789000 +time_to_sec('12:34:56') 45296 +time_to_sec('12:34:56.789') 45296.789 select sec_to_time(time_to_sec('1:2:3')), sec_to_time(time_to_sec('2:3:4.567890')); -sec_to_time(time_to_sec('1:2:3')) 01:02:03.000000 -sec_to_time(time_to_sec('2:3:4.567890')) 02:03:04.567890 +sec_to_time(time_to_sec('1:2:3')) 01:02:03 +sec_to_time(time_to_sec('2:3:4.567890')) 02:03:04.56789 select time_to_sec(sec_to_time(11111)), time_to_sec(sec_to_time(11111.22222)); time_to_sec(sec_to_time(11111)) 11111 time_to_sec(sec_to_time(11111.22222)) 11111.22222 @@ -48,7 +48,7 @@ t1 CREATE TABLE `t1` ( `localtime(5)` datetime(5) NOT NULL DEFAULT '0000-00-00 00:00:00.00000', `localtimestamp(6)` datetime(6) NOT NULL DEFAULT '0000-00-00 00:00:00.000000', `time_to_sec(123456)` bigint(17) DEFAULT NULL, - `time_to_sec('12:34:56.789')` decimal(22,6) DEFAULT NULL + `time_to_sec('12:34:56.789')` decimal(19,3) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 select * from t1; sec_to_time(12345) 03:25:45 @@ -63,15 +63,15 @@ current_timestamp(4) 2011-01-01 01:01:01.1234 localtime(5) 2011-01-01 01:01:01.12345 localtimestamp(6) 2011-01-01 01:01:01.123456 time_to_sec(123456) 45296 -time_to_sec('12:34:56.789') 45296.789000 +time_to_sec('12:34:56.789') 45296.789 drop table t1; select unix_timestamp('2011-01-01 01:01:01'), unix_timestamp('2011-01-01 01:01:01.123456'), unix_timestamp(cast('2011-01-01 01:01:01.123456' as datetime(0))), unix_timestamp(cast('2011-01-01 01:01:01.123456' as datetime(4)));; -unix_timestamp('2011-01-01 01:01:01') 1293832861.000000 +unix_timestamp('2011-01-01 01:01:01') 1293832861 unix_timestamp('2011-01-01 01:01:01.123456') 1293832861.123456 unix_timestamp(cast('2011-01-01 01:01:01.123456' as datetime(0))) 1293832861 unix_timestamp(cast('2011-01-01 01:01:01.123456' as datetime(4))) 1293832861.1234 select from_unixtime(unix_timestamp('2011/1/1 1:1:1')), from_unixtime(unix_timestamp('2011/1/1 1:1:1.123456')), from_unixtime(unix_timestamp(cast('2011/1/1 1:1:1.123456' as datetime(0)))), from_unixtime(unix_timestamp(cast('2011/1/1 1:1:1.123456' as datetime(4))));; -from_unixtime(unix_timestamp('2011/1/1 1:1:1')) 2011-01-01 01:01:01.000000 +from_unixtime(unix_timestamp('2011/1/1 1:1:1')) 2011-01-01 01:01:01 from_unixtime(unix_timestamp('2011/1/1 1:1:1.123456')) 2011-01-01 01:01:01.123456 from_unixtime(unix_timestamp(cast('2011/1/1 1:1:1.123456' as datetime(0)))) 2011-01-01 01:01:01 from_unixtime(unix_timestamp(cast('2011/1/1 1:1:1.123456' as datetime(4)))) 2011-01-01 01:01:01.1234 @@ -167,7 +167,7 @@ CONVERT_TZ('2011-01-02 12:00:00', '+00:00', '+03:00') 2011-01-02 15:00:00 SELECT CONVERT_TZ('2011-01-02 12:00:00.123', '+00:00', '+03:00'); CONVERT_TZ('2011-01-02 12:00:00.123', '+00:00', '+03:00') -2011-01-02 15:00:00.123000 +2011-01-02 15:00:00.123 SELECT CONVERT_TZ('2011-01-02 12:00:00.123456', '+00:00', '+03:00'); CONVERT_TZ('2011-01-02 12:00:00.123456', '+00:00', '+03:00') 2011-01-02 15:00:00.123456 @@ -200,7 +200,7 @@ time(f1) alter table t1 modify f1 varchar(100); select time(f1) from t1; time(f1) -21:00:00 +21:00:00.000000 select time(f1) from t1 union all select time(f1 + interval 1 second) from t1; time(f1) 21:00:00.000000 diff --git a/mysql-test/r/ps_2myisam.result b/mysql-test/r/ps_2myisam.result index cce5d6e9e2f..4b245edef09 100644 --- a/mysql-test/r/ps_2myisam.result +++ b/mysql-test/r/ps_2myisam.result @@ -1793,8 +1793,8 @@ t5 CREATE TABLE `t5` ( `param08` longtext, `const09` datetime DEFAULT NULL, `param09` longblob, - `const10` decimal(22,6) DEFAULT NULL, - `param10` decimal(65,30) DEFAULT NULL, + `const10` bigint(17) DEFAULT NULL, + `param10` bigint(20) DEFAULT NULL, `const11` int(4) DEFAULT NULL, `param11` bigint(20) DEFAULT NULL, `const12` binary(0) DEFAULT NULL, @@ -1823,8 +1823,8 @@ def test t5 t5 const08 const08 253 19 19 N 1 0 8 def test t5 t5 param08 param08 252 4294967295 19 Y 16 0 8 def test t5 t5 const09 const09 12 19 19 Y 128 0 63 def test t5 t5 param09 param09 252 4294967295 19 Y 144 0 63 -def test t5 t5 const10 const10 246 24 16 Y 0 6 63 -def test t5 t5 param10 param10 246 67 40 Y 0 30 63 +def test t5 t5 const10 const10 8 17 9 Y 32768 0 63 +def test t5 t5 param10 param10 8 20 9 Y 32768 0 63 def test t5 t5 const11 const11 3 4 4 Y 32768 0 63 def test t5 t5 param11 param11 8 20 4 Y 32768 0 63 def test t5 t5 const12 const12 254 0 0 Y 128 0 63 @@ -1850,8 +1850,8 @@ const08 1991-08-05 01:01:01 param08 1991-08-05 01:01:01 const09 1991-08-05 01:01:01 param09 1991-08-05 01:01:01 -const10 662680861.000000 -param10 662680861.000000000000000000000000000000 +const10 662680861 +param10 662680861 const11 1991 param11 1991 const12 NULL diff --git a/mysql-test/r/ps_3innodb.result b/mysql-test/r/ps_3innodb.result index 328df9e5978..4798d63b5e7 100644 --- a/mysql-test/r/ps_3innodb.result +++ b/mysql-test/r/ps_3innodb.result @@ -1776,8 +1776,8 @@ t5 CREATE TABLE `t5` ( `param08` longtext, `const09` datetime DEFAULT NULL, `param09` longblob, - `const10` decimal(22,6) DEFAULT NULL, - `param10` decimal(65,30) DEFAULT NULL, + `const10` bigint(17) DEFAULT NULL, + `param10` bigint(20) DEFAULT NULL, `const11` int(4) DEFAULT NULL, `param11` bigint(20) DEFAULT NULL, `const12` binary(0) DEFAULT NULL, @@ -1806,8 +1806,8 @@ def test t5 t5 const08 const08 253 19 19 N 1 0 8 def test t5 t5 param08 param08 252 4294967295 19 Y 16 0 8 def test t5 t5 const09 const09 12 19 19 Y 128 0 63 def test t5 t5 param09 param09 252 4294967295 19 Y 144 0 63 -def test t5 t5 const10 const10 246 24 16 Y 0 6 63 -def test t5 t5 param10 param10 246 67 40 Y 0 30 63 +def test t5 t5 const10 const10 8 17 9 Y 32768 0 63 +def test t5 t5 param10 param10 8 20 9 Y 32768 0 63 def test t5 t5 const11 const11 3 4 4 Y 32768 0 63 def test t5 t5 param11 param11 8 20 4 Y 32768 0 63 def test t5 t5 const12 const12 254 0 0 Y 128 0 63 @@ -1833,8 +1833,8 @@ const08 1991-08-05 01:01:01 param08 1991-08-05 01:01:01 const09 1991-08-05 01:01:01 param09 1991-08-05 01:01:01 -const10 662680861.000000 -param10 662680861.000000000000000000000000000000 +const10 662680861 +param10 662680861 const11 1991 param11 1991 const12 NULL diff --git a/mysql-test/r/ps_4heap.result b/mysql-test/r/ps_4heap.result index cc4330c57e4..f94273ea3ad 100644 --- a/mysql-test/r/ps_4heap.result +++ b/mysql-test/r/ps_4heap.result @@ -1777,8 +1777,8 @@ t5 CREATE TABLE `t5` ( `param08` longtext, `const09` datetime DEFAULT NULL, `param09` longblob, - `const10` decimal(22,6) DEFAULT NULL, - `param10` decimal(65,30) DEFAULT NULL, + `const10` bigint(17) DEFAULT NULL, + `param10` bigint(20) DEFAULT NULL, `const11` int(4) DEFAULT NULL, `param11` bigint(20) DEFAULT NULL, `const12` binary(0) DEFAULT NULL, @@ -1807,8 +1807,8 @@ def test t5 t5 const08 const08 253 19 19 N 1 0 8 def test t5 t5 param08 param08 252 4294967295 19 Y 16 0 8 def test t5 t5 const09 const09 12 19 19 Y 128 0 63 def test t5 t5 param09 param09 252 4294967295 19 Y 144 0 63 -def test t5 t5 const10 const10 246 24 16 Y 0 6 63 -def test t5 t5 param10 param10 246 67 40 Y 0 30 63 +def test t5 t5 const10 const10 8 17 9 Y 32768 0 63 +def test t5 t5 param10 param10 8 20 9 Y 32768 0 63 def test t5 t5 const11 const11 3 4 4 Y 32768 0 63 def test t5 t5 param11 param11 8 20 4 Y 32768 0 63 def test t5 t5 const12 const12 254 0 0 Y 128 0 63 @@ -1834,8 +1834,8 @@ const08 1991-08-05 01:01:01 param08 1991-08-05 01:01:01 const09 1991-08-05 01:01:01 param09 1991-08-05 01:01:01 -const10 662680861.000000 -param10 662680861.000000000000000000000000000000 +const10 662680861 +param10 662680861 const11 1991 param11 1991 const12 NULL diff --git a/mysql-test/r/ps_5merge.result b/mysql-test/r/ps_5merge.result index fe1665fc24e..eed82775d7b 100644 --- a/mysql-test/r/ps_5merge.result +++ b/mysql-test/r/ps_5merge.result @@ -1713,8 +1713,8 @@ t5 CREATE TABLE `t5` ( `param08` longtext, `const09` datetime DEFAULT NULL, `param09` longblob, - `const10` decimal(22,6) DEFAULT NULL, - `param10` decimal(65,30) DEFAULT NULL, + `const10` bigint(17) DEFAULT NULL, + `param10` bigint(20) DEFAULT NULL, `const11` int(4) DEFAULT NULL, `param11` bigint(20) DEFAULT NULL, `const12` binary(0) DEFAULT NULL, @@ -1743,8 +1743,8 @@ def test t5 t5 const08 const08 253 19 19 N 1 0 8 def test t5 t5 param08 param08 252 4294967295 19 Y 16 0 8 def test t5 t5 const09 const09 12 19 19 Y 128 0 63 def test t5 t5 param09 param09 252 4294967295 19 Y 144 0 63 -def test t5 t5 const10 const10 246 24 16 Y 0 6 63 -def test t5 t5 param10 param10 246 67 40 Y 0 30 63 +def test t5 t5 const10 const10 8 17 9 Y 32768 0 63 +def test t5 t5 param10 param10 8 20 9 Y 32768 0 63 def test t5 t5 const11 const11 3 4 4 Y 32768 0 63 def test t5 t5 param11 param11 8 20 4 Y 32768 0 63 def test t5 t5 const12 const12 254 0 0 Y 128 0 63 @@ -1770,8 +1770,8 @@ const08 1991-08-05 01:01:01 param08 1991-08-05 01:01:01 const09 1991-08-05 01:01:01 param09 1991-08-05 01:01:01 -const10 662680861.000000 -param10 662680861.000000000000000000000000000000 +const10 662680861 +param10 662680861 const11 1991 param11 1991 const12 NULL @@ -5067,8 +5067,8 @@ t5 CREATE TABLE `t5` ( `param08` longtext, `const09` datetime DEFAULT NULL, `param09` longblob, - `const10` decimal(22,6) DEFAULT NULL, - `param10` decimal(65,30) DEFAULT NULL, + `const10` bigint(17) DEFAULT NULL, + `param10` bigint(20) DEFAULT NULL, `const11` int(4) DEFAULT NULL, `param11` bigint(20) DEFAULT NULL, `const12` binary(0) DEFAULT NULL, @@ -5097,8 +5097,8 @@ def test t5 t5 const08 const08 253 19 19 N 1 0 8 def test t5 t5 param08 param08 252 4294967295 19 Y 16 0 8 def test t5 t5 const09 const09 12 19 19 Y 128 0 63 def test t5 t5 param09 param09 252 4294967295 19 Y 144 0 63 -def test t5 t5 const10 const10 246 24 16 Y 0 6 63 -def test t5 t5 param10 param10 246 67 40 Y 0 30 63 +def test t5 t5 const10 const10 8 17 9 Y 32768 0 63 +def test t5 t5 param10 param10 8 20 9 Y 32768 0 63 def test t5 t5 const11 const11 3 4 4 Y 32768 0 63 def test t5 t5 param11 param11 8 20 4 Y 32768 0 63 def test t5 t5 const12 const12 254 0 0 Y 128 0 63 @@ -5124,8 +5124,8 @@ const08 1991-08-05 01:01:01 param08 1991-08-05 01:01:01 const09 1991-08-05 01:01:01 param09 1991-08-05 01:01:01 -const10 662680861.000000 -param10 662680861.000000000000000000000000000000 +const10 662680861 +param10 662680861 const11 1991 param11 1991 const12 NULL diff --git a/mysql-test/r/timezone.result b/mysql-test/r/timezone.result index 5ae7e6f8117..d84fe54ba8c 100644 --- a/mysql-test/r/timezone.result +++ b/mysql-test/r/timezone.result @@ -7,7 +7,7 @@ select @a:=FROM_UNIXTIME(1); 1970-01-01 01:00:01 select unix_timestamp(@a); unix_timestamp(@a) -1.000000 +1 CREATE TABLE t1 (ts int); INSERT INTO t1 (ts) VALUES (Unix_timestamp('2002-10-27 01:00')); INSERT INTO t1 (ts) VALUES (Unix_timestamp('2002-10-27 02:00')); @@ -44,7 +44,7 @@ unix_timestamp('1970-01-01 01:00:01'), unix_timestamp('2038-01-19 04:14:07'), unix_timestamp('2038-01-19 04:14:08'); unix_timestamp('1970-01-01 01:00:00') unix_timestamp('1970-01-01 01:00:01') unix_timestamp('2038-01-19 04:14:07') unix_timestamp('2038-01-19 04:14:08') -0.000000 1.000000 2147483647.000000 NULL +0 1 2147483647 NULL select unix_timestamp('1969-12-31 23:59:59'), unix_timestamp('1970-01-01 00:00:00'), unix_timestamp('1970-01-01 00:59:59'); unix_timestamp('1969-12-31 23:59:59') unix_timestamp('1970-01-01 00:00:00') unix_timestamp('1970-01-01 00:59:59') NULL NULL NULL diff --git a/mysql-test/r/timezone4.result b/mysql-test/r/timezone4.result index ad0672890a2..28028bea657 100644 --- a/mysql-test/r/timezone4.result +++ b/mysql-test/r/timezone4.result @@ -3,4 +3,4 @@ from_unixtime(0) 1969-12-31 14:00:00 select unix_timestamp('1969-12-31 14:00:01'); unix_timestamp('1969-12-31 14:00:01') -1.000000 +1 diff --git a/mysql-test/r/type_time.result b/mysql-test/r/type_time.result index 23943c3c848..c66f3f08e08 100644 --- a/mysql-test/r/type_time.result +++ b/mysql-test/r/type_time.result @@ -186,10 +186,10 @@ Warning 1292 Incorrect datetime value: '0000-00-00 00:00:00' # SELECT CONCAT(GREATEST(TIME('00:00:01'),TIME('00:00:00'))); CONCAT(GREATEST(TIME('00:00:01'),TIME('00:00:00'))) -00:00:01.000000 +00:00:01 SELECT CONCAT(GREATEST(TIME('32 00:00:01'),TIME('00:00:00'))); CONCAT(GREATEST(TIME('32 00:00:01'),TIME('00:00:00'))) -768:00:01.000000 +768:00:01 # # End of 5.3 tests # |