Loading mysql-test/r/func_str.result +7 −0 Original line number Diff line number Diff line Loading @@ -436,3 +436,10 @@ id aes_decrypt(str, 'bar') 1 foo 2 NULL DROP TABLE t1, t2; create table t1(a varchar(8), primary key(a)); insert into t1 values('bar'), ('foo'); select a from t1 where a=elt(1, 'foo', 'bar') or a=elt(2, 'foo', 'bar'); a bar foo drop table t1; mysql-test/t/func_str.test +8 −0 Original line number Diff line number Diff line Loading @@ -254,3 +254,11 @@ SELECT t1.id, aes_decrypt(str, 'bar') FROM t1, t2 WHERE t1.id = t2.id DROP TABLE t1, t2; # # Bug #12728: strange elt() behavior # create table t1(a varchar(8), primary key(a)); insert into t1 values('bar'), ('foo'); select a from t1 where a=elt(1, 'foo', 'bar') or a=elt(2, 'foo', 'bar'); drop table t1; sql/item_strfunc.cc +11 −0 Original line number Diff line number Diff line Loading @@ -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) Loading sql/item_strfunc.h +1 −0 Original line number Diff line number Diff line Loading @@ -372,6 +372,7 @@ class Item_func_elt :public Item_str_func 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);} }; Loading Loading
mysql-test/r/func_str.result +7 −0 Original line number Diff line number Diff line Loading @@ -436,3 +436,10 @@ id aes_decrypt(str, 'bar') 1 foo 2 NULL DROP TABLE t1, t2; create table t1(a varchar(8), primary key(a)); insert into t1 values('bar'), ('foo'); select a from t1 where a=elt(1, 'foo', 'bar') or a=elt(2, 'foo', 'bar'); a bar foo drop table t1;
mysql-test/t/func_str.test +8 −0 Original line number Diff line number Diff line Loading @@ -254,3 +254,11 @@ SELECT t1.id, aes_decrypt(str, 'bar') FROM t1, t2 WHERE t1.id = t2.id DROP TABLE t1, t2; # # Bug #12728: strange elt() behavior # create table t1(a varchar(8), primary key(a)); insert into t1 values('bar'), ('foo'); select a from t1 where a=elt(1, 'foo', 'bar') or a=elt(2, 'foo', 'bar'); drop table t1;
sql/item_strfunc.cc +11 −0 Original line number Diff line number Diff line Loading @@ -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) Loading
sql/item_strfunc.h +1 −0 Original line number Diff line number Diff line Loading @@ -372,6 +372,7 @@ class Item_func_elt :public Item_str_func 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);} }; Loading