diff options
Diffstat (limited to 'mysql-test/r/function_defaults.result')
-rw-r--r-- | mysql-test/r/function_defaults.result | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/mysql-test/r/function_defaults.result b/mysql-test/r/function_defaults.result index 1c63ae17a5d..4a8f64df352 100644 --- a/mysql-test/r/function_defaults.result +++ b/mysql-test/r/function_defaults.result @@ -3116,3 +3116,32 @@ select if(@new = j, 'correct', 'wrong') from t1; if(@new = j, 'correct', 'wrong') correct drop table t1; +create table t1 (a int, b varchar(20) default 'foo'); +insert t1 values (1,'bla'),(2, 'bar'); +select * from t1; +a b +1 bla +2 bar +update t1 set b=default where a=1; +select * from t1; +a b +1 foo +2 bar +drop table t1; +create table t1 ( +a int, +b timestamp default '2010-10-10 10:10:10' on update now(), +c varchar(100) default 'x'); +insert t1 (a) values (1),(2); +select * from t1; +a b c +1 2010-10-10 10:10:10 x +2 2010-10-10 10:10:10 x +set timestamp=unix_timestamp('2011-11-11 11-11-11'); +update t1 set b=default, c=default(b) where a=1; +select * from t1; +a b c +1 2010-10-10 10:10:10 2010-10-10 10:10:10 +2 2010-10-10 10:10:10 x +drop table t1; +set timestamp=default; |