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
4735aaea
Commit
4735aaea
authored
Oct 02, 2008
by
Sergey Glukhov
Browse files
Options
Browse Files
Download
Plain Diff
automerge
parents
7adf7154
7e60f710
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
72 additions
and
0 deletions
+72
-0
mysql-test/r/information_schema_db.result
mysql-test/r/information_schema_db.result
+21
-0
mysql-test/t/information_schema_db.test
mysql-test/t/information_schema_db.test
+30
-0
sql/sql_show.cc
sql/sql_show.cc
+21
-0
No files found.
mysql-test/r/information_schema_db.result
View file @
4735aaea
...
@@ -221,3 +221,24 @@ drop view testdb_1.v1, v2, testdb_1.v3, v4;
...
@@ -221,3 +221,24 @@ drop view testdb_1.v1, v2, testdb_1.v3, v4;
drop database testdb_1;
drop database testdb_1;
drop user testdb_1@localhost;
drop user testdb_1@localhost;
drop user testdb_2@localhost;
drop user testdb_2@localhost;
create database testdb_1;
create table testdb_1.t1 (a int);
create view testdb_1.v1 as select * from testdb_1.t1;
grant show view on testdb_1.* to mysqltest_1@localhost;
grant select on testdb_1.v1 to mysqltest_1@localhost;
select table_schema, table_name, view_definition from information_schema.views
where table_name='v1';
table_schema table_name view_definition
testdb_1 v1 select `testdb_1`.`t1`.`a` AS `a` from `testdb_1`.`t1`
show create view testdb_1.v1;
View Create View character_set_client collation_connection
v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `testdb_1`.`v1` AS select `testdb_1`.`t1`.`a` AS `a` from `testdb_1`.`t1` latin1 latin1_swedish_ci
revoke select on testdb_1.v1 from mysqltest_1@localhost;
select table_schema, table_name, view_definition from information_schema.views
where table_name='v1';
table_schema table_name view_definition
testdb_1 v1
show create view testdb_1.v1;
ERROR 42000: SELECT command denied to user 'mysqltest_1'@'localhost' for table 'v1'
drop user mysqltest_1@localhost;
drop database testdb_1;
mysql-test/t/information_schema_db.test
View file @
4735aaea
...
@@ -82,6 +82,7 @@ drop function func2;
...
@@ -82,6 +82,7 @@ drop function func2;
drop
database
`inf%`
;
drop
database
`inf%`
;
drop
procedure
mbase
.
p1
;
drop
procedure
mbase
.
p1
;
drop
database
mbase
;
drop
database
mbase
;
disconnect
user1
;
#
#
# Bug#18282 INFORMATION_SCHEMA.TABLES provides inconsistent info about invalid views
# Bug#18282 INFORMATION_SCHEMA.TABLES provides inconsistent info about invalid views
...
@@ -210,3 +211,32 @@ drop view testdb_1.v1, v2, testdb_1.v3, v4;
...
@@ -210,3 +211,32 @@ drop view testdb_1.v1, v2, testdb_1.v3, v4;
drop
database
testdb_1
;
drop
database
testdb_1
;
drop
user
testdb_1
@
localhost
;
drop
user
testdb_1
@
localhost
;
drop
user
testdb_2
@
localhost
;
drop
user
testdb_2
@
localhost
;
#
# Bug#22763 Disrepancy between SHOW CREATE VIEW and I_S.VIEWS
#
create
database
testdb_1
;
create
table
testdb_1
.
t1
(
a
int
);
create
view
testdb_1
.
v1
as
select
*
from
testdb_1
.
t1
;
grant
show
view
on
testdb_1
.*
to
mysqltest_1
@
localhost
;
grant
select
on
testdb_1
.
v1
to
mysqltest_1
@
localhost
;
connect
(
user1
,
localhost
,
mysqltest_1
,,
test
);
connection
user1
;
select
table_schema
,
table_name
,
view_definition
from
information_schema
.
views
where
table_name
=
'v1'
;
show
create
view
testdb_1
.
v1
;
connection
default
;
revoke
select
on
testdb_1
.
v1
from
mysqltest_1
@
localhost
;
connection
user1
;
select
table_schema
,
table_name
,
view_definition
from
information_schema
.
views
where
table_name
=
'v1'
;
--
error
ER_TABLEACCESS_DENIED_ERROR
show
create
view
testdb_1
.
v1
;
connection
default
;
drop
user
mysqltest_1
@
localhost
;
drop
database
testdb_1
;
disconnect
user1
;
sql/sql_show.cc
View file @
4735aaea
...
@@ -4236,6 +4236,27 @@ static int get_schema_views_record(THD *thd, TABLE_LIST *tables,
...
@@ -4236,6 +4236,27 @@ static int get_schema_views_record(THD *thd, TABLE_LIST *tables,
!
my_strcasecmp
(
system_charset_info
,
tables
->
definer
.
host
.
str
,
!
my_strcasecmp
(
system_charset_info
,
tables
->
definer
.
host
.
str
,
sctx
->
priv_host
))
sctx
->
priv_host
))
tables
->
allowed_show
=
TRUE
;
tables
->
allowed_show
=
TRUE
;
#ifndef NO_EMBEDDED_ACCESS_CHECKS
else
{
if
((
thd
->
col_access
&
(
SHOW_VIEW_ACL
|
SELECT_ACL
))
==
(
SHOW_VIEW_ACL
|
SELECT_ACL
))
tables
->
allowed_show
=
TRUE
;
else
{
TABLE_LIST
table_list
;
uint
view_access
;
memset
(
&
table_list
,
0
,
sizeof
(
table_list
));
table_list
.
db
=
tables
->
view_db
.
str
;
table_list
.
table_name
=
tables
->
view_name
.
str
;
table_list
.
grant
.
privilege
=
thd
->
col_access
;
view_access
=
get_table_grant
(
thd
,
&
table_list
);
if
((
view_access
&
(
SHOW_VIEW_ACL
|
SELECT_ACL
))
==
(
SHOW_VIEW_ACL
|
SELECT_ACL
))
tables
->
allowed_show
=
TRUE
;
}
}
#endif
}
}
restore_record
(
table
,
s
->
default_values
);
restore_record
(
table
,
s
->
default_values
);
tmp_db_name
=
&
tables
->
view_db
;
tmp_db_name
=
&
tables
->
view_db
;
...
...
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