summaryrefslogtreecommitdiff
path: root/sql/item_timefunc.h
diff options
context:
space:
mode:
authorunknown <gluh@gluh.mysql.r18.ru>2004-03-15 18:28:21 +0400
committerunknown <gluh@gluh.mysql.r18.ru>2004-03-15 18:28:21 +0400
commitafedd9f8f777cd3ccbe6901f70b467bb71147afa (patch)
treec617b4731b141e48f4e7d0e9c03dffad70b9d936 /sql/item_timefunc.h
parent1b81fcf8ca993a4aac88492f1332868b0fea9233 (diff)
downloadmariadb-git-afedd9f8f777cd3ccbe6901f70b467bb71147afa.tar.gz
Task #835: additional changes fot str_to_date
include/mysqld_error.h: Task #835: additional changes fot str_to_date New error message mysql-test/r/date_formats.result: Task #835: additional changes fot str_to_date tests mysql-test/r/func_sapdb.result: Task #835: additional changes fot str_to_date tests mysql-test/r/func_time.result: Task #835: additional changes fot str_to_date tests mysql-test/r/type_time.result: Task #835: additional changes fot str_to_date tests mysql-test/t/date_formats.test: Task #835: additional changes fot str_to_date tests mysql-test/t/func_sapdb.test: Task #835: additional changes fot str_to_date tests mysql-test/t/func_time.test: Task #835: additional changes fot str_to_date tests sql/share/czech/errmsg.txt: Task #835: additional changes fot str_to_date New error message sql/share/danish/errmsg.txt: Task #835: additional changes fot str_to_date New error message sql/share/dutch/errmsg.txt: Task #835: additional changes fot str_to_date New error message sql/share/english/errmsg.txt: Task #835: additional changes fot str_to_date New error message sql/share/estonian/errmsg.txt: Task #835: additional changes fot str_to_date New error message sql/share/french/errmsg.txt: Task #835: additional changes fot str_to_date New error message sql/share/german/errmsg.txt: Task #835: additional changes fot str_to_date New error message sql/share/greek/errmsg.txt: Task #835: additional changes fot str_to_date New error message sql/share/hungarian/errmsg.txt: Task #835: additional changes fot str_to_date New error message sql/share/italian/errmsg.txt: Task #835: additional changes fot str_to_date New error message sql/share/japanese/errmsg.txt: Task #835: additional changes fot str_to_date New error message sql/share/korean/errmsg.txt: Task #835: additional changes fot str_to_date New error message sql/share/norwegian-ny/errmsg.txt: Task #835: additional changes fot str_to_date New error message sql/share/norwegian/errmsg.txt: Task #835: additional changes fot str_to_date New error message sql/share/polish/errmsg.txt: Task #835: additional changes fot str_to_date New error message sql/share/portuguese/errmsg.txt: Task #835: additional changes fot str_to_date New error message sql/share/romanian/errmsg.txt: Task #835: additional changes fot str_to_date New error message sql/share/russian/errmsg.txt: Task #835: additional changes fot str_to_date New error message sql/share/serbian/errmsg.txt: Task #835: additional changes fot str_to_date New error message sql/share/slovak/errmsg.txt: Task #835: additional changes fot str_to_date New error message sql/share/spanish/errmsg.txt: Task #835: additional changes fot str_to_date New error message sql/share/swedish/errmsg.txt: Task #835: additional changes fot str_to_date New error message sql/share/ukrainian/errmsg.txt: Task #835: additional changes fot str_to_date New error message
Diffstat (limited to 'sql/item_timefunc.h')
-rw-r--r--sql/item_timefunc.h43
1 files changed, 21 insertions, 22 deletions
diff --git a/sql/item_timefunc.h b/sql/item_timefunc.h
index 854a54bbe80..1b044b49fb1 100644
--- a/sql/item_timefunc.h
+++ b/sql/item_timefunc.h
@@ -21,6 +21,11 @@
#pragma interface /* gcc class implementation */
#endif
+enum date_time_format_types
+{
+ TIME_ONLY= 0, TIME_MICROSECOND, DATE_ONLY, DATE_TIME, DATE_TIME_MICROSECOND
+};
+
class Item_func_period_add :public Item_int_func
{
public:
@@ -318,6 +323,7 @@ public:
enum Item_result result_type () const { return STRING_RESULT; }
enum_field_types field_type() const { return MYSQL_TYPE_DATE; }
String *val_str(String *str);
+ longlong val_int();
double val() { return (double) val_int(); }
const char *func_name() const { return "date"; }
void fix_length_and_dec()
@@ -407,6 +413,7 @@ public:
Item_func_curdate() :Item_date() {}
void set_result_from_tm(struct tm *now);
longlong val_int() { return (value) ; }
+ String *val_str(String *str);
void fix_length_and_dec();
bool get_date(TIME *res, uint fuzzy_date);
virtual void store_now_in_tm(time_t now, struct tm *now_tm)=0;
@@ -477,8 +484,8 @@ class Item_func_from_days :public Item_date
{
public:
Item_func_from_days(Item *a) :Item_date(a) {}
- longlong val_int();
const char *func_name() const { return "from_days"; }
+ bool get_date(TIME *res, uint fuzzy_date);
};
@@ -806,37 +813,29 @@ public:
};
-class Item_func_str_to_date :public Item_date_func
+class Item_func_str_to_date :public Item_str_func
{
+ enum_field_types cached_field_type;
+ date_time_format_types cached_format_type;
+ timestamp_type cached_timestamp_type;
+ bool const_item;
public:
Item_func_str_to_date(Item *a, Item *b)
- :Item_date_func(a, b)
+ :Item_str_func(a, b)
{}
String *val_str(String *str);
bool get_date(TIME *ltime, uint fuzzy_date);
const char *func_name() const { return "str_to_date"; }
- void fix_length_and_dec()
- {
- maybe_null= 1;
- decimals=0;
- max_length=MAX_DATETIME_FULL_WIDTH*MY_CHARSET_BIN_MB_MAXLEN;
- }
+ enum_field_types field_type() const { return cached_field_type; }
+ void fix_length_and_dec();
+ Field *tmp_table_field(TABLE *t_arg);
};
-class Item_func_last_day :public Item_str_func
+
+class Item_func_last_day :public Item_date
{
public:
- Item_func_last_day(Item *a) :Item_str_func(a) {}
- String *val_str(String *str);
+ Item_func_last_day(Item *a) :Item_date(a) {}
const char *func_name() const { return "last_day"; }
- enum_field_types field_type() const { return MYSQL_TYPE_DATE; }
- void fix_length_and_dec()
- {
- decimals=0;
- max_length=MAX_DATE_WIDTH*MY_CHARSET_BIN_MB_MAXLEN;
- }
- Field *tmp_table_field(TABLE *t_arg)
- {
- return (new Field_date(maybe_null, name, t_arg, &my_charset_bin));
- }
+ bool get_date(TIME *res, uint fuzzy_date);
};