summaryrefslogtreecommitdiff
path: root/sql/item_timefunc.cc
diff options
context:
space:
mode:
authorMattias Jonsson <mattias.jonsson@sun.com>2009-08-28 12:55:59 +0200
committerMattias Jonsson <mattias.jonsson@sun.com>2009-08-28 12:55:59 +0200
commit0a76397171c3e53402aab78f9a6261bdfa2fca3c (patch)
tree810fbe1527988b56b8833ff44e31f1a6f4ab4484 /sql/item_timefunc.cc
parentcb57e856b64689dc6b4209817b33ca7bfff73efa (diff)
parent4655118bea2bcb14a06f01046fb06052fd37214c (diff)
downloadmariadb-git-0a76397171c3e53402aab78f9a6261bdfa2fca3c.tar.gz
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.
Diffstat (limited to 'sql/item_timefunc.cc')
-rw-r--r--sql/item_timefunc.cc10
1 files changed, 7 insertions, 3 deletions
diff --git a/sql/item_timefunc.cc b/sql/item_timefunc.cc
index eefe47232ae..a9e5c71ab56 100644
--- a/sql/item_timefunc.cc
+++ b/sql/item_timefunc.cc
@@ -1006,15 +1006,19 @@ longlong Item_func_to_days::val_int_endpoint(bool left_endp, bool *incl_endp)
point to day bound ("strictly less" comparison stays intact):
col < '2007-09-15 00:00:00' -> TO_DAYS(col) < TO_DAYS('2007-09-15')
+ col > '2007-09-15 23:59:59' -> TO_DAYS(col) > TO_DAYS('2007-09-15')
which is different from the general case ("strictly less" changes to
"less or equal"):
col < '2007-09-15 12:34:56' -> TO_DAYS(col) <= TO_DAYS('2007-09-15')
*/
- if (!left_endp && !(ltime.hour || ltime.minute || ltime.second ||
- ltime.second_part))
- ; /* do nothing */
+ if ((!left_endp && !(ltime.hour || ltime.minute || ltime.second ||
+ ltime.second_part)) ||
+ (left_endp && ltime.hour == 23 && ltime.minute == 59 &&
+ ltime.second == 59))
+ /* do nothing */
+ ;
else
*incl_endp= TRUE;
return res;