-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[BugFix] Fix show table status not check view privilege (#53811)
(cherry picked from commit 297ae92)
- Loading branch information
1 parent
15533ea
commit d357c6c
Showing
7 changed files
with
64 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
-- name: test_view_privilege | ||
drop user if exists u1; | ||
-- result: | ||
-- !result | ||
create user u1; | ||
-- result: | ||
-- !result | ||
grant impersonate on user root to u1; | ||
-- result: | ||
-- !result | ||
CREATE TABLE tbl1 (col1 INT, col2 INT, col3 INT); | ||
-- result: | ||
-- !result | ||
CREATE VIEW view1 AS SELECT * FROM tbl1; | ||
-- result: | ||
-- !result | ||
execute as u1 with no revert; | ||
-- result: | ||
-- !result | ||
SHOW TABLE STATUS; | ||
-- result: | ||
-- !result | ||
show create view view1; | ||
-- result: | ||
E: (5203, 'Access denied; you need (at least one of) the ANY privilege(s) on TABLE view1 for this operation. Please ask the admin to grant permission(s) or try activating existing roles using <set [default] role>. Current role(s): NONE. Inactivated role(s): NONE.') | ||
-- !result | ||
execute as root with no revert; | ||
-- result: | ||
-- !result | ||
drop user u1; | ||
-- result: | ||
-- !result |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
-- name: test_view_privilege | ||
drop user if exists u1; | ||
create user u1; | ||
grant impersonate on user root to u1; | ||
|
||
CREATE TABLE tbl1 (col1 INT, col2 INT, col3 INT); | ||
CREATE VIEW view1 AS SELECT * FROM tbl1; | ||
|
||
execute as u1 with no revert; | ||
SHOW TABLE STATUS; | ||
show create view view1; | ||
|
||
execute as root with no revert; | ||
drop user u1; |