Commit de158e94 authored by evgen@moonbone.local's avatar evgen@moonbone.local

Merge epotemkin@bk-internal.mysql.com:/home/bk/mysql-4.1

into moonbone.local:/work/mysql-4.1-bug-12266
parents b9da4176 697836c7
...@@ -757,3 +757,10 @@ SELECT n+1 AS n FROM t1 GROUP BY n; ...@@ -757,3 +757,10 @@ SELECT n+1 AS n FROM t1 GROUP BY n;
n n
2 2
DROP TABLE t1; 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;
...@@ -590,4 +590,14 @@ INSERT INTO t1 VALUES (1); ...@@ -590,4 +590,14 @@ INSERT INTO t1 VALUES (1);
SELECT n+1 AS n FROM t1 GROUP BY n; SELECT n+1 AS n FROM t1 GROUP BY n;
DROP TABLE t1; 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 # End of 4.1 tests
...@@ -709,6 +709,12 @@ public: ...@@ -709,6 +709,12 @@ public:
{ {
return (new Field_date(maybe_null, name, t_arg, &my_charset_bin)); 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;
}
}; };
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment