forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commite55f025
committed
Refactor CopyFrom() in copyfrom.c.
This commit simplifies CopyFrom() by removing the unnecessary local variable'skipped', which tracked the number of rows skipped due to on_error = 'ignore'.That count is already handled by cstate->num_errors, so the 'skipped' variablewas redundant.Additionally, the condition on_error != COPY_ON_ERROR_STOP is removed.Since on_error == COPY_ON_ERROR_IGNORE is already checked, and on_erroronly has two values (ignore and stop), the additional check was redundantand made the logic harder to read. Seemingly this was introducedin preparation for a future patch, but the current checks don’t offerclear value and have been removed to improve readability.Author: Atsushi TorikoshiReviewed-by: Masahiko Sawada, Fujii MasaoDiscussion:https://postgr.es/m/ab59dad10490ea3734cf022b16c24cfd@oss.nttdata.com1 parenta1c4c8a commite55f025
1 file changed
+8
-13
lines changedLines changed: 8 additions & 13 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
657 | 657 |
| |
658 | 658 |
| |
659 | 659 |
| |
660 |
| - | |
661 | 660 |
| |
662 | 661 |
| |
663 | 662 |
| |
| |||
1004 | 1003 |
| |
1005 | 1004 |
| |
1006 | 1005 |
| |
1007 |
| - | |
| 1006 | + | |
1008 | 1007 |
| |
1009 | 1008 |
| |
1010 | 1009 |
| |
1011 |
| - | |
1012 |
| - | |
| 1010 | + | |
| 1011 | + | |
| 1012 | + | |
| 1013 | + | |
1013 | 1014 |
| |
1014 |
| - | |
1015 |
| - | |
1016 |
| - | |
1017 |
| - | |
1018 |
| - | |
1019 |
| - | |
1020 |
| - | |
1021 |
| - | |
| 1015 | + | |
1022 | 1016 |
| |
1023 | 1017 |
| |
1024 | 1018 |
| |
1025 |
| - | |
| 1019 | + | |
1026 | 1020 |
| |
| 1021 | + | |
1027 | 1022 |
| |
1028 | 1023 |
| |
1029 | 1024 |
| |
|
0 commit comments
Comments
(0)