diff options
author | Mattias Jonsson <mattias.jonsson@sun.com> | 2009-08-26 12:51:23 +0200 |
---|---|---|
committer | Mattias Jonsson <mattias.jonsson@sun.com> | 2009-08-26 12:51:23 +0200 |
commit | 3b756a01a04cf8d7a2a11207d3512f5839b4fd89 (patch) | |
tree | 7f812893ef1db316782ee8e0b013f4e57a754483 /sql/item.h | |
parent | 10e90a1fe5154e78402fe4b3868e79d1f2076239 (diff) | |
download | mariadb-git-3b756a01a04cf8d7a2a11207d3512f5839b4fd89.tar.gz |
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 '>='.
Diffstat (limited to 'sql/item.h')
-rw-r--r-- | sql/item.h | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/sql/item.h b/sql/item.h index 3dfcd7c2612..8b37bd3c26d 100644 --- a/sql/item.h +++ b/sql/item.h @@ -576,8 +576,8 @@ public: left_endp FALSE <=> The interval is "x < const" or "x <= const" TRUE <=> The interval is "x > const" or "x >= const" - incl_endp IN TRUE <=> the comparison is '<' or '>' - FALSE <=> the comparison is '<=' or '>=' + incl_endp IN FALSE <=> the comparison is '<' or '>' + TRUE <=> the comparison is '<=' or '>=' OUT The same but for the "F(x) $CMP$ F(const)" comparison DESCRIPTION @@ -3117,4 +3117,4 @@ void mark_select_range_as_dependent(THD *thd, extern Cached_item *new_Cached_item(THD *thd, Item *item); extern Item_result item_cmp_type(Item_result a,Item_result b); extern void resolve_const_item(THD *thd, Item **ref, Item *cmp_item); -extern bool field_is_equal_to_item(Field *field,Item *item); +extern int stored_field_cmp_to_item(Field *field, Item *item); |