summaryrefslogtreecommitdiff
path: root/mysql-test/t/func_time.test
diff options
context:
space:
mode:
authorpem@mysql.com <>2004-04-07 19:07:44 +0200
committerpem@mysql.com <>2004-04-07 19:07:44 +0200
commitdfd59e296e2c267a21f1ea8b3b937e07730dad0d (patch)
treee5ac1517ff3dccc42352b7bac39ecd1c093d0ae6 /mysql-test/t/func_time.test
parent1541f2e7949416d6e172ef6406ecf140d3b26659 (diff)
parent61fd95d168b51092b7ce3ff56b2c8c8ed1a49c0f (diff)
downloadmariadb-git-dfd59e296e2c267a21f1ea8b3b937e07730dad0d.tar.gz
Merge 4.1 -> 5.0.
Diffstat (limited to 'mysql-test/t/func_time.test')
-rw-r--r--mysql-test/t/func_time.test18
1 files changed, 16 insertions, 2 deletions
diff --git a/mysql-test/t/func_time.test b/mysql-test/t/func_time.test
index 7a6e2a815f4..5934e291dca 100644
--- a/mysql-test/t/func_time.test
+++ b/mysql-test/t/func_time.test
@@ -273,12 +273,18 @@ select last_day('2000-02-05') as f1, last_day('2002-12-31') as f2,
last_day('2001-01-01 01:01:01') as f5, last_day(NULL),
last_day('2001-02-12');
-create table t1 select last_day('2000-02-05') as a;
+create table t1 select last_day('2000-02-05') as a,
+ from_days(to_days("960101")) as b;
describe t1;
select * from t1;
drop table t1;
-select last_day('2000-02-05');
+select last_day('2000-02-05') as a,
+ from_days(to_days("960101")) as b;
+select date_add(last_day("1997-12-1"), INTERVAL 1 DAY);
+select length(last_day("1997-12-1"));
+select last_day("1997-12-1")+0;
+select last_day("1997-12-1")+0.0;
# Test SAPDB UTC_% functions. This part is TZ dependant (It is supposed that
# TZ variable set to GMT-3
@@ -291,5 +297,13 @@ select strcmp(concat(utc_date(),' ',utc_time()),utc_timestamp())=0;
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();
+CREATE TABLE t1 (d DATETIME);
+INSERT INTO t1 VALUES (NOW());
+INSERT INTO t1 VALUES (NOW());
+INSERT INTO t1 VALUES (NOW());
+SELECT count(*) FROM t1 WHERE d>FROM_DAYS(TO_DAYS(@TMP)) AND d<=FROM_DAYS(TO_DAYS(@TMP)+1);
+DROP TABLE t1;
+
explain extended select timestampdiff(SQL_TSI_WEEK, '2001-02-01', '2001-05-01') as a1,
timestampdiff(SQL_TSI_FRAC_SECOND, '2001-02-01 12:59:59.120000', '2001-05-01 12:58:58.119999') as a2;