1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-27 18:02:13 +03:00

MDEV-6679 Different optimizer plan for "a BETWEEN 'string' AND ?" and "a BETWEEN ? AND 'string'"

Item_string::eq() and Item_param::eq() in string context behaved differently.
Introducing a new class Item_basic_value to share the eq() code between
literals (Item_int, Item_double, Item_string, Item_null) and Item_param.
This commit is contained in:
Alexander Barkov
2014-09-02 22:04:48 +04:00
parent e2bf60276c
commit c70cacacfe
5 changed files with 136 additions and 92 deletions

View File

@ -540,6 +540,15 @@ public:
}
return TRUE;
}
bool bin_eq(const String *other) const
{
return length() == other->length() &&
!memcmp(ptr(), other->ptr(), length());
}
bool eq(const String *other, CHARSET_INFO *cs) const
{
return !sortcmp(this, other, cs);
}
};