summaryrefslogtreecommitdiff
path: root/sql/item_cmpfunc.h
diff options
context:
space:
mode:
authorunknown <igor@rurik.mysql.com>2004-06-10 22:27:21 -0700
committerunknown <igor@rurik.mysql.com>2004-06-10 22:27:21 -0700
commitcd23d6e37a6caf527bc2672b15b9c9d25947a3e7 (patch)
treedea74bc620f67c825c7c66767c81c27051cec635 /sql/item_cmpfunc.h
parentd4898d174c7e728a66831a299b8dddfd5ca6e802 (diff)
downloadmariadb-git-cd23d6e37a6caf527bc2672b15b9c9d25947a3e7.tar.gz
join_nested.test, join_nested.result:
new file Many files: Nested joins added. sql/item_cmpfunc.h: Nested joins added. sql/item_func.h: Nested joins added. sql/sql_base.cc: Nested joins added. sql/sql_lex.cc: Nested joins added. sql/sql_lex.h: Nested joins added. sql/sql_parse.cc: Nested joins added. sql/sql_select.cc: Nested joins added. sql/sql_select.h: Nested joins added. sql/sql_yacc.yy: Nested joins added. sql/table.h: Nested joins added. mysql-test/r/join_outer.result: Nested joins added. mysql-test/r/select.result: Nested joins added.
Diffstat (limited to 'sql/item_cmpfunc.h')
-rw-r--r--sql/item_cmpfunc.h36
1 files changed, 35 insertions, 1 deletions
diff --git a/sql/item_cmpfunc.h b/sql/item_cmpfunc.h
index 541bc47557d..04819688e0d 100644
--- a/sql/item_cmpfunc.h
+++ b/sql/item_cmpfunc.h
@@ -214,6 +214,40 @@ public:
Item *neg_transformer();
};
+
+/*
+ The class Item_func_trig_cond is used for guarded predicates
+ which are employed only for internal purposes.
+ A guarded predicates is an object consisting of an a regular or
+ a guarded predicate P and a pointer to a boolean guard variable g.
+ A guarded predicate P/g is evaluated to true if the value of the
+ guard g is false, otherwise it is evaluated to the same value that
+ the predicate P: val(P/g)= g ? val(P):true.
+ Guarded predicates allow us to include predicates into a conjunction
+ conditionally. Currently they are utilized for pushed down predicates
+ in queries with outer join operations.
+
+ In the future, probably, it makes sense to extend this class to
+ the objects consisting of three elements: a predicate P, a pointer
+ to a variable g and a firing value s with following evaluation
+ rule: val(P/g,s)= g==s? val(P) : true. It will allow us to build only
+ one item for the objects of the form P/g1/g2...
+
+ Objects of this class are built only for query execution after
+ the execution plan has been already selected. That's why this
+ class needs only val_int out of generic methods.
+*/
+
+class Item_func_trig_cond: public Item_bool_func
+{
+ bool *trig_var;
+public:
+ Item_func_trig_cond(Item *a, bool *f) : Item_bool_func(a) { trig_var= f; }
+ longlong val_int() { return *trig_var ? args[0]->val_int() : 1; }
+ enum Functype functype() const { return TRIG_COND_FUNC; };
+ const char *func_name() const { return "trigcond"; };
+};
+
class Item_func_not_all :public Item_func_not
{
bool abort_on_null;
@@ -793,7 +827,7 @@ public:
}
const char *func_name() const { return "isnotnull"; }
optimize_type select_optimize() const { return OPTIMIZE_NULL; }
- table_map not_null_tables() const { return 0; }
+ table_map not_null_tables() const { return used_tables(); }
Item *neg_transformer();
void print(String *str);
};