diff options
author | unknown <gkodinov@dl145s.mysql.com> | 2006-09-15 11:52:49 +0200 |
---|---|---|
committer | unknown <gkodinov@dl145s.mysql.com> | 2006-09-15 11:52:49 +0200 |
commit | e4b044060ca806c3c6a78bc7fc89acf3641f62ad (patch) | |
tree | af058bb5d99db7c740c4e135bb2137cd924529ff /sql/item.h | |
parent | a1c85e65f0615c57f30d3c20fbdaeb60679ff9bb (diff) | |
parent | 8fd0cf54983889377cdaaf5b5c7020687c9447a6 (diff) | |
download | mariadb-git-e4b044060ca806c3c6a78bc7fc89acf3641f62ad.tar.gz |
Merge dl145s.mysql.com:/data/bk/team_tree_merge/CLEAN/mysql-5.0
into dl145s.mysql.com:/data/bk/team_tree_merge/MERGE/mysql-5.0-opt
sql/item.cc:
Auto merged
sql/item_cmpfunc.cc:
Auto merged
sql/item_func.cc:
Auto merged
sql/item_func.h:
Auto merged
sql/mysql_priv.h:
Auto merged
sql/sql_parse.cc:
Auto merged
sql/sql_select.cc:
Auto merged
sql/sql_yacc.yy:
Auto merged
sql/item.h:
SCCS merged
Diffstat (limited to 'sql/item.h')
-rw-r--r-- | sql/item.h | 45 |
1 files changed, 44 insertions, 1 deletions
diff --git a/sql/item.h b/sql/item.h index 58a3bfd0d75..f1fb2f6a04a 100644 --- a/sql/item.h +++ b/sql/item.h @@ -410,7 +410,19 @@ public: }; -typedef bool (Item::*Item_processor)(byte *arg); +typedef bool (Item::*Item_processor) (byte *arg); +/* + Analyzer function + SYNOPSIS + argp in/out IN: Analysis parameter + OUT: Parameter to be passed to the transformer + + RETURN + TRUE Invoke the transformer + FALSE Don't do it + +*/ +typedef bool (Item::*Item_analyzer) (byte **argp); typedef Item* (Item::*Item_transformer) (byte *arg); typedef void (*Cond_traverser) (const Item *item, void *arg); @@ -736,6 +748,30 @@ public: virtual Item* transform(Item_transformer transformer, byte *arg); + /* + This function performs a generic "compilation" of the Item tree. + The process of compilation is assumed to go as follows: + + compile() + { + if (this->*some_analyzer(...)) + { + compile children if any; + this->*some_transformer(...); + } + } + + i.e. analysis is performed top-down while transformation is done + bottom-up. + */ + virtual Item* compile(Item_analyzer analyzer, byte **arg_p, + Item_transformer transformer, byte *arg_t) + { + if ((this->*analyzer) (arg_p)) + return ((this->*transformer) (arg_t)); + return 0; + } + virtual void traverse_cond(Cond_traverser traverser, void *arg, traverse_order order) { @@ -750,6 +786,12 @@ public: virtual bool change_context_processor(byte *context) { return 0; } virtual bool reset_query_id_processor(byte *query_id) { return 0; } virtual bool is_expensive_processor(byte *arg) { return 0; } + virtual bool subst_argument_checker(byte **arg) + { + if (*arg) + *arg= NULL; + return TRUE; + } virtual Item *equal_fields_propagator(byte * arg) { return this; } virtual bool set_no_const_sub(byte *arg) { return FALSE; } @@ -1251,6 +1293,7 @@ public: return field->can_be_compared_as_longlong(); } Item_equal *find_item_equal(COND_EQUAL *cond_equal); + bool subst_argument_checker(byte **arg); Item *equal_fields_propagator(byte *arg); bool set_no_const_sub(byte *arg); Item *replace_equal_field(byte *arg); |