summaryrefslogtreecommitdiff
path: root/sql
diff options
context:
space:
mode:
authorKristofer.Pettersson@naruto. <>2006-10-11 11:05:55 +0200
committerKristofer.Pettersson@naruto. <>2006-10-11 11:05:55 +0200
commit2e5063f97adfdab2aa3354d5f45a6db4356fada2 (patch)
treec6fdc3c8f0c635d61d68059b960c1a2c6cd47274 /sql
parent9cb8ea76e463bd4c87c1b739ecc0f01e6955cf51 (diff)
parent3ef964bbfe98f0a7094ad6adda1eee421c71e077 (diff)
downloadmariadb-git-2e5063f97adfdab2aa3354d5f45a6db4356fada2.tar.gz
Merge naruto.:C:/cpp/bug21811/my51-bug21811
into naruto.:C:/cpp/mysql-5.1-new-maint
Diffstat (limited to 'sql')
-rw-r--r--sql/item_timefunc.cc8
-rw-r--r--sql/time.cc13
2 files changed, 18 insertions, 3 deletions
diff --git a/sql/item_timefunc.cc b/sql/item_timefunc.cc
index d32adde5e64..064db11b65f 100644
--- a/sql/item_timefunc.cc
+++ b/sql/item_timefunc.cc
@@ -2030,11 +2030,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/time.cc b/sql/time.cc
index 0461f7723c6..467dbc684a5 100644
--- a/sql/time.cc
+++ b/sql/time.cc
@@ -25,14 +25,25 @@
#ifndef TESTTIME
+/*
+ Name description of interval names used in statements.
+
+ 'interval_type_to_name' is ordered and sorted on interval size and
+ interval complexity.
+ Order of elements in 'interval_type_to_name' should correspond to
+ the order of elements in 'interval_type' enum
+
+ See also interval_type, interval_names
+*/
+
LEX_STRING interval_type_to_name[INTERVAL_LAST] = {
{ C_STRING_WITH_LEN("YEAR")},
{ C_STRING_WITH_LEN("QUARTER")},
{ C_STRING_WITH_LEN("MONTH")},
+ { C_STRING_WITH_LEN("WEEK")},
{ C_STRING_WITH_LEN("DAY")},
{ C_STRING_WITH_LEN("HOUR")},
{ C_STRING_WITH_LEN("MINUTE")},
- { C_STRING_WITH_LEN("WEEK")},
{ C_STRING_WITH_LEN("SECOND")},
{ C_STRING_WITH_LEN("MICROSECOND")},
{ C_STRING_WITH_LEN("YEAR_MONTH")},