Commit d7a9d4b
fix(scalar-arrays): parse multi-word element-type casts in array_position CHECK recognizer
The Shape 3 array_position element-non-null recognizer used a cast
fragment `(?:::[^\s)]+)?` that stopped at the first whitespace, so
multi-word Postgres type names (e.g. `timestamp with time zone` for
DateTime[]) failed to match and the column dropped out of drift
management, breaking schema verification after migrate. Anchor the
cast with a non-greedy `(?:::.+?)?` up to the closing `) IS NULL`; the
cast is discarded and the predicate re-canonicalized, so the wider
match is safe.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Signed-off-by: Serhii Tatarintsev <tatarintsev@prisma.io>1 parent 3cb7113 commit d7a9d4b
3 files changed
Lines changed: 33 additions & 3 deletions
File tree
- packages/3-targets/6-adapters/postgres
- src/core
- test
- migrations
Lines changed: 6 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1506 | 1506 | | |
1507 | 1507 | | |
1508 | 1508 | | |
1509 | | - | |
1510 | | - | |
| 1509 | + | |
| 1510 | + | |
| 1511 | + | |
| 1512 | + | |
| 1513 | + | |
1511 | 1514 | | |
1512 | | - | |
| 1515 | + | |
1513 | 1516 | | |
1514 | 1517 | | |
1515 | 1518 | | |
| |||
Lines changed: 20 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
120 | 120 | | |
121 | 121 | | |
122 | 122 | | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
123 | 143 | | |
124 | 144 | | |
125 | 145 | | |
| |||
Lines changed: 7 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
39 | 39 | | |
40 | 40 | | |
41 | 41 | | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
42 | 48 | | |
43 | 49 | | |
44 | 50 | | |
| |||
320 | 326 | | |
321 | 327 | | |
322 | 328 | | |
| 329 | + | |
323 | 330 | | |
324 | 331 | | |
325 | 332 | | |
| |||
0 commit comments