diff options
author | unknown <Sinisa@sinisa.nasamreza.org> | 2001-12-26 16:49:10 +0200 |
---|---|---|
committer | unknown <Sinisa@sinisa.nasamreza.org> | 2001-12-26 16:49:10 +0200 |
commit | 71ce58a3b1f0b2d4ec776bc7864076603b3170f4 (patch) | |
tree | 1924b9282a4aed314ccafcecea76220ffcee2576 /sql/item_timefunc.h | |
parent | 1baa552749eab973ce7814a47d4f3826ffd71bfe (diff) | |
download | mariadb-git-71ce58a3b1f0b2d4ec776bc7864076603b3170f4.tar.gz |
This is a large push. Included are :
* multi-table updates
* new paid feature for limiting number of queries per hour for users
* optional syntax for multi-table deletes
* optimization for SQL_CALC_FOUND_ROWS
* a small addition for CREATE .. SELECT that will be of future use
I know that all this will require many additions to documentation,
which I have not done, but I am at Arjen's disposal to help him document
all this.
libmysqld/lib_sql.cc:
This is a small change required due to new paid feature of limiting
number of queries per hour for each user.
mysql-test/r/multi_update.result:
Change of the result to accomodate multi-table updates
mysql-test/t/multi_update.test:
Change in multi-table tests to accomodate multi-table updates
BitKeeper/etc/ignore:
Added 50 sql/new.cc to the ignore list
scripts/mysql_install_db.sh:
This is a small change required due to new paid feature of limiting
number of queries per hour for each user.
sql/item_timefunc.h:
This is a small feature that will be of use later in the proper
creation of the tables out of CREATE ... SELECT...
Further changes will come after this resolve/push/test passes ..
sql/lex.h:
This is a small change required due to new paid feature of limiting
number of queries per hour for each user.
sql/mysql_priv.h:
This is a small change required due to new paid feature of limiting
number of queries per hour for each user.
sql/mysqld.cc:
This is a small change required due to new paid feature of limiting
number of queries per hour for each user.
sql/sql_acl.cc:
This is a small change required due to new paid feature of limiting
number of queries per hour for each user.
sql/sql_acl.h:
This is a small change required due to new paid feature of limiting
number of queries per hour for each user.
sql/sql_class.h:
These are changes required for multi-table updates.
sql/sql_lex.h:
Changes required for both multi-table updates and limiting number of
queries per hour (paid feature).
sql/sql_parse.cc:
Ha ! So many changes.
* multi-table updates
* limiting number of queries per hour for users
sql/sql_select.cc:
Optimisation for SQL_CALC_FOUND_ROWS, when a query involves a single
table, without WHERE or GROUP clause
sql/sql_update.cc:
multi-table updates
sql/sql_yacc.yy:
Many things :
* multi-table updates
* limiting number of queries per hour for users
* new optional syntax for multi-table deletes. This one is different
from the one demanded by user. USING clause MUST include ALL tables,
not just the ones that are used and not deleted from.
Diffstat (limited to 'sql/item_timefunc.h')
-rw-r--r-- | sql/item_timefunc.h | 41 |
1 files changed, 33 insertions, 8 deletions
diff --git a/sql/item_timefunc.h b/sql/item_timefunc.h index 1343cdad390..e1df072ff2a 100644 --- a/sql/item_timefunc.h +++ b/sql/item_timefunc.h @@ -229,6 +229,23 @@ public: const char *func_name() const { return "date"; } void fix_length_and_dec() { decimals=0; max_length=10; } bool save_in_field(Field *to); + void make_field(Send_field *tmp_field) + { + init_make_field(tmp_field,FIELD_TYPE_DATE); + } +}; + + +class Item_date_func :public Item_str_func +{ +public: + Item_date_func() :Item_str_func() {} + Item_date_func(Item *a) :Item_str_func(a) {} + Item_date_func(Item *a,Item *b) :Item_str_func(a,b) {} + void make_field(Send_field *tmp_field) + { + init_make_field(tmp_field,FIELD_TYPE_DATETIME); + } }; @@ -247,6 +264,10 @@ public: { str_value.set(buff,buff_length); return &str_value; } const char *func_name() const { return "curtime"; } void fix_length_and_dec(); + void make_field(Send_field *tmp_field) + { + init_make_field(tmp_field,FIELD_TYPE_TIME); + } }; @@ -263,15 +284,15 @@ public: }; -class Item_func_now :public Item_func +class Item_func_now :public Item_date_func { longlong value; char buff[20]; uint buff_length; TIME ltime; public: - Item_func_now() :Item_func() {} - Item_func_now(Item *a) :Item_func(a) {} + Item_func_now() :Item_date_func() {} + Item_func_now(Item *a) :Item_date_func(a) {} enum Item_result result_type () const { return STRING_RESULT; } double val() { return (double) value; } longlong val_int() { return value; } @@ -307,16 +328,16 @@ public: }; -class Item_func_from_unixtime :public Item_func +class Item_func_from_unixtime :public Item_date_func { public: - Item_func_from_unixtime(Item *a) :Item_func(a) {} + Item_func_from_unixtime(Item *a) :Item_date_func(a) {} double val() { return (double) Item_func_from_unixtime::val_int(); } longlong val_int(); String *val_str(String *str); const char *func_name() const { return "from_unixtime"; } void fix_length_and_dec() { decimals=0; max_length=19; } - enum Item_result result_type () const { return STRING_RESULT; } +// enum Item_result result_type () const { return STRING_RESULT; } bool get_date(TIME *res,bool fuzzy_date); }; @@ -330,6 +351,10 @@ public: String *val_str(String *); void fix_length_and_dec() { maybe_null=1; max_length=13; } const char *func_name() const { return "sec_to_time"; } + void make_field(Send_field *tmp_field) + { + init_make_field(tmp_field,FIELD_TYPE_TIME); + } }; enum interval_type { INTERVAL_YEAR, INTERVAL_MONTH, INTERVAL_DAY, @@ -339,7 +364,7 @@ enum interval_type { INTERVAL_YEAR, INTERVAL_MONTH, INTERVAL_DAY, INTERVAL_HOUR_MINUTE, INTERVAL_HOUR_SECOND, INTERVAL_MINUTE_SECOND}; -class Item_date_add_interval :public Item_str_func +class Item_date_add_interval :public Item_date_func { const interval_type int_type; String value; @@ -347,7 +372,7 @@ class Item_date_add_interval :public Item_str_func public: Item_date_add_interval(Item *a,Item *b,interval_type type_arg,bool neg_arg) - :Item_str_func(a,b),int_type(type_arg), date_sub_interval(neg_arg) {} + :Item_date_func(a,b),int_type(type_arg), date_sub_interval(neg_arg) {} String *val_str(String *); const char *func_name() const { return "date_add_interval"; } void fix_length_and_dec() { maybe_null=1; max_length=19; value.alloc(32);} |