diff options
author | Tor Didriksen <tor.didriksen@oracle.com> | 2012-04-18 13:14:05 +0200 |
---|---|---|
committer | Tor Didriksen <tor.didriksen@oracle.com> | 2012-04-18 13:14:05 +0200 |
commit | 11b2cf4f03b7c4b84c26d3c95cdf6f8fa6322349 (patch) | |
tree | 4d01c9aee49ac506a5ef0f801599bedd03001e6e /mysql-test/r/sp.result | |
parent | 448c3d627542c835ac7ea1851e8e019596e377fd (diff) | |
download | mariadb-git-11b2cf4f03b7c4b84c26d3c95cdf6f8fa6322349.tar.gz |
Backport 5.5=>5.1 Patch for Bug#13805127:
Stored program cache produces wrong result in same THD.
Diffstat (limited to 'mysql-test/r/sp.result')
-rw-r--r-- | mysql-test/r/sp.result | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/mysql-test/r/sp.result b/mysql-test/r/sp.result index 11d6ff02756..0d0d76e609b 100644 --- a/mysql-test/r/sp.result +++ b/mysql-test/r/sp.result @@ -7110,3 +7110,41 @@ DROP FUNCTION f1; # ------------------------------------------------------------------ # -- End of 5.1 tests # ------------------------------------------------------------------ + +# Bug#13805127: Stored program cache produces wrong result in same THD + +CREATE PROCEDURE p1(x INT UNSIGNED) +BEGIN +SELECT c1, t2.c2, count(c3) +FROM +( +SELECT 3 as c2 FROM dual WHERE x = 1 +UNION +SELECT 2 FROM dual WHERE x = 1 OR x = 2 +) AS t1, +( +SELECT '2012-03-01 01:00:00' AS c1, 3 as c2, 1 as c3 FROM dual +UNION +SELECT '2012-03-01 02:00:00', 3, 2 FROM dual +UNION +SELECT '2012-03-01 01:00:00', 2, 1 FROM dual +) AS t2 +WHERE t2.c2 = t1.c2 +GROUP BY c1, c2 +; +END| + +CALL p1(1); +c1 c2 count(c3) +2012-03-01 01:00:00 2 1 +2012-03-01 01:00:00 3 1 +2012-03-01 02:00:00 3 1 +CALL p1(2); +c1 c2 count(c3) +2012-03-01 01:00:00 2 1 +CALL p1(1); +c1 c2 count(c3) +2012-03-01 01:00:00 2 1 +2012-03-01 01:00:00 3 1 +2012-03-01 02:00:00 3 1 +DROP PROCEDURE p1; |