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
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nexedi
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
Hide 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
v2 CREATE ALGORITHM=UNDEFINED DEFINER=`some_user`@`localhost` SQL SECURITY INVOKER VIEW `v2` AS select 1 AS `1`
drop view v1;
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;
show
create
view
v2
;
drop
view
v1
;
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,
sctx
->
master_access
=
0
;
sctx
->
db_access
=
0
;
sctx
->
priv_user
=
(
char
*
)
""
;
*
sctx
->
priv_host
=
0
;
/*
Find acl entry in user database.
...
...
sql/table.cc
View file @
f0f9c740
...
...
@@ -2428,8 +2428,18 @@ bool st_table_list::prepare_view_securety_context(THD *thd)
definer
.
host
.
str
,
thd
->
db
))
{
my_error
(
ER_NO_SUCH_USER
,
MYF
(
0
),
definer
.
user
.
str
,
definer
.
host
.
str
);
DBUG_RETURN
(
TRUE
);
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
);
DBUG_RETURN
(
TRUE
);
}
}
}
DBUG_RETURN
(
FALSE
);
...
...
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