diff options
author | unknown <monty@hundin.mysql.fi> | 2002-01-03 00:46:43 +0200 |
---|---|---|
committer | unknown <monty@hundin.mysql.fi> | 2002-01-03 00:46:43 +0200 |
commit | b79170b7fd6b77bbc6cc083fbcaa13faf7f02f92 (patch) | |
tree | 4e18e3ee4d74189f2a784d419334e02f025eacd1 /sql/item_timefunc.h | |
parent | 301cdf9f240106978b04d4f8044b24e4a3fa6d00 (diff) | |
download | mariadb-git-b79170b7fd6b77bbc6cc083fbcaa13faf7f02f92.tar.gz |
New CAST syntax
Cleanup of multi-table-delete in sql_yacc.yy
Changed syntax of MAXIMUM QUERIES PER HOUR to MAX_QUERIES_PER_HOUR to
not get too many reserved words.
Docs/manual.texi:
Updated information about CAST
mysql-test/r/bigint.result:
New CAST syntax
mysql-test/r/create.result:
New CAST syntax
mysql-test/r/variables.result:
Fix after merge with 3.23
mysql-test/t/bigint.test:
New CAST syntax
mysql-test/t/create.test:
New CAST syntax
sql/item_create.cc:
New CAST syntax
sql/item_func.h:
New CAST syntax
sql/item_timefunc.cc:
New CAST syntax
sql/item_timefunc.h:
New CAST syntax
sql/lex.h:
Changed syntax to MAX_QUERIES_PER_HOUR to not get too many reserved words.
sql/mysql_priv.h:
Cleanup multi-delete
sql/sql_parse.cc:
Cleanup multi-delete
sql/sql_yacc.yy:
Cleanup multi-delete.
New CAST syntax.
Removed some restricted words.
Diffstat (limited to 'sql/item_timefunc.h')
-rw-r--r-- | sql/item_timefunc.h | 33 |
1 files changed, 17 insertions, 16 deletions
diff --git a/sql/item_timefunc.h b/sql/item_timefunc.h index b824174edf0..c9daa2316e8 100644 --- a/sql/item_timefunc.h +++ b/sql/item_timefunc.h @@ -414,14 +414,21 @@ class Item_extract :public Item_int_func void fix_length_and_dec(); }; -class Item_date_typecast :public Item_str_func +class Item_typecast :public Item_str_func { public: - Item_date_typecast(Item *a) :Item_str_func(a) {} - const char *func_name() const { return "date_typecast"; } + Item_typecast(Item *a) :Item_str_func(a) {} String *val_str(String *a) { return (args[0]->val_str(a)); } void fix_length_and_dec() { max_length=args[0]->max_length; } - void print(String *str) { print_op(str); } + void print(String *str); +}; + + +class Item_date_typecast :public Item_typecast +{ +public: + Item_date_typecast(Item *a) :Item_typecast(a) {} + const char *func_name() const { return "date"; } void make_field(Send_field *tmp_field) { init_make_field(tmp_field,FIELD_TYPE_DATE); @@ -433,14 +440,11 @@ public: } }; -class Item_time_typecast :public Item_str_func +class Item_time_typecast :public Item_typecast { public: - Item_time_typecast(Item *a) :Item_str_func(a) {} - const char *func_name() const { return "time_typecast"; } - String *val_str(String *a) { return (args[0]->val_str(a)); } - void fix_length_and_dec() { max_length=args[0]->max_length; } - void print(String *str) { print_op(str); } + Item_time_typecast(Item *a) :Item_typecast(a) {} + const char *func_name() const { return "time"; } void make_field(Send_field *tmp_field) { init_make_field(tmp_field,FIELD_TYPE_TIME); @@ -452,14 +456,11 @@ public: } }; -class Item_datetime_typecast :public Item_str_func +class Item_datetime_typecast :public Item_typecast { public: - Item_datetime_typecast(Item *a) :Item_str_func(a) {} - const char *func_name() const { return "datetime_typecast"; } - String *val_str(String *a) { return (args[0]->val_str(a)); } - void fix_length_and_dec() { max_length=args[0]->max_length; } - void print(String *str) { print_op(str); } + Item_datetime_typecast(Item *a) :Item_typecast(a) {} + const char *func_name() const { return "datetime"; } void make_field(Send_field *tmp_field) { init_make_field(tmp_field,FIELD_TYPE_DATETIME); |