Repository navigation
Commit 9d6d9e7
committed
Fix get_current_catalog() to return lowercase — unblock 6 ctx.create_context() tests
CURRENT SERVER returns 'TESTDB' from Db2. The DuckDB-dialect config parser uses
LOWERCASE normalisation and lowercases all identifiers, so _default_catalog is
'testdb'. The previous .upper() call made get_current_catalog() return 'TESTDB',
which failed the raw == comparison in shared.py:346 and raised SQLMeshError in
every test that calls ctx.create_context().
Fix: return result[0].lower() — same as Postgres, Redshift, and MySQL.
The set_catalog decorator strips the catalog from all DDL before sending it to
Db2, so the case of this value never affects SQL sent to the engine.
Remove the 6 db2 pytest.skip blocks that were guarding these tests:
- test_batch_size_on_incremental_by_unique_key_model
- test_incremental_by_unique_key_model_when_matched
- test_state_migrate_from_scratch
- test_python_model_column_order
- test_unicode_characters
- test_grants_plan
Update test_get_current_catalog: assert result == 'testdb' (was 'TESTDB').1 parent 28047bf commit 9d6d9e7
3 files changed
Lines changed: 12 additions & 49 deletions
File tree
- sqlmesh/core/engine_adapter
- tests/core/engine_adapter
- integration
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
88 | 88 | | |
89 | 89 | | |
90 | 90 | | |
91 | | - | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
92 | 97 | | |
93 | 98 | | |
94 | 99 | | |
95 | | - | |
| 100 | + | |
96 | 101 | | |
97 | 102 | | |
98 | 103 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2744 | 2744 | | |
2745 | 2745 | | |
2746 | 2746 | | |
2747 | | - | |
2748 | | - | |
2749 | | - | |
2750 | | - | |
2751 | | - | |
2752 | | - | |
2753 | | - | |
2754 | | - | |
2755 | | - | |
2756 | 2747 | | |
2757 | 2748 | | |
2758 | 2749 | | |
| |||
2849 | 2840 | | |
2850 | 2841 | | |
2851 | 2842 | | |
2852 | | - | |
2853 | | - | |
2854 | | - | |
2855 | | - | |
2856 | | - | |
2857 | | - | |
2858 | | - | |
2859 | 2843 | | |
2860 | 2844 | | |
2861 | 2845 | | |
| |||
3582 | 3566 | | |
3583 | 3567 | | |
3584 | 3568 | | |
3585 | | - | |
3586 | | - | |
3587 | | - | |
3588 | | - | |
3589 | | - | |
3590 | | - | |
3591 | | - | |
3592 | 3569 | | |
3593 | 3570 | | |
3594 | 3571 | | |
| |||
3623 | 3600 | | |
3624 | 3601 | | |
3625 | 3602 | | |
3626 | | - | |
3627 | | - | |
3628 | | - | |
3629 | | - | |
3630 | | - | |
3631 | | - | |
3632 | | - | |
3633 | | - | |
3634 | 3603 | | |
3635 | 3604 | | |
3636 | 3605 | | |
| |||
3998 | 3967 | | |
3999 | 3968 | | |
4000 | 3969 | | |
4001 | | - | |
4002 | | - | |
4003 | | - | |
4004 | | - | |
4005 | | - | |
4006 | | - | |
4007 | | - | |
4008 | 3970 | | |
4009 | 3971 | | |
4010 | 3972 | | |
| |||
4146 | 4108 | | |
4147 | 4109 | | |
4148 | 4110 | | |
4149 | | - | |
4150 | | - | |
4151 | | - | |
4152 | | - | |
4153 | | - | |
4154 | | - | |
4155 | | - | |
4156 | 4111 | | |
4157 | 4112 | | |
4158 | 4113 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
374 | 374 | | |
375 | 375 | | |
376 | 376 | | |
377 | | - | |
| 377 | + | |
| 378 | + | |
| 379 | + | |
| 380 | + | |
378 | 381 | | |
379 | 382 | | |
380 | 383 | | |
381 | 384 | | |
382 | | - | |
| 385 | + | |
383 | 386 | | |
384 | 387 | | |
385 | 388 | | |
| |||
0 commit comments