summaryrefslogtreecommitdiff
path: root/mysql-test
diff options
context:
space:
mode:
authorunknown <ramil@mysql.com>2006-06-13 16:01:54 +0500
committerunknown <ramil@mysql.com>2006-06-13 16:01:54 +0500
commit05750704a83bc3388e007145e16907c0b61abaa2 (patch)
tree0e6d464d3e54cb0ac88c718bcd6857e55dc4e7e9 /mysql-test
parent65fcdee56e6ffccee45fc4ab70e6d3050fa0e20d (diff)
downloadmariadb-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 'mysql-test')
-rw-r--r--mysql-test/r/func_str.result7
-rw-r--r--mysql-test/t/func_str.test8
2 files changed, 15 insertions, 0 deletions
diff --git a/mysql-test/r/func_str.result b/mysql-test/r/func_str.result
index 6fefbb16353..1feda854014 100644
--- a/mysql-test/r/func_str.result
+++ b/mysql-test/r/func_str.result
@@ -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;
diff --git a/mysql-test/t/func_str.test b/mysql-test/t/func_str.test
index 81d5daaf0ba..0e7ab70940a 100644
--- a/mysql-test/t/func_str.test
+++ b/mysql-test/t/func_str.test
@@ -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;