mirror of
https://github.com/apache/datafusion-sqlparser-rs.git
synced 2025-08-25 08:24:05 +00:00
Fix panic with GRANT/REVOKE
in CONNECT
, CREATE
, EXECUTE
or TEMPORARY
(#401)
* fix inconsistency between parse_grant_permissions and matched keywords * Make it clear the error is an internal problem Co-authored-by: Andrew Lamb <andrew@nerdnetworks.org>
This commit is contained in:
parent
c4cbc8340a
commit
8a3544abae
2 changed files with 37 additions and 17 deletions
|
@ -3898,7 +3898,7 @@ fn parse_drop_index() {
|
|||
|
||||
#[test]
|
||||
fn parse_grant() {
|
||||
let sql = "GRANT SELECT, INSERT, UPDATE (shape, size), USAGE, DELETE, TRUNCATE, REFERENCES, TRIGGER ON abc, def TO xyz, m WITH GRANT OPTION GRANTED BY jj";
|
||||
let sql = "GRANT SELECT, INSERT, UPDATE (shape, size), USAGE, DELETE, TRUNCATE, REFERENCES, TRIGGER, CONNECT, CREATE, EXECUTE, TEMPORARY ON abc, def TO xyz, m WITH GRANT OPTION GRANTED BY jj";
|
||||
match verified_stmt(sql) {
|
||||
Statement::Grant {
|
||||
privileges,
|
||||
|
@ -3930,6 +3930,10 @@ fn parse_grant() {
|
|||
Action::Truncate,
|
||||
Action::References { columns: None },
|
||||
Action::Trigger,
|
||||
Action::Connect,
|
||||
Action::Create,
|
||||
Action::Execute,
|
||||
Action::Temporary,
|
||||
],
|
||||
actions
|
||||
);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue