summaryrefslogtreecommitdiff
path: root/mysql-test/t/sp.test
diff options
context:
space:
mode:
authorGeorgi Kodinov <Georgi.Kodinov@Oracle.com>2011-07-07 14:32:05 +0300
committerGeorgi Kodinov <Georgi.Kodinov@Oracle.com>2011-07-07 14:32:05 +0300
commit0dc17bc77087380e3bda5c4e53544a11cdc2325f (patch)
tree58c01300963ad3ab1eabe5ebfb87f16ba99ada53 /mysql-test/t/sp.test
parent0a07be0b2afce18853980a336362db514fd6d9e1 (diff)
parent21d088e44a2812784d78a63049bfa2e156eea658 (diff)
downloadmariadb-git-0dc17bc77087380e3bda5c4e53544a11cdc2325f.tar.gz
weave merge of mysql-5.5->mysql-5.5-security
Diffstat (limited to 'mysql-test/t/sp.test')
-rw-r--r--mysql-test/t/sp.test56
1 files changed, 56 insertions, 0 deletions
diff --git a/mysql-test/t/sp.test b/mysql-test/t/sp.test
index 06ef0a1debd..b687e3ae6aa 100644
--- a/mysql-test/t/sp.test
+++ b/mysql-test/t/sp.test
@@ -8796,4 +8796,60 @@ DROP TABLE t1, t2, t3;
DROP PROCEDURE p1;
--echo
+
+--echo
+--echo # --
+--echo # -- Bug#12652769 - 61470: case operator in stored routine retains old
+--echo # -- value of input parameter
+--echo # ---
+
+--disable_warnings
+DROP TABLE IF EXISTS t1;
+DROP PROCEDURE IF EXISTS p1;
+--enable_warnings
+
+CREATE TABLE t1 (s1 CHAR(5) CHARACTER SET utf8);
+INSERT INTO t1 VALUES ('a');
+
+delimiter |;
+
+CREATE PROCEDURE p1(dt DATETIME, i INT)
+BEGIN
+ SELECT
+ CASE
+ WHEN i = 1 THEN 2
+ ELSE dt
+ END AS x1;
+
+ SELECT
+ CASE _latin1'a'
+ WHEN _utf8'a' THEN 'A'
+ END AS x2;
+
+ SELECT
+ CASE _utf8'a'
+ WHEN _latin1'a' THEN _utf8'A'
+ END AS x3;
+
+ SELECT
+ CASE s1
+ WHEN _latin1'a' THEN _latin1'b'
+ ELSE _latin1'c'
+ END AS x4
+ FROM t1;
+END|
+
+delimiter ;|
+
+--echo
+CALL p1('2011-04-03 05:14:10', 1);
+CALL p1('2011-04-03 05:14:11', 2);
+CALL p1('2011-04-03 05:14:12', 2);
+CALL p1('2011-04-03 05:14:13', 2);
+
+--echo
+DROP TABLE t1;
+DROP PROCEDURE p1;
+--echo
+
--echo # End of 5.5 test