diff options
author | Alexander Barkov <bar@mariadb.org> | 2014-09-02 22:04:48 +0400 |
---|---|---|
committer | Alexander Barkov <bar@mariadb.org> | 2014-09-02 22:04:48 +0400 |
commit | c70cacacfef0dac99f56b6c2ed71c21d0da14a7b (patch) | |
tree | 86fa14b5ee14e70c4ac4d90f81312e14885bc52b /sql/sql_string.h | |
parent | e2bf60276cafcb2764ca6268f4250e55ca4aca45 (diff) | |
download | mariadb-git-c70cacacfef0dac99f56b6c2ed71c21d0da14a7b.tar.gz |
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.
Diffstat (limited to 'sql/sql_string.h')
-rw-r--r-- | sql/sql_string.h | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/sql/sql_string.h b/sql/sql_string.h index cc1db1d214b..dbc1df0aaaf 100644 --- a/sql/sql_string.h +++ b/sql/sql_string.h @@ -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); + } }; |