Bug #46362 | Endpoint should be set to false for TO_DAYS(DATE) | ||
---|---|---|---|
Submitted: | 24 Jul 2009 9:30 | Modified: | 18 Sep 2009 9:44 |
Reporter: | Mikiya Okuno | Email Updates: | |
Status: | Closed | Impact on me: | |
Category: | MySQL Server: Partitions | Severity: | S3 (Non-critical) |
Version: | 5.1.36 | OS: | Any |
Assigned to: | Mattias Jonsson | CPU Architecture: | Any |
[24 Jul 2009 9:30]
Mikiya Okuno
[13 Aug 2009 23:01]
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/commits/80799 3068 Mattias Jonsson 2009-08-14 Bug#46362: Endpoint should be set to false for TO_DAYS(DATE) There were multiple problems since pruning uses the field for comparison (while evaluate_join_record uses longlong) Fix was to take better care when comparing DATE vs DATETIME. And adding optimization for comparing with 23:59:59. @ mysql-test/r/partition_pruning.result Bug#46362: Endpoint should be set to false for TO_DAYS(DATE) Updated result-file @ mysql-test/t/partition_pruning.test Bug#46362: Endpoint should be set to false for TO_DAYS(DATE) Added testcases. @ sql-common/my_time.c Bug#46362: Endpoint should be set to false for TO_DAYS(DATE) removed duplicate assignment. @ sql/item.cc Bug#46362: Endpoint should be set to false for TO_DAYS(DATE) Changed field_is_equal_to_item into field_cmp_to_item, to better handling DATE vs DATETIME comparision. @ sql/item.h Bug#46362: Endpoint should be set to false for TO_DAYS(DATE) Updated comment @ sql/item_timefunc.cc Bug#46362: Endpoint should be set to false for TO_DAYS(DATE) Added optimization (pruning) of DATETIME where time-part is 23:59:59 @ sql/opt_range.cc Bug#46362: Endpoint should be set to false for TO_DAYS(DATE) Using the new field_cmp_to_item for better pruning.
[18 Aug 2009 20:15]
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/commits/81020 3068 Mattias Jonsson 2009-08-18 Bug#46362: Endpoint should be set to false for TO_DAYS(DATE) There were multiple problems since pruning uses the field for comparison (while evaluate_join_record uses longlong) Fix was to take better care when comparing DATE vs DATETIME. And adding optimization for comparing with 23:59:59. (Updated, failed with main.range test, now OK) @ mysql-test/r/partition_pruning.result Bug#46362: Endpoint should be set to false for TO_DAYS(DATE) Updated result-file @ mysql-test/t/partition_pruning.test Bug#46362: Endpoint should be set to false for TO_DAYS(DATE) Added testcases. @ sql-common/my_time.c Bug#46362: Endpoint should be set to false for TO_DAYS(DATE) removed duplicate assignment. @ sql/item.cc Bug#46362: Endpoint should be set to false for TO_DAYS(DATE) Changed field_is_equal_to_item into field_cmp_to_item, to better handling DATE vs DATETIME comparision. @ sql/item.h Bug#46362: Endpoint should be set to false for TO_DAYS(DATE) Updated comment @ sql/item_timefunc.cc Bug#46362: Endpoint should be set to false for TO_DAYS(DATE) Added optimization (pruning) of DATETIME where time-part is 23:59:59 @ sql/opt_range.cc Bug#46362: Endpoint should be set to false for TO_DAYS(DATE) Using the new field_cmp_to_item for better pruning. (Updated, failed with main.range test, now OK)
[26 Aug 2009 10:52]
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/commits/81594 3068 Mattias Jonsson 2009-08-26 Bug#46362: Endpoint should be set to false for TO_DAYS(DATE) There were a problem since pruning uses the field for comparison (while evaluate_join_record uses longlong), resulting in pruning failures when comparing DATE to DATETIME. Fix was to always comparing DATE vs DATETIME as DATETIME, by adding ' 00:00:00' to the DATE string. And adding optimization for comparing with 23:59:59, so that DATETIME_col > '2001-02-03 23:59:59' -> TO_DAYS(DATETIME_col) > TO_DAYS('2001-02-03 23:59:59') instead of '>='. @ mysql-test/r/partition_pruning.result Bug#46362: Endpoint should be set to false for TO_DAYS(DATE) Updated result-file @ mysql-test/t/partition_pruning.test Bug#46362: Endpoint should be set to false for TO_DAYS(DATE) Added testcases. @ sql-common/my_time.c Bug#46362: Endpoint should be set to false for TO_DAYS(DATE) removed duplicate assignment. @ sql/item.cc Bug#46362: Endpoint should be set to false for TO_DAYS(DATE) Changed field_is_equal_to_item into field_cmp_to_item, to better handling DATE vs DATETIME comparision. @ sql/item.h Bug#46362: Endpoint should be set to false for TO_DAYS(DATE) Updated comment @ sql/item_timefunc.cc Bug#46362: Endpoint should be set to false for TO_DAYS(DATE) Added optimization (pruning) of DATETIME where time-part is 23:59:59 @ sql/opt_range.cc Bug#46362: Endpoint should be set to false for TO_DAYS(DATE) Using the new stored_field_cmp_to_item for better pruning.
[28 Aug 2009 10:57]
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/commits/81843 3084 Mattias Jonsson 2009-08-28 [merge] Manual merge between bug#46362 and bug#20577. @ sql/opt_range.cc Removed duplicate code (if statement must have been duplicated during earlier merge). @ sql/sql_partition.cc After mergeing bug#46362 and bug#20577, the NULL partition was also searched when col = const, fixed by checking if = or range.
[28 Aug 2009 19:05]
Mattias Jonsson
pushed into mysql-5.1-bugteam and mysql-pe
[1 Sep 2009 12:54]
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/commits/82130 3096 Mattias Jonsson 2009-09-01 post push fix for bug#20577 and bug#46362, disabling warnings
[2 Sep 2009 16:42]
Bugs System
Pushed into 5.1.39 (revid:joro@sun.com-20090902154533-8actmfcsjfqovgsb) (version source revid:mattias.jonsson@sun.com-20090901125327-v3rszrg5cfwsksxc) (merge vers: 5.1.39) (pib:11)
[11 Sep 2009 23:30]
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/commits/83092 3602 Mattias Jonsson 2009-09-12 post push fix for mysql-pe for bug#20577 and bug#46362. fix for mysql-pe; 'Using where' should not be in the extra column after MRR and other optimizer changes. @ mysql-test/r/partition_pruning.result post push fix for mysql-pe for bug#20577 and bug#46362. fix for mysql-pe; 'Using where' should not be in the extra column after MRR and other optimizer changes.
[14 Sep 2009 16:05]
Bugs System
Pushed into 5.4.4-alpha (revid:alik@sun.com-20090914155317-m1g9wodmndzdj4l1) (version source revid:alik@sun.com-20090914155317-m1g9wodmndzdj4l1) (merge vers: 5.4.4-alpha) (pib:11)
[16 Sep 2009 8:21]
Jon Stephens
Documented bugfix in the 5.4.4 changelog as follows: Partition pruning did not always work correctly when the table's partitioning key used the TO_DAYS() function. Set status = NDI, waiting for push to 5.1.
[18 Sep 2009 9:44]
Jon Stephens
I failed to notice 5.1.39 push already shown. Bugfix now also documented in the 5.1.39 changelog, closed.
[1 Oct 2009 5:59]
Bugs System
Pushed into 5.1.39-ndb-6.3.28 (revid:jonas@mysql.com-20091001055605-ap2kiaarr7p40mmv) (version source revid:jonas@mysql.com-20091001055605-ap2kiaarr7p40mmv) (merge vers: 5.1.39-ndb-6.3.28) (pib:11)
[1 Oct 2009 7:25]
Bugs System
Pushed into 5.1.39-ndb-7.0.9 (revid:jonas@mysql.com-20091001072547-kv17uu06hfjhgjay) (version source revid:jonas@mysql.com-20091001071652-irejtnumzbpsbgk2) (merge vers: 5.1.39-ndb-7.0.9) (pib:11)
[1 Oct 2009 13:25]
Bugs System
Pushed into 5.1.39-ndb-7.1.0 (revid:jonas@mysql.com-20091001123013-g9ob2tsyctpw6zs0) (version source revid:jonas@mysql.com-20091001123013-g9ob2tsyctpw6zs0) (merge vers: 5.1.39-ndb-7.1.0) (pib:11)
[2 Oct 2009 1:20]
Paul DuBois
Move 5.4 changelog entry from 5.4.4 to 5.4.3.
[5 Oct 2009 10:50]
Bugs System
Pushed into 5.1.39-ndb-6.2.19 (revid:jonas@mysql.com-20091005103850-dwij2dojwpvf5hi6) (version source revid:jonas@mysql.com-20090930185117-bhud4ek1y0hsj1nv) (merge vers: 5.1.39-ndb-6.2.19) (pib:11)
[13 Oct 2009 20:30]
James Day
The fix for this bug introduced new bug #47963 "using null microsecond part (e.g. "YYYY-MM-DD HH:MM:SS.0000") in a WHERE condition may lead to wrong results due to improper DATETIMEs comparison in some cases". The fix is expected in version 5.1.41.