-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Support SELECT ON CHANGE STREAM privilege (#169)
* Implement SELECT ON CHANGE STREAM in GRANT/REVOKE * Update testdadta * Reorder
- Loading branch information
Showing
10 changed files
with
176 additions
and
2 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
GRANT SELECT ON CHANGE STREAM cs_name_one, cs_name_two TO ROLE hr_manager |
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 @@ | ||
REVOKE SELECT ON CHANGE STREAM cs_name_one, cs_name_two FROM ROLE hr_manager |
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,31 @@ | ||
--- grant_change_stream_privilege.sql | ||
GRANT SELECT ON CHANGE STREAM cs_name_one, cs_name_two TO ROLE hr_manager | ||
--- AST | ||
&ast.Grant{ | ||
Grant: 0, | ||
Privilege: &ast.SelectPrivilegeOnChangeStream{ | ||
Select: 6, | ||
Names: []*ast.Ident{ | ||
&ast.Ident{ | ||
NamePos: 30, | ||
NameEnd: 41, | ||
Name: "cs_name_one", | ||
}, | ||
&ast.Ident{ | ||
NamePos: 43, | ||
NameEnd: 54, | ||
Name: "cs_name_two", | ||
}, | ||
}, | ||
}, | ||
Roles: []*ast.Ident{ | ||
&ast.Ident{ | ||
NamePos: 63, | ||
NameEnd: 73, | ||
Name: "hr_manager", | ||
}, | ||
}, | ||
} | ||
|
||
--- SQL | ||
GRANT SELECT ON CHANGE STREAM cs_name_one, cs_name_two TO ROLE hr_manager |
31 changes: 31 additions & 0 deletions
31
testdata/result/ddl/revoke_change_stream_privilege.sql.txt
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,31 @@ | ||
--- revoke_change_stream_privilege.sql | ||
REVOKE SELECT ON CHANGE STREAM cs_name_one, cs_name_two FROM ROLE hr_manager | ||
--- AST | ||
&ast.Revoke{ | ||
Revoke: 0, | ||
Privilege: &ast.SelectPrivilegeOnChangeStream{ | ||
Select: 7, | ||
Names: []*ast.Ident{ | ||
&ast.Ident{ | ||
NamePos: 31, | ||
NameEnd: 42, | ||
Name: "cs_name_one", | ||
}, | ||
&ast.Ident{ | ||
NamePos: 44, | ||
NameEnd: 55, | ||
Name: "cs_name_two", | ||
}, | ||
}, | ||
}, | ||
Roles: []*ast.Ident{ | ||
&ast.Ident{ | ||
NamePos: 66, | ||
NameEnd: 76, | ||
Name: "hr_manager", | ||
}, | ||
}, | ||
} | ||
|
||
--- SQL | ||
REVOKE SELECT ON CHANGE STREAM cs_name_one, cs_name_two FROM ROLE hr_manager |
31 changes: 31 additions & 0 deletions
31
testdata/result/statement/grant_change_stream_privilege.sql.txt
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,31 @@ | ||
--- grant_change_stream_privilege.sql | ||
GRANT SELECT ON CHANGE STREAM cs_name_one, cs_name_two TO ROLE hr_manager | ||
--- AST | ||
&ast.Grant{ | ||
Grant: 0, | ||
Privilege: &ast.SelectPrivilegeOnChangeStream{ | ||
Select: 6, | ||
Names: []*ast.Ident{ | ||
&ast.Ident{ | ||
NamePos: 30, | ||
NameEnd: 41, | ||
Name: "cs_name_one", | ||
}, | ||
&ast.Ident{ | ||
NamePos: 43, | ||
NameEnd: 54, | ||
Name: "cs_name_two", | ||
}, | ||
}, | ||
}, | ||
Roles: []*ast.Ident{ | ||
&ast.Ident{ | ||
NamePos: 63, | ||
NameEnd: 73, | ||
Name: "hr_manager", | ||
}, | ||
}, | ||
} | ||
|
||
--- SQL | ||
GRANT SELECT ON CHANGE STREAM cs_name_one, cs_name_two TO ROLE hr_manager |
31 changes: 31 additions & 0 deletions
31
testdata/result/statement/revoke_change_stream_privilege.sql.txt
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,31 @@ | ||
--- revoke_change_stream_privilege.sql | ||
REVOKE SELECT ON CHANGE STREAM cs_name_one, cs_name_two FROM ROLE hr_manager | ||
--- AST | ||
&ast.Revoke{ | ||
Revoke: 0, | ||
Privilege: &ast.SelectPrivilegeOnChangeStream{ | ||
Select: 7, | ||
Names: []*ast.Ident{ | ||
&ast.Ident{ | ||
NamePos: 31, | ||
NameEnd: 42, | ||
Name: "cs_name_one", | ||
}, | ||
&ast.Ident{ | ||
NamePos: 44, | ||
NameEnd: 55, | ||
Name: "cs_name_two", | ||
}, | ||
}, | ||
}, | ||
Roles: []*ast.Ident{ | ||
&ast.Ident{ | ||
NamePos: 66, | ||
NameEnd: 76, | ||
Name: "hr_manager", | ||
}, | ||
}, | ||
} | ||
|
||
--- SQL | ||
REVOKE SELECT ON CHANGE STREAM cs_name_one, cs_name_two FROM ROLE hr_manager |