Commit be13377
committed
fix(db): Resolve the execution table through search_path in the revision guard
The guard added in #924 tested information_schema against
current_schema(), which is only the first entry in search_path. On a
connection whose search_path puts another schema first, an execution
table in a later schema makes the predicate false while the unqualified
ALTER below it resolves to that same later table, so the widening is
skipped without a word and execution.revision silently stays integer.
Resolve the relation with to_regclass and read its type from
pg_attribute, so the guard and the ALTER always agree on which table
they are talking about. to_regclass returns NULL when no execution table
is reachable at all, which leaves the guard false as before.
Reported by the cubic review bot on #924, after that PR had merged.
Signed-off-by: Prasanth Baskar <prasanth@8gears.com>1 parent 48e574d commit be13377
1 file changed
Lines changed: 11 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
138 | 138 | | |
139 | 139 | | |
140 | 140 | | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
141 | 146 | | |
142 | 147 | | |
143 | | - | |
144 | | - | |
145 | | - | |
146 | | - | |
147 | | - | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
148 | 154 | | |
149 | 155 | | |
150 | 156 | | |
| |||
0 commit comments