File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -463,12 +463,13 @@ impl fmt::Display for Grant {
463463 write ! ( f, " ON {objects}" ) ?;
464464 }
465465 write ! ( f, " TO {}" , display_comma_separated( & self . grantees) ) ?;
466- if let Some ( ref current_grants) = self . current_grants {
467- write ! ( f, " {current_grants}" ) ?;
468- }
466+ // Printed in the order the parser reads them, so the output re-parses.
469467 if self . with_grant_option {
470468 write ! ( f, " WITH GRANT OPTION" ) ?;
471469 }
470+ if let Some ( ref current_grants) = self . current_grants {
471+ write ! ( f, " {current_grants}" ) ?;
472+ }
472473 if let Some ( ref as_grantor) = self . as_grantor {
473474 write ! ( f, " AS {as_grantor}" ) ?;
474475 }
Original file line number Diff line number Diff line change @@ -10058,6 +10058,10 @@ fn parse_grant() {
1005810058 verified_stmt("GRANT OWNERSHIP ON ALL TABLES IN SCHEMA DEV_STAS_ROGOZHIN TO ROLE ANALYST");
1005910059 verified_stmt("GRANT OWNERSHIP ON ALL TABLES IN SCHEMA DEV_STAS_ROGOZHIN TO ROLE ANALYST COPY CURRENT GRANTS");
1006010060 verified_stmt("GRANT OWNERSHIP ON ALL TABLES IN SCHEMA DEV_STAS_ROGOZHIN TO ROLE ANALYST REVOKE CURRENT GRANTS");
10061+ // Printing these the other way round yields output the parser rejects.
10062+ verified_stmt(
10063+ "GRANT OWNERSHIP ON ALL TABLES IN SCHEMA s TO ROLE r WITH GRANT OPTION COPY CURRENT GRANTS",
10064+ );
1006110065 verified_stmt("GRANT USAGE ON DATABASE db1 TO ROLE role1");
1006210066 verified_stmt("GRANT USAGE ON WAREHOUSE wh1 TO ROLE role1");
1006310067 verified_stmt("GRANT OWNERSHIP ON INTEGRATION int1 TO ROLE role1");
You can’t perform that action at this time.
0 commit comments