summaryrefslogtreecommitdiff
path: root/sql-common
diff options
context:
space:
mode:
authorMattias Jonsson <mattias.jonsson@sun.com>2009-08-26 12:51:23 +0200
committerMattias Jonsson <mattias.jonsson@sun.com>2009-08-26 12:51:23 +0200
commit3b756a01a04cf8d7a2a11207d3512f5839b4fd89 (patch)
tree7f812893ef1db316782ee8e0b013f4e57a754483 /sql-common
parent10e90a1fe5154e78402fe4b3868e79d1f2076239 (diff)
downloadmariadb-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-common')
-rw-r--r--sql-common/my_time.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/sql-common/my_time.c b/sql-common/my_time.c
index 747c5797ed4..a1b85049934 100644
--- a/sql-common/my_time.c
+++ b/sql-common/my_time.c
@@ -450,9 +450,7 @@ str_to_datetime(const char *str, uint length, MYSQL_TIME *l_time,
}
}
- DBUG_RETURN(l_time->time_type=
- (number_of_fields <= 3 ? MYSQL_TIMESTAMP_DATE :
- MYSQL_TIMESTAMP_DATETIME));
+ DBUG_RETURN(l_time->time_type);
err:
bzero((char*) l_time, sizeof(*l_time));