summaryrefslogtreecommitdiff
path: root/sql/field.h
diff options
context:
space:
mode:
authorAlexander Barkov <bar@mariadb.org>2017-05-06 23:06:18 +0400
committerAlexander Barkov <bar@mariadb.org>2017-05-06 23:06:18 +0400
commitaea54a11a6493ee9279189798592c5c1fa25c571 (patch)
tree7c1a7f4eccb8b12b101fc9e31b0194a42175f80c /sql/field.h
parentc898de84b78482932fd5110e4bc40229f109d424 (diff)
downloadmariadb-git-aea54a11a6493ee9279189798592c5c1fa25c571.tar.gz
MDEV-12716 Change Value_source::Context to operate Type_handler rather than Item_result
Diffstat (limited to 'sql/field.h')
-rw-r--r--sql/field.h18
1 files changed, 10 insertions, 8 deletions
diff --git a/sql/field.h b/sql/field.h
index 1333c924fa5..f389c02cbb2 100644
--- a/sql/field.h
+++ b/sql/field.h
@@ -365,24 +365,25 @@ public:
Subst_constraint m_subst_constraint;
/*
Comparison type.
- Impostant only when ANY_SUBSTS.
+ Important only when ANY_SUBSTS.
*/
- Item_result m_compare_type;
+ const Type_handler *m_compare_handler;
/*
Collation of the comparison operation.
Important only when ANY_SUBST.
*/
CHARSET_INFO *m_compare_collation;
public:
- Context(Subst_constraint subst, Item_result type, CHARSET_INFO *cs)
+ Context(Subst_constraint subst, const Type_handler *h, CHARSET_INFO *cs)
:m_subst_constraint(subst),
- m_compare_type(type),
- m_compare_collation(cs) { }
+ m_compare_handler(h),
+ m_compare_collation(cs)
+ { DBUG_ASSERT(h == h->type_handler_for_comparison()); }
Subst_constraint subst_constraint() const { return m_subst_constraint; }
Item_result compare_type() const
{
DBUG_ASSERT(m_subst_constraint == ANY_SUBST);
- return m_compare_type;
+ return m_compare_handler->cmp_type();
}
CHARSET_INFO *compare_collation() const
{
@@ -394,12 +395,13 @@ public:
{ // Use this to request only exact value, no invariants.
public:
Context_identity()
- :Context(IDENTITY_SUBST, STRING_RESULT, &my_charset_bin) { }
+ :Context(IDENTITY_SUBST, &type_handler_long_blob, &my_charset_bin) { }
};
class Context_boolean: public Context
{ // Use this when an item is [a part of] a boolean expression
public:
- Context_boolean() :Context(ANY_SUBST, INT_RESULT, &my_charset_bin) { }
+ Context_boolean()
+ :Context(ANY_SUBST, &type_handler_longlong, &my_charset_bin) { }
};
};