diff options
author | Evgeny Potemkin <epotemkin@mysql.com> | 2009-11-24 18:26:13 +0300 |
---|---|---|
committer | Evgeny Potemkin <epotemkin@mysql.com> | 2009-11-24 18:26:13 +0300 |
commit | 9f638f535e63b4bbe7cddfda153ddedad02f3f8a (patch) | |
tree | 6e715efd003d16cfc130e158eb707c3c7249c158 /mysql-test/t/func_group.test | |
parent | fad34c34cf22eb1c503204aee204dfb83ad7acea (diff) | |
parent | bc43bff7edf79095c243cf6858acb29213fb152b (diff) | |
download | mariadb-git-9f638f535e63b4bbe7cddfda153ddedad02f3f8a.tar.gz |
Manual merge of the fix for bug#43668.
Diffstat (limited to 'mysql-test/t/func_group.test')
-rw-r--r-- | mysql-test/t/func_group.test | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/mysql-test/t/func_group.test b/mysql-test/t/func_group.test index 6e39795a5d6..6dbc8a05789 100644 --- a/mysql-test/t/func_group.test +++ b/mysql-test/t/func_group.test @@ -1053,4 +1053,35 @@ ORDER BY max; --echo # DROP TABLE t1; +--echo # +--echo # Bug#43668: Wrong comparison and MIN/MAX for YEAR(2) +--echo # +create table t1 (f1 year(2), f2 year(4), f3 date, f4 datetime); +insert into t1 values + (98,1998,19980101,"1998-01-01 00:00:00"), + (00,2000,20000101,"2000-01-01 00:00:01"), + (02,2002,20020101,"2002-01-01 23:59:59"), + (60,2060,20600101,"2060-01-01 11:11:11"), + (70,1970,19700101,"1970-11-11 22:22:22"), + (NULL,NULL,NULL,NULL); +select min(f1),max(f1) from t1; +select min(f2),max(f2) from t1; +select min(f3),max(f3) from t1; +select min(f4),max(f4) from t1; +select a.f1 as a, b.f1 as b, a.f1 > b.f1 as gt, + a.f1 < b.f1 as lt, a.f1<=>b.f1 as eq +from t1 a, t1 b; +select a.f1 as a, b.f2 as b, a.f1 > b.f2 as gt, + a.f1 < b.f2 as lt, a.f1<=>b.f2 as eq +from t1 a, t1 b; +select a.f1 as a, b.f3 as b, a.f1 > b.f3 as gt, + a.f1 < b.f3 as lt, a.f1<=>b.f3 as eq +from t1 a, t1 b; +select a.f1 as a, b.f4 as b, a.f1 > b.f4 as gt, + a.f1 < b.f4 as lt, a.f1<=>b.f4 as eq +from t1 a, t1 b; +select *, f1 = f2 from t1; +drop table t1; +--echo # --echo End of 5.1 tests + |