Commit 63dc3ab
committed
fix(table): run batch unique check inside import transaction
`checkBatchUniqueConstraintsDb` queried the global `db` connection, so
inside a single import transaction (one tx wrapping all batches) the
constraint lookup couldn't see uncommitted rows from prior batches —
duplicates that crossed `CSV_MAX_BATCH_SIZE` boundaries slipped through.
Accept an optional executor and pass `trx` from `batchInsertRowsWithTx`
so the lookup observes the in-flight transaction state.1 parent 553ae99 commit 63dc3ab
2 files changed
Lines changed: 20 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
849 | 849 | | |
850 | 850 | | |
851 | 851 | | |
852 | | - | |
| 852 | + | |
| 853 | + | |
| 854 | + | |
| 855 | + | |
| 856 | + | |
| 857 | + | |
853 | 858 | | |
854 | 859 | | |
855 | 860 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
379 | 379 | | |
380 | 380 | | |
381 | 381 | | |
| 382 | + | |
| 383 | + | |
| 384 | + | |
| 385 | + | |
| 386 | + | |
| 387 | + | |
| 388 | + | |
382 | 389 | | |
383 | 390 | | |
384 | 391 | | |
| 392 | + | |
| 393 | + | |
| 394 | + | |
| 395 | + | |
385 | 396 | | |
386 | 397 | | |
387 | 398 | | |
388 | 399 | | |
389 | | - | |
| 400 | + | |
| 401 | + | |
390 | 402 | | |
391 | 403 | | |
392 | 404 | | |
| |||
458 | 470 | | |
459 | 471 | | |
460 | 472 | | |
461 | | - | |
| 473 | + | |
462 | 474 | | |
463 | 475 | | |
464 | 476 | | |
| |||
0 commit comments