summaryrefslogtreecommitdiff
path: root/sql/item.h
diff options
context:
space:
mode:
authorunknown <gkodinov/kgeorge@magare.gmz>2007-11-21 11:46:15 +0200
committerunknown <gkodinov/kgeorge@magare.gmz>2007-11-21 11:46:15 +0200
commit3fdc12ca42a2a84c1ccde582d64372ca6b2fa76d (patch)
tree4e5c66a5aea96d3141805fadfd521c3e5519c0bc /sql/item.h
parentf339b1d3f2c4a6e6ec65efddad5d8d8c2f10de22 (diff)
parentf3637af43ebdda58c2cbaa79406792dc6f739c08 (diff)
downloadmariadb-git-3fdc12ca42a2a84c1ccde582d64372ca6b2fa76d.tar.gz
Merge gkodinov@bk-internal.mysql.com:/home/bk/mysql-5.0-opt
into magare.gmz:/home/kgeorge/mysql/autopush/B30788-5.0-opt sql/item.h: Auto merged sql/sql_select.cc: Auto merged mysql-test/r/subselect.result: merge of 5.0-opt mysql-test/t/subselect.test: merge of 5.0-opt
Diffstat (limited to 'sql/item.h')
-rw-r--r--sql/item.h22
1 files changed, 21 insertions, 1 deletions
diff --git a/sql/item.h b/sql/item.h
index a1135c2c725..5046e0ceb93 100644
--- a/sql/item.h
+++ b/sql/item.h
@@ -2452,8 +2452,18 @@ class Item_cache: public Item
protected:
Item *example;
table_map used_table_map;
+ /*
+ Field that this object will get value from. This is set/used by
+ index-based subquery engines to detect and remove the equality injected
+ by IN->EXISTS transformation.
+ For all other uses of Item_cache, cached_field doesn't matter.
+ */
+ Field *cached_field;
public:
- Item_cache(): example(0), used_table_map(0) {fixed= 1; null_value= 1;}
+ Item_cache(): example(0), used_table_map(0), cached_field(0)
+ {
+ fixed= 1; null_value= 1;
+ }
void set_used_tables(table_map map) { used_table_map= map; }
@@ -2465,6 +2475,8 @@ public:
decimals= item->decimals;
collation.set(item->collation);
unsigned_flag= item->unsigned_flag;
+ if (item->type() == FIELD_ITEM)
+ cached_field= ((Item_field *)item)->field;
return 0;
};
virtual void store(Item *)= 0;
@@ -2475,6 +2487,14 @@ public:
// to prevent drop fixed flag (no need parent cleanup call)
void cleanup() {}
void print(String *str);
+ bool eq_def(Field *field)
+ {
+ return cached_field ? cached_field->eq_def (field) : FALSE;
+ }
+ bool eq(const Item *item, bool binary_cmp) const
+ {
+ return this == item;
+ }
};