File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -5836,8 +5836,8 @@ impl<T: AstInfo> AstDisplay for AbbreviatedGrantStatement<T> {
58365836 f. write_str ( "GRANT " ) ;
58375837 f. write_node ( & self . privileges ) ;
58385838 f. write_str ( " ON " ) ;
5839- f . write_node ( & self . object_type ) ;
5840- f. write_str ( "S TO " ) ;
5839+ write_grant_object_type_plural ( f , & self . object_type ) ;
5840+ f. write_str ( " TO " ) ;
58415841 f. write_node ( & display:: comma_separated ( & self . grantees ) ) ;
58425842 }
58435843}
@@ -5860,8 +5860,8 @@ impl<T: AstInfo> AstDisplay for AbbreviatedRevokeStatement<T> {
58605860 f. write_str ( "REVOKE " ) ;
58615861 f. write_node ( & self . privileges ) ;
58625862 f. write_str ( " ON " ) ;
5863- f . write_node ( & self . object_type ) ;
5864- f. write_str ( "S FROM " ) ;
5863+ write_grant_object_type_plural ( f , & self . object_type ) ;
5864+ f. write_str ( " FROM " ) ;
58655865 f. write_node ( & display:: comma_separated ( & self . revokees ) ) ;
58665866 }
58675867}
Original file line number Diff line number Diff line change @@ -377,6 +377,27 @@ fn test_grant_revoke_all_policies_roundtrips() {
377377 }
378378}
379379
380+ #[ mz_ore:: test]
381+ fn test_alter_default_privileges_policies_roundtrips ( ) {
382+ for sql in [
383+ "ALTER DEFAULT PRIVILEGES FOR ROLE owner GRANT USAGE ON POLICIES TO j" ,
384+ "ALTER DEFAULT PRIVILEGES FOR ROLE owner REVOKE USAGE ON POLICIES FROM j" ,
385+ ] {
386+ let displayed = parse_statements ( sql)
387+ . unwrap_or_else ( |e| panic ! ( "{sql:?} should parse: {e}" ) )
388+ . into_iter ( )
389+ . next ( )
390+ . unwrap ( )
391+ . ast
392+ . to_ast_string_simple ( ) ;
393+ assert ! (
394+ displayed. contains( "ON POLICIES" ) && !displayed. contains( "POLICYS" ) ,
395+ "{sql:?} mis-pluralized network policies: {displayed:?}"
396+ ) ;
397+ assert_display_roundtrips ( sql) ;
398+ }
399+ }
400+
380401#[ mz_ore:: test]
381402#[ cfg_attr( miri, ignore) ] // unsupported operation: can't call foreign function `rust_psm_stack_pointer` on OS `linux`
382403fn test_negated_cast_display_roundtrip ( ) {
You can’t perform that action at this time.
0 commit comments