diff options
author | unknown <anozdrin/alik@station.> | 2007-12-14 16:30:22 +0300 |
---|---|---|
committer | unknown <anozdrin/alik@station.> | 2007-12-14 16:30:22 +0300 |
commit | 541ac204014fb7a051156fb369fadcf77342788c (patch) | |
tree | 362dc5c4acd0fff3e86d1b9d4b96ef068d73b341 /sql/item.h | |
parent | a6eec72e7bcf1ef04dd4569e51fa8845cb192fc1 (diff) | |
parent | 35742460f4f252f6d08217997ea2f103b57a5201 (diff) | |
download | mariadb-git-541ac204014fb7a051156fb369fadcf77342788c.tar.gz |
Merge station.:/mnt/raid/alik/MySQL/devel/5.1
into station.:/mnt/raid/alik/MySQL/devel/5.1-rt
client/mysqltest.c:
Auto merged
include/mysql_com.h:
Auto merged
libmysqld/emb_qcache.cc:
Auto merged
libmysqld/emb_qcache.h:
Auto merged
libmysqld/lib_sql.cc:
Auto merged
mysql-test/lib/mtr_report.pl:
Auto merged
sql/ha_partition.cc:
Auto merged
sql/item_func.cc:
Auto merged
sql/mysql_priv.h:
Auto merged
sql/mysqld.cc:
Auto merged
sql/opt_range.cc:
Auto merged
sql/set_var.cc:
Auto merged
sql/set_var.h:
Auto merged
sql/slave.cc:
Auto merged
sql/sql_class.cc:
Auto merged
sql/sql_class.h:
Auto merged
sql/sql_db.cc:
Auto merged
sql/sql_insert.cc:
Auto merged
sql/sql_parse.cc:
Auto merged
sql/sql_partition.cc:
Auto merged
sql/sql_select.cc:
Auto merged
sql/sql_table.cc:
Auto merged
sql/table.cc:
Auto merged
storage/myisam/ha_myisam.cc:
Auto merged
sql/protocol.cc:
SCCS merged
Diffstat (limited to 'sql/item.h')
-rw-r--r-- | sql/item.h | 21 |
1 files changed, 19 insertions, 2 deletions
diff --git a/sql/item.h b/sql/item.h index 2219153616b..b98389bc8d4 100644 --- a/sql/item.h +++ b/sql/item.h @@ -2622,16 +2622,23 @@ 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; enum enum_field_types cached_field_type; public: Item_cache(): - example(0), used_table_map(0), cached_field_type(MYSQL_TYPE_STRING) + example(0), used_table_map(0), cached_field(0), cached_field_type(MYSQL_TYPE_STRING) { fixed= 1; null_value= 1; } Item_cache(enum_field_types field_type_arg): - example(0), used_table_map(0), cached_field_type(field_type_arg) + example(0), used_table_map(0), cached_field(0), cached_field_type(field_type_arg) { fixed= 1; null_value= 1; @@ -2647,6 +2654,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; @@ -2658,6 +2667,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; + } }; |