Commit 7673d44
dbt-materialize: quote the schema when copying default privileges
`internal_copy_schema_default_privs` interpolated the target schema name
raw into `ALTER DEFAULT PRIVILEGES ... IN SCHEMA`, so the parser folded
it to lowercase. #38066 started creating the deployment schema with a
quoted name, which made the two disagree for any schema name that is not
a bare lowercase identifier: `deploy_init` created `"Prod_dbt_deploy"`
and then failed trying to alter default privileges in `prod_dbt_deploy`,
after the schema already existed. The retry then took the
schema-already-exists branch, which skips both privilege-copying macros,
so the operation reported success while silently dropping the grants and
default privileges the production schema had.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>1 parent 4260c34 commit 7673d44
3 files changed
Lines changed: 12 additions & 7 deletions
File tree
- misc/dbt-materialize
- dbt/include/materialize/macros/deploy
- tests/adapter
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
13 | | - | |
| 13 | + | |
| 14 | + | |
14 | 15 | | |
15 | 16 | | |
16 | 17 | | |
| |||
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
170 | 170 | | |
171 | 171 | | |
172 | 172 | | |
173 | | - | |
| 173 | + | |
174 | 174 | | |
175 | 175 | | |
176 | 176 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
64 | 64 | | |
65 | 65 | | |
66 | 66 | | |
| 67 | + | |
67 | 68 | | |
68 | 69 | | |
69 | 70 | | |
70 | | - | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
71 | 75 | | |
72 | 76 | | |
73 | 77 | | |
74 | | - | |
| 78 | + | |
75 | 79 | | |
76 | 80 | | |
77 | 81 | | |
| |||
81 | 85 | | |
82 | 86 | | |
83 | 87 | | |
84 | | - | |
| 88 | + | |
85 | 89 | | |
86 | 90 | | |
87 | 91 | | |
88 | 92 | | |
89 | | - | |
| 93 | + | |
90 | 94 | | |
91 | 95 | | |
92 | | - | |
| 96 | + | |
93 | 97 | | |
94 | 98 | | |
95 | 99 | | |
| |||
0 commit comments