diff options
author | kroki/tomash@moonlight.home <> | 2007-03-08 15:16:21 +0300 |
---|---|---|
committer | kroki/tomash@moonlight.home <> | 2007-03-08 15:16:21 +0300 |
commit | 17929083813cd84f4005acf775fe2e78e9cfc62e (patch) | |
tree | 04a1fbc0ff2506a6a4f02970c53fe2e612a93a9e /mysql-test/t/sp.test | |
parent | a52a1f8d565774c0379567da3cb32c145c01931d (diff) | |
parent | 7abe938dfa77911e55bb54f076994a780db0a2f5 (diff) | |
download | mariadb-git-17929083813cd84f4005acf775fe2e78e9cfc62e.tar.gz |
Merge moonlight.home:/home/tomash/src/mysql_ab/mysql-5.0
into moonlight.home:/home/tomash/src/mysql_ab/mysql-5.0-bug20492
Diffstat (limited to 'mysql-test/t/sp.test')
-rw-r--r-- | mysql-test/t/sp.test | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/mysql-test/t/sp.test b/mysql-test/t/sp.test index 157d0b7c118..80fb1354b16 100644 --- a/mysql-test/t/sp.test +++ b/mysql-test/t/sp.test @@ -6613,6 +6613,47 @@ call proc_bug19733()| drop procedure proc_bug19733| drop table t3| + +# +# BUG#20492: Subsequent calls to stored procedure yeild incorrect +# result if join is used +# +# Optimized ON expression in join wasn't properly saved for reuse. +# +--disable_warnings +DROP PROCEDURE IF EXISTS p1| +DROP VIEW IF EXISTS v1, v2| +DROP TABLE IF EXISTS t3, t4| +--enable_warnings + +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| + +# Results should not differ. +CALL p1()| +CALL p1()| + +DROP PROCEDURE p1| +DROP VIEW v1, v2| +DROP TABLE t3, t4| + + --echo End of 5.0 tests |