-
Notifications
You must be signed in to change notification settings - Fork 5.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Tracking view feature implement #8520
Comments
Can I help you with the infoschema implementation? I can see two issues:
|
@morgo Sure, Do you check validity of view during select from |
@AndrewDi I don't think so. Two things to mention though:
I will create an issue to support |
@morgo I have do some test on MySQL 5.7, and it seems like already have view dependency tracking? mysql> create table t1(a int,b int);
Query OK, 0 rows affected (0.45 sec)
mysql> create view v as select * from t1;
Query OK, 0 rows affected (0.06 sec)
mysql> drop table t1;
Query OK, 0 rows affected (0.20 sec)
mysql> select * from information_schema.views where table_schema='test';
+---------------+--------------+------------+-----------------------------------------------------------------------+--------------+--------------+----------------+---------------+----------------------+----------------------+
| TABLE_CATALOG | TABLE_SCHEMA | TABLE_NAME | VIEW_DEFINITION | CHECK_OPTION | IS_UPDATABLE | DEFINER | SECURITY_TYPE | CHARACTER_SET_CLIENT | COLLATION_CONNECTION |
+---------------+--------------+------------+-----------------------------------------------------------------------+--------------+--------------+----------------+---------------+----------------------+----------------------+
| def | test | v | select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b` from `test`.`t1` | NONE | | root@localhost | DEFINER | latin1 | latin1_swedish_ci |
+---------------+--------------+------------+-----------------------------------------------------------------------+--------------+--------------+----------------+---------------+----------------------+----------------------+
1 row in set, 1 warning (0.00 sec)
mysql> show warnings;
+---------+------+--------------------------------------------------------------------------------------------------------------------------+
| Level | Code | Message |
+---------+------+--------------------------------------------------------------------------------------------------------------------------+
| Warning | 1356 | View 'test.v' references invalid table(s) or column(s) or function(s) or definer/invoker of view lack rights to use them |
+---------+------+--------------------------------------------------------------------------------------------------------------------------+
1 row in set (0.00 sec) MySQL Version:
|
@AndrewDi interesting behavior! I think this is the equivalent of running The 8.0 feature I was referring to is EDIT: Here is an example from MySQL 5.7 w/
|
This issue is to track view feature implement. proposal is from #8416 .
CREATE VIEW
TableInfo
ast, parser: extract create view parameters to CreateViewStmt parser#55CREATE_VIEW_PRIV
privileges check parser: add CreateViewPriv privilege parser#138 planner, privileges: add CreateViewPriv Support #9153DROP VIEW
SHOW TABLE STATUS
SELECT FROM VIEW
BuildDataSource
to rewrite view planner: support building data source from View #8757SQL SECURITY
privilege check privilege,planner: handle View's security privilege check #9194SHOW FULL TABLS
DESCRIBE TABLE
SHOW CREATE TABLE
Information Schema
ALTER TABLE
The text was updated successfully, but these errors were encountered: