Bug #12266 | GROUP BY expression on DATE column gives wrong results | ||
---|---|---|---|
Submitted: | 29 Jul 2005 12:12 | Modified: | 7 Aug 2005 1:39 |
Reporter: | Valeriy Kravchuk | Email Updates: | |
Status: | Closed | Impact on me: | |
Category: | MySQL Server: Optimizer | Severity: | S3 (Non-critical) |
Version: | 4.1.12-nt, 4.1.13, 4.1.14 | OS: | Linux (Linux) |
Assigned to: | Evgeny Potemkin | CPU Architecture: | Any |
[29 Jul 2005 12:12]
Valeriy Kravchuk
[4 Aug 2005 14:05]
Bugs System
A patch for this bug has been committed. After review, it may be pushed to the relevant source trees for release in the next version. You can access the patch from: http://lists.mysql.com/internals/27895
[4 Aug 2005 14:05]
Evgeny Potemkin
When temporary field created for DATE(LEFT(column,8)) expression, max_length value is taken from Item_date_typecast, and it is getting it from underlaid Item_func_left and it's max_length is 8 in given expression. And all this results in stripping last 2 digits.
[4 Aug 2005 21:05]
Evgeny Potemkin
Fixed in 4.1.14, cset 1.2352.14.1
[7 Aug 2005 1:39]
Mike Hillyer
Documented in 4.1.14 changelog: <listitem><para> Performing <literal>DATE(LEFT(column,8))</literal> on a <literal>DATE</literal> column produces incorrect results. (Bug #12266) </para></listitem>