From 57f5c319af85b645f144425af285d117aeebd47a Mon Sep 17 00:00:00 2001 From: Alexander Barkov Date: Wed, 6 Jul 2022 15:42:21 +0400 Subject: MDEV-21445 Strange/inconsistent behavior of IN condition when mixing numbers and strings --- sql/sql_type.cc | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'sql/sql_type.cc') diff --git a/sql/sql_type.cc b/sql/sql_type.cc index c92a437259f..df9ac28bab6 100644 --- a/sql/sql_type.cc +++ b/sql/sql_type.cc @@ -765,6 +765,11 @@ Type_handler_hybrid_field_type::aggregate_for_comparison(const Type_handler *h) m_type_handler= &type_handler_datetime; } } + else if ((a == INT_RESULT && b == STRING_RESULT) || + (b == INT_RESULT && a == STRING_RESULT)) + { + m_type_handler= &type_handler_newdecimal; + } else if ((a == INT_RESULT || a == DECIMAL_RESULT) && (b == INT_RESULT || b == DECIMAL_RESULT)) { -- cgit v1.2.1