summaryrefslogtreecommitdiff
path: root/sql/item_timefunc.cc
diff options
context:
space:
mode:
authorunknown <Kristofer.Pettersson@naruto.>2006-09-22 11:22:01 +0200
committerunknown <Kristofer.Pettersson@naruto.>2006-09-22 11:22:01 +0200
commite8cc98c87a6036311099d1a7ea60855556e3665a (patch)
treec993dd16cf571013caeb38bb536c9e9c0bd6f385 /sql/item_timefunc.cc
parent4934231545c994b90517b2c1b4c9b85b4fbe2018 (diff)
downloadmariadb-git-e8cc98c87a6036311099d1a7ea60855556e3665a.tar.gz
Bug#21811 Odd casting with date + INTERVAL arithmetic
- The definition of the result type of a type_date function didn't include INTERVAL_WEEK - This patch adds an explicit test for INTERVAL_WEEK which results in the result type for an item_date_add_intervall operation being DATE rather than DATETIME when one parameter is INTERVAL_WEEK. sql/item_timefunc.cc: Added explicit test for INTERVAL_WEEK to evaluate as MYSQL_TYPE_DATE
Diffstat (limited to 'sql/item_timefunc.cc')
-rw-r--r--sql/item_timefunc.cc2
1 files changed, 1 insertions, 1 deletions
diff --git a/sql/item_timefunc.cc b/sql/item_timefunc.cc
index febc92e34f6..3886af27158 100644
--- a/sql/item_timefunc.cc
+++ b/sql/item_timefunc.cc
@@ -1876,7 +1876,7 @@ void Item_date_add_interval::fix_length_and_dec()
cached_field_type= MYSQL_TYPE_DATETIME;
else if (arg0_field_type == MYSQL_TYPE_DATE)
{
- if (int_type <= INTERVAL_DAY || int_type == INTERVAL_YEAR_MONTH)
+ if (int_type <= INTERVAL_DAY || int_type == INTERVAL_YEAR_MONTH || int_type == INTERVAL_WEEK )
cached_field_type= arg0_field_type;
else
cached_field_type= MYSQL_TYPE_DATETIME;