diff options
author | unknown <ramil@mysql.com> | 2006-06-13 16:01:54 +0500 |
---|---|---|
committer | unknown <ramil@mysql.com> | 2006-06-13 16:01:54 +0500 |
commit | 05750704a83bc3388e007145e16907c0b61abaa2 (patch) | |
tree | 0e6d464d3e54cb0ac88c718bcd6857e55dc4e7e9 /sql | |
parent | 65fcdee56e6ffccee45fc4ab70e6d3050fa0e20d (diff) | |
download | mariadb-git-05750704a83bc3388e007145e16907c0b61abaa2.tar.gz |
Fix for bug #12728: Very strange behaviour of ELT
mysql-test/r/func_str.result:
Fix for bug #12728: Very strange behaviour of ELT
- test case
mysql-test/t/func_str.test:
Fix for bug #12728: Very strange behaviour of ELT
- test result
sql/item_strfunc.cc:
Fix for bug #12728: Very strange behaviour of ELT
- Item_func_elt::eq() introduced: check 'item' member as well
(to distinguish for instance elt(1, 'a', 'b') and elt(2, 'a', 'b')
sql/item_strfunc.h:
Fix for bug #12728: Very strange behaviour of ELT
- Item_func_elt::eq() introduced: check 'item' member as well
(to distinguish for instance elt(1, 'a', 'b') and elt(2, 'a', 'b')
Diffstat (limited to 'sql')
-rw-r--r-- | sql/item_strfunc.cc | 11 | ||||
-rw-r--r-- | sql/item_strfunc.h | 1 |
2 files changed, 12 insertions, 0 deletions
diff --git a/sql/item_strfunc.cc b/sql/item_strfunc.cc index f070382e5c1..2ea693e94a3 100644 --- a/sql/item_strfunc.cc +++ b/sql/item_strfunc.cc @@ -1599,6 +1599,17 @@ String *Item_func_elt::val_str(String *str) } +bool Item_func_elt::eq(const Item *par_item, bool binary_cmp) const +{ + /* + We can use (Item_func_elt*) typecast here because the check is done + in the Item_func::eq(). + */ + return Item_func::eq(par_item, binary_cmp) && + item->eq(((Item_func_elt*) par_item)->item, binary_cmp); +} + + void Item_func_make_set::split_sum_func(List<Item> &fields) { if (item->with_sum_func && item->type() != SUM_FUNC_ITEM) diff --git a/sql/item_strfunc.h b/sql/item_strfunc.h index ece15484fd9..482a941c55b 100644 --- a/sql/item_strfunc.h +++ b/sql/item_strfunc.h @@ -372,6 +372,7 @@ public: void fix_length_and_dec(); void update_used_tables(); const char *func_name() const { return "elt"; } + bool eq(const Item *par_item, bool binary_cmp) const; unsigned int size_of() { return sizeof(*this);} }; |