summaryrefslogtreecommitdiff
path: root/mysql-test/r/view.result
diff options
context:
space:
mode:
authorIgor Babaev <igor@askmonty.org>2011-07-11 10:56:48 -0700
committerIgor Babaev <igor@askmonty.org>2011-07-11 10:56:48 -0700
commit47aee19827743f0fd9e6af45713b4e1ed6365576 (patch)
treee020bef635a4e127d92d6da67c9c55e85327ac00 /mysql-test/r/view.result
parentf8db35bd157f0e1c78cb86cb61200a9aaf7998c1 (diff)
downloadmariadb-git-47aee19827743f0fd9e6af45713b4e1ed6365576.tar.gz
Fixed LP bug #793386.
Auto-generated names for view field items must be allocated in the statement memory, not in the execution memory of the statement.
Diffstat (limited to 'mysql-test/r/view.result')
-rw-r--r--mysql-test/r/view.result18
1 files changed, 18 insertions, 0 deletions
diff --git a/mysql-test/r/view.result b/mysql-test/r/view.result
index b36697d093f..b09c00a883c 100644
--- a/mysql-test/r/view.result
+++ b/mysql-test/r/view.result
@@ -4277,3 +4277,21 @@ Warnings:
Note 1003 select `v2`.`b` AS `b` from `test`.`v2` where 0
DROP VIEW v1,v2;
DROP TABLE t1;
+#
+# LP bug #793386: unexpected 'Duplicate column name ''' error
+# at the second execution of a PS using a view
+#
+CREATE TABLE t1 (f1 int, f2 int, f3 int, f4 int);
+CREATE VIEW v1 AS
+SELECT t.f1, t.f2, s.f3, s.f4 FROM t1 t, t1 s
+WHERE t.f4 >= s.f2 AND s.f3 < 0;
+PREPARE stmt1 FROM
+"SELECT s.f1 AS f1, s.f2 AS f2, s.f3 AS f3, t.f4 AS f4
+ FROM v1 AS t LEFT JOIN v1 AS s ON t.f4=s.f4 WHERE t.f2 <> 1225";
+EXECUTE stmt1;
+f1 f2 f3 f4
+EXECUTE stmt1;
+f1 f2 f3 f4
+DEALLOCATE PREPARE stmt1;
+DROP VIEW v1;
+DROP TABLE t1;