Commit 1cbd7ea
fix(unique): prevent nil pointer panic in verifyUniqueWithinMutation (#9677)
## Summary
- Fix nil pointer dereference in `verifyUniqueWithinMutation` and
`addQueryIfUnique` when a mutation batch contains a UID edge
(`ObjectValue` is nil) on a `@unique` predicate
- Add nil checks for `ObjectValue` in 3 locations before calling
`dql.TypeValFrom()`
- All 3 alphas crash simultaneously because the same mutation is
replicated via Raft
## Test plan
- [x] Added 2 regression tests that panic without the fix and pass with
it
- [x]
`TestVerifyUniqueWithinMutationBoundsChecks/nil_ObjectValue_should_not_panic`
- [x]
`TestVerifyUniqueWithinMutationBoundsChecks/nil_ObjectValue_mixed_with_value_NQuad_should_not_panic`
- [x] All existing tests pass
Fixes #9670
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-authored-by: Claude Opus 4.6 (1M context) <[email protected]>1 parent b15c87e commit 1cbd7ea
2 files changed
Lines changed: 99 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1804 | 1804 | | |
1805 | 1805 | | |
1806 | 1806 | | |
| 1807 | + | |
| 1808 | + | |
| 1809 | + | |
1807 | 1810 | | |
1808 | 1811 | | |
1809 | 1812 | | |
| |||
2218 | 2221 | | |
2219 | 2222 | | |
2220 | 2223 | | |
| 2224 | + | |
| 2225 | + | |
| 2226 | + | |
2221 | 2227 | | |
2222 | 2228 | | |
2223 | 2229 | | |
| |||
2229 | 2235 | | |
2230 | 2236 | | |
2231 | 2237 | | |
| 2238 | + | |
| 2239 | + | |
| 2240 | + | |
2232 | 2241 | | |
2233 | 2242 | | |
2234 | 2243 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
285 | 285 | | |
286 | 286 | | |
287 | 287 | | |
| 288 | + | |
| 289 | + | |
| 290 | + | |
| 291 | + | |
| 292 | + | |
| 293 | + | |
| 294 | + | |
| 295 | + | |
| 296 | + | |
| 297 | + | |
| 298 | + | |
| 299 | + | |
| 300 | + | |
| 301 | + | |
| 302 | + | |
| 303 | + | |
| 304 | + | |
| 305 | + | |
| 306 | + | |
| 307 | + | |
| 308 | + | |
| 309 | + | |
| 310 | + | |
| 311 | + | |
| 312 | + | |
| 313 | + | |
| 314 | + | |
| 315 | + | |
| 316 | + | |
| 317 | + | |
| 318 | + | |
| 319 | + | |
| 320 | + | |
| 321 | + | |
| 322 | + | |
| 323 | + | |
| 324 | + | |
| 325 | + | |
| 326 | + | |
| 327 | + | |
| 328 | + | |
| 329 | + | |
| 330 | + | |
| 331 | + | |
| 332 | + | |
| 333 | + | |
| 334 | + | |
| 335 | + | |
| 336 | + | |
| 337 | + | |
| 338 | + | |
| 339 | + | |
| 340 | + | |
| 341 | + | |
| 342 | + | |
| 343 | + | |
| 344 | + | |
| 345 | + | |
| 346 | + | |
| 347 | + | |
| 348 | + | |
| 349 | + | |
| 350 | + | |
| 351 | + | |
| 352 | + | |
| 353 | + | |
| 354 | + | |
| 355 | + | |
| 356 | + | |
| 357 | + | |
| 358 | + | |
| 359 | + | |
| 360 | + | |
| 361 | + | |
| 362 | + | |
| 363 | + | |
| 364 | + | |
| 365 | + | |
| 366 | + | |
| 367 | + | |
| 368 | + | |
| 369 | + | |
| 370 | + | |
| 371 | + | |
| 372 | + | |
| 373 | + | |
| 374 | + | |
| 375 | + | |
| 376 | + | |
| 377 | + | |
288 | 378 | | |
0 commit comments