summaryrefslogtreecommitdiff
path: root/sql
diff options
context:
space:
mode:
authorunknown <Kristofer.Pettersson@naruto.>2006-10-11 10:41:22 +0200
committerunknown <Kristofer.Pettersson@naruto.>2006-10-11 10:41:22 +0200
commit1e0ebb9105e4ff6f0e4318bbb5cc83781ab9341c (patch)
tree8cf5a5d6b5927563b4f87bfedf735e3fd3dd01be /sql
parent87ae7cb978dfeb249cdc6c5000d788949d82a665 (diff)
parent5e71afcbe79091f9113e66e161cb15c3c35f3f67 (diff)
downloadmariadb-git-1e0ebb9105e4ff6f0e4318bbb5cc83781ab9341c.tar.gz
Merge naruto.:C:/cpp/bug21811/my50-bug21811
into naruto.:C:/cpp/mysql-5.0-maint mysql-test/r/func_time.result: Auto merged sql/item_timefunc.cc: Auto merged
Diffstat (limited to 'sql')
-rw-r--r--sql/item_timefunc.cc8
-rw-r--r--sql/item_timefunc.h19
2 files changed, 17 insertions, 10 deletions
diff --git a/sql/item_timefunc.cc b/sql/item_timefunc.cc
index 48d6458bd88..58b18cd0e7e 100644
--- a/sql/item_timefunc.cc
+++ b/sql/item_timefunc.cc
@@ -2151,11 +2151,15 @@ bool Item_date_add_interval::eq(const Item *item, bool binary_cmp) const
(date_sub_interval == other->date_sub_interval));
}
+/*
+ 'interval_names' reflects the order of the enumeration interval_type.
+ See item_timefunc.h
+ */
static const char *interval_names[]=
{
- "year", "quarter", "month", "day", "hour",
- "minute", "week", "second", "microsecond",
+ "year", "quarter", "month", "week", "day",
+ "hour", "minute", "second", "microsecond",
"year_month", "day_hour", "day_minute",
"day_second", "hour_minute", "hour_second",
"minute_second", "day_microsecond",
diff --git a/sql/item_timefunc.h b/sql/item_timefunc.h
index d5d3efeeab4..e79c62e6ffb 100644
--- a/sql/item_timefunc.h
+++ b/sql/item_timefunc.h
@@ -630,18 +630,21 @@ public:
};
/*
- The following must be sorted so that simple intervals comes first.
- (get_interval_value() depends on this)
+ 'interval_type' must be sorted so that simple intervals comes first,
+ ie year, quarter, month, week, day, hour, etc. The order based on
+ interval size is also important and the intervals should be kept in a
+ large to smaller order. (get_interval_value() depends on this)
*/
enum interval_type
{
- INTERVAL_YEAR, INTERVAL_QUARTER, INTERVAL_MONTH, INTERVAL_DAY, INTERVAL_HOUR,
- INTERVAL_MINUTE, INTERVAL_WEEK, INTERVAL_SECOND, INTERVAL_MICROSECOND ,
- INTERVAL_YEAR_MONTH, INTERVAL_DAY_HOUR, INTERVAL_DAY_MINUTE,
- INTERVAL_DAY_SECOND, INTERVAL_HOUR_MINUTE, INTERVAL_HOUR_SECOND,
- INTERVAL_MINUTE_SECOND, INTERVAL_DAY_MICROSECOND, INTERVAL_HOUR_MICROSECOND,
- INTERVAL_MINUTE_MICROSECOND, INTERVAL_SECOND_MICROSECOND
+ INTERVAL_YEAR, INTERVAL_QUARTER, INTERVAL_MONTH, INTERVAL_WEEK,
+ INTERVAL_DAY, INTERVAL_HOUR, INTERVAL_MINUTE, INTERVAL_SECOND,
+ INTERVAL_MICROSECOND, INTERVAL_YEAR_MONTH, INTERVAL_DAY_HOUR,
+ INTERVAL_DAY_MINUTE, INTERVAL_DAY_SECOND, INTERVAL_HOUR_MINUTE,
+ INTERVAL_HOUR_SECOND, INTERVAL_MINUTE_SECOND, INTERVAL_DAY_MICROSECOND,
+ INTERVAL_HOUR_MICROSECOND, INTERVAL_MINUTE_MICROSECOND,
+ INTERVAL_SECOND_MICROSECOND
};
class Item_date_add_interval :public Item_date_func