summaryrefslogtreecommitdiff
path: root/sql/item_cmpfunc.h
diff options
context:
space:
mode:
Diffstat (limited to 'sql/item_cmpfunc.h')
-rw-r--r--sql/item_cmpfunc.h19
1 files changed, 19 insertions, 0 deletions
diff --git a/sql/item_cmpfunc.h b/sql/item_cmpfunc.h
index 25cc97d60bf..2570a86ea80 100644
--- a/sql/item_cmpfunc.h
+++ b/sql/item_cmpfunc.h
@@ -291,6 +291,7 @@ public:
enum Item_result result_type () const { return cached_result_type; }
void fix_length_and_dec();
const char *func_name() const { return "ifnull"; }
+ table_map not_null_tables() const { return 0; }
};
@@ -312,6 +313,7 @@ public:
}
void fix_length_and_dec();
const char *func_name() const { return "if"; }
+ table_map not_null_tables() const { return 0; }
};
@@ -328,6 +330,7 @@ public:
enum Item_result result_type () const { return cached_result_type; }
void fix_length_and_dec();
const char *func_name() const { return "nullif"; }
+ table_map not_null_tables() const { return 0; }
};
@@ -344,8 +347,10 @@ public:
void fix_length_and_dec();
enum Item_result result_type () const { return cached_result_type; }
const char *func_name() const { return "coalesce"; }
+ table_map not_null_tables() const { return 0; }
};
+
class Item_func_case :public Item_func
{
int first_expr_num, else_expr_num;
@@ -376,6 +381,7 @@ public:
longlong val_int();
String *val_str(String *);
void fix_length_and_dec();
+ table_map not_null_tables() const { return 0; }
enum Item_result result_type () const { return cached_result_type; }
const char *func_name() const { return "case"; }
void print(String *str);
@@ -668,6 +674,7 @@ public:
}
}
}
+ table_map not_null_tables() const { return 0; }
optimize_type select_optimize() const { return OPTIMIZE_NULL; }
};
@@ -699,8 +706,10 @@ public:
}
const char *func_name() const { return "isnotnull"; }
optimize_type select_optimize() const { return OPTIMIZE_NULL; }
+ table_map not_null_tables() const { return 0; }
};
+
class Item_func_like :public Item_bool_func2
{
char escape;
@@ -773,6 +782,8 @@ class Item_cond :public Item_bool_func
protected:
List<Item> list;
bool abort_on_null;
+ table_map and_tables_cache;
+
public:
/* Item_cond() is only used to create top level items */
Item_cond() : Item_bool_func(), abort_on_null(1) { const_item_cache=0; }
@@ -812,15 +823,23 @@ public:
enum Functype functype() const { return COND_OR_FUNC; }
longlong val_int();
const char *func_name() const { return "or"; }
+ table_map not_null_tables() const { return and_tables_cache; }
};
+/*
+ XOR is Item_cond, not an Item_int_func bevause we could like to
+ optimize (a XOR b) later on. It's low prio, though
+*/
+
class Item_cond_xor :public Item_cond
{
public:
Item_cond_xor() :Item_cond() {}
Item_cond_xor(Item *i1,Item *i2) :Item_cond(i1,i2) {}
enum Functype functype() const { return COND_XOR_FUNC; }
+ /* TODO: remove the next line when implementing XOR optimization */
+ enum Type type() const { return FUNC_ITEM; }
longlong val_int();
const char *func_name() const { return "xor"; }
};