You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: test/resources/orders_test.jsonl
+10-2Lines changed: 10 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -2,6 +2,8 @@
2
2
{"name": "two_illegal_tables", "sql": "SELECT col1 FROM users AS u1 JOIN products AS p1", "errors": ["Table users is not allowed", "Table products is not allowed"]}
3
3
{"name": "select_no_legal_cols", "sql": "SELECT col1, col2 FROM orders WHERE id = 123", "errors": ["Column col1 is not allowed. Column removed from SELECT clause", "Column col2 is not allowed. Column removed from SELECT clause", "No legal elements in SELECT clause"]}
4
4
{"name": "select_star", "sql": "SELECT * FROM orders WHERE id = 123", "errors": ["SELECT * is not allowed"], "fix": "SELECT id, product_name, account_id, day FROM orders WHERE id = 123", "data": [[123, "product1", 123, "2025-01-01"]]}
5
+
{"name": "select_star_with_column", "sql": "SELECT product_name, * FROM orders WHERE id = 123", "errors": ["SELECT * is not allowed"], "fix": "SELECT product_name, id, product_name, account_id, day FROM orders WHERE id = 123", "data": [["product1", 123, "product1", 123, "2025-01-01"]]}
6
+
{"name": "select_star_with_column_and_alias", "sql": "SELECT product_name AS \"p_n\", * FROM orders WHERE id = 123", "errors": ["SELECT * is not allowed"], "fix": "SELECT product_name AS \"p_n\", id, product_name, account_id, day FROM orders WHERE id = 123", "data": [["product1", 123, "product1", 123, "2025-01-01"]]}
5
7
{"name": "two_cols", "sql": "SELECT id, product_name FROM orders WHERE id = 123", "errors": [], "data": [[123, "product1"]]}
6
8
{"name": "quote_and_alias", "sql": "SELECT \"id\" AS my_id FROM orders WHERE id = 123", "errors": [], "data": [[123]]}
7
9
{"name": "sql_with_group_by_and_order_by", "sql": "SELECT id FROM orders GROUP BY id ORDER BY id", "errors": ["Missing restriction for table: orders column: id value: 123"], "fix": "SELECT id FROM orders WHERE id = 123 GROUP BY id ORDER BY id", "data": [[123]]}
@@ -50,5 +52,11 @@
50
52
{"name": "is_null", "sql": "SELECT id FROM orders WHERE day IS NOT NULL AND id = 123", "errors": [], ",data": [[123]]}
51
53
{"name": "is_null_static_exp", "sql": "SELECT id FROM orders WHERE NULL IS NULL AND id = 123", "errors": ["Static expression is not allowed: NULL IS NULL"], ",data": [[123]]}
52
54
{"name": "not_op", "sql": "SELECT id FROM orders WHERE NOT id = 123", "errors": ["Missing restriction for table: orders column: id value: 123"], "fix": "SELECT id FROM orders WHERE (NOT id = 123) AND id = 123", "data": []}
53
-
{"name": "delete_op", "sql": "DELETE FROM orders", "errors": ["Could not find a select statement"]}
54
-
{"name": "drop_op", "sql": "DROP orders", "errors": ["Could not find a select statement"]}
55
+
{"name": "delete_op", "sql": "DELETE FROM orders", "errors": ["DELETE statement is not allowed"]}
56
+
{"name": "drop_op", "sql": "DROP orders", "errors": ["DROP statement is not allowed"]}
57
+
{"name": "json_object", "sql": "SELECT json_object('id', id) FROM orders WHERE id = 123", "data": [["{\"id\":123}"]]}
58
+
{"name": "json_object_with_illegal_col", "sql": "SELECT json_object('id', id, 'status', status) FROM orders WHERE id = 123", "errors": ["Column status is not allowed. Column removed from SELECT clause", "No legal elements in SELECT clause"]}
59
+
{"name": "json_object_with_illegal_col_fix", "sql": "SELECT id, json_object('id', id, 'status', status) FROM orders WHERE id = 123", "errors": ["Column status is not allowed. Column removed from SELECT clause"], "fix": "SELECT id FROM orders WHERE id = 123", "data": [[123]]}
60
+
{"name": "union_all", "sql": "SELECT id FROM orders WHERE id = 123 UNION ALL SELECT id FROM orders WHERE id = 123", "errors": [], "data": [[123], [123]]}
61
+
{"name": "union_all_3_parts", "sql": "SELECT id FROM orders WHERE id = 123 UNION ALL SELECT id FROM orders WHERE id = 123 UNION ALL SELECT id FROM orders WHERE id = 123", "errors": [], "data": [[123], [123], [123]]}
62
+
{"name": "union_all_missing_restriction", "sql": "SELECT id FROM orders WHERE id = 123 UNION ALL SELECT id FROM orders", "errors": ["Missing restriction for table: orders column: id value: 123"], "fix": "SELECT id FROM orders WHERE id = 123 UNION ALL SELECT id FROM orders WHERE id = 123", "data": [[123], [123]]}
0 commit comments