Repository navigation
Commit d4d492b
committed
fix: use REQUIRES_SET_CATALOG + no-op set_current_catalog to handle catalog case mismatch
SINGLE_CATALOG_ONLY uses a raw == comparison (shared.py:346) between
catalog_name from the model expression and _default_catalog. The model
expression case depends on which dialect built it: db2 dialect produces
UPPERCASE, duckdb dialect produces lowercase. Either case can appear at
runtime and neither alone satisfies a raw == against a fixed-case string.
Switch to REQUIRES_SET_CATALOG: the decorator's alternate path (shared.py:352)
calls get_current_catalog() for the RHS of the comparison. Both get_catalog()
(connection.py) and get_current_catalog() (db2.py) now return uppercase, so
_default_catalog and the live value are always 'TESTDB'. When a lowercase
'testdb' arrives from a duckdb-dialect context it won't match, but that only
calls set_current_catalog() which is now a no-op — Db2 has a single catalog
and CONNECT TO cannot switch to a different database mid-session anyway.
Reverts the .lower() changes from commit ba0fe1d which broke test_janitor
by causing 'testdb vs TESTDB' errors on the SINGLE_CATALOG_ONLY path.1 parent ba0fe1d commit d4d492b
2 files changed
Lines changed: 42 additions & 15 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2650 | 2650 | | |
2651 | 2651 | | |
2652 | 2652 | | |
2653 | | - | |
2654 | | - | |
2655 | | - | |
2656 | | - | |
2657 | | - | |
2658 | | - | |
| 2653 | + | |
| 2654 | + | |
| 2655 | + | |
| 2656 | + | |
| 2657 | + | |
| 2658 | + | |
| 2659 | + | |
| 2660 | + | |
| 2661 | + | |
2659 | 2662 | | |
2660 | | - | |
| 2663 | + | |
2661 | 2664 | | |
2662 | 2665 | | |
2663 | 2666 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
85 | 85 | | |
86 | 86 | | |
87 | 87 | | |
88 | | - | |
89 | | - | |
90 | | - | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
91 | 94 | | |
92 | 95 | | |
93 | 96 | | |
94 | | - | |
| 97 | + | |
95 | 98 | | |
96 | 99 | | |
97 | 100 | | |
| |||
328 | 331 | | |
329 | 332 | | |
330 | 333 | | |
331 | | - | |
| 334 | + | |
| 335 | + | |
| 336 | + | |
| 337 | + | |
| 338 | + | |
| 339 | + | |
| 340 | + | |
| 341 | + | |
| 342 | + | |
| 343 | + | |
| 344 | + | |
| 345 | + | |
| 346 | + | |
332 | 347 | | |
333 | 348 | | |
334 | 349 | | |
| |||
836 | 851 | | |
837 | 852 | | |
838 | 853 | | |
839 | | - | |
840 | | - | |
841 | | - | |
| 854 | + | |
| 855 | + | |
| 856 | + | |
| 857 | + | |
| 858 | + | |
| 859 | + | |
| 860 | + | |
| 861 | + | |
| 862 | + | |
| 863 | + | |
| 864 | + | |
| 865 | + | |
842 | 866 | | |
843 | 867 | | |
844 | 868 | | |
| |||
0 commit comments