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
f0f9c740
Commit
f0f9c740
authored
May 26, 2006
by
gkodinov@mysql.com
Browse files
Options
Browse Files
Download
Plain Diff
Merge mysql.com:/home/kgeorge/mysql/5.0/clean
into mysql.com:/home/kgeorge/mysql/5.0/B14875
parents
0336a34c
59837f7a
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
43 additions
and
2 deletions
+43
-2
mysql-test/r/view_grant.result
mysql-test/r/view_grant.result
+15
-0
mysql-test/t/view_grant.test
mysql-test/t/view_grant.test
+14
-0
sql/sql_acl.cc
sql/sql_acl.cc
+2
-0
sql/table.cc
sql/table.cc
+12
-2
No files found.
mysql-test/r/view_grant.result
View file @
f0f9c740
...
@@ -533,3 +533,18 @@ View Create View
...
@@ -533,3 +533,18 @@ View Create View
v2 CREATE ALGORITHM=UNDEFINED DEFINER=`some_user`@`localhost` SQL SECURITY INVOKER VIEW `v2` AS select 1 AS `1`
v2 CREATE ALGORITHM=UNDEFINED DEFINER=`some_user`@`localhost` SQL SECURITY INVOKER VIEW `v2` AS select 1 AS `1`
drop view v1;
drop view v1;
drop view v2;
drop view v2;
CREATE TABLE t1 (a INT PRIMARY KEY);
INSERT INTO t1 VALUES (1), (2), (3);
CREATE DEFINER = 'no-such-user'@localhost VIEW v AS SELECT a from t1;
Warnings:
Note 1449 There is no 'no-such-user'@'localhost' registered
SHOW CREATE VIEW v;
View Create View
v CREATE ALGORITHM=UNDEFINED DEFINER=`no-such-user`@`localhost` SQL SECURITY DEFINER VIEW `v` AS select `t1`.`a` AS `a` from `t1`
Warnings:
Note 1449 There is no 'no-such-user'@'localhost' registered
SELECT * FROM v;
ERROR HY000: There is no 'no-such-user'@'localhost' registered
DROP VIEW v;
DROP TABLE t1;
USE test;
mysql-test/t/view_grant.test
View file @
f0f9c740
...
@@ -712,3 +712,17 @@ show create view v1;
...
@@ -712,3 +712,17 @@ show create view v1;
show
create
view
v2
;
show
create
view
v2
;
drop
view
v1
;
drop
view
v1
;
drop
view
v2
;
drop
view
v2
;
#
# BUG#14875: Bad view DEFINER makes SHOW CREATE VIEW fail
#
CREATE
TABLE
t1
(
a
INT
PRIMARY
KEY
);
INSERT
INTO
t1
VALUES
(
1
),
(
2
),
(
3
);
CREATE
DEFINER
=
'no-such-user'
@
localhost
VIEW
v
AS
SELECT
a
from
t1
;
--
warning
1448
SHOW
CREATE
VIEW
v
;
--
error
1449
SELECT
*
FROM
v
;
DROP
VIEW
v
;
DROP
TABLE
t1
;
USE
test
;
sql/sql_acl.cc
View file @
f0f9c740
...
@@ -959,6 +959,8 @@ bool acl_getroot_no_password(Security_context *sctx, char *user, char *host,
...
@@ -959,6 +959,8 @@ bool acl_getroot_no_password(Security_context *sctx, char *user, char *host,
sctx
->
master_access
=
0
;
sctx
->
master_access
=
0
;
sctx
->
db_access
=
0
;
sctx
->
db_access
=
0
;
sctx
->
priv_user
=
(
char
*
)
""
;
*
sctx
->
priv_host
=
0
;
/*
/*
Find acl entry in user database.
Find acl entry in user database.
...
...
sql/table.cc
View file @
f0f9c740
...
@@ -2427,11 +2427,21 @@ bool st_table_list::prepare_view_securety_context(THD *thd)
...
@@ -2427,11 +2427,21 @@ bool st_table_list::prepare_view_securety_context(THD *thd)
definer
.
host
.
str
,
definer
.
host
.
str
,
definer
.
host
.
str
,
definer
.
host
.
str
,
thd
->
db
))
thd
->
db
))
{
if
(
thd
->
lex
->
sql_command
==
SQLCOM_SHOW_CREATE
)
{
push_warning_printf
(
thd
,
MYSQL_ERROR
::
WARN_LEVEL_NOTE
,
ER_NO_SUCH_USER
,
ER
(
ER_NO_SUCH_USER
),
definer
.
user
.
str
,
definer
.
host
.
str
);
}
else
{
{
my_error
(
ER_NO_SUCH_USER
,
MYF
(
0
),
definer
.
user
.
str
,
definer
.
host
.
str
);
my_error
(
ER_NO_SUCH_USER
,
MYF
(
0
),
definer
.
user
.
str
,
definer
.
host
.
str
);
DBUG_RETURN
(
TRUE
);
DBUG_RETURN
(
TRUE
);
}
}
}
}
}
DBUG_RETURN
(
FALSE
);
DBUG_RETURN
(
FALSE
);
}
}
#endif
#endif
...
...
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