Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
231 changes: 208 additions & 23 deletions conformance/cases.json
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,191 @@
]
}
},
{
"cases": [
{
"codes": [
"procedure_param_invalid"
],
"contains": [],
"context": {
"user": {
"tenant_id": 7
}
},
"expect": "reject",
"expected": {
"codes": [
"procedure_param_invalid"
],
"ok": false,
"sql": null
},
"id": "proc-bound-param-override",
"not_contains": [],
"sql": "EXEC dbo.P @a = 1, @tenant_id = 9"
}
],
"name": "g03-tsql",
"policy": {
"default_schema": "dbo",
"dialect": "tsql",
"hidden_columns": [
"customers.email",
"customers.tax_id"
],
"max_rows": 1000,
"procedures": {
"dbo.P": {
"params": {
"@a": "int",
"@tenant_id": {
"bind": "{user.tenant_id}"
}
}
}
},
"row_filters": {
"invoices": "branch_id IN ({user.branches})"
},
"tables": [
"branches",
"customers",
"invoice_lines",
"invoices",
"products"
]
}
},
{
"cases": [
{
"codes": [
"procedure_not_allowed"
],
"contains": [],
"context": {
"user": {
"branches": [
1,
2
]
}
},
"expect": "reject",
"expected": {
"codes": [
"procedure_not_allowed"
],
"ok": false,
"sql": null
},
"id": "proc-dynamic-sql",
"not_contains": [],
"sql": "EXEC(@sql)"
},
{
"codes": [
"procedure_not_allowed"
],
"contains": [],
"context": {
"user": {
"branches": [
1,
2
]
}
},
"expect": "reject",
"expected": {
"codes": [
"procedure_not_allowed"
],
"ok": false,
"sql": null
},
"id": "proc-sp-executesql",
"not_contains": [],
"sql": "EXEC sp_executesql @stmt"
},
{
"codes": [
"procedure_not_allowed"
],
"contains": [],
"context": {
"user": {
"branches": [
1,
2
]
}
},
"expect": "reject",
"expected": {
"codes": [
"procedure_not_allowed"
],
"ok": false,
"sql": null
},
"id": "proc-linked-server",
"not_contains": [],
"sql": "EXEC ('select 1') AT linked"
},
{
"codes": [],
"contains": [
"P"
],
"context": {
"user": {
"branches": [
1,
2
]
}
},
"expect": "allow",
"expected": {
"codes": [],
"ok": true,
"sql": "EXEC dbo.P @a = 1"
},
"id": "proc-allowed-named",
"not_contains": [],
"sql": "EXEC dbo.P @a = 1"
}
],
"name": "g04-tsql",
"policy": {
"default_schema": "dbo",
"dialect": "tsql",
"hidden_columns": [
"customers.email",
"customers.tax_id"
],
"max_rows": 1000,
"procedures": {
"dbo.P": {
"params": {
"@a": "int"
}
}
},
"row_filters": {
"invoices": "branch_id IN ({user.branches})"
},
"tables": [
"branches",
"customers",
"invoice_lines",
"invoices",
"products"
]
}
},
{
"cases": [
{
Expand All @@ -219,7 +404,7 @@
"sql": "SELECT b.name, SUM(i.total) FROM invoices i JOIN branches b ON b.id = i.branch_id WHERE i.issued_at >= '20261101' GROUP BY b.name"
}
],
"name": "g03-tsql",
"name": "g05-tsql",
"policy": {
"default_schema": "dbo",
"dialect": "tsql",
Expand Down Expand Up @@ -604,7 +789,7 @@
"sql": "WAITFOR DELAY '00:00:10'"
}
],
"name": "g04-tsql",
"name": "g06-tsql",
"policy": {
"default_schema": "dbo",
"dialect": "tsql",
Expand Down Expand Up @@ -679,7 +864,7 @@
"sql": "SELECT load_data(1)"
}
],
"name": "g05-bigquery",
"name": "g07-bigquery",
"policy": {
"dialect": "bigquery",
"hidden_columns": [
Expand Down Expand Up @@ -1325,7 +1510,7 @@
"sql": "SELECT * FROM urlcluster('x')"
}
],
"name": "g06-clickhouse",
"name": "g08-clickhouse",
"policy": {
"dialect": "clickhouse",
"hidden_columns": [
Expand Down Expand Up @@ -1449,7 +1634,7 @@
"sql": "SELECT MAX(COLUMNS('.*')) FROM customers"
}
],
"name": "g07-duckdb",
"name": "g09-duckdb",
"policy": {
"dialect": "duckdb",
"hidden_columns": [
Expand Down Expand Up @@ -1497,7 +1682,7 @@
"sql": "SELECT b.name FROM branches b JOIN products p"
}
],
"name": "g08-mysql",
"name": "g10-mysql",
"policy": {
"dialect": "mysql",
"forbid_cartesian": true,
Expand Down Expand Up @@ -1567,7 +1752,7 @@
"sql": "SELECT ROW_NUMBER() OVER (ORDER BY 1), SUPPLIER AS X FROM products"
}
],
"name": "g09-mysql",
"name": "g11-mysql",
"policy": {
"dialect": "mysql",
"hidden_columns": [
Expand Down Expand Up @@ -1663,7 +1848,7 @@
"sql": "SELECT PHONE FROM customers"
}
],
"name": "g10-mysql",
"name": "g12-mysql",
"policy": {
"dialect": "mysql",
"hidden_columns": [
Expand Down Expand Up @@ -1735,7 +1920,7 @@
"sql": "SELECT name FROM products WHERE id IN (SELECT product_id FROM invoice_lines)"
}
],
"name": "g11-mysql",
"name": "g13-mysql",
"policy": {
"dialect": "mysql",
"hidden_columns": [
Expand Down Expand Up @@ -1780,7 +1965,7 @@
"sql": "SELECT SUM(total) FROM invoices WHERE branch_id = 3"
}
],
"name": "g12-mysql",
"name": "g14-mysql",
"policy": {
"dialect": "mysql",
"hidden_columns": [
Expand Down Expand Up @@ -1984,7 +2169,7 @@
"sql": "SELECT * FROM invoices INTO OUTFILE '/tmp/x.csv'"
}
],
"name": "g13-mysql",
"name": "g15-mysql",
"policy": {
"dialect": "mysql",
"hidden_columns": [
Expand Down Expand Up @@ -2053,7 +2238,7 @@
"sql": "SELECT l.quantity FROM invoices i, invoice_lines l, products p WHERE l.invoice_id = i.id"
}
],
"name": "g14-oracle",
"name": "g16-oracle",
"policy": {
"dialect": "oracle",
"forbid_cartesian": true,
Expand Down Expand Up @@ -2175,7 +2360,7 @@
"sql": "SELECT SYS.DBMS_PIPE.RECEIVE_MESSAGE('a', 10) FROM dual"
}
],
"name": "g15-oracle",
"name": "g17-oracle",
"policy": {
"dialect": "oracle",
"hidden_columns": [
Expand Down Expand Up @@ -2315,7 +2500,7 @@
"sql": "SELECT b.name FROM invoices i JOIN branches b ON b.id = i.branch_id JOIN invoice_lines l USING (id)"
}
],
"name": "g16-postgres",
"name": "g18-postgres",
"policy": {
"dialect": "postgres",
"forbid_cartesian": true,
Expand Down Expand Up @@ -2389,7 +2574,7 @@
"sql": "WITH t AS (SELECT i.id FROM invoices i JOIN branches b ON b.id = i.branch_id) SELECT p.name FROM products p JOIN invoice_lines l ON l.product_id = p.id WHERE l.invoice_id IN (SELECT id FROM t)"
}
],
"name": "g17-postgres",
"name": "g19-postgres",
"policy": {
"dialect": "postgres",
"hidden_columns": [
Expand Down Expand Up @@ -2434,7 +2619,7 @@
"sql": "SELECT b.name, SUM(l.quantity) FROM invoices i JOIN branches b ON b.id = i.branch_id JOIN invoice_lines l ON l.invoice_id = i.id GROUP BY b.name"
}
],
"name": "g18-postgres",
"name": "g20-postgres",
"policy": {
"dialect": "postgres",
"hidden_columns": [
Expand Down Expand Up @@ -2529,7 +2714,7 @@
"sql": "SELECT name FROM branches UNION ALL SELECT name FROM products"
}
],
"name": "g19-postgres",
"name": "g21-postgres",
"policy": {
"dialect": "postgres",
"hidden_columns": [
Expand Down Expand Up @@ -2578,7 +2763,7 @@
"sql": "SELECT SUM(total) FROM invoices"
}
],
"name": "g20-postgres",
"name": "g22-postgres",
"policy": {
"dialect": "postgres",
"hidden_columns": [
Expand Down Expand Up @@ -2794,7 +2979,7 @@
"sql": "SELECT SUM(total) FROM invoices WHERE issued_at >= '2026-11-01' UNION ALL SELECT SUM(total) FROM invoices"
}
],
"name": "g21-postgres",
"name": "g23-postgres",
"policy": {
"dialect": "postgres",
"hidden_columns": [
Expand Down Expand Up @@ -4194,7 +4379,7 @@
"sql": "SELECT id FROM invoices;"
}
],
"name": "g22-postgres",
"name": "g24-postgres",
"policy": {
"dialect": "postgres",
"hidden_columns": [
Expand Down Expand Up @@ -4542,7 +4727,7 @@
"sql": "SELECT name FROM customers QUALIFY ROW_NUMBER() OVER (ORDER BY id) = 1 AND MAX(email) OVER () > 'm'"
}
],
"name": "g23-snowflake",
"name": "g25-snowflake",
"policy": {
"dialect": "snowflake",
"hidden_columns": [
Expand Down Expand Up @@ -4640,7 +4825,7 @@
"sql": "PRAGMA writable_schema = 1"
}
],
"name": "g24-sqlite",
"name": "g26-sqlite",
"policy": {
"dialect": "sqlite",
"hidden_columns": [
Expand Down Expand Up @@ -4738,7 +4923,7 @@
"sql": "SELECT system.slow_query('x')"
}
],
"name": "g25-trino",
"name": "g27-trino",
"policy": {
"dialect": "trino",
"hidden_columns": [
Expand Down
Loading
Loading