summaryrefslogtreecommitdiff
path: root/sql/item.h
diff options
context:
space:
mode:
authorEvgeny Potemkin <epotemkin@mysql.com>2010-08-14 13:11:33 +0400
committerEvgeny Potemkin <epotemkin@mysql.com>2010-08-14 13:11:33 +0400
commit48738f737ade6e5e58e37bcd7e70ad5a515f0f18 (patch)
treee62f523aa32ed6704ce025ceef21724a2e6c29a3 /sql/item.h
parent87f655d52d4e30392f2232b51a7658684db6c5d1 (diff)
downloadmariadb-git-48738f737ade6e5e58e37bcd7e70ad5a515f0f18.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.
Diffstat (limited to 'sql/item.h')
-rw-r--r--sql/item.h10
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 *);