Fix: 修复 PostgreSQL 默认权限语句诊断误报

This commit is contained in:
zipg authored and GitHub committed 2026-06-29 11:20:15 +08:00
1 parent cedf4f1be3
commit ba283e07c4
2 files changed
+23

No files matched your search

+13
View File
@@ -44,6 +44,19 @@ fn extracts_mysql_single_quoted_table_references() {
assert_eq!(analysis.tables[0].schema, None);
}
#[test]
fn postgres_default_privileges_statements_do_not_raise_syntax_errors() {
let sql = "\
ALTER DEFAULT PRIVILEGES IN SCHEMA public
GRANT SELECT,INSERT,UPDATE,DELETE,TRUNCATE,REFERENCES,TRIGGER ON TABLES TO app_user;";
let analysis = analyze_sql_references(sql, Some("postgres"))
.unwrap_or_else(|error| panic!("PostgreSQL ALTER DEFAULT PRIVILEGES should analyze: {error}"));
assert!(analysis.tables.is_empty());
assert!(analysis.columns.is_empty());
}
#[test]
fn extracts_unqualified_order_by_columns_for_sqlserver_queries() {
let analysis =