diff options
author | unknown <dlenev@mysql.com> | 2006-04-24 19:00:37 +0400 |
---|---|---|
committer | unknown <dlenev@mysql.com> | 2006-04-24 19:00:37 +0400 |
commit | ef82f93dcc0d4636cdf102f6583224b49989581f (patch) | |
tree | 8f039fc448490ca548aa9c149c448928be859a77 /mysql-test | |
parent | 8e28ab1f40e60cbd9837468fc0d357335209f877 (diff) | |
parent | dfbf652165def750409cc1e8519e1aacd7a17f8b (diff) | |
download | mariadb-git-ef82f93dcc0d4636cdf102f6583224b49989581f.tar.gz |
Merge bk-internal.mysql.com:/home/bk/mysql-5.0-runtime
into mysql.com:/home/dlenev/mysql-5.0-bg11081
Diffstat (limited to 'mysql-test')
-rw-r--r-- | mysql-test/r/timezone2.result | 15 | ||||
-rw-r--r-- | mysql-test/t/timezone2.test | 20 |
2 files changed, 35 insertions, 0 deletions
diff --git a/mysql-test/r/timezone2.result b/mysql-test/r/timezone2.result index df51a6aac9b..a1ae2f63212 100644 --- a/mysql-test/r/timezone2.result +++ b/mysql-test/r/timezone2.result @@ -1,4 +1,5 @@ drop table if exists t1, t2; +drop function if exists f1; create table t1 (ts timestamp); set time_zone='+00:00'; select unix_timestamp(utc_timestamp())-unix_timestamp(current_timestamp()); @@ -268,3 +269,17 @@ select * from t1; convert_tz(NULL, NULL, NULL) NULL drop table t1; +create table t1 (ldt datetime, udt datetime); +create function f1(i datetime) returns datetime +return convert_tz(i, 'UTC', 'Europe/Moscow'); +create trigger t1_bi before insert on t1 for each row +set new.udt:= convert_tz(new.ldt, 'Europe/Moscow', 'UTC'); +insert into t1 (ldt) values ('2006-04-19 16:30:00'); +select * from t1; +ldt udt +2006-04-19 16:30:00 2006-04-19 12:30:00 +select ldt, f1(udt) as ldt2 from t1; +ldt ldt2 +2006-04-19 16:30:00 2006-04-19 16:30:00 +drop table t1; +drop function f1; diff --git a/mysql-test/t/timezone2.test b/mysql-test/t/timezone2.test index 069c19341e4..bfc909d6995 100644 --- a/mysql-test/t/timezone2.test +++ b/mysql-test/t/timezone2.test @@ -3,6 +3,7 @@ # Preparing playground --disable_warnings drop table if exists t1, t2; +drop function if exists f1; --enable_warnings @@ -222,3 +223,22 @@ select * from t1; drop table t1; # End of 4.1 tests + +# +# Test for bug #11081 "Using a CONVERT_TZ function in a stored function +# or trigger fails". +# +create table t1 (ldt datetime, udt datetime); +create function f1(i datetime) returns datetime + return convert_tz(i, 'UTC', 'Europe/Moscow'); +create trigger t1_bi before insert on t1 for each row + set new.udt:= convert_tz(new.ldt, 'Europe/Moscow', 'UTC'); +# This should work without errors +insert into t1 (ldt) values ('2006-04-19 16:30:00'); +select * from t1; +# This should work without errors as well +select ldt, f1(udt) as ldt2 from t1; +drop table t1; +drop function f1; + +# End of 5.0 tests |