Commit ae76529
committed
fix(db2): implement grants via GrantsFromInfoSchemaMixin + role-based test infrastructure
db2.py:
- Add GrantsFromInfoSchemaMixin to Db2EngineAdapter — provides _get_current_grants_config,
_apply_grants_config_expr, _revoke_grants_config_expr via INFORMATION_SCHEMA.table_privileges
- Set CURRENT_USER_OR_ROLE_EXPRESSION to CURRENT USER (Db2 special register)
- Add _grant_object_kind() returning 'TABLE' (Db2 GRANT requires the TABLE keyword)
Without the mixin, SUPPORTS_GRANTS=True with no implementations caused
NotImplementedError on every grant test method call.
__init__.py:
- Add db2 case to _get_create_user_or_role(): CREATE ROLE (Db2 LUW uses OS-level
users for auth; roles work for GRANT/REVOKE testing without OS user setup)
- Add db2 to _cleanup_user_or_role(): DROP ROLE IF EXISTS (same as Snowflake)1 parent e306cdb commit ae76529
2 files changed
Lines changed: 17 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
12 | | - | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
13 | 16 | | |
14 | 17 | | |
15 | 18 | | |
| |||
43 | 46 | | |
44 | 47 | | |
45 | 48 | | |
| 49 | + | |
46 | 50 | | |
47 | 51 | | |
48 | 52 | | |
49 | 53 | | |
50 | 54 | | |
51 | 55 | | |
52 | 56 | | |
| 57 | + | |
| 58 | + | |
53 | 59 | | |
54 | 60 | | |
55 | 61 | | |
| |||
324 | 330 | | |
325 | 331 | | |
326 | 332 | | |
| 333 | + | |
| 334 | + | |
| 335 | + | |
| 336 | + | |
| 337 | + | |
327 | 338 | | |
328 | 339 | | |
329 | 340 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
818 | 818 | | |
819 | 819 | | |
820 | 820 | | |
| 821 | + | |
| 822 | + | |
| 823 | + | |
| 824 | + | |
821 | 825 | | |
822 | 826 | | |
823 | 827 | | |
| |||
883 | 887 | | |
884 | 888 | | |
885 | 889 | | |
886 | | - | |
| 890 | + | |
887 | 891 | | |
888 | 892 | | |
889 | 893 | | |
| |||
0 commit comments