Below is the list of changes that have just been committed into a local
5.0 repository of igor. When igor does a push these changes will
be propagated to the main repository and, within 24 hours after the
push, to the public repository.
For information on how to access the public repository
see http://dev.mysql.com/doc/mysql/en/installing-source-tree.html
ChangeSet
1.1898 05/07/06 09:00:17 igor@stripped +3 -0
view.result, view.test:
Added a test case for bug #6120.
sql_view.cc:
Fixed bug #6120.
The SP cache must be invalidated when a view is altered.
mysql-test/r/view.result
1.84 05/07/06 08:28:55 igor@stripped +17 -0
Added a test case for bug #6120.
mysql-test/t/view.test
1.79 05/07/06 08:28:29 igor@stripped +17 -0
Added a test case for bug #6120.
sql/sql_view.cc
1.52 05/07/06 08:25:58 igor@stripped +4 -0
Fixed bug #6120.
The SP cache must be invalidated when a view is altered.
# This is a BitKeeper patch. What follows are the unified diffs for the
# set of deltas contained in the patch. The rest of the patch, the part
# that BitKeeper cares about, is below these diffs.
# User: igor
# Host: igor-inspiron.creware.com
# Root: /home/igor/dev/mysql-5.0-0
--- 1.83/mysql-test/r/view.result Tue Jul 5 17:03:43 2005
+++ 1.84/mysql-test/r/view.result Wed Jul 6 08:28:55 2005
@@ -1923,3 +1923,20 @@
set sql_mode=default;
drop view v2,v1;
drop table t1;
+CREATE TABLE t1 (s1 int, s2 int);
+INSERT INTO t1 VALUES (1,2);
+CREATE VIEW v1 AS SELECT s2 AS s1, s1 AS s2 FROM t1;
+SELECT * FROM v1;
+s1 s2
+2 1
+CREATE PROCEDURE p1 () SELECT * FROM v1;
+CALL p1();
+s1 s2
+2 1
+ALTER VIEW v1 AS SELECT s1 AS s1, s2 AS s2 FROM t1;
+CALL p1();
+s1 s2
+1 2
+DROP PROCEDURE p1;
+DROP VIEW v1;
+DROP TABLE t1;
--- 1.78/mysql-test/t/view.test Tue Jul 5 03:42:16 2005
+++ 1.79/mysql-test/t/view.test Wed Jul 6 08:28:29 2005
@@ -1761,3 +1761,20 @@
set sql_mode=default;
drop view v2,v1;
drop table t1;
+
+#
+# Test for bug #6120: SP cache to be invalidated when altering a view
+#
+
+CREATE TABLE t1 (s1 int, s2 int);
+INSERT INTO t1 VALUES (1,2);
+CREATE VIEW v1 AS SELECT s2 AS s1, s1 AS s2 FROM t1;
+SELECT * FROM v1;
+CREATE PROCEDURE p1 () SELECT * FROM v1;
+CALL p1();
+ALTER VIEW v1 AS SELECT s1 AS s1, s2 AS s2 FROM t1;
+CALL p1();
+
+DROP PROCEDURE p1;
+DROP VIEW v1;
+DROP TABLE t1;
--- 1.51/sql/sql_view.cc Sun Jul 3 17:44:31 2005
+++ 1.52/sql/sql_view.cc Wed Jul 6 08:25:58 2005
@@ -20,6 +20,7 @@
#include "parse_file.h"
#include "sp.h"
#include "sp_head.h"
+#include "sp_cache.h"
#define MD5_BUFF_LENGTH 33
@@ -140,6 +141,9 @@
res= TRUE;
goto err;
}
+
+ if (mode != VIEW_CREATE_NEW)
+ sp_cache_invalidate();
#ifndef NO_EMBEDDED_ACCESS_CHECKS
/*
| Thread |
|---|
| • bk commit into 5.0 tree (igor:1.1898) BUG#6120 | igor | 6 Jul |