diff options
author | unknown <dlenev@mysql.com> | 2003-08-11 23:43:54 +0400 |
---|---|---|
committer | unknown <dlenev@mysql.com> | 2003-08-11 23:43:54 +0400 |
commit | 253b2a9654f6430d879076771b70bd018dd30732 (patch) | |
tree | 0b805a624dace087c6da146604e908ebe10b4dee /mysql-test | |
parent | 0960c3eb26861238d9102845d370f3eb66d91290 (diff) | |
parent | 2ad06dc68e3ca572d2abbe89b470f2a510466ad3 (diff) | |
download | mariadb-git-253b2a9654f6430d879076771b70bd018dd30732.tar.gz |
Merge bk-internal.mysql.com:/home/bk/mysql-4.1
into mysql.com:/home/dlenev/src/mysql-4.1-345
Diffstat (limited to 'mysql-test')
-rw-r--r-- | mysql-test/r/func_time.result | 18 | ||||
-rw-r--r-- | mysql-test/t/func_time.test | 9 |
2 files changed, 27 insertions, 0 deletions
diff --git a/mysql-test/r/func_time.result b/mysql-test/r/func_time.result index 38fe97a79a6..c65dbbb926f 100644 --- a/mysql-test/r/func_time.result +++ b/mysql-test/r/func_time.result @@ -465,3 +465,21 @@ select date_add(time,INTERVAL 1 SECOND) from t1; date_add(time,INTERVAL 1 SECOND) 2006-07-08 00:00:01 drop table t1; +select strcmp(date_sub(localtimestamp(), interval 3 hour), utc_timestamp())=0; +strcmp(date_sub(localtimestamp(), interval 3 hour), utc_timestamp())=0 +1 +select strcmp(date_format(date_sub(localtimestamp(), interval 3 hour),"%T"), utc_time())=0; +strcmp(date_format(date_sub(localtimestamp(), interval 3 hour),"%T"), utc_time())=0 +1 +select strcmp(date_format(date_sub(localtimestamp(), interval 3 hour),"%Y-%m-%d"), utc_date())=0; +strcmp(date_format(date_sub(localtimestamp(), interval 3 hour),"%Y-%m-%d"), utc_date())=0 +1 +select strcmp(date_format(utc_timestamp(),"%T"), utc_time())=0; +strcmp(date_format(utc_timestamp(),"%T"), utc_time())=0 +1 +select strcmp(date_format(utc_timestamp(),"%Y-%m-%d"), utc_date())=0; +strcmp(date_format(utc_timestamp(),"%Y-%m-%d"), utc_date())=0 +1 +select strcmp(concat(utc_date(),' ',utc_time()),utc_timestamp())=0; +strcmp(concat(utc_date(),' ',utc_time()),utc_timestamp())=0 +1 diff --git a/mysql-test/t/func_time.test b/mysql-test/t/func_time.test index af222b0b3cc..4be6570d410 100644 --- a/mysql-test/t/func_time.test +++ b/mysql-test/t/func_time.test @@ -220,3 +220,12 @@ select date_add(date,INTERVAL "1 1:1:1" DAY_SECOND) from t1; # The following is not as one would expect... select date_add(time,INTERVAL 1 SECOND) from t1; drop table t1; + +# Test SAPDB UTC_% functions. This part is TZ dependant (It is supposed that +# TZ variable set to GMT-3 +select strcmp(date_sub(localtimestamp(), interval 3 hour), utc_timestamp())=0; +select strcmp(date_format(date_sub(localtimestamp(), interval 3 hour),"%T"), utc_time())=0; +select strcmp(date_format(date_sub(localtimestamp(), interval 3 hour),"%Y-%m-%d"), utc_date())=0; +select strcmp(date_format(utc_timestamp(),"%T"), utc_time())=0; +select strcmp(date_format(utc_timestamp(),"%Y-%m-%d"), utc_date())=0; +select strcmp(concat(utc_date(),' ',utc_time()),utc_timestamp())=0; |