Loading mysql-test/r/group_by.result +7 −0 Original line number Diff line number Diff line Loading @@ -757,3 +757,10 @@ SELECT n+1 AS n FROM t1 GROUP BY n; n 2 DROP TABLE t1; create table t1 (f1 date); insert into t1 values('2005-06-06'); insert into t1 values('2005-06-06'); select date(left(f1+0,8)) from t1 group by 1; date(left(f1+0,8)) 2005-06-06 drop table t1; mysql-test/t/group_by.test +10 −0 Original line number Diff line number Diff line Loading @@ -590,4 +590,14 @@ INSERT INTO t1 VALUES (1); SELECT n+1 AS n FROM t1 GROUP BY n; DROP TABLE t1; # # Bug #12266 GROUP BY expression on DATE column produces result with # reduced length # create table t1 (f1 date); insert into t1 values('2005-06-06'); insert into t1 values('2005-06-06'); select date(left(f1+0,8)) from t1 group by 1; drop table t1; # End of 4.1 tests sql/item_timefunc.h +6 −0 Original line number Diff line number Diff line Loading @@ -709,6 +709,12 @@ class Item_date_typecast :public Item_typecast_maybe_null { return (new Field_date(maybe_null, name, t_arg, &my_charset_bin)); } void fix_length_and_dec() { collation.set(&my_charset_bin); max_length= 10; maybe_null= 1; } }; Loading Loading
mysql-test/r/group_by.result +7 −0 Original line number Diff line number Diff line Loading @@ -757,3 +757,10 @@ SELECT n+1 AS n FROM t1 GROUP BY n; n 2 DROP TABLE t1; create table t1 (f1 date); insert into t1 values('2005-06-06'); insert into t1 values('2005-06-06'); select date(left(f1+0,8)) from t1 group by 1; date(left(f1+0,8)) 2005-06-06 drop table t1;
mysql-test/t/group_by.test +10 −0 Original line number Diff line number Diff line Loading @@ -590,4 +590,14 @@ INSERT INTO t1 VALUES (1); SELECT n+1 AS n FROM t1 GROUP BY n; DROP TABLE t1; # # Bug #12266 GROUP BY expression on DATE column produces result with # reduced length # create table t1 (f1 date); insert into t1 values('2005-06-06'); insert into t1 values('2005-06-06'); select date(left(f1+0,8)) from t1 group by 1; drop table t1; # End of 4.1 tests
sql/item_timefunc.h +6 −0 Original line number Diff line number Diff line Loading @@ -709,6 +709,12 @@ class Item_date_typecast :public Item_typecast_maybe_null { return (new Field_date(maybe_null, name, t_arg, &my_charset_bin)); } void fix_length_and_dec() { collation.set(&my_charset_bin); max_length= 10; maybe_null= 1; } }; Loading