diff options
author | Evgeny Potemkin <epotemkin@mysql.com> | 2010-08-14 13:11:33 +0400 |
---|---|---|
committer | Evgeny Potemkin <epotemkin@mysql.com> | 2010-08-14 13:11:33 +0400 |
commit | 827a89996a06255b471ae9f24d3f3d3cbf9f99fd (patch) | |
tree | e62f523aa32ed6704ce025ceef21724a2e6c29a3 /sql/item.h | |
parent | 0058f16d933d6de41e670348080ce625d8109b47 (diff) | |
download | mariadb-git-827a89996a06255b471ae9f24d3f3d3cbf9f99fd.tar.gz |
Bug#49746: Const expression caching led to NDB not using engine condition
pushdown.
NDB supports only a limited set of item nodes for use in engine condition
pushdown. Because of this adding cache for const expression effectively
disabled this optimization.
The ndb_serialize_cond function is extended to support Item_cache and treat
it as a constant values.
A helper function called ndb_serialize_const is added. It is used to create
Ndb_cond value node from given const item.
mysql-test/suite/ndb/t/disabled.def:
Bug#49746: Const expression caching led to NDB not using engine condition
pushdown.
Enabled ndb_condition_pushdown test after fixing appropriate bug.
sql/ha_ndbcluster_cond.cc:
Bug#49746: Const expression caching led to NDB not using engine condition
pushdown.
The ndb_serialize_cond function is extended to support Item_cache and treat
it as a constant values.
A helper function called ndb_serialize_const is added. It is used to create
Ndb_cond value node from given const item.
sql/item.cc:
Bug#49746: Const expression caching led to NDB not using engine condition
pushdown.
The Item::cache_const_expr_analyzer function is adjusted to not create
cache for Item_int_with_ref objects.
sql/item.h:
Bug#49746: Const expression caching led to NDB not using engine condition
pushdown.
The result_type() method is added to Item_cache class.
The Item_cache_str now initializes its collation.
Diffstat (limited to 'sql/item.h')
-rw-r--r-- | sql/item.h | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/sql/item.h b/sql/item.h index c7a97ca716a..d1957c46d25 100644 --- a/sql/item.h +++ b/sql/item.h @@ -3266,6 +3266,12 @@ public: bool basic_const_item() const { return test(example && example->basic_const_item());} virtual void clear() { null_value= TRUE; value_cached= FALSE; } + Item_result result_type() const + { + if (!example) + return INT_RESULT; + return Field::result_merge_type(example->field_type()); + } }; @@ -3335,7 +3341,9 @@ public: is_varbinary(item->type() == FIELD_ITEM && cached_field_type == MYSQL_TYPE_VARCHAR && !((const Item_field *) item)->field->has_charset()) - {} + { + collation.set(const_cast<DTCollation&>(item->collation)); + } double val_real(); longlong val_int(); String* val_str(String *); |