Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
mariadb
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
mariadb
Commits
ef4290d5
Commit
ef4290d5
authored
Jul 06, 2005
by
unknown
Browse files
Options
Browse Files
Download
Plain Diff
Merge igor-inspiron.creware.com:/home/igor/mysql-5.0
into igor-inspiron.creware.com:/home/igor/dev/mysql-5.0-0
parents
a20b8753
39968552
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
38 additions
and
0 deletions
+38
-0
mysql-test/r/view.result
mysql-test/r/view.result
+17
-0
mysql-test/t/view.test
mysql-test/t/view.test
+17
-0
sql/sql_view.cc
sql/sql_view.cc
+4
-0
No files found.
mysql-test/r/view.result
View file @
ef4290d5
...
...
@@ -1923,3 +1923,20 @@ ERROR HY000: Field of view 'test.v2' underlying table doesn't have a default val
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;
mysql-test/t/view.test
View file @
ef4290d5
...
...
@@ -1761,3 +1761,20 @@ INSERT INTO v2 (vcol1) VALUES(12);
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
;
sql/sql_view.cc
View file @
ef4290d5
...
...
@@ -20,6 +20,7 @@
#include "parse_file.h"
#include "sp.h"
#include "sp_head.h"
#include "sp_cache.h"
#define MD5_BUFF_LENGTH 33
...
...
@@ -141,6 +142,9 @@ bool mysql_create_view(THD *thd,
goto
err
;
}
if
(
mode
!=
VIEW_CREATE_NEW
)
sp_cache_invalidate
();
#ifndef NO_EMBEDDED_ACCESS_CHECKS
/*
Privilege check for view creation:
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment