summaryrefslogtreecommitdiff
path: root/mysql-test/r/sp.result
diff options
context:
space:
mode:
authorunknown <kroki/tomash@moonlight.intranet>2006-09-07 18:51:00 +0400
committerunknown <kroki/tomash@moonlight.intranet>2006-09-07 18:51:00 +0400
commitee09b41ea277ee3916509e8c2ee3145b3b2e6518 (patch)
treee0132a61a13a83836bb9c131ca02708e3634ecf7 /mysql-test/r/sp.result
parent33294b1b50eb20e09db5f1462a12fe5668f4f097 (diff)
downloadmariadb-git-ee09b41ea277ee3916509e8c2ee3145b3b2e6518.tar.gz
BUG#20492: Subsequent calls to stored procedure yield incorrect result
if join is used For procedures with selects that use complicated joins with ON expression re-execution could erroneously ignore this ON expression, giving incorrect result. The problem was that optimized ON expression wasn't saved for re-execution. The solution is to properly save it. mysql-test/r/sp.result: Add result for bug#20492: Subsequent calls to stored procedure yield incorrect result if join is used. mysql-test/t/sp.test: Add test case for bug#20492: Subsequent calls to stored procedure yield incorrect result if join is used. sql/sql_select.cc: Save modified ON expression for re-execution.
Diffstat (limited to 'mysql-test/r/sp.result')
-rw-r--r--mysql-test/r/sp.result26
1 files changed, 26 insertions, 0 deletions
diff --git a/mysql-test/r/sp.result b/mysql-test/r/sp.result
index 854935b071b..9e4fdb6c6b8 100644
--- a/mysql-test/r/sp.result
+++ b/mysql-test/r/sp.result
@@ -5394,4 +5394,30 @@ Procedure sql_mode Create Procedure
bug21416 CREATE DEFINER=`root`@`localhost` PROCEDURE `bug21416`()
show create procedure bug21416
drop procedure bug21416|
+DROP PROCEDURE IF EXISTS p1|
+DROP VIEW IF EXISTS v1, v2|
+DROP TABLE IF EXISTS t3, t4|
+CREATE TABLE t3 (t3_id INT)|
+INSERT INTO t3 VALUES (0)|
+INSERT INTO t3 VALUES (1)|
+CREATE TABLE t4 (t4_id INT)|
+INSERT INTO t4 VALUES (2)|
+CREATE VIEW v1 AS
+SELECT t3.t3_id, t4.t4_id
+FROM t3 JOIN t4 ON t3.t3_id = 0|
+CREATE VIEW v2 AS
+SELECT t3.t3_id AS t3_id_1, v1.t3_id AS t3_id_2, v1.t4_id
+FROM t3 LEFT JOIN v1 ON t3.t3_id = 0|
+CREATE PROCEDURE p1() SELECT * FROM v2|
+CALL p1()|
+t3_id_1 t3_id_2 t4_id
+0 0 2
+1 NULL NULL
+CALL p1()|
+t3_id_1 t3_id_2 t4_id
+0 0 2
+1 NULL NULL
+DROP PROCEDURE p1|
+DROP VIEW v1, v2|
+DROP TABLE t3, t4|
drop table t1,t2;